@farm.js/core 0.1.83 → 0.1.85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{analyzer-Y6IY26HI.mjs → analyzer-R6KNJ6IO.mjs} +2 -2
- package/dist/analyzer-XVY76XMM.cjs +17 -0
- package/dist/{app.d-eSm7jgoc.d.mts → app.d-Bvpc2eJq.d.mts} +1 -1
- package/dist/{app.d-CVPu_hoD.d.ts → app.d-DEKpJEp4.d.ts} +1 -1
- package/dist/{chunk-R3VLM2MW.mjs → chunk-2DMOB6BH.mjs} +5 -5
- package/dist/{chunk-3CZ4MJHW.cjs → chunk-3HWNYLQV.cjs} +1 -1
- package/dist/{chunk-NGTZHWBG.cjs → chunk-3OKSEJ33.cjs} +31 -10
- package/dist/{chunk-B5SJYXJK.mjs → chunk-3TCFONUE.mjs} +16 -7
- package/dist/{chunk-U56Z3755.mjs → chunk-4QCMTIBM.mjs} +9 -9
- package/dist/{chunk-DZTWUEBB.cjs → chunk-7TPLDPNC.cjs} +10 -10
- package/dist/{chunk-55UJGUBP.cjs → chunk-BBX4RPOV.cjs} +13 -13
- package/dist/{chunk-RGTZAM6Y.mjs → chunk-BCCCPFHQ.mjs} +25 -4
- package/dist/{chunk-IABI62FH.cjs → chunk-BZN5HX7Y.cjs} +2 -2
- package/dist/{chunk-FFWSER54.mjs → chunk-CDZ55QRD.mjs} +1 -1
- package/dist/{chunk-IAIRQAHA.mjs → chunk-CWUQBECF.mjs} +1 -1
- package/dist/{chunk-BBVLOEND.cjs → chunk-F7JVO3OZ.cjs} +4 -4
- package/dist/{chunk-NDWI6FDH.mjs → chunk-GFVPQ25Z.mjs} +132 -33
- package/dist/{chunk-5X5GJU5A.cjs → chunk-GLNVLCUH.cjs} +6 -6
- package/dist/{chunk-JHRJ5V2F.cjs → chunk-H6C45DCF.cjs} +165 -162
- package/dist/{chunk-LN6FAYNB.cjs → chunk-HKJIUZS5.cjs} +2 -2
- package/dist/{chunk-ORBBAA7B.mjs → chunk-J7VIXTPQ.mjs} +1 -1
- package/dist/{chunk-HRH7OKBQ.cjs → chunk-L3BSHASB.cjs} +4 -4
- package/dist/{chunk-ELNRKD4V.mjs → chunk-L5HDCDFT.mjs} +1 -1
- package/dist/chunk-MAPHNGTF.cjs +98 -0
- package/dist/{chunk-RE5E2G5S.cjs → chunk-MNUYXZV7.cjs} +2 -18
- package/dist/{chunk-YSU3WCW6.mjs → chunk-MYSH5Y4E.mjs} +1 -1
- package/dist/{chunk-EFI6QWBQ.cjs → chunk-OYM6VJEF.cjs} +35 -26
- package/dist/{chunk-43N3X6OO.mjs → chunk-PQR5A7R2.mjs} +1 -1
- package/dist/{chunk-3DAJXBSL.cjs → chunk-Q7GB3I4O.cjs} +2 -2
- package/dist/{chunk-A5BHJHDF.cjs → chunk-QUHDVJMR.cjs} +3 -3
- package/dist/chunk-RJBUI5AN.mjs +18 -0
- package/dist/chunk-RQ6XX5IN.mjs +98 -0
- package/dist/{chunk-OM6JIIJU.cjs → chunk-RVJQHQCG.cjs} +4 -4
- package/dist/{chunk-WCSBYQOT.cjs → chunk-TOUC6BR3.cjs} +4 -4
- package/dist/{chunk-WZV2G2A6.mjs → chunk-U6HUVY5R.mjs} +90 -29
- package/dist/{chunk-SLIXHUMS.cjs → chunk-UEQC4ZLP.cjs} +446 -347
- package/dist/{chunk-7X2CYE66.cjs → chunk-WYTK7HQS.cjs} +261 -200
- package/dist/{chunk-DPUZVGXH.mjs → chunk-X7RSOEMQ.mjs} +33 -30
- package/dist/{chunk-NKVBWPXR.mjs → chunk-XIXAUXV3.mjs} +1 -1
- package/dist/{chunk-RNJX3MD6.mjs → chunk-YS647ASS.mjs} +1 -1
- package/dist/{chunk-VQ6IXALL.mjs → chunk-YX532KEF.mjs} +2 -2
- package/dist/{chunk-K3GHY7GY.mjs → chunk-Z3LOPHSO.mjs} +1 -1
- package/dist/{client-component.d-DLknFP8l.d.ts → client-component.d-CZG02pIh.d.ts} +2 -1
- package/dist/{client-component.d-DLMCzmUx.d.mts → client-component.d-miqIXyQv.d.mts} +2 -1
- package/dist/{devtools-OI52TCSD.mjs → devtools-34ZQWX3M.mjs} +4 -4
- package/dist/{devtools-ZM2AR36W.cjs → devtools-SXL5RFE5.cjs} +6 -6
- package/dist/docs.cjs +6 -6
- package/dist/docs.mjs +5 -5
- package/dist/environment/vite.cjs +5 -5
- package/dist/environment/vite.mjs +4 -4
- package/dist/index.cjs +26 -25
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +26 -25
- package/dist/internal/build-runtime.cjs +26 -25
- package/dist/internal/build-runtime.mjs +25 -24
- package/dist/internal/cli-runtime.cjs +8 -8
- package/dist/internal/cli-runtime.mjs +7 -7
- 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 +3 -37
- package/dist/internal/client-runtime.d.ts +3 -37
- package/dist/internal/config-runtime.cjs +6 -6
- package/dist/internal/config-runtime.mjs +5 -5
- package/dist/internal/infra-analytics-runtime.cjs +6 -6
- package/dist/internal/infra-analytics-runtime.mjs +4 -4
- package/dist/internal/islands-runtime.cjs +15 -8
- package/dist/internal/islands-runtime.d.mts +2 -3
- package/dist/internal/islands-runtime.d.ts +2 -3
- package/dist/internal/islands-runtime.mjs +15 -8
- package/dist/internal/islands-server-tree.cjs +8 -0
- package/dist/internal/islands-server-tree.d.mts +5 -0
- package/dist/internal/islands-server-tree.d.ts +5 -0
- package/dist/internal/islands-server-tree.mjs +8 -0
- package/dist/internal/islx-actions-server.d.mts +0 -3
- package/dist/internal/islx-actions-server.d.ts +0 -3
- package/dist/internal/native-server-fns.cjs +4 -4
- package/dist/internal/native-server-fns.mjs +3 -3
- package/dist/internal/product-telemetry-runtime.cjs +3 -3
- package/dist/internal/product-telemetry-runtime.mjs +2 -2
- package/dist/internal/production-runtime.cjs +15 -15
- package/dist/internal/production-runtime.mjs +21 -21
- package/dist/internal/renderer-islands.cjs +47 -0
- package/dist/internal/renderer-islands.d.mts +32 -0
- package/dist/internal/renderer-islands.d.ts +32 -0
- package/dist/internal/renderer-islands.mjs +47 -0
- package/dist/island-runtime.d-BA7EPo1v.d.ts +38 -0
- package/dist/island-runtime.d-BBS_YUSX.d.mts +38 -0
- package/dist/plugin.cjs +20 -19
- package/dist/plugin.d.mts +1 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.mjs +19 -18
- package/dist/renderer.cjs +8 -2
- package/dist/renderer.d.mts +81 -1
- package/dist/renderer.d.ts +81 -1
- package/dist/renderer.mjs +7 -1
- package/dist/{rsc-pipeline-MFJZGDPE.cjs → rsc-pipeline-ESPGX4VX.cjs} +9 -9
- package/dist/{rsc-pipeline-TRZVFCBX.mjs → rsc-pipeline-MW2V3WEE.mjs} +8 -8
- package/dist/{runtime-MJUG2HGR.cjs → runtime-FCMLEBTX.cjs} +13 -14
- package/dist/{runtime-O4Y3Z6V3.mjs → runtime-KGSOEMLT.mjs} +10 -11
- package/dist/server.cjs +50 -50
- package/dist/server.d.mts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.mjs +28 -28
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +20 -19
- package/dist/vite.d.mts +8 -2
- package/dist/vite.d.ts +8 -2
- package/dist/vite.mjs +19 -18
- package/package.json +13 -3
- package/dist/analyzer-WGH6J2HN.cjs +0 -17
- package/dist/chunk-4QENVMG7.mjs +0 -34
- package/dist/{chunk-NEKO3HM2.cjs → chunk-4B6YJ5DS.cjs} +2 -2
- package/dist/{chunk-CA2HBLXP.mjs → chunk-4EEAPBNV.mjs} +3 -3
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
var _chunkE5UN4OWXcjs = require('./chunk-E5UN4OWX.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
+
var _chunkMF3IA2AWcjs = require('./chunk-MF3IA2AW.cjs');
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
|
|
@@ -19,10 +20,9 @@ var _chunkE5UN4OWXcjs = require('./chunk-E5UN4OWX.cjs');
|
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
|
|
22
|
-
var _chunkNG2EZ6QScjs = require('./chunk-NG2EZ6QS.cjs');
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
var
|
|
25
|
+
var _chunkNG2EZ6QScjs = require('./chunk-NG2EZ6QS.cjs');
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
var _chunkVM57CK74cjs = require('./chunk-VM57CK74.cjs');
|
|
@@ -32,7 +32,7 @@ var _chunkMHKPXX3Jcjs = require('./chunk-MHKPXX3J.cjs');
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
var
|
|
35
|
+
var _chunkQUHDVJMRcjs = require('./chunk-QUHDVJMR.cjs');
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
|
|
@@ -40,7 +40,7 @@ var _chunkA5BHJHDFcjs = require('./chunk-A5BHJHDF.cjs');
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
var
|
|
43
|
+
var _chunkHKJIUZS5cjs = require('./chunk-HKJIUZS5.cjs');
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
|
|
@@ -70,7 +70,7 @@ var _chunkNDOE76QCcjs = require('./chunk-NDOE76QC.cjs');
|
|
|
70
70
|
|
|
71
71
|
|
|
72
72
|
|
|
73
|
-
var
|
|
73
|
+
var _chunkBBX4RPOVcjs = require('./chunk-BBX4RPOV.cjs');
|
|
74
74
|
|
|
75
75
|
|
|
76
76
|
var _chunk3BTN3NP7cjs = require('./chunk-3BTN3NP7.cjs');
|
|
@@ -115,7 +115,7 @@ var _chunkO4JYMU5Ncjs = require('./chunk-O4JYMU5N.cjs');
|
|
|
115
115
|
|
|
116
116
|
|
|
117
117
|
|
|
118
|
-
var
|
|
118
|
+
var _chunkH6C45DCFcjs = require('./chunk-H6C45DCF.cjs');
|
|
119
119
|
|
|
120
120
|
|
|
121
121
|
|
|
@@ -131,12 +131,14 @@ var _chunkVACYUMXWcjs = require('./chunk-VACYUMXW.cjs');
|
|
|
131
131
|
|
|
132
132
|
|
|
133
133
|
|
|
134
|
-
var
|
|
134
|
+
var _chunkL3BSHASBcjs = require('./chunk-L3BSHASB.cjs');
|
|
135
135
|
|
|
136
136
|
|
|
137
|
+
var _chunkMAPHNGTFcjs = require('./chunk-MAPHNGTF.cjs');
|
|
137
138
|
|
|
138
139
|
|
|
139
140
|
|
|
141
|
+
var _chunkRVJQHQCGcjs = require('./chunk-RVJQHQCG.cjs');
|
|
140
142
|
|
|
141
143
|
|
|
142
144
|
|
|
@@ -144,17 +146,18 @@ var _chunkHRH7OKBQcjs = require('./chunk-HRH7OKBQ.cjs');
|
|
|
144
146
|
|
|
145
147
|
|
|
146
148
|
|
|
147
|
-
var _chunkNEKO3HM2cjs = require('./chunk-NEKO3HM2.cjs');
|
|
148
149
|
|
|
149
150
|
|
|
150
|
-
var _chunk3HLQTOVUcjs = require('./chunk-3HLQTOVU.cjs');
|
|
151
151
|
|
|
152
152
|
|
|
153
|
-
var _chunk47JV57DAcjs = require('./chunk-47JV57DA.cjs');
|
|
154
153
|
|
|
154
|
+
var _chunk4B6YJ5DScjs = require('./chunk-4B6YJ5DS.cjs');
|
|
155
155
|
|
|
156
156
|
|
|
157
|
-
var
|
|
157
|
+
var _chunk3HLQTOVUcjs = require('./chunk-3HLQTOVU.cjs');
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
var _chunk47JV57DAcjs = require('./chunk-47JV57DA.cjs');
|
|
158
161
|
|
|
159
162
|
|
|
160
163
|
|
|
@@ -162,7 +165,7 @@ var _chunkOM6JIIJUcjs = require('./chunk-OM6JIIJU.cjs');
|
|
|
162
165
|
|
|
163
166
|
|
|
164
167
|
|
|
165
|
-
var
|
|
168
|
+
var _chunkTOUC6BR3cjs = require('./chunk-TOUC6BR3.cjs');
|
|
166
169
|
|
|
167
170
|
|
|
168
171
|
|
|
@@ -170,7 +173,7 @@ var _chunkWCSBYQOTcjs = require('./chunk-WCSBYQOT.cjs');
|
|
|
170
173
|
var _chunkW53Z4WDIcjs = require('./chunk-W53Z4WDI.cjs');
|
|
171
174
|
|
|
172
175
|
|
|
173
|
-
var
|
|
176
|
+
var _chunkBZN5HX7Ycjs = require('./chunk-BZN5HX7Y.cjs');
|
|
174
177
|
|
|
175
178
|
|
|
176
179
|
var _chunk4EBC7EMWcjs = require('./chunk-4EBC7EMW.cjs');
|
|
@@ -191,7 +194,7 @@ var _chunk4EBC7EMWcjs = require('./chunk-4EBC7EMW.cjs');
|
|
|
191
194
|
|
|
192
195
|
|
|
193
196
|
|
|
194
|
-
var
|
|
197
|
+
var _chunkOYM6VJEFcjs = require('./chunk-OYM6VJEF.cjs');
|
|
195
198
|
|
|
196
199
|
|
|
197
200
|
|
|
@@ -215,9 +218,6 @@ var _chunkIIHZ2BEEcjs = require('./chunk-IIHZ2BEE.cjs');
|
|
|
215
218
|
var _chunk6JHZPB52cjs = require('./chunk-6JHZPB52.cjs');
|
|
216
219
|
|
|
217
220
|
|
|
218
|
-
var _chunkRE5E2G5Scjs = require('./chunk-RE5E2G5S.cjs');
|
|
219
|
-
|
|
220
|
-
|
|
221
221
|
var _chunk52Q4OB4Acjs = require('./chunk-52Q4OB4A.cjs');
|
|
222
222
|
|
|
223
223
|
|
|
@@ -228,7 +228,8 @@ var _chunk52Q4OB4Acjs = require('./chunk-52Q4OB4A.cjs');
|
|
|
228
228
|
|
|
229
229
|
|
|
230
230
|
|
|
231
|
-
|
|
231
|
+
|
|
232
|
+
var _chunk3OKSEJ33cjs = require('./chunk-3OKSEJ33.cjs');
|
|
232
233
|
|
|
233
234
|
|
|
234
235
|
|
|
@@ -307,7 +308,7 @@ var _chunk7U4XF76Rcjs = require('./chunk-7U4XF76R.cjs');
|
|
|
307
308
|
var _chunk2OF5RPVUcjs = require('./chunk-2OF5RPVU.cjs');
|
|
308
309
|
|
|
309
310
|
|
|
310
|
-
var
|
|
311
|
+
var _chunk3HWNYLQVcjs = require('./chunk-3HWNYLQV.cjs');
|
|
311
312
|
|
|
312
313
|
|
|
313
314
|
var _chunkY3DO7BIJcjs = require('./chunk-Y3DO7BIJ.cjs');
|
|
@@ -660,7 +661,7 @@ async function compileFarmDocsManifest(docs, options) {
|
|
|
660
661
|
isPathGuarded: options.isPathGuarded,
|
|
661
662
|
basePath
|
|
662
663
|
});
|
|
663
|
-
const apiHandler =
|
|
664
|
+
const apiHandler = _chunkHKJIUZS5cjs.createFarmDocsAPIHandler.call(void 0, {
|
|
664
665
|
rootDir: options.root,
|
|
665
666
|
srcDir: options.srcDir,
|
|
666
667
|
docs,
|
|
@@ -834,6 +835,7 @@ function collectFarmClientModulePreloads(bundle, options) {
|
|
|
834
835
|
const rendererFiles = dynamicFiles(options.rendererModules);
|
|
835
836
|
const rootFiles = dynamicFiles(options.rootModules);
|
|
836
837
|
const actionFiles = dynamicFiles(options.actionModules, rendererFiles);
|
|
838
|
+
const serverTreeFiles = dynamicFiles(options.serverTreeModules, rendererFiles);
|
|
837
839
|
return {
|
|
838
840
|
files,
|
|
839
841
|
entry: entryFiles.map(index),
|
|
@@ -841,6 +843,7 @@ function collectFarmClientModulePreloads(bundle, options) {
|
|
|
841
843
|
...rendererFiles.length > 0 ? { renderer: rendererFiles.map(index) } : {},
|
|
842
844
|
...rootFiles.length > 0 ? { root: rootFiles.map(index) } : {},
|
|
843
845
|
...actionFiles.length > 0 ? { actions: actionFiles.map(index) } : {},
|
|
846
|
+
...serverTreeFiles.length > 0 ? { serverTrees: serverTreeFiles.map(index) } : {},
|
|
844
847
|
modules
|
|
845
848
|
};
|
|
846
849
|
}
|
|
@@ -859,11 +862,17 @@ function createFarmClientModulePreloadPlugin(options) {
|
|
|
859
862
|
};
|
|
860
863
|
const rendererModules = await resolve(options.rendererImports);
|
|
861
864
|
const actionModules = await resolve(options.actionImports);
|
|
865
|
+
const serverTreeModules = await resolve(options.serverTreeImports);
|
|
862
866
|
await _promises2.default.mkdir(options.buildDir, { recursive: true });
|
|
863
867
|
await _promises2.default.writeFile(
|
|
864
868
|
_path2.default.join(options.buildDir, FARM_CLIENT_MODULE_PRELOADS_FILE),
|
|
865
869
|
JSON.stringify(
|
|
866
|
-
collectFarmClientModulePreloads(bundle, {
|
|
870
|
+
collectFarmClientModulePreloads(bundle, {
|
|
871
|
+
...options,
|
|
872
|
+
rendererModules,
|
|
873
|
+
actionModules,
|
|
874
|
+
serverTreeModules
|
|
875
|
+
})
|
|
867
876
|
)
|
|
868
877
|
);
|
|
869
878
|
}
|
|
@@ -885,6 +894,50 @@ function encodeFarmBuildJSONPlaceholder(value) {
|
|
|
885
894
|
return JSON.stringify(JSON.stringify(value)).slice(1, -1).replace(/'/g, "\\u0027").replace(/`/g, "\\u0060").replace(/\$/g, "\\u0024").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
886
895
|
}
|
|
887
896
|
|
|
897
|
+
// src/nitro/islands-react-chunk.ts
|
|
898
|
+
var REACT_MODULE = /[\\/]node_modules[\\/](?:react|react-dom|scheduler)[\\/]/;
|
|
899
|
+
function createFarmIslandsReactChunkGroup() {
|
|
900
|
+
let entryImportsReact;
|
|
901
|
+
return {
|
|
902
|
+
debugName: "react",
|
|
903
|
+
name(moduleId, context) {
|
|
904
|
+
if (!REACT_MODULE.test(moduleId)) return null;
|
|
905
|
+
_nullishCoalesce(entryImportsReact, () => ( (entryImportsReact = reactLoadsWithAnEntry(moduleId, context))));
|
|
906
|
+
return entryImportsReact ? null : "react";
|
|
907
|
+
}
|
|
908
|
+
};
|
|
909
|
+
}
|
|
910
|
+
function reactLoadsWithAnEntry(moduleId, context) {
|
|
911
|
+
const react = /* @__PURE__ */ new Set();
|
|
912
|
+
const pending = [moduleId];
|
|
913
|
+
for (let id = pending.pop(); id !== void 0; id = pending.pop()) {
|
|
914
|
+
if (react.has(id) || !REACT_MODULE.test(id)) continue;
|
|
915
|
+
react.add(id);
|
|
916
|
+
const info = context.getModuleInfo(id);
|
|
917
|
+
if (info) pending.push(...info.importedIds, ...info.importers);
|
|
918
|
+
}
|
|
919
|
+
const seen = /* @__PURE__ */ new Set();
|
|
920
|
+
pending.push(...react);
|
|
921
|
+
for (let id = pending.pop(); id !== void 0; id = pending.pop()) {
|
|
922
|
+
if (seen.has(id)) continue;
|
|
923
|
+
seen.add(id);
|
|
924
|
+
const info = context.getModuleInfo(id);
|
|
925
|
+
if (!info) continue;
|
|
926
|
+
if (info.isEntry) return true;
|
|
927
|
+
pending.push(...info.importers);
|
|
928
|
+
}
|
|
929
|
+
return false;
|
|
930
|
+
}
|
|
931
|
+
function configuresFarmClientChunks(vite) {
|
|
932
|
+
const build2 = _optionalChain([vite, 'optionalAccess', _10 => _10.build]);
|
|
933
|
+
const outputs = [_optionalChain([build2, 'optionalAccess', _11 => _11.rollupOptions, 'optionalAccess', _12 => _12.output]), _optionalChain([build2, 'optionalAccess', _13 => _13.rolldownOptions, 'optionalAccess', _14 => _14.output])].flat();
|
|
934
|
+
return outputs.some(
|
|
935
|
+
(output) => !!output && typeof output === "object" && ["manualChunks", "advancedChunks", "codeSplitting", "inlineDynamicImports"].some(
|
|
936
|
+
(key) => output[key] !== void 0
|
|
937
|
+
)
|
|
938
|
+
);
|
|
939
|
+
}
|
|
940
|
+
|
|
888
941
|
// src/nitro/client-route-table.ts
|
|
889
942
|
|
|
890
943
|
|
|
@@ -1052,7 +1105,7 @@ async function createFarmRouteRuntimeManifest(options) {
|
|
|
1052
1105
|
const routes = [];
|
|
1053
1106
|
for (const [pattern, entry] of options.routeManager.getRoutes()) {
|
|
1054
1107
|
const routeModule = await options.routeManager.loadRouteModule(entry.modulePath);
|
|
1055
|
-
const rendering = await
|
|
1108
|
+
const rendering = await _chunkL3BSHASBcjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
|
|
1056
1109
|
const runtimeConfig = await options.routeManager.resolveRouteRuntimeConfig(pattern);
|
|
1057
1110
|
routes.push({
|
|
1058
1111
|
kind: "page",
|
|
@@ -1139,7 +1192,7 @@ function validateFarmRouteRuntimeDeployment(manifest, preset) {
|
|
|
1139
1192
|
`Route "${route.pattern}" requires the ${route.runtime} runtime, but preset "${preset}" emits ${runtime} functions. Choose a compatible preset or change the route runtime.`
|
|
1140
1193
|
);
|
|
1141
1194
|
}
|
|
1142
|
-
if (_optionalChain([route, 'access',
|
|
1195
|
+
if (_optionalChain([route, 'access', _15 => _15.regions, 'optionalAccess', _16 => _16.length]) && preset !== "vercel") {
|
|
1143
1196
|
warnings.add(
|
|
1144
1197
|
`Preset "${preset}" does not map per-route regions; Farm kept them in ${FARM_ROUTE_RUNTIME_MANIFEST} for deployment adapters.`
|
|
1145
1198
|
);
|
|
@@ -1186,7 +1239,7 @@ async function createFarmVercelRouteRuntimeFunctions(outputDir, manifest, fs5, b
|
|
|
1186
1239
|
const destinations = /* @__PURE__ */ new Map();
|
|
1187
1240
|
let groupIndex = 0;
|
|
1188
1241
|
for (const [key, group] of groups) {
|
|
1189
|
-
if (!_optionalChain([group, 'access',
|
|
1242
|
+
if (!_optionalChain([group, 'access', _17 => _17.config, 'access', _18 => _18.regions, 'optionalAccess', _19 => _19.length]) && !group.config.maxDuration) {
|
|
1190
1243
|
destinations.set(key, "/__nitro");
|
|
1191
1244
|
continue;
|
|
1192
1245
|
}
|
|
@@ -1236,14 +1289,14 @@ async function configureVercelFunction(functionDir, config, fs5) {
|
|
|
1236
1289
|
const current = JSON.parse(await fs5.readFile(configPath, "utf8"));
|
|
1237
1290
|
const next = {
|
|
1238
1291
|
...current,
|
|
1239
|
-
..._optionalChain([config, 'access',
|
|
1292
|
+
..._optionalChain([config, 'access', _20 => _20.regions, 'optionalAccess', _21 => _21.length]) ? { regions: config.regions } : {},
|
|
1240
1293
|
...config.maxDuration ? { maxDuration: config.maxDuration } : {}
|
|
1241
1294
|
};
|
|
1242
1295
|
await fs5.writeFile(configPath, `${JSON.stringify(next, null, 2)}
|
|
1243
1296
|
`);
|
|
1244
1297
|
}
|
|
1245
1298
|
function hasVercelFunctionControls(route) {
|
|
1246
|
-
return Boolean(_optionalChain([route, 'access',
|
|
1299
|
+
return Boolean(_optionalChain([route, 'access', _22 => _22.regions, 'optionalAccess', _23 => _23.length]) || route.maxDuration);
|
|
1247
1300
|
}
|
|
1248
1301
|
function compareRuntimeRoutes(left, right) {
|
|
1249
1302
|
const kindOrder = { page: 0, api: 0, metadata: 0, rule: 1 };
|
|
@@ -1288,7 +1341,7 @@ var FARM_HASHED_ASSET_DIRS = ["assets", "chunks"];
|
|
|
1288
1341
|
var LITERAL_ROUTE_PATH = /^\/[\w.~@/-]+$/;
|
|
1289
1342
|
function planFarmImmutableAssets(options) {
|
|
1290
1343
|
const cacheRulePatterns = Object.entries(_nullishCoalesce(options.routeRules, () => ( {}))).filter(
|
|
1291
|
-
([, rule]) => Object.keys(_nullishCoalesce(_optionalChain([rule, 'optionalAccess',
|
|
1344
|
+
([, rule]) => Object.keys(_nullishCoalesce(_optionalChain([rule, 'optionalAccess', _24 => _24.headers]), () => ( {}))).some((name) => name.toLowerCase() === "cache-control")
|
|
1292
1345
|
).map(([pattern]) => pattern);
|
|
1293
1346
|
const isImmutable = (file) => isFarmImmutableAssetPath(file) && !cacheRulePatterns.some((pattern) => _chunkIUKBPBM7cjs.farmRouteRuleMatches.call(void 0, pattern, file));
|
|
1294
1347
|
const routeDirs = new Set(
|
|
@@ -1416,7 +1469,7 @@ function resolveBundleFileName(chunkFileName, relativeUrl) {
|
|
|
1416
1469
|
function replaceServerFileReferences(bundle, chunkFileName, code, replace) {
|
|
1417
1470
|
return code.replace(SERVER_FILE_URL_RE, (reference, _quote, relativeUrl) => {
|
|
1418
1471
|
const target = resolveBundleFileName(chunkFileName, relativeUrl);
|
|
1419
|
-
return target && _optionalChain([bundle, 'access',
|
|
1472
|
+
return target && _optionalChain([bundle, 'access', _25 => _25[target], 'optionalAccess', _26 => _26.type]) === "asset" ? replace(target) : reference;
|
|
1420
1473
|
});
|
|
1421
1474
|
}
|
|
1422
1475
|
function collectServerReadSSRAssets(bundle) {
|
|
@@ -1469,7 +1522,7 @@ function assertServerReadSSRAssetsSupported(bundle, preset, root) {
|
|
|
1469
1522
|
if (assets.length === 0) return;
|
|
1470
1523
|
const sources = assets.map((fileName) => {
|
|
1471
1524
|
const output = bundle[fileName];
|
|
1472
|
-
const original = _optionalChain([output, 'optionalAccess',
|
|
1525
|
+
const original = _optionalChain([output, 'optionalAccess', _27 => _27.type]) === "asset" ? _optionalChain([output, 'access', _28 => _28.originalFileNames, 'optionalAccess', _29 => _29[0]]) : void 0;
|
|
1473
1526
|
if (!original) return fileName;
|
|
1474
1527
|
return _path2.default.relative(root, _path2.default.resolve(root, original)).split(_path2.default.sep).join("/");
|
|
1475
1528
|
});
|
|
@@ -1488,7 +1541,7 @@ function createServerReadSSRAssetsPlugin(bundle, ssrOutputDir) {
|
|
|
1488
1541
|
transform(code, id) {
|
|
1489
1542
|
if (!code.includes("import.meta.url")) return null;
|
|
1490
1543
|
const chunkFileName = _path2.default.relative(ssrOutputDir, id.split("?", 1)[0]).split(_path2.default.sep).join("/");
|
|
1491
|
-
if (_optionalChain([bundle, 'access',
|
|
1544
|
+
if (_optionalChain([bundle, 'access', _30 => _30[chunkFileName], 'optionalAccess', _31 => _31.type]) !== "chunk") return null;
|
|
1492
1545
|
let changed = false;
|
|
1493
1546
|
const transformed = replaceServerFileReferences(
|
|
1494
1547
|
bundle,
|
|
@@ -1584,7 +1637,7 @@ export default async function farmNetlifyHandler(request, context) {
|
|
|
1584
1637
|
var PLATFORM_CONFIG_KEYS = /* @__PURE__ */ new Set(["desktop", "mobile"]);
|
|
1585
1638
|
var CONFIG_FACTORIES = /* @__PURE__ */ new Set(["defineConfig", "defineFarmConfig"]);
|
|
1586
1639
|
function isConfigObject(node) {
|
|
1587
|
-
return _optionalChain([node, 'optionalAccess',
|
|
1640
|
+
return _optionalChain([node, 'optionalAccess', _32 => _32.type]) === "ObjectExpression";
|
|
1588
1641
|
}
|
|
1589
1642
|
function propertyName(property) {
|
|
1590
1643
|
if (property.type !== "Property" || property.computed) return void 0;
|
|
@@ -1605,7 +1658,7 @@ function collectConfigObjects(node, found) {
|
|
|
1605
1658
|
}
|
|
1606
1659
|
if (current.type === "CallExpression") {
|
|
1607
1660
|
const callee = current.callee;
|
|
1608
|
-
const name = callee.type === "Identifier" ? callee.name : _optionalChain([callee, 'access',
|
|
1661
|
+
const name = callee.type === "Identifier" ? callee.name : _optionalChain([callee, 'access', _33 => _33.property, 'optionalAccess', _34 => _34.name]);
|
|
1609
1662
|
const argument = current.arguments[0];
|
|
1610
1663
|
if (name && CONFIG_FACTORIES.has(name) && isConfigObject(argument)) found.push(argument);
|
|
1611
1664
|
}
|
|
@@ -1638,7 +1691,7 @@ function stripPlatformConfigSource(code, parse) {
|
|
|
1638
1691
|
const trailingComma = /^\s*,/.exec(code.slice(properties[last].end));
|
|
1639
1692
|
removals.push([
|
|
1640
1693
|
properties[first].start,
|
|
1641
|
-
properties[last].end + (_nullishCoalesce(_optionalChain([trailingComma, 'optionalAccess',
|
|
1694
|
+
properties[last].end + (_nullishCoalesce(_optionalChain([trailingComma, 'optionalAccess', _35 => _35[0], 'access', _36 => _36.length]), () => ( 0)))
|
|
1642
1695
|
]);
|
|
1643
1696
|
}
|
|
1644
1697
|
first = last;
|
|
@@ -1665,7 +1718,7 @@ function farmStripPlatformConfigPlugin(configFiles) {
|
|
|
1665
1718
|
// removed block used (`readFileSync` for a version, say).
|
|
1666
1719
|
enforce: "pre",
|
|
1667
1720
|
transform: {
|
|
1668
|
-
filter: { id:
|
|
1721
|
+
filter: { id: _chunkH6C45DCFcjs.fileNamePattern.call(void 0, configFiles) },
|
|
1669
1722
|
async handler(code, id) {
|
|
1670
1723
|
const file = id.split("?", 1)[0];
|
|
1671
1724
|
if (!files.has(_path2.default.resolve(file)) && !files.has(realPath(file))) return null;
|
|
@@ -1718,7 +1771,7 @@ function precompileFarmMarkdownPages(bodies, coreRoot) {
|
|
|
1718
1771
|
return;
|
|
1719
1772
|
}
|
|
1720
1773
|
worker.once("message", (entries) => {
|
|
1721
|
-
void _optionalChain([worker, 'optionalAccess',
|
|
1774
|
+
void _optionalChain([worker, 'optionalAccess', _37 => _37.terminate, 'call', _38 => _38()]);
|
|
1722
1775
|
done(entries);
|
|
1723
1776
|
});
|
|
1724
1777
|
worker.once("error", () => done());
|
|
@@ -1727,7 +1780,7 @@ function precompileFarmMarkdownPages(bodies, coreRoot) {
|
|
|
1727
1780
|
return {
|
|
1728
1781
|
pages,
|
|
1729
1782
|
dispose() {
|
|
1730
|
-
void _optionalChain([worker, 'optionalAccess',
|
|
1783
|
+
void _optionalChain([worker, 'optionalAccess', _39 => _39.terminate, 'call', _40 => _40()]);
|
|
1731
1784
|
}
|
|
1732
1785
|
};
|
|
1733
1786
|
}
|
|
@@ -1809,7 +1862,7 @@ function literalMatcher(node) {
|
|
|
1809
1862
|
if (node.type === "Literal" && node.regex)
|
|
1810
1863
|
return new RegExp(node.regex.pattern, node.regex.flags);
|
|
1811
1864
|
if (node.type === "TemplateLiteral" && node.expressions.length === 0) {
|
|
1812
|
-
return _nullishCoalesce(_optionalChain([node, 'access',
|
|
1865
|
+
return _nullishCoalesce(_optionalChain([node, 'access', _41 => _41.quasis, 'access', _42 => _42[0], 'optionalAccess', _43 => _43.value, 'optionalAccess', _44 => _44.cooked]), () => ( void 0));
|
|
1813
1866
|
}
|
|
1814
1867
|
return void 0;
|
|
1815
1868
|
}
|
|
@@ -1833,7 +1886,7 @@ function readStaticMiddlewareConfig(program) {
|
|
|
1833
1886
|
let found = null;
|
|
1834
1887
|
for (const statement of program.body) {
|
|
1835
1888
|
if (statement.type === "ExportNamedDeclaration" && !statement.declaration) {
|
|
1836
|
-
if (statement.specifiers.some((specifier) => _optionalChain([specifier, 'access',
|
|
1889
|
+
if (statement.specifiers.some((specifier) => _optionalChain([specifier, 'access', _45 => _45.exported, 'optionalAccess', _46 => _46.name]) === "config")) {
|
|
1837
1890
|
return "unknown";
|
|
1838
1891
|
}
|
|
1839
1892
|
continue;
|
|
@@ -1841,14 +1894,14 @@ function readStaticMiddlewareConfig(program) {
|
|
|
1841
1894
|
const declaration = statement.type === "ExportNamedDeclaration" ? statement.declaration : null;
|
|
1842
1895
|
if (!declaration || declaration.type !== "VariableDeclaration") continue;
|
|
1843
1896
|
for (const declarator of declaration.declarations) {
|
|
1844
|
-
if (_optionalChain([declarator, 'access',
|
|
1897
|
+
if (_optionalChain([declarator, 'access', _47 => _47.id, 'optionalAccess', _48 => _48.type]) !== "Identifier" || declarator.id.name !== "config") continue;
|
|
1845
1898
|
if (declaration.kind !== "const" || !declarator.init) return "unknown";
|
|
1846
1899
|
const init = unwrap(declarator.init);
|
|
1847
1900
|
if (init.type !== "ObjectExpression") return "unknown";
|
|
1848
1901
|
const config = {};
|
|
1849
1902
|
for (const property of init.properties) {
|
|
1850
1903
|
if (property.type !== "Property" || property.computed) return "unknown";
|
|
1851
|
-
const key = _nullishCoalesce(_optionalChain([property, 'access',
|
|
1904
|
+
const key = _nullishCoalesce(_optionalChain([property, 'access', _49 => _49.key, 'optionalAccess', _50 => _50.name]), () => ( _optionalChain([property, 'access', _51 => _51.key, 'optionalAccess', _52 => _52.value])));
|
|
1852
1905
|
if (key === "runtime") {
|
|
1853
1906
|
const runtime = literalMatcher(unwrap(property.value));
|
|
1854
1907
|
if (runtime === "edge" || runtime === "nodejs") config.runtime = runtime;
|
|
@@ -1869,7 +1922,7 @@ async function readMiddlewareFileConfig(filePath) {
|
|
|
1869
1922
|
try {
|
|
1870
1923
|
const [{ readFile: readFile2 }, vite] = await Promise.all([import("fs/promises"), import("vite")]);
|
|
1871
1924
|
const parsed = vite.parseSync(filePath, await readFile2(filePath, "utf8"));
|
|
1872
|
-
if (_optionalChain([parsed, 'access',
|
|
1925
|
+
if (_optionalChain([parsed, 'access', _53 => _53.errors, 'optionalAccess', _54 => _54.length])) return "unknown";
|
|
1873
1926
|
return readStaticMiddlewareConfig(parsed.program);
|
|
1874
1927
|
} catch (e14) {
|
|
1875
1928
|
return "unknown";
|
|
@@ -1888,7 +1941,7 @@ function farmTargetRunsEdgeMiddleware(preset) {
|
|
|
1888
1941
|
return preset === "vercel";
|
|
1889
1942
|
}
|
|
1890
1943
|
function isFarmEdgeMiddlewareRoute(route) {
|
|
1891
|
-
return typeof route.config === "object" && _optionalChain([route, 'access',
|
|
1944
|
+
return typeof route.config === "object" && _optionalChain([route, 'access', _55 => _55.config, 'optionalAccess', _56 => _56.runtime]) === "edge";
|
|
1892
1945
|
}
|
|
1893
1946
|
function escapeRegExp3(value) {
|
|
1894
1947
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
@@ -1925,7 +1978,7 @@ export default createFarmVercelEdgeMiddleware({
|
|
|
1925
1978
|
${modules.join("\n")}
|
|
1926
1979
|
],
|
|
1927
1980
|
i18n: ${JSON.stringify(config.i18n)},
|
|
1928
|
-
server: ${JSON.stringify({ trustProxy: _optionalChain([config, 'access',
|
|
1981
|
+
server: ${JSON.stringify({ trustProxy: _optionalChain([config, 'access', _57 => _57.server, 'optionalAccess', _58 => _58.trustProxy]) === true })},
|
|
1929
1982
|
apiBasePath: ${JSON.stringify(_chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, config.api))},
|
|
1930
1983
|
notFoundPath: ${JSON.stringify(_chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, FARM_VERCEL_EDGE_NOT_FOUND_PATH, config.basePath))},
|
|
1931
1984
|
pages: ${JSON.stringify(toFarmVercelEdgeGuardedUrls(guardedPages, config.basePath))},
|
|
@@ -1984,7 +2037,7 @@ async function writeFarmVercelEdgeMiddlewareFunction(options) {
|
|
|
1984
2037
|
logLevel: "silent",
|
|
1985
2038
|
plugins: [edgeNodeModulesPlugin(coreDir, unsupported)],
|
|
1986
2039
|
resolve: {
|
|
1987
|
-
alias:
|
|
2040
|
+
alias: _chunkH6C45DCFcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
1988
2041
|
conditionNames: ["edge-light", "worker", "browser", "import", "module", "default"]
|
|
1989
2042
|
},
|
|
1990
2043
|
transform: {
|
|
@@ -2216,7 +2269,7 @@ function createPrerenderRuntimeResolverPlugin(root, resolveNitroEntry = resolveN
|
|
|
2216
2269
|
return {
|
|
2217
2270
|
name: "farm-prerender-runtime-resolver",
|
|
2218
2271
|
async resolveId(id, _importer, options) {
|
|
2219
|
-
if (_optionalChain([options, 'access',
|
|
2272
|
+
if (_optionalChain([options, 'access', _59 => _59.custom, 'optionalAccess', _60 => _60.farmPrerenderRuntimeResolve])) return null;
|
|
2220
2273
|
if (id.startsWith("\0") || id.startsWith(".") || id.startsWith("#") || id.startsWith("virtual:") || _path2.default.isAbsolute(id) || NODE_BUILTIN_MODULES.has(id)) {
|
|
2221
2274
|
return null;
|
|
2222
2275
|
}
|
|
@@ -2344,7 +2397,7 @@ function hasReactDomEdgeServerBuild(root) {
|
|
|
2344
2397
|
}
|
|
2345
2398
|
}
|
|
2346
2399
|
function shouldAliasReactServerToWebBuild(renderer, preset) {
|
|
2347
|
-
return
|
|
2400
|
+
return _chunk3OKSEJ33cjs.isReactRenderer.call(void 0, renderer) && _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) === "edge";
|
|
2348
2401
|
}
|
|
2349
2402
|
function isCloudflareImagePreset(preset) {
|
|
2350
2403
|
return preset === "cloudflare" || preset === "cloudflare-pages" || preset === "cloudflare-module";
|
|
@@ -2386,7 +2439,7 @@ function createOmittedMetadataImageRuntimePlugin(externalizeOtherImports) {
|
|
|
2386
2439
|
return {
|
|
2387
2440
|
name: "farm-omitted-metadata-image-runtime",
|
|
2388
2441
|
resolveId: {
|
|
2389
|
-
filter: { id:
|
|
2442
|
+
filter: { id: _chunkH6C45DCFcjs.exactIdPattern.call(void 0, ["@vercel/og"]) },
|
|
2390
2443
|
handler(source, importer) {
|
|
2391
2444
|
if (source !== "@vercel/og") return null;
|
|
2392
2445
|
const fromCoreRuntime = importer !== void 0 && isFarmCoreModule(importer) && !/^og\.[cm]?[jt]sx?$/.test(_path2.default.basename(importer.split("?", 1)[0]));
|
|
@@ -2395,7 +2448,7 @@ function createOmittedMetadataImageRuntimePlugin(externalizeOtherImports) {
|
|
|
2395
2448
|
}
|
|
2396
2449
|
},
|
|
2397
2450
|
load: {
|
|
2398
|
-
filter: { id:
|
|
2451
|
+
filter: { id: _chunkH6C45DCFcjs.exactIdPattern.call(void 0, [FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID]) },
|
|
2399
2452
|
handler(id) {
|
|
2400
2453
|
if (id !== FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID) return null;
|
|
2401
2454
|
return `
|
|
@@ -2423,8 +2476,8 @@ function readVercelOgManifest(file) {
|
|
|
2423
2476
|
}
|
|
2424
2477
|
function resolveVercelOgConditionEntry(resolvedId, condition) {
|
|
2425
2478
|
const vercelOg = readVercelOgManifest(resolvedId);
|
|
2426
|
-
const entry = _optionalChain([vercelOg, 'optionalAccess',
|
|
2427
|
-
const file = typeof entry === "string" ? entry : _optionalChain([entry, 'optionalAccess',
|
|
2479
|
+
const entry = _optionalChain([vercelOg, 'optionalAccess', _61 => _61.manifest, 'access', _62 => _62.exports, 'optionalAccess', _63 => _63["."], 'optionalAccess', _64 => _64[condition]]);
|
|
2480
|
+
const file = typeof entry === "string" ? entry : _optionalChain([entry, 'optionalAccess', _65 => _65.default]);
|
|
2428
2481
|
return vercelOg && typeof file === "string" ? _path2.default.join(vercelOg.dir, file) : null;
|
|
2429
2482
|
}
|
|
2430
2483
|
function createEdgeMetadataImageRuntimePlugin({
|
|
@@ -2440,7 +2493,7 @@ function createEdgeMetadataImageRuntimePlugin({
|
|
|
2440
2493
|
const edgeEntry = resolveVercelOgConditionEntry(resolved.id, condition);
|
|
2441
2494
|
return edgeEntry ? { ...resolved, id: edgeEntry } : resolved;
|
|
2442
2495
|
}
|
|
2443
|
-
if (wasm !== "module" || !source.endsWith(".wasm?module") || !_optionalChain([importer, 'optionalAccess',
|
|
2496
|
+
if (wasm !== "module" || !source.endsWith(".wasm?module") || !_optionalChain([importer, 'optionalAccess', _66 => _66.replace, 'call', _67 => _67(/\\/g, "/"), 'access', _68 => _68.includes, 'call', _69 => _69("/@vercel/og/")])) {
|
|
2444
2497
|
return null;
|
|
2445
2498
|
}
|
|
2446
2499
|
const resolvedPath = _path2.default.resolve(_path2.default.dirname(importer.split("?", 1)[0]), source);
|
|
@@ -2462,7 +2515,7 @@ function createVercelOgFontInlinePlugin(runtime = "Cloudflare Workers") {
|
|
|
2462
2515
|
return `Promise.resolve({ arrayBuffer: () => Uint8Array.from(atob(${JSON.stringify(encoded)}), (character) => character.charCodeAt(0)).buffer })`;
|
|
2463
2516
|
});
|
|
2464
2517
|
if (inlined !== code) return { code: inlined, map: null };
|
|
2465
|
-
const version = _nullishCoalesce(_optionalChain([readVercelOgManifest, 'call',
|
|
2518
|
+
const version = _nullishCoalesce(_optionalChain([readVercelOgManifest, 'call', _70 => _70(file), 'optionalAccess', _71 => _71.manifest, 'access', _72 => _72.version]), () => ( "(unknown version)"));
|
|
2466
2519
|
this.error(
|
|
2467
2520
|
`@vercel/og ${version} cannot be bundled for ${runtime}: ${file} does not load its default font with fetch(new URL("./<font>.ttf", import.meta.url)), the pattern Farm inlines because an edge function cannot fetch it. Install a @vercel/og version whose edge build does, such as 1.0.1.`
|
|
2468
2521
|
);
|
|
@@ -2473,7 +2526,7 @@ function createMetadataImageWasmPlugin() {
|
|
|
2473
2526
|
return {
|
|
2474
2527
|
name: "farm-metadata-image-wasm",
|
|
2475
2528
|
resolveId(source, importer) {
|
|
2476
|
-
if (!source.endsWith(".wasm?module") || !_optionalChain([importer, 'optionalAccess',
|
|
2529
|
+
if (!source.endsWith(".wasm?module") || !_optionalChain([importer, 'optionalAccess', _73 => _73.replace, 'call', _74 => _74(/\\/g, "/"), 'access', _75 => _75.includes, 'call', _76 => _76("/@vercel/og/")])) {
|
|
2477
2530
|
return null;
|
|
2478
2531
|
}
|
|
2479
2532
|
const requestPath = source.slice(0, -"?module".length);
|
|
@@ -2549,9 +2602,9 @@ function hasFarmRuntimeConfigModule(config, configModulePath) {
|
|
|
2549
2602
|
return Boolean(configModulePath || (config.layers || []).some((layer) => layer.configFile));
|
|
2550
2603
|
}
|
|
2551
2604
|
function nameCodeSplittingGroups(bundlerConfig) {
|
|
2552
|
-
const outputs = _optionalChain([bundlerConfig, 'optionalAccess',
|
|
2605
|
+
const outputs = _optionalChain([bundlerConfig, 'optionalAccess', _77 => _77.output]);
|
|
2553
2606
|
for (const output of Array.isArray(outputs) ? outputs : [outputs]) {
|
|
2554
|
-
const groups = _optionalChain([output, 'optionalAccess',
|
|
2607
|
+
const groups = _optionalChain([output, 'optionalAccess', _78 => _78.codeSplitting, 'optionalAccess', _79 => _79.groups]);
|
|
2555
2608
|
if (!Array.isArray(groups)) continue;
|
|
2556
2609
|
groups.forEach((group, index) => {
|
|
2557
2610
|
if (group && typeof group.name === "function" && !group.debugName) {
|
|
@@ -2612,9 +2665,9 @@ function restoreLiteralModuleSpecifiers(code, fileName, { parseSync, Visitor })
|
|
|
2612
2665
|
throw new Error(`Failed to minify ${fileName}: ${parsed.errors[0].message}`);
|
|
2613
2666
|
}
|
|
2614
2667
|
const restore = (node) => {
|
|
2615
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
2668
|
+
if (_optionalChain([node, 'optionalAccess', _80 => _80.type]) !== "TemplateLiteral") return;
|
|
2616
2669
|
const template = node;
|
|
2617
|
-
const value = _optionalChain([template, 'access',
|
|
2670
|
+
const value = _optionalChain([template, 'access', _81 => _81.quasis, 'access', _82 => _82[0], 'optionalAccess', _83 => _83.value, 'access', _84 => _84.cooked]);
|
|
2618
2671
|
if (template.expressions.length > 0 || typeof value !== "string") return;
|
|
2619
2672
|
replacements.push({
|
|
2620
2673
|
start: template.start,
|
|
@@ -2772,7 +2825,7 @@ async function discoverMiddlewareRoutes(appDir) {
|
|
|
2772
2825
|
return Array.from(routes.values()).sort(_chunkSHDCKRP4cjs.compareMiddlewareRouteLocations).map(({ path: routePath, filePath }) => ({ path: routePath, filePath }));
|
|
2773
2826
|
}
|
|
2774
2827
|
function assertFarmDocsRuntimeSupported(config, preset) {
|
|
2775
|
-
if (!_optionalChain([config, 'access',
|
|
2828
|
+
if (!_optionalChain([config, 'access', _85 => _85.docs, 'optionalAccess', _86 => _86.enabled]) || !_optionalChain([config, 'access', _87 => _87.docs, 'access', _88 => _88.adapter, 'optionalAccess', _89 => _89.server]) || _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) !== "edge" || Boolean(config.docs.adapter.edgeCompiler)) {
|
|
2776
2829
|
return;
|
|
2777
2830
|
}
|
|
2778
2831
|
throw new Error(
|
|
@@ -2864,7 +2917,7 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
2864
2917
|
const productionVite = productionViteResult.value;
|
|
2865
2918
|
_chunk7U4XF76Rcjs.logger.info("\u26A1 Building application bundles with Vite Rolldown");
|
|
2866
2919
|
const mobileClient = shouldBuildFarmMobileClient(config);
|
|
2867
|
-
const rendererDisabled =
|
|
2920
|
+
const rendererDisabled = _chunk3OKSEJ33cjs.isFarmRendererDisabled.call(void 0, config.renderer);
|
|
2868
2921
|
const buildClientBundle = async () => {
|
|
2869
2922
|
if (rendererDisabled) {
|
|
2870
2923
|
await fs5.rm(clientOutputDir, { recursive: true, force: true });
|
|
@@ -2953,7 +3006,7 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
2953
3006
|
);
|
|
2954
3007
|
}
|
|
2955
3008
|
}
|
|
2956
|
-
_optionalChain([sourceSnapshot, 'optionalAccess',
|
|
3009
|
+
_optionalChain([sourceSnapshot, 'optionalAccess', _90 => _90.clear, 'call', _91 => _91()]);
|
|
2957
3010
|
const ssrResult = ssrBuildResult.value;
|
|
2958
3011
|
const routeRuntimeManifest = routeRuntimeManifestResult.value;
|
|
2959
3012
|
const runtimeValidation = validateFarmRouteRuntimeDeployment(routeRuntimeManifest, preset);
|
|
@@ -2985,7 +3038,7 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
2985
3038
|
configuredHeaderRoutes,
|
|
2986
3039
|
nitroBuilderResultPromise,
|
|
2987
3040
|
lifecyclePluginManager,
|
|
2988
|
-
_optionalChain([markdownPrecompile, 'optionalAccess',
|
|
3041
|
+
_optionalChain([markdownPrecompile, 'optionalAccess', _92 => _92.pages])
|
|
2989
3042
|
);
|
|
2990
3043
|
const runtimeManifestPath = await writeFarmRouteRuntimeManifest(
|
|
2991
3044
|
_path2.default.join(root, distDir),
|
|
@@ -3006,8 +3059,8 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
3006
3059
|
_chunk7U4XF76Rcjs.logger.error(`\u274C Build failed: ${error}`);
|
|
3007
3060
|
throw error;
|
|
3008
3061
|
} finally {
|
|
3009
|
-
_optionalChain([rendererBuild, 'optionalAccess',
|
|
3010
|
-
_optionalChain([markdownPrecompile, 'optionalAccess',
|
|
3062
|
+
_optionalChain([rendererBuild, 'optionalAccess', _93 => _93.abort, 'call', _94 => _94()]);
|
|
3063
|
+
_optionalChain([markdownPrecompile, 'optionalAccess', _95 => _95.dispose, 'call', _96 => _96()]);
|
|
3011
3064
|
}
|
|
3012
3065
|
}
|
|
3013
3066
|
function collectFarmPrerenderedMarkdownBodies(pageRoutes) {
|
|
@@ -3015,7 +3068,7 @@ function collectFarmPrerenderedMarkdownBodies(pageRoutes) {
|
|
|
3015
3068
|
for (const route of pageRoutes) {
|
|
3016
3069
|
if (route.source === void 0 || !_chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) continue;
|
|
3017
3070
|
const { body } = _chunk26WP75W5cjs.parseMarkdownFrontmatter.call(void 0, route.source);
|
|
3018
|
-
const rendering =
|
|
3071
|
+
const rendering = _chunkL3BSHASBcjs.resolveRouteRenderingConfig.call(void 0,
|
|
3019
3072
|
_chunk26WP75W5cjs.readFarmMarkdownRouteConfig.call(void 0, body),
|
|
3020
3073
|
route.source
|
|
3021
3074
|
);
|
|
@@ -3030,7 +3083,7 @@ function varyFarmNitroCacheRules(rules, headerNames) {
|
|
|
3030
3083
|
if (headerNames.length === 0) return rules;
|
|
3031
3084
|
return Object.fromEntries(
|
|
3032
3085
|
Object.entries(rules).map(([source, rule]) => {
|
|
3033
|
-
const cached = _optionalChain([rule, 'optionalAccess',
|
|
3086
|
+
const cached = _optionalChain([rule, 'optionalAccess', _97 => _97.swr]) !== void 0 && rule.swr !== false || _optionalChain([rule, 'optionalAccess', _98 => _98.cache]) !== void 0 && rule.cache !== false;
|
|
3034
3087
|
if (!cached || rule.cache === false) return [source, rule];
|
|
3035
3088
|
const cache = rule.cache && typeof rule.cache === "object" ? rule.cache : {};
|
|
3036
3089
|
const varies = [
|
|
@@ -3059,7 +3112,7 @@ async function writeFarmVideoPlayerToClient(outputDir) {
|
|
|
3059
3112
|
const filePath = _path2.default.join(outputDir, _chunkY3DO7BIJcjs.FARM_VIDEO_PLAYER_PATH.slice(1));
|
|
3060
3113
|
await fs5.mkdir(_path2.default.dirname(filePath), { recursive: true });
|
|
3061
3114
|
try {
|
|
3062
|
-
await fs5.writeFile(filePath,
|
|
3115
|
+
await fs5.writeFile(filePath, _chunkH6C45DCFcjs.FARM_VIDEO_PLAYER_HTML, { flag: "wx" });
|
|
3063
3116
|
} catch (error) {
|
|
3064
3117
|
if (error.code !== "EEXIST") throw error;
|
|
3065
3118
|
}
|
|
@@ -3093,7 +3146,7 @@ async function mergeBuiltFontCss(outputDir, fontCssSource) {
|
|
|
3093
3146
|
}
|
|
3094
3147
|
const normalizedFontCss = typeof fontCss === "string" ? fontCss : Buffer.from(fontCss).toString("utf8");
|
|
3095
3148
|
await fs5.writeFile(fontCssPath, normalizedFontCss);
|
|
3096
|
-
await fs5.writeFile(clientCssPath,
|
|
3149
|
+
await fs5.writeFile(clientCssPath, _chunkH6C45DCFcjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
|
|
3097
3150
|
}
|
|
3098
3151
|
function importsFarmClientBlockedPackage(id, packageName) {
|
|
3099
3152
|
return id === packageName || id.startsWith(`${packageName}/`);
|
|
@@ -3143,10 +3196,10 @@ async function validateClientBuildOutput(root, srcDir, outputDir) {
|
|
|
3143
3196
|
}
|
|
3144
3197
|
}
|
|
3145
3198
|
function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, options = {}) {
|
|
3146
|
-
const key =
|
|
3199
|
+
const key = _chunkOYM6VJEFcjs.getClientModuleHydrationPlanKey.call(void 0, modulePath, root, mode, options);
|
|
3147
3200
|
let plan = cache.get(key);
|
|
3148
3201
|
if (!plan) {
|
|
3149
|
-
plan =
|
|
3202
|
+
plan = _chunkOYM6VJEFcjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
|
|
3150
3203
|
cache.set(key, plan);
|
|
3151
3204
|
}
|
|
3152
3205
|
return { ...plan, isolatedBoundaries: [...plan.isolatedBoundaries] };
|
|
@@ -3175,44 +3228,44 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3175
3228
|
const unsupportedIntegrationProvider = integrationProviders.find(
|
|
3176
3229
|
(provider) => provider.supportsIsolatedHydration !== true
|
|
3177
3230
|
);
|
|
3178
|
-
if (_optionalChain([config, 'access',
|
|
3231
|
+
if (_optionalChain([config, 'access', _99 => _99.experimental, 'optionalAccess', _100 => _100.isolatedClientHydration]) === "enabled" && _chunk3OKSEJ33cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _101 => _101.experimental, 'optionalAccess', _102 => _102.serverComponents])) !== "rsc" && unsupportedIntegrationProvider) {
|
|
3179
3232
|
_chunk7U4XF76Rcjs.logger.warn(
|
|
3180
3233
|
`[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
|
|
3181
3234
|
);
|
|
3182
3235
|
}
|
|
3183
|
-
const isolatedMode =
|
|
3184
|
-
_optionalChain([config, 'access',
|
|
3236
|
+
const isolatedMode = _chunkOYM6VJEFcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
3237
|
+
_optionalChain([config, 'access', _103 => _103.experimental, 'optionalAccess', _104 => _104.isolatedClientHydration]),
|
|
3185
3238
|
{
|
|
3186
|
-
serverComponents:
|
|
3239
|
+
serverComponents: _chunk3OKSEJ33cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _105 => _105.experimental, 'optionalAccess', _106 => _106.serverComponents])) === "rsc",
|
|
3187
3240
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
3188
3241
|
}
|
|
3189
3242
|
);
|
|
3190
|
-
const planOptions =
|
|
3243
|
+
const planOptions = _chunkOYM6VJEFcjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
3191
3244
|
config.renderer,
|
|
3192
3245
|
Boolean(unsupportedIntegrationProvider)
|
|
3193
3246
|
);
|
|
3194
3247
|
const pagePlanOptions = {
|
|
3195
3248
|
...planOptions,
|
|
3196
|
-
serverOwners:
|
|
3249
|
+
serverOwners: _chunk3OKSEJ33cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _107 => _107.experimental, 'optionalAccess', _108 => _108.serverComponents])) === "islands"
|
|
3197
3250
|
};
|
|
3198
3251
|
const layoutPlanOptions = {
|
|
3199
3252
|
...planOptions,
|
|
3200
3253
|
serverTreeLayouts: pagePlanOptions.serverOwners
|
|
3201
3254
|
};
|
|
3202
|
-
const layoutAppliesToRoute =
|
|
3255
|
+
const layoutAppliesToRoute = _chunk4B6YJ5DScjs.routeBoundaryCoversDirectory;
|
|
3203
3256
|
const routeDirectory = (route) => _nullishCoalesce(route.directory, () => ( route.pattern));
|
|
3204
|
-
const islandsMode =
|
|
3257
|
+
const islandsMode = _chunk3OKSEJ33cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _109 => _109.experimental, 'optionalAccess', _110 => _110.serverComponents])) === "islands";
|
|
3205
3258
|
const adapterOwnsDocsRuntime = _chunkL2GUEYHRcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs);
|
|
3206
|
-
const docsEntries = _optionalChain([config, 'access',
|
|
3259
|
+
const docsEntries = _optionalChain([config, 'access', _111 => _111.docs, 'optionalAccess', _112 => _112.enabled]) ? _chunkHR5GU4UUcjs.getFarmDocsRoots.call(void 0, config.docs).map(
|
|
3207
3260
|
(docsRoot) => `/${docsRoot.entry || "docs"}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/"
|
|
3208
3261
|
) : [];
|
|
3209
3262
|
const adapterDocsEntry = _nullishCoalesce(docsEntries[0], () => ( null));
|
|
3210
3263
|
const isAdapterDocsRoute = (routePattern) => adapterOwnsDocsRuntime && docsEntries.some(
|
|
3211
3264
|
(docsEntry) => docsEntry === "/" || routePattern === docsEntry || routePattern.startsWith(`${docsEntry}/`)
|
|
3212
3265
|
);
|
|
3213
|
-
const syntheticDocsEntry = _optionalChain([config, 'access',
|
|
3266
|
+
const syntheticDocsEntry = _optionalChain([config, 'access', _113 => _113.docs, 'optionalAccess', _114 => _114.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
|
|
3214
3267
|
const syntheticDocsPatterns = syntheticDocsEntry ? syntheticDocsEntry === "/" ? ["/", "/[...slug]"] : [syntheticDocsEntry, `${syntheticDocsEntry}/[...slug]`] : [];
|
|
3215
|
-
const plan = (operation) => sourceSnapshot ?
|
|
3268
|
+
const plan = (operation) => sourceSnapshot ? _chunkOYM6VJEFcjs.withFarmSourceSnapshotOf.call(void 0, sourceSnapshot, operation) : _chunkOYM6VJEFcjs.withFarmSourceSnapshot.call(void 0, operation);
|
|
3216
3269
|
const { clientLayouts, clientRouteSlots } = plan(() => {
|
|
3217
3270
|
const clientLayouts2 = layoutRoutes.map((layout) => {
|
|
3218
3271
|
try {
|
|
@@ -3259,7 +3312,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3259
3312
|
};
|
|
3260
3313
|
}
|
|
3261
3314
|
});
|
|
3262
|
-
const markdownPagePlan =
|
|
3315
|
+
const markdownPagePlan = _chunkOYM6VJEFcjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
3263
3316
|
_chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), root),
|
|
3264
3317
|
root,
|
|
3265
3318
|
isolatedMode,
|
|
@@ -3275,7 +3328,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3275
3328
|
pagePlanOptions
|
|
3276
3329
|
)
|
|
3277
3330
|
}));
|
|
3278
|
-
|
|
3331
|
+
_chunkOYM6VJEFcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
3279
3332
|
clientLayouts2.map((layout) => ({
|
|
3280
3333
|
pattern: layout.pattern,
|
|
3281
3334
|
depth: layout.pattern.split("/").filter(Boolean).length,
|
|
@@ -3284,7 +3337,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3284
3337
|
[
|
|
3285
3338
|
...routePlans.map(({ route, metadata }) => ({
|
|
3286
3339
|
pattern: routeDirectory(route),
|
|
3287
|
-
depth:
|
|
3340
|
+
depth: _chunk4B6YJ5DScjs.getRouteDirectoryDepth.call(void 0, routeDirectory(route)),
|
|
3288
3341
|
metadata
|
|
3289
3342
|
})),
|
|
3290
3343
|
...syntheticDocsPatterns.map((pattern) => ({
|
|
@@ -3309,7 +3362,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3309
3362
|
const matchesBuiltRoute = pageRoutes.some((route) => layoutAppliesToRoute(layout.pattern, routeDirectory(route))) || docsEntries.some((docsEntry) => layoutAppliesToRoute(layout.pattern, docsEntry));
|
|
3310
3363
|
if (matchesBuiltRoute && layout.suppressedAsyncHydration) {
|
|
3311
3364
|
_chunk7U4XF76Rcjs.logger.warn(
|
|
3312
|
-
`\u26A0\uFE0F ${
|
|
3365
|
+
`\u26A0\uFE0F ${_chunkOYM6VJEFcjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`
|
|
3313
3366
|
);
|
|
3314
3367
|
}
|
|
3315
3368
|
}
|
|
@@ -3344,7 +3397,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3344
3397
|
);
|
|
3345
3398
|
if (metadata.suppressedAsyncHydration) {
|
|
3346
3399
|
_chunk7U4XF76Rcjs.logger.warn(
|
|
3347
|
-
`\u26A0\uFE0F ${
|
|
3400
|
+
`\u26A0\uFE0F ${_chunkOYM6VJEFcjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
|
|
3348
3401
|
);
|
|
3349
3402
|
}
|
|
3350
3403
|
const slotBoundaries = serverSlotPlans.filter(
|
|
@@ -3352,7 +3405,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3352
3405
|
).flatMap(({ plan: plan2 }) => plan2.isolatedBoundaries);
|
|
3353
3406
|
if (metadata.shouldHydrate || metadata.hasIsolatedClientBoundaries || applicableClientLayouts.length > 0 || slotBoundaries.length > 0) {
|
|
3354
3407
|
const relativePath = route.modulePath.replace(root, "").replace(/^\//, "");
|
|
3355
|
-
const islandStrategy =
|
|
3408
|
+
const islandStrategy = _chunkH6C45DCFcjs.resolveFarmRouteRootStrategy.call(void 0,
|
|
3356
3409
|
route,
|
|
3357
3410
|
metadata,
|
|
3358
3411
|
clientLayouts2,
|
|
@@ -3371,7 +3424,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3371
3424
|
...applicableClientLayouts.filter((layout) => layout.hasIsolatedClientBoundaries || layout.serverTreeLayout).flatMap((layout) => layout.isolatedBoundaries)
|
|
3372
3425
|
],
|
|
3373
3426
|
// The server renders a server tree only below a hydrating layout.
|
|
3374
|
-
...
|
|
3427
|
+
..._chunkOYM6VJEFcjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
|
|
3375
3428
|
});
|
|
3376
3429
|
_chunk7U4XF76Rcjs.logger.info(`\u{1F4F1} Found hydratable route: ${route.pattern} -> ${route.modulePath}`);
|
|
3377
3430
|
}
|
|
@@ -3408,7 +3461,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3408
3461
|
}
|
|
3409
3462
|
const clientRouteSlots2 = routeSlots.filter((slot) => {
|
|
3410
3463
|
try {
|
|
3411
|
-
const metadata =
|
|
3464
|
+
const metadata = _chunkOYM6VJEFcjs.getClientModuleMetadata.call(void 0, slot.modulePath, root);
|
|
3412
3465
|
return metadata.shouldHydrate && (!islandsMode || metadata.isClientComponent);
|
|
3413
3466
|
} catch (error) {
|
|
3414
3467
|
_chunk7U4XF76Rcjs.logger.warn(`\u26A0\uFE0F Could not inspect route slot ${slot.modulePath}: ${error}`);
|
|
@@ -3452,7 +3505,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3452
3505
|
srcDir,
|
|
3453
3506
|
adapterOwnsDocsRuntime ? false : _chunkN3H7UPBMcjs.isFarmDocsSearchEnabled.call(void 0, config.docs),
|
|
3454
3507
|
adapterOwnsDocsRuntime ? void 0 : _chunkN3H7UPBMcjs.resolveFarmDocsSearchClientModule.call(void 0, root),
|
|
3455
|
-
_optionalChain([config, 'access',
|
|
3508
|
+
_optionalChain([config, 'access', _115 => _115.docs, 'optionalAccess', _116 => _116.enabled]) ? _chunkHR5GU4UUcjs.getFarmDocsRoots.call(void 0, config.docs).map((docsRoot) => docsRoot.entry) : void 0,
|
|
3456
3509
|
adapterOwnsDocsRuntime ? _chunkL2GUEYHRcjs.getFarmDocsAdapterUIModule.call(void 0, config.docs.adapter) : void 0,
|
|
3457
3510
|
config.i18n,
|
|
3458
3511
|
config.plugins,
|
|
@@ -3461,11 +3514,11 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3461
3514
|
config.trailingSlash,
|
|
3462
3515
|
_chunkB3HQTGXScjs.getIntegrationProviders.call(void 0, config.integrations),
|
|
3463
3516
|
config.basePath,
|
|
3464
|
-
|
|
3517
|
+
_chunkH6C45DCFcjs.generateClientCachePersistenceCode.call(void 0, _chunkH6C45DCFcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
|
|
3465
3518
|
adapterOwnsDocsRuntime ? _chunkXJDB564Acjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0,
|
|
3466
|
-
|
|
3519
|
+
_chunk3OKSEJ33cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _117 => _117.experimental, 'optionalAccess', _118 => _118.serverComponents])) === "islands",
|
|
3467
3520
|
platform,
|
|
3468
|
-
islandsMode ?
|
|
3521
|
+
islandsMode ? _chunkOYM6VJEFcjs.collectFarmServerStylesheets.call(void 0,
|
|
3469
3522
|
[
|
|
3470
3523
|
...layoutRoutes.map((layout) => layout.modulePath),
|
|
3471
3524
|
...pageRoutes.filter((route) => !isAdapterDocsRoute(route.pattern)).map((route) => route.modulePath)
|
|
@@ -3489,7 +3542,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3489
3542
|
await fs5.writeFile(_path2.default.join(clientEntryDir, "farm-client-root.tsx"), clientEntry.root);
|
|
3490
3543
|
}
|
|
3491
3544
|
const clientInput = { [entryName]: clientEntryPath };
|
|
3492
|
-
if (platform === "web" &&
|
|
3545
|
+
if (platform === "web" && _chunkH6C45DCFcjs.canBootFarmIslandsClient.call(void 0, config)) {
|
|
3493
3546
|
const clientBootPath = _path2.default.join(clientEntryDir, "farm-client-boot.tsx");
|
|
3494
3547
|
await fs5.writeFile(
|
|
3495
3548
|
clientBootPath,
|
|
@@ -3500,7 +3553,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3500
3553
|
const hasScopedPostcssConfig = hasProjectPostcssConfig(root);
|
|
3501
3554
|
let postcssSearchPath;
|
|
3502
3555
|
let tailwindVitePlugin = void 0;
|
|
3503
|
-
const rendererVitePlugins = await
|
|
3556
|
+
const rendererVitePlugins = await _chunk3OKSEJ33cjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, root, {
|
|
3504
3557
|
ssr: false,
|
|
3505
3558
|
buildLifetime: rendererBuildLifetime
|
|
3506
3559
|
});
|
|
@@ -3531,11 +3584,11 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3531
3584
|
target: FARM_CLIENT_BUILD_TARGET,
|
|
3532
3585
|
// Tailwind CSS 4 already requires newer browsers than that baseline. An app's own
|
|
3533
3586
|
// `build.target` or `build.cssTarget` still decides, as Vite derives one from the other.
|
|
3534
|
-
..._optionalChain([config, 'access',
|
|
3587
|
+
..._optionalChain([config, 'access', _119 => _119.vite, 'optionalAccess', _120 => _120.build, 'optionalAccess', _121 => _121.target]) === void 0 && _optionalChain([config, 'access', _122 => _122.vite, 'optionalAccess', _123 => _123.build, 'optionalAccess', _124 => _124.cssTarget]) === void 0 && (_chunkDMSXZNQRcjs.includesTailwindVitePlugin.call(void 0, tailwindVitePlugin) || _chunkDMSXZNQRcjs.includesTailwindVitePlugin.call(void 0, _optionalChain([config, 'access', _125 => _125.vite, 'optionalAccess', _126 => _126.plugins]))) ? { cssTarget: _chunkDMSXZNQRcjs.TAILWIND_CSS_BROWSER_TARGET } : {},
|
|
3535
3588
|
outDir: outputDir,
|
|
3536
3589
|
emptyOutDir: platform === "web",
|
|
3537
3590
|
// Never public: see resolveFarmClientSourcemap.
|
|
3538
|
-
sourcemap: resolveFarmClientSourcemap(_optionalChain([config, 'access',
|
|
3591
|
+
sourcemap: resolveFarmClientSourcemap(_optionalChain([config, 'access', _127 => _127.vite, 'optionalAccess', _128 => _128.build, 'optionalAccess', _129 => _129.sourcemap])),
|
|
3539
3592
|
assetsInlineLimit: 0,
|
|
3540
3593
|
cssCodeSplit: false,
|
|
3541
3594
|
// Bundle all CSS into one file
|
|
@@ -3545,9 +3598,10 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3545
3598
|
entryFileNames: "[name]-h[hash].js",
|
|
3546
3599
|
chunkFileNames: "chunks/[name]-h[hash].js",
|
|
3547
3600
|
hashCharacters: "hex",
|
|
3601
|
+
...islandsMode && _chunk3OKSEJ33cjs.isReactRenderer.call(void 0, config.renderer) && !configuresFarmClientChunks(config.vite) ? { codeSplitting: { groups: [createFarmIslandsReactChunkGroup()] } } : {},
|
|
3548
3602
|
// Use predictable name for CSS so we can reference it in SSR HTML
|
|
3549
3603
|
assetFileNames: (assetInfo) => {
|
|
3550
|
-
if (_optionalChain([assetInfo, 'access',
|
|
3604
|
+
if (_optionalChain([assetInfo, 'access', _130 => _130.name, 'optionalAccess', _131 => _131.endsWith, 'call', _132 => _132(".css")])) {
|
|
3551
3605
|
return `${entryName}.css`;
|
|
3552
3606
|
}
|
|
3553
3607
|
return "assets/[name]-h[hash][extname]";
|
|
@@ -3564,7 +3618,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3564
3618
|
}
|
|
3565
3619
|
},
|
|
3566
3620
|
plugins: [
|
|
3567
|
-
|
|
3621
|
+
_chunkH6C45DCFcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
3568
3622
|
createFarmPrivateClientSourcemapsPlugin({
|
|
3569
3623
|
outDir: _path2.default.join(
|
|
3570
3624
|
_path2.default.dirname(outputDir),
|
|
@@ -3585,7 +3639,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3585
3639
|
],
|
|
3586
3640
|
rootModules: [_path2.default.join(clientEntryDir, "farm-client-root.tsx")],
|
|
3587
3641
|
// What the islands entry loads with its first render or hydration (RFC 0010).
|
|
3588
|
-
...islandsMode &&
|
|
3642
|
+
...islandsMode && _chunk3OKSEJ33cjs.isReactRenderer.call(void 0, config.renderer) ? {
|
|
3589
3643
|
rendererImports: [
|
|
3590
3644
|
"react",
|
|
3591
3645
|
"react-dom/client",
|
|
@@ -3593,6 +3647,9 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3593
3647
|
],
|
|
3594
3648
|
// What a call's result is handled with, imported on the first (RFC 0013).
|
|
3595
3649
|
actionImports: ["@farm.js/core/internal/islands-action-client"],
|
|
3650
|
+
// What a root rebuilds a server tree with, imported with the first (RFC
|
|
3651
|
+
// 0013). A build without server trees has no chunk for it.
|
|
3652
|
+
serverTreeImports: ["@farm.js/core/internal/islands-server-tree"],
|
|
3596
3653
|
rendererImporter: clientEntryPath
|
|
3597
3654
|
} : {}
|
|
3598
3655
|
}),
|
|
@@ -3613,7 +3670,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3613
3670
|
...config.vite.plugins || [],
|
|
3614
3671
|
farmServerOnlyEntriesPlugin({ platform, distDir: config.distDir || ".farm" }),
|
|
3615
3672
|
farmNavigationPlugin(config.renderer),
|
|
3616
|
-
|
|
3673
|
+
_chunkH6C45DCFcjs.farmDocsClientConfigPlugin.call(void 0,
|
|
3617
3674
|
adapterOwnsDocsRuntime ? _chunkXJDB564Acjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
|
|
3618
3675
|
),
|
|
3619
3676
|
// Plugin to redirect @farm.js/core imports to client-only exports
|
|
@@ -3646,7 +3703,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3646
3703
|
},
|
|
3647
3704
|
load: {
|
|
3648
3705
|
filter: {
|
|
3649
|
-
id:
|
|
3706
|
+
id: _chunkH6C45DCFcjs.exactIdPattern.call(void 0, [
|
|
3650
3707
|
"\0empty-module",
|
|
3651
3708
|
"\0empty-api-route",
|
|
3652
3709
|
"\0farm-i18n-client-bridge",
|
|
@@ -3684,7 +3741,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3684
3741
|
{ ...config, isolatedClientBoundaryModules, programmaticClientRoutes, sourceSnapshot },
|
|
3685
3742
|
pluginManager
|
|
3686
3743
|
),
|
|
3687
|
-
|
|
3744
|
+
_chunkOYM6VJEFcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
|
|
3688
3745
|
],
|
|
3689
3746
|
mode: "production",
|
|
3690
3747
|
css: postcssSearchPath ? {
|
|
@@ -3692,7 +3749,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3692
3749
|
} : void 0,
|
|
3693
3750
|
// Ensure React is bundled for client
|
|
3694
3751
|
resolve: {
|
|
3695
|
-
alias:
|
|
3752
|
+
alias: _chunkH6C45DCFcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
3696
3753
|
dedupe: [...config.renderer.dedupe || []]
|
|
3697
3754
|
},
|
|
3698
3755
|
// Optimize dependencies - exclude server-side code from client bundle
|
|
@@ -3706,7 +3763,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3706
3763
|
}
|
|
3707
3764
|
};
|
|
3708
3765
|
await viteBuild(
|
|
3709
|
-
|
|
3766
|
+
_chunkH6C45DCFcjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite, { clientOutput: true })
|
|
3710
3767
|
);
|
|
3711
3768
|
if (platform === "mobile") {
|
|
3712
3769
|
await fs5.rm(_path2.default.join(outputDir, `${entryName}.css`), { force: true });
|
|
@@ -3800,9 +3857,9 @@ async function fetchFarmNavigationDocument(url, headers, recover = true, signal)
|
|
|
3800
3857
|
return response;
|
|
3801
3858
|
}
|
|
3802
3859
|
|
|
3803
|
-
${streamNavigations ? `${
|
|
3860
|
+
${streamNavigations ? `${_chunkH6C45DCFcjs.FARM_NAVIGATION_STREAM_READER_SOURCE}
|
|
3804
3861
|
|
|
3805
|
-
${
|
|
3862
|
+
${_chunkH6C45DCFcjs.FARM_EARLY_NAVIGATION_SOURCE}` : ""}
|
|
3806
3863
|
|
|
3807
3864
|
function clearFarmPrefetchCacheOnDeploymentMismatch(router, error) {
|
|
3808
3865
|
if (error?.name === "FarmDeploymentMismatchError") {
|
|
@@ -3971,8 +4028,8 @@ for (const type of FARM_ROUTE_TABLE_INTENT_EVENTS) {
|
|
|
3971
4028
|
}`;
|
|
3972
4029
|
}
|
|
3973
4030
|
function getFarmClientLayoutMatch(pattern) {
|
|
3974
|
-
const groupScope =
|
|
3975
|
-
return groupScope ? { pattern, urlPattern:
|
|
4031
|
+
const groupScope = _chunk4B6YJ5DScjs.getRouteGroupScope.call(void 0, pattern);
|
|
4032
|
+
return groupScope ? { pattern, urlPattern: _chunk4B6YJ5DScjs.stripRouteGroups.call(void 0, pattern), groupScope } : { pattern };
|
|
3976
4033
|
}
|
|
3977
4034
|
function generateFarmClientLayoutSelectionSource() {
|
|
3978
4035
|
return `function selectFarmClientLayouts(layouts, routePathname, readDirectory) {
|
|
@@ -4975,7 +5032,7 @@ function readFarmEntryImports(source) {
|
|
|
4975
5032
|
for (const match of source.matchAll(/^import\s+([^"';]+?)\s+from\s+(["'][^"']+["'])/gm)) {
|
|
4976
5033
|
const from = match[2];
|
|
4977
5034
|
const named = /\{([^}]*)\}/.exec(match[1]);
|
|
4978
|
-
for (const specifier of _nullishCoalesce(_optionalChain([named, 'optionalAccess',
|
|
5035
|
+
for (const specifier of _nullishCoalesce(_optionalChain([named, 'optionalAccess', _133 => _133[1], 'optionalAccess', _134 => _134.split, 'call', _135 => _135(",")]), () => ( []))) {
|
|
4979
5036
|
const [imported, local] = specifier.trim().split(/\s+as\s+/);
|
|
4980
5037
|
if (imported)
|
|
4981
5038
|
bindings.push({ local: _nullishCoalesce(local, () => ( imported)), clause: `{ ${specifier.trim()} }`, from });
|
|
@@ -5110,7 +5167,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
|
|
|
5110
5167
|
secure: false
|
|
5111
5168
|
},
|
|
5112
5169
|
direction: {}
|
|
5113
|
-
}, plugins = [], renderer =
|
|
5170
|
+
}, plugins = [], renderer = _chunk3OKSEJ33cjs.REACT_RENDERER, publicRuntimeConfig = void 0, trailingSlash = false, integrationProviders = [], basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule, islandValues = false, platform, serverStylesheets = []) {
|
|
5114
5171
|
const toImportPath = (targetPath) => targetPath.replace(/\\/g, "/");
|
|
5115
5172
|
const clientPluginEntry = _chunkDMSXZNQRcjs.generateFarmClientPluginEntryCode.call(void 0,
|
|
5116
5173
|
plugins,
|
|
@@ -5119,11 +5176,11 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
|
|
|
5119
5176
|
publicRuntimeConfig,
|
|
5120
5177
|
platform
|
|
5121
5178
|
);
|
|
5122
|
-
const appSetupPath =
|
|
5123
|
-
const lazyRenderer = islandValues && platform !== "mobile" &&
|
|
5179
|
+
const appSetupPath = _chunk3OKSEJ33cjs.resolveFarmRendererAppSetup.call(void 0, root, renderer);
|
|
5180
|
+
const lazyRenderer = islandValues && platform !== "mobile" && _chunk3OKSEJ33cjs.isReactRenderer.call(void 0, renderer) && clientRouteSlots.length === 0;
|
|
5124
5181
|
const lazyRoot = islandValues && platform !== "mobile";
|
|
5125
5182
|
const lazyMatcher = lazyRoot && clientPages.length > 0;
|
|
5126
|
-
const rendererClientImports = lazyRenderer ? `import { holdFarmIslandInteractions, restorePagePosition, watchFarmIslandTriggers } from "@farm.js/core/internal/client-runtime";` :
|
|
5183
|
+
const rendererClientImports = lazyRenderer ? `import { holdFarmIslandInteractions, restorePagePosition, watchFarmIslandTriggers } from "@farm.js/core/internal/client-runtime";` : _chunk3OKSEJ33cjs.isReactRenderer.call(void 0, renderer) ? `import React from "react";
|
|
5127
5184
|
import { createRoot, hydrateRoot } from "react-dom/client";
|
|
5128
5185
|
import { restorePagePosition } from "@farm.js/core/internal/client-runtime";` : (
|
|
5129
5186
|
// Named exports only, as the server entry and the development client read them. A copy
|
|
@@ -5136,8 +5193,8 @@ __farmConfigureApp(__farmAppSetup);` : `import * as __farmRendererClient from ${
|
|
|
5136
5193
|
import { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};
|
|
5137
5194
|
const React = { ...__farmRendererClient };`
|
|
5138
5195
|
);
|
|
5139
|
-
const hydrateFarmRouteCall =
|
|
5140
|
-
const providerClientCode =
|
|
5196
|
+
const hydrateFarmRouteCall = _chunk3OKSEJ33cjs.isReactRenderer.call(void 0, renderer) ? "return hydrateRoot(container, route.element);" : "return route.layouts.length > 0 ? hydrateRoot(container, route.element, route) : hydrateRoot(container, route.element);";
|
|
5197
|
+
const providerClientCode = _chunkH6C45DCFcjs.generateFarmIntegrationProviderClientCode.call(void 0,
|
|
5141
5198
|
integrationProviders,
|
|
5142
5199
|
root,
|
|
5143
5200
|
_nullishCoalesce(renderer.componentExtensions, () => ( []))
|
|
@@ -5161,12 +5218,12 @@ const React = { ...__farmRendererClient };`
|
|
|
5161
5218
|
const layoutRegistrations = [];
|
|
5162
5219
|
const layoutComponents = [];
|
|
5163
5220
|
const hydratingLayoutPatterns = layoutRoutes.filter((layout) => layout.shouldHydrate).map((layout) => layout.pattern);
|
|
5164
|
-
const treeLayoutPatterns = islandValues ?
|
|
5221
|
+
const treeLayoutPatterns = islandValues ? _chunk4B6YJ5DScjs.getFarmServerTreeLayoutPatterns.call(void 0, layoutRoutes) : /* @__PURE__ */ new Set();
|
|
5165
5222
|
layoutRoutes.forEach((layout, index) => {
|
|
5166
5223
|
const relativePath = toImportPath(layout.modulePath);
|
|
5167
5224
|
const treeLayout = treeLayoutPatterns.has(layout.pattern);
|
|
5168
5225
|
const rendersOnClient = treeLayout || !layout.hasIsolatedClientBoundaries && hydratingLayoutPatterns.some(
|
|
5169
|
-
(pattern) =>
|
|
5226
|
+
(pattern) => _chunk4B6YJ5DScjs.layoutsCanCoverSamePage.call(void 0, layout.pattern, pattern)
|
|
5170
5227
|
);
|
|
5171
5228
|
if (rendersOnClient && !treeLayout) {
|
|
5172
5229
|
layoutImportStatements.push(`import Layout${index} from "${relativePath}";`);
|
|
@@ -5247,7 +5304,7 @@ function isFarmDocsPath() {
|
|
|
5247
5304
|
docsAdapterUI,
|
|
5248
5305
|
docsConfigModule,
|
|
5249
5306
|
// Config resolution keeps an adapter to its UI's renderer, so this is the UI's renderer too.
|
|
5250
|
-
|
|
5307
|
+
_chunk3OKSEJ33cjs.isReactRenderer.call(void 0, renderer) ? void 0 : renderer.client
|
|
5251
5308
|
);
|
|
5252
5309
|
if (clientPages.length === 0 && clientRouteSlots.length === 0 && !providerClientCode.hasProviders) {
|
|
5253
5310
|
return `
|
|
@@ -5271,7 +5328,7 @@ mountFarmDocsSearch();
|
|
|
5271
5328
|
|
|
5272
5329
|
${generateUniversalRouterStateRuntime()}
|
|
5273
5330
|
|
|
5274
|
-
${
|
|
5331
|
+
${_chunkH6C45DCFcjs.FARM_NAVIGATION_SCRIPT_SOURCE}
|
|
5275
5332
|
|
|
5276
5333
|
// SPA Router for server-rendered pages (HTML swap)
|
|
5277
5334
|
const spaRouter = {
|
|
@@ -5574,6 +5631,7 @@ installFarmLinkPrefetch();
|
|
|
5574
5631
|
}
|
|
5575
5632
|
});
|
|
5576
5633
|
const isolatedHydrationEnabled = isolatedBoundaryModules.size > 0;
|
|
5634
|
+
const rendererIslands = isolatedHydrationEnabled && !islandValues && !_chunk3OKSEJ33cjs.isReactRenderer.call(void 0, renderer) && _chunk3OKSEJ33cjs.getFarmRendererCapabilities.call(void 0, renderer).islands;
|
|
5577
5635
|
const serverTreeEnabled = isolatedHydrationEnabled && clientPages.some((page) => page.serverTree);
|
|
5578
5636
|
const islandsRuntimeExports = [
|
|
5579
5637
|
"createFarmIsolatedHydrationRuntime",
|
|
@@ -5613,7 +5671,7 @@ function loadFarmRenderer() {
|
|
|
5613
5671
|
}));
|
|
5614
5672
|
}
|
|
5615
5673
|
` : "";
|
|
5616
|
-
const isolatedHydrationImport = lazyRenderer ? "" : isolatedHydrationEnabled ? `${islandValues ? `import { createFarmIsolatedHydrationRuntime, createFarmServerPageBoundary, wrapFarmIsolatedClientGraph, createFarmServerTreeElement${hasServerTreeLayouts ? ", createFarmServerTreeLayout" : ""} } from "@farm.js/core/internal/islands-runtime";` : 'import { createFarmIsolatedHydrationRuntime, createFarmServerPageBoundary, wrapFarmIsolatedClientGraph } from "@farm.js/core/internal/isolated-boundary";'}${serverTreeEnabled && !islandValues ? '\nimport { createFarmServerTreeElement } from "@farm.js/core/internal/server-tree";' : ""}` : "";
|
|
5674
|
+
const isolatedHydrationImport = lazyRenderer ? "" : rendererIslands ? 'import { createFarmRendererIslandRuntime } from "@farm.js/core/internal/renderer-islands";' : isolatedHydrationEnabled ? `${islandValues ? `import { createFarmIsolatedHydrationRuntime, createFarmServerPageBoundary, wrapFarmIsolatedClientGraph, createFarmServerTreeElement${hasServerTreeLayouts ? ", createFarmServerTreeLayout" : ""} } from "@farm.js/core/internal/islands-runtime";` : 'import { createFarmIsolatedHydrationRuntime, createFarmServerPageBoundary, wrapFarmIsolatedClientGraph } from "@farm.js/core/internal/isolated-boundary";'}${serverTreeEnabled && !islandValues ? '\nimport { createFarmServerTreeElement } from "@farm.js/core/internal/server-tree";' : ""}` : "";
|
|
5617
5675
|
const isolatedHydrationRuntime = isolatedHydrationEnabled ? `const farmIsolatedBoundaryLoaders = {
|
|
5618
5676
|
${Array.from(isolatedBoundaryModules.entries()).map(
|
|
5619
5677
|
([reference, modulePath]) => ` ${JSON.stringify(reference)}: () => import(${JSON.stringify(modulePath)}),`
|
|
@@ -5689,7 +5747,15 @@ const farmIsolatedHydrationRuntime = {
|
|
|
5689
5747
|
endStream: function(root) {
|
|
5690
5748
|
whenFarmIslandsRuntime(root, function(runtime) { runtime.endStream(root); });
|
|
5691
5749
|
},
|
|
5692
|
-
};` : `const farmIsolatedHydrationRuntime =
|
|
5750
|
+
};` : rendererIslands ? `const farmIsolatedHydrationRuntime = createFarmRendererIslandRuntime({
|
|
5751
|
+
renderer: React,
|
|
5752
|
+
load: loadFarmIsolatedBoundary,
|
|
5753
|
+
schedule: scheduleFarmIslandHydration,
|
|
5754
|
+
});
|
|
5755
|
+
|
|
5756
|
+
// A hydrating layout keeps a page that doesn't hydrate as server HTML in a plain element. The
|
|
5757
|
+
// renderer's root never renders the page's islands, so the runtime starts them after each render.
|
|
5758
|
+
const FarmServerPage = "div";` : `const farmIsolatedHydrationRuntime = createFarmIsolatedHydrationRuntime({
|
|
5693
5759
|
ReactRuntime: React,
|
|
5694
5760
|
hydrateRoot,
|
|
5695
5761
|
load: loadFarmIsolatedBoundary,
|
|
@@ -5707,7 +5773,14 @@ function disposeFarmIsolatedClientBoundaries(scope) {
|
|
|
5707
5773
|
async function hydrateFarmIsolatedClientBoundaries(scope = document, signal) {
|
|
5708
5774
|
await farmIsolatedHydrationRuntime.hydrate(scope, signal);
|
|
5709
5775
|
}
|
|
5710
|
-
${
|
|
5776
|
+
${rendererIslands ? `
|
|
5777
|
+
// After a hydrating layout renders another page: release the islands whose markup it replaced,
|
|
5778
|
+
// and start the new page's.
|
|
5779
|
+
async function hydrateFarmLayoutPageIslands(container) {
|
|
5780
|
+
farmIsolatedHydrationRuntime.prune();
|
|
5781
|
+
await hydrateFarmIsolatedClientBoundaries(container);
|
|
5782
|
+
}
|
|
5783
|
+
` : ""}${serverTreeEnabled ? `
|
|
5711
5784
|
/*farm-root-start*/
|
|
5712
5785
|
// A server-tree page (an async page below a hydrating layout) rebuilds in the layout's root.
|
|
5713
5786
|
async function createFarmServerTreePageElement(source, pathname) {
|
|
@@ -5726,7 +5799,7 @@ async function createFarmServerTreePageElement(source, pathname) {
|
|
|
5726
5799
|
/*farm-root-end*/` : "\n/*farm-root-start*/\nasync function createFarmServerTreePageElement() { return null; }\n/*farm-root-end*/"}` : `/*farm-root-start*/
|
|
5727
5800
|
async function createFarmServerTreePageElement() { return null; }
|
|
5728
5801
|
/*farm-root-end*/`;
|
|
5729
|
-
const routeClientGraphRuntime = isolatedHydrationEnabled ? `function wrapFarmRouteClientGraph(element) {
|
|
5802
|
+
const routeClientGraphRuntime = isolatedHydrationEnabled && !rendererIslands ? `function wrapFarmRouteClientGraph(element) {
|
|
5730
5803
|
return wrapFarmIsolatedClientGraph(React, element);
|
|
5731
5804
|
}` : `function wrapFarmRouteClientGraph(element) { return element; }`;
|
|
5732
5805
|
clientRouteSlots.forEach((slot, index) => {
|
|
@@ -5795,7 +5868,7 @@ ${layoutRegistrations.join(",\n")}
|
|
|
5795
5868
|
${generateFarmClientRouteMatchSource({ lazyMatcher })}
|
|
5796
5869
|
|
|
5797
5870
|
${layoutComponentsRuntime}/*farm-root-start*/
|
|
5798
|
-
${
|
|
5871
|
+
${_chunkH6C45DCFcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
|
|
5799
5872
|
// Wrap a page element with applicable layouts
|
|
5800
5873
|
function wrapWithLayouts(pageElement, pathname, params) {
|
|
5801
5874
|
const layouts = getApplicableLayouts(pathname);
|
|
@@ -5830,7 +5903,7 @@ function createLayoutPageBoundary(route, pageElement, serverHtml) {
|
|
|
5830
5903
|
return React.createElement("div", props, pageElement);
|
|
5831
5904
|
}
|
|
5832
5905
|
let farmLastRouteState = null;
|
|
5833
|
-
${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${
|
|
5906
|
+
${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${_chunkH6C45DCFcjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
|
|
5834
5907
|
function farmTreeLayoutsOf(pathname) {
|
|
5835
5908
|
return getApplicableLayouts(pathname).filter(function(layout) {
|
|
5836
5909
|
return layout.serverTree === true;
|
|
@@ -5945,7 +6018,7 @@ async function createMatchedHydrationRoute(matched, pathname, searchParams, navi
|
|
|
5945
6018
|
|
|
5946
6019
|
if (!pageElement) return null;
|
|
5947
6020
|
if (!hydrateLayouts) {
|
|
5948
|
-
${
|
|
6021
|
+
${_chunk3OKSEJ33cjs.isReactRenderer.call(void 0, renderer) ? "if (hydrationContainer) pageElement = restorePagePosition(React, hydrationContainer, pageElement);" : ""}
|
|
5949
6022
|
return createFarmRouteState(pageElement, pathname, params, false);
|
|
5950
6023
|
}
|
|
5951
6024
|
if (matched.route.pageShouldHydrate) {
|
|
@@ -5974,7 +6047,7 @@ function createFarmRouteState(page, pathname, params, includeLayouts) {
|
|
|
5974
6047
|
|
|
5975
6048
|
function hydrateFarmRoute(container, route) {
|
|
5976
6049
|
farmLastRouteState = route;
|
|
5977
|
-
${
|
|
6050
|
+
${_chunk3OKSEJ33cjs.getFarmRendererCapabilities.call(void 0, renderer).hydrationFallback ? `try {
|
|
5978
6051
|
${hydrateFarmRouteCall}
|
|
5979
6052
|
} catch (error) {
|
|
5980
6053
|
// The renderer opted in with capabilities.hydrationFallback, as development always does. The
|
|
@@ -6344,8 +6417,7 @@ ${lazyRenderer ? ` // React DOM and islx load with what first renders or hydrat
|
|
|
6344
6417
|
${isolatedHydrationEnabled ? `// Not cancelled with the page: a navigation disposes the islands it removes, and one in a
|
|
6345
6418
|
// layout it keeps still waits for its trigger, as on a page of islands only.
|
|
6346
6419
|
const isolatedHydration =
|
|
6347
|
-
!hasHydratableLayout(pathname)
|
|
6348
|
-
document.querySelector('f-island[src]')
|
|
6420
|
+
${rendererIslands ? "" : "!hasHydratableLayout(pathname) &&\n "}document.querySelector('f-island[src]')
|
|
6349
6421
|
? hydrateFarmIsolatedClientBoundaries(document)
|
|
6350
6422
|
: Promise.resolve();
|
|
6351
6423
|
await Promise.all([pageHydration, isolatedHydration]);` : "await pageHydration;"}
|
|
@@ -6465,7 +6537,7 @@ function fitsSegmentResponse(currentRoot, nextRoot) {
|
|
|
6465
6537
|
return true;
|
|
6466
6538
|
}` : ""}
|
|
6467
6539
|
|
|
6468
|
-
${
|
|
6540
|
+
${_chunkH6C45DCFcjs.FARM_NAVIGATION_SCRIPT_SOURCE}
|
|
6469
6541
|
|
|
6470
6542
|
function activateNavigationScripts(root) {
|
|
6471
6543
|
for (const script of Array.from(root?.querySelectorAll?.("script") || [])) {
|
|
@@ -6571,7 +6643,7 @@ function getLayoutShell(root, patterns, index) {
|
|
|
6571
6643
|
return shell.innerHTML;
|
|
6572
6644
|
}
|
|
6573
6645
|
|
|
6574
|
-
${islandValues ?
|
|
6646
|
+
${islandValues ? _chunkH6C45DCFcjs.FARM_REFRESH_FIELDS_SOURCE : ""}function replaceSharedLayoutBoundary(currentRoot, nextRoot, refresh = false) {
|
|
6575
6647
|
// A refresh keeps the islands still on the page: the ones in streamed Suspense content too.
|
|
6576
6648
|
if (refresh) revealFarmStreamedContent(nextRoot);
|
|
6577
6649
|
const currentPatterns = getLayoutPatterns(currentRoot);
|
|
@@ -7014,7 +7086,7 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
|
|
|
7014
7086
|
if (routeState) {
|
|
7015
7087
|
farmRoot.renderFarmRoute(reactRoot, routeState);
|
|
7016
7088
|
window.__FARM_ROUTE_SLOTS__ = nextRouteSlots;
|
|
7017
|
-
setFarmHydrated();
|
|
7089
|
+
setFarmHydrated();${rendererIslands ? "\n await hydrateFarmLayoutPageIslands(currentRoot);" : ""}
|
|
7018
7090
|
return true;
|
|
7019
7091
|
}
|
|
7020
7092
|
}
|
|
@@ -7091,7 +7163,7 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
|
|
|
7091
7163
|
console.error("[Farm.js] Hydrating the page's islands failed:", error);
|
|
7092
7164
|
});
|
|
7093
7165
|
}
|
|
7094
|
-
}` : `if (matched.route.hasIsolatedClientBoundaries && !hydrateLayouts) {
|
|
7166
|
+
}` : `if (matched.route.hasIsolatedClientBoundaries${rendererIslands ? "" : " && !hydrateLayouts"}) {
|
|
7095
7167
|
await hydrateFarmIsolatedClientBoundaries(
|
|
7096
7168
|
isolatedHydrationScope,
|
|
7097
7169
|
navigation.controller.signal,
|
|
@@ -7261,7 +7333,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7261
7333
|
const hasScopedPostcssConfig = hasProjectPostcssConfig(root);
|
|
7262
7334
|
let postcssConfigDir;
|
|
7263
7335
|
let tailwindVitePlugin = void 0;
|
|
7264
|
-
const rendererVitePlugins = await
|
|
7336
|
+
const rendererVitePlugins = await _chunk3OKSEJ33cjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, root, {
|
|
7265
7337
|
ssr: true,
|
|
7266
7338
|
buildLifetime: rendererBuildLifetime
|
|
7267
7339
|
});
|
|
@@ -7378,7 +7450,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7378
7450
|
}))
|
|
7379
7451
|
);
|
|
7380
7452
|
const instrumentationPath = _chunk3BTN3NP7cjs.resolveFarmInstrumentationFile.call(void 0, root, config.srcDir || "src");
|
|
7381
|
-
const notFoundPath =
|
|
7453
|
+
const notFoundPath = _chunkH6C45DCFcjs.resolveFarmNotFoundComponentPath.call(void 0,
|
|
7382
7454
|
config,
|
|
7383
7455
|
appDirs,
|
|
7384
7456
|
routeManager.getRendererNotFoundPath()
|
|
@@ -7403,9 +7475,9 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7403
7475
|
(provider) => provider.component || provider.type === "clerk"
|
|
7404
7476
|
);
|
|
7405
7477
|
const hasObservabilityHandler = !!config.observability && typeof config.observability === "object" && "onEvent" in config.observability;
|
|
7406
|
-
const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access',
|
|
7407
|
-
const hasMiddlewareConfig =
|
|
7408
|
-
const hasRouteContextConfig =
|
|
7478
|
+
const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _136 => _136.mdx, 'optionalAccess', _137 => _137.components]));
|
|
7479
|
+
const hasMiddlewareConfig = _chunk4B6YJ5DScjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
|
|
7480
|
+
const hasRouteContextConfig = _chunkBBX4RPOVcjs.hasCustomFarmRouteContext.call(void 0, config);
|
|
7409
7481
|
const hasServerRuntimePlugins = _chunkDMSXZNQRcjs.hasFarmServerRuntimePlugins.call(void 0, config.plugins);
|
|
7410
7482
|
const hasPluginRoutes = hasFarmPluginRoutes(config);
|
|
7411
7483
|
const hasServerCacheConfig = hasFarmServerCacheConfig(config.cache);
|
|
@@ -7417,7 +7489,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7417
7489
|
);
|
|
7418
7490
|
if (_chunkL2GUEYHRcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
|
|
7419
7491
|
const adapterGuardedPaths = new Set(getFarmDocsGuardedPaths(config, middlewareRoutes));
|
|
7420
|
-
|
|
7492
|
+
_chunkHKJIUZS5cjs.assertFarmDocsAdapterServesNoGuardedPages.call(void 0,
|
|
7421
7493
|
config.docs,
|
|
7422
7494
|
{ root, srcDir: config.srcDir },
|
|
7423
7495
|
(pathname) => adapterGuardedPaths.has(pathname),
|
|
@@ -7425,9 +7497,9 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7425
7497
|
);
|
|
7426
7498
|
}
|
|
7427
7499
|
const farmDocsCspNonceMarker = _chunk6JHZPB52cjs.createFarmCspNonce.call(void 0, config.security);
|
|
7428
|
-
const farmDocsPrecompiledManifest = _optionalChain([config, 'access',
|
|
7500
|
+
const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _138 => _138.docs, 'optionalAccess', _139 => _139.enabled]) && _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? await _chunk2RSVYJT6cjs._runWithFarmCspNonce.call(void 0,
|
|
7429
7501
|
farmDocsCspNonceMarker,
|
|
7430
|
-
async () => _optionalChain([config, 'access',
|
|
7502
|
+
async () => _optionalChain([config, 'access', _140 => _140.docs, 'access', _141 => _141.adapter, 'optionalAccess', _142 => _142.server]) ? await _chunkHKJIUZS5cjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
|
|
7431
7503
|
root,
|
|
7432
7504
|
srcDir: config.srcDir,
|
|
7433
7505
|
clientEntry: FARM_CLIENT_JS_SRC_PLACEHOLDER,
|
|
@@ -7487,7 +7559,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7487
7559
|
(image) => image.sourceType === "module"
|
|
7488
7560
|
);
|
|
7489
7561
|
const externalMetadataImageRuntime = useExternalMetadataImageRuntime && !omitCoreMetadataImageRuntime ? ["@vercel/og"] : [];
|
|
7490
|
-
const rendererOptionalExternals =
|
|
7562
|
+
const rendererOptionalExternals = _chunk3OKSEJ33cjs.isReactRenderer.call(void 0, config.renderer) ? [] : [
|
|
7491
7563
|
"react",
|
|
7492
7564
|
"react/jsx-runtime",
|
|
7493
7565
|
"react/jsx-dev-runtime",
|
|
@@ -7541,7 +7613,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7541
7613
|
// Adapters can render provider scripts by serializing function source.
|
|
7542
7614
|
// keepNames injects helper calls into those functions; after Nitro
|
|
7543
7615
|
// minifies the server chunk the helper is no longer in script scope.
|
|
7544
|
-
keepNames: !(_optionalChain([config, 'access',
|
|
7616
|
+
keepNames: !(_optionalChain([config, 'access', _143 => _143.docs, 'optionalAccess', _144 => _144.enabled]) && _optionalChain([config, 'access', _145 => _145.docs, 'access', _146 => _146.adapter, 'optionalAccess', _147 => _147.server])),
|
|
7545
7617
|
jsxDev: false
|
|
7546
7618
|
},
|
|
7547
7619
|
// SSR configuration to externalize problematic modules
|
|
@@ -7591,10 +7663,10 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7591
7663
|
define: {
|
|
7592
7664
|
__FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
|
|
7593
7665
|
__FARM_ENV__: JSON.stringify(_chunk3EIPOTZVcjs.createBundledEnv.call(void 0, config.env)),
|
|
7594
|
-
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access',
|
|
7666
|
+
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _148 => _148.env, 'optionalAccess', _149 => _149.public]) || {})
|
|
7595
7667
|
},
|
|
7596
7668
|
plugins: [
|
|
7597
|
-
|
|
7669
|
+
_chunkH6C45DCFcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
7598
7670
|
...tailwindVitePlugin ? [tailwindVitePlugin] : [],
|
|
7599
7671
|
...rendererVitePlugins,
|
|
7600
7672
|
...config.vite.plugins || [],
|
|
@@ -7626,7 +7698,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7626
7698
|
},
|
|
7627
7699
|
pluginManager
|
|
7628
7700
|
),
|
|
7629
|
-
|
|
7701
|
+
_chunkOYM6VJEFcjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
|
|
7630
7702
|
...hasRuntimeConfigModule ? [
|
|
7631
7703
|
farmStripPlatformConfigPlugin(
|
|
7632
7704
|
[
|
|
@@ -7638,7 +7710,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7638
7710
|
{
|
|
7639
7711
|
name: "farm-virtual-ssr-entry",
|
|
7640
7712
|
resolveId: {
|
|
7641
|
-
filter: { id:
|
|
7713
|
+
filter: { id: _chunkH6C45DCFcjs.exactIdPattern.call(void 0, [virtualEntryId, "\0virtual:farm-ssr-entry"]) },
|
|
7642
7714
|
handler(id) {
|
|
7643
7715
|
if (id === virtualEntryId || id === "\0virtual:farm-ssr-entry") {
|
|
7644
7716
|
return virtualEntryId;
|
|
@@ -7647,7 +7719,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7647
7719
|
}
|
|
7648
7720
|
},
|
|
7649
7721
|
load: {
|
|
7650
|
-
filter: { id:
|
|
7722
|
+
filter: { id: _chunkH6C45DCFcjs.exactIdPattern.call(void 0, [virtualEntryId]) },
|
|
7651
7723
|
handler(id) {
|
|
7652
7724
|
if (id === virtualEntryId) {
|
|
7653
7725
|
return virtualEntryCode;
|
|
@@ -7679,7 +7751,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7679
7751
|
resolve: {
|
|
7680
7752
|
alias: [
|
|
7681
7753
|
...shouldAliasReactServerToWebBuild(config.renderer, preset) ? [createFarmReactWebServerAlias(hasReactDomEdgeServerBuild(root))] : [],
|
|
7682
|
-
...Object.entries(
|
|
7754
|
+
...Object.entries(_chunkH6C45DCFcjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
|
|
7683
7755
|
([find, replacement]) => ({ find, replacement })
|
|
7684
7756
|
)
|
|
7685
7757
|
],
|
|
@@ -7687,7 +7759,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7687
7759
|
dedupe: [...config.renderer.dedupe || []]
|
|
7688
7760
|
}
|
|
7689
7761
|
};
|
|
7690
|
-
await viteBuild(
|
|
7762
|
+
await viteBuild(_chunkH6C45DCFcjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
|
|
7691
7763
|
} finally {
|
|
7692
7764
|
if (postcssConfigDir) {
|
|
7693
7765
|
try {
|
|
@@ -7723,7 +7795,7 @@ function readFarmPageLastModified(pageRoutes) {
|
|
|
7723
7795
|
return lastModified;
|
|
7724
7796
|
}
|
|
7725
7797
|
function getFarmDocsGuardedPaths(config, middlewareRoutes) {
|
|
7726
|
-
if (!_optionalChain([config, 'access',
|
|
7798
|
+
if (!_optionalChain([config, 'access', _150 => _150.docs, 'optionalAccess', _151 => _151.enabled])) return [];
|
|
7727
7799
|
const options = { root: config.root, srcDir: config.srcDir };
|
|
7728
7800
|
const guards = {
|
|
7729
7801
|
config: { middleware: config.middleware, integrations: config.integrations },
|
|
@@ -7731,18 +7803,18 @@ function getFarmDocsGuardedPaths(config, middlewareRoutes) {
|
|
|
7731
7803
|
};
|
|
7732
7804
|
return _chunkHR5GU4UUcjs.getFarmDocsRoots.call(void 0, config.docs).flatMap(
|
|
7733
7805
|
(docsRoot) => _chunkHR5GU4UUcjs.discoverFarmDocsPages.call(void 0, _chunkHR5GU4UUcjs.resolveFarmDocsContentDir.call(void 0, docsRoot, options), docsRoot)
|
|
7734
|
-
).flatMap((page) => [page.href, _chunkHR5GU4UUcjs.getFarmDocsMarkdownPath.call(void 0, page.href)]).filter((pathname) =>
|
|
7806
|
+
).flatMap((page) => [page.href, _chunkHR5GU4UUcjs.getFarmDocsMarkdownPath.call(void 0, page.href)]).filter((pathname) => _chunk4B6YJ5DScjs.farmPathGuardCoversPage.call(void 0, guards, pathname));
|
|
7735
7807
|
}
|
|
7736
7808
|
function getFarmAppOwnedDocsEnginePaths(agent, applicationMetadataRoutes) {
|
|
7737
|
-
const llmsTxt = _optionalChain([agent, 'optionalAccess',
|
|
7809
|
+
const llmsTxt = _optionalChain([agent, 'optionalAccess', _152 => _152.llmsTxt]);
|
|
7738
7810
|
const ownedByFile = (kind) => applicationMetadataRoutes.some(
|
|
7739
7811
|
(metadata) => metadata.kind === kind && metadata.pattern === "/"
|
|
7740
7812
|
);
|
|
7741
7813
|
return [
|
|
7742
|
-
..._optionalChain([llmsTxt, 'optionalAccess',
|
|
7743
|
-
..._optionalChain([llmsTxt, 'optionalAccess',
|
|
7744
|
-
..._optionalChain([agent, 'optionalAccess',
|
|
7745
|
-
..._optionalChain([agent, 'optionalAccess',
|
|
7814
|
+
..._optionalChain([llmsTxt, 'optionalAccess', _153 => _153.enabled]) || ownedByFile("llms") ? ["/llms.txt"] : [],
|
|
7815
|
+
..._optionalChain([llmsTxt, 'optionalAccess', _154 => _154.enabled]) && llmsTxt.full || ownedByFile("llms-full") ? ["/llms-full.txt"] : [],
|
|
7816
|
+
..._optionalChain([agent, 'optionalAccess', _155 => _155.sitemap, 'optionalAccess', _156 => _156.enabled]) || ownedByFile("sitemap") ? ["/sitemap.xml"] : [],
|
|
7817
|
+
..._optionalChain([agent, 'optionalAccess', _157 => _157.crawlers, 'optionalAccess', _158 => _158.enabled]) || ownedByFile("robots") ? ["/robots.txt"] : []
|
|
7746
7818
|
];
|
|
7747
7819
|
}
|
|
7748
7820
|
function generateFarmDocsAdapterHandlerArguments(docs, docsConfigModulePath) {
|
|
@@ -7753,7 +7825,7 @@ function generateFarmDocsAdapterHandlerArguments(docs, docsConfigModulePath) {
|
|
|
7753
7825
|
docsPath: ${root}.entry,
|
|
7754
7826
|
contentDir: ${root}.contentDir || ${root}.config?.contentDir,
|
|
7755
7827
|
}`;
|
|
7756
|
-
if (_optionalChain([docs, 'optionalAccess',
|
|
7828
|
+
if (_optionalChain([docs, 'optionalAccess', _159 => _159.roots, 'optionalAccess', _160 => _160.length])) {
|
|
7757
7829
|
return {
|
|
7758
7830
|
factory: "createFarmDocsAdapterMultiRuntimeHandler",
|
|
7759
7831
|
config: `[farmDocsResolvedConfig, ...farmDocsResolvedConfig.roots].map((farmDocsRoot) => (${runtimeConfig("farmDocsRoot")}))`
|
|
@@ -7766,7 +7838,7 @@ function generateFarmDocsAdapterHandlerArguments(docs, docsConfigModulePath) {
|
|
|
7766
7838
|
}
|
|
7767
7839
|
function generateFarmDocsRuntimeConfigExpression(docs, precompiled = false) {
|
|
7768
7840
|
if (!docs.enabled) return "null";
|
|
7769
|
-
const serializableDocs = _optionalChain([docs, 'access',
|
|
7841
|
+
const serializableDocs = _optionalChain([docs, 'access', _161 => _161.roots, 'optionalAccess', _162 => _162.length]) ? {
|
|
7770
7842
|
...docs,
|
|
7771
7843
|
// React elements and functions do not survive JSON; see runtimeConfig below.
|
|
7772
7844
|
roots: docs.roots.map((docsRoot) => ({ ...docsRoot, runtimeConfig: void 0 }))
|
|
@@ -7800,7 +7872,7 @@ function generateFarmDocsRuntimeConfigExpression(docs, precompiled = false) {
|
|
|
7800
7872
|
},
|
|
7801
7873
|
}
|
|
7802
7874
|
: ${JSON.stringify({ ...serializableDocs, runtimeConfig: void 0 })}`;
|
|
7803
|
-
if (!_optionalChain([docs, 'access',
|
|
7875
|
+
if (!_optionalChain([docs, 'access', _163 => _163.roots, 'optionalAccess', _164 => _164.length])) return expression;
|
|
7804
7876
|
return `((farmDocs) => ({
|
|
7805
7877
|
...farmDocs,
|
|
7806
7878
|
roots: farmDocs.roots.map((farmDocsRoot, index) => {
|
|
@@ -7817,7 +7889,7 @@ function toVirtualEntryImportSpecifier(modulePath) {
|
|
|
7817
7889
|
return JSON.stringify(modulePath.replace(/\\/g, "/"));
|
|
7818
7890
|
}
|
|
7819
7891
|
function generateNativeAuthIntegrationSource(auth) {
|
|
7820
|
-
if (_optionalChain([auth, 'optionalAccess',
|
|
7892
|
+
if (_optionalChain([auth, 'optionalAccess', _165 => _165.enabled]) !== true) {
|
|
7821
7893
|
return { importSource: "", registerSource: "" };
|
|
7822
7894
|
}
|
|
7823
7895
|
return {
|
|
@@ -8121,7 +8193,7 @@ async function applyFarmPreloadBudget(response, pathname, request) {
|
|
|
8121
8193
|
`.trim();
|
|
8122
8194
|
}
|
|
8123
8195
|
function generateFarmRendererAppSetupServerCode(config) {
|
|
8124
|
-
const appSetupPath =
|
|
8196
|
+
const appSetupPath = _chunk3OKSEJ33cjs.resolveFarmRendererAppSetup.call(void 0, config.root || process.cwd(), config.renderer);
|
|
8125
8197
|
if (!appSetupPath) return "";
|
|
8126
8198
|
return `
|
|
8127
8199
|
import __farmAppSetup from ${JSON.stringify(_chunk7U4XF76Rcjs.toPosixPath.call(void 0, appSetupPath))};
|
|
@@ -8131,44 +8203,45 @@ if (typeof ReactDOMServer.configureApp !== "function") {
|
|
|
8131
8203
|
ReactDOMServer.configureApp(__farmAppSetup);`;
|
|
8132
8204
|
}
|
|
8133
8205
|
function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlots, errorRoutes, metadataImageRoutes, applicationMetadataRoutes, middlewareRoutes, redirectRoutes, configuredRewriteRoutes, configuredHeaderRoutes, openAPIReference, notFoundPath, instrumentationPath, config, farmDocsPrecompiledManifest, configModulePath, hasServerRuntimeIntegrations, hasRuntimeIntegrationConfig, hasConfiguredRuntimePlugins, hasServerRuntimePlugins, preset, i18nCatalogs, isolatedClientBoundaryModules, hydrationPlanCache, mobileShellLoadingRoutes = [], farmDocsAnalyticsPages = []) {
|
|
8134
|
-
const farmRendererDisabled =
|
|
8206
|
+
const farmRendererDisabled = _chunk3OKSEJ33cjs.isFarmRendererDisabled.call(void 0, config.renderer);
|
|
8135
8207
|
const searchPreserveRoutes = pageRoutes.flatMap(
|
|
8136
8208
|
(route) => route.searchPreserve ? [route.searchPreserve] : []
|
|
8137
8209
|
);
|
|
8138
8210
|
const searchPreserveRoutesSource = searchPreserveRoutes.length > 0 ? JSON.stringify(searchPreserveRoutes) : "";
|
|
8139
|
-
const farmIslandsMode =
|
|
8140
|
-
const farmRendererActions =
|
|
8141
|
-
const farmClientBoot =
|
|
8211
|
+
const farmIslandsMode = _chunk3OKSEJ33cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _166 => _166.experimental, 'optionalAccess', _167 => _167.serverComponents])) === "islands";
|
|
8212
|
+
const farmRendererActions = _chunkH6C45DCFcjs.resolveFarmIslxActionsMode.call(void 0, config) === "renderer";
|
|
8213
|
+
const farmClientBoot = _chunkH6C45DCFcjs.canBootFarmIslandsClient.call(void 0, config);
|
|
8142
8214
|
const farmMobileClient = shouldBuildFarmMobileClient(config);
|
|
8143
8215
|
const farmMobileShells = farmMobileClient && config.mobileShells ? config.mobileShells : null;
|
|
8144
8216
|
const hasCompressionRuntime = config.compress && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) !== "edge";
|
|
8145
|
-
const servesAgentRobotsTxt = Boolean(_optionalChain([config, 'access',
|
|
8217
|
+
const servesAgentRobotsTxt = Boolean(_optionalChain([config, 'access', _168 => _168.agent, 'optionalAccess', _169 => _169.crawlers, 'optionalAccess', _170 => _170.enabled])) && !applicationMetadataRoutes.some(
|
|
8146
8218
|
(metadata) => metadata.kind === "robots" && metadata.pattern === "/"
|
|
8147
8219
|
);
|
|
8148
|
-
const servesAgentSitemap = Boolean(_optionalChain([config, 'access',
|
|
8220
|
+
const servesAgentSitemap = Boolean(_optionalChain([config, 'access', _171 => _171.agent, 'optionalAccess', _172 => _172.sitemap, 'optionalAccess', _173 => _173.enabled])) && !applicationMetadataRoutes.some(
|
|
8149
8221
|
(metadata) => metadata.kind === "sitemap" && metadata.pattern === "/"
|
|
8150
8222
|
);
|
|
8151
|
-
const servesDefaultMCP = _optionalChain([config, 'access',
|
|
8152
|
-
const servesAiCatalog = _optionalChain([config, 'access',
|
|
8223
|
+
const servesDefaultMCP = _optionalChain([config, 'access', _174 => _174.agent, 'optionalAccess', _175 => _175.mcp]) === true && !_chunkW53Z4WDIcjs.farmConfigMountsMCP.call(void 0, config) && !apiRoutes.some((route) => route.path === "/api/mcp");
|
|
8224
|
+
const servesAiCatalog = _optionalChain([config, 'access', _176 => _176.agent, 'optionalAccess', _177 => _177.aiCatalog]) !== false;
|
|
8153
8225
|
const hasPluginRuntime = hasRuntimeIntegrationConfig || hasServerRuntimePlugins;
|
|
8154
8226
|
const hasInfraAnalyticsRuntime = config.analytics !== false && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
|
|
8155
|
-
const reportsWebMCPCalls = hasInfraAnalyticsRuntime &&
|
|
8227
|
+
const reportsWebMCPCalls = hasInfraAnalyticsRuntime && _chunkRVJQHQCGcjs._farmWebMCPReportsEnabled.call(void 0, config.plugins);
|
|
8156
8228
|
const hasPrecompiledDocs = Boolean(farmDocsPrecompiledManifest);
|
|
8157
8229
|
const adapterOwnsDocsRuntime = _chunkL2GUEYHRcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs);
|
|
8158
|
-
if (_optionalChain([config, 'access',
|
|
8230
|
+
if (_optionalChain([config, 'access', _178 => _178.docs, 'optionalAccess', _179 => _179.enabled]) && _optionalChain([config, 'access', _180 => _180.docs, 'access', _181 => _181.roots, 'optionalAccess', _182 => _182.length]) && !adapterOwnsDocsRuntime) {
|
|
8159
8231
|
throw new Error(
|
|
8160
8232
|
"Several docs roots need a docs adapter; Farm's built-in docs renderer serves a single docs root."
|
|
8161
8233
|
);
|
|
8162
8234
|
}
|
|
8163
8235
|
const docsConfigModulePath = adapterOwnsDocsRuntime && !hasPrecompiledDocs && config.docs.configPath && !config.docs.configPath.endsWith(".json") ? config.docs.configPath : void 0;
|
|
8164
8236
|
const adapterHandler = generateFarmDocsAdapterHandlerArguments(config.docs, docsConfigModulePath);
|
|
8165
|
-
const hasIsolatedClientGraphRuntime =
|
|
8166
|
-
const
|
|
8237
|
+
const hasIsolatedClientGraphRuntime = _chunk3OKSEJ33cjs.isReactRenderer.call(void 0, config.renderer) && isolatedClientBoundaryModules.size > 0;
|
|
8238
|
+
const hasRendererIslandsGraph = isolatedClientBoundaryModules.size > 0 && _chunkMAPHNGTFcjs.usesFarmRendererIslands.call(void 0, config);
|
|
8239
|
+
const rendererStreamingCapabilities = _chunk3OKSEJ33cjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0,
|
|
8167
8240
|
config.renderer,
|
|
8168
8241
|
_chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset)
|
|
8169
8242
|
);
|
|
8170
|
-
const hasReactSyncRender =
|
|
8171
|
-
const rendererServerImports =
|
|
8243
|
+
const hasReactSyncRender = _chunk3OKSEJ33cjs.isReactRenderer.call(void 0, config.renderer);
|
|
8244
|
+
const rendererServerImports = _chunk3OKSEJ33cjs.isReactRenderer.call(void 0, config.renderer) ? `import * as React from "react";
|
|
8172
8245
|
import * as ReactDOMServer from "react-dom/server";
|
|
8173
8246
|
import { markPagePosition, markLayoutPosition } from "@farm.js/core/internal/production-runtime";${hasIsolatedClientGraphRuntime ? farmIslandsMode ? '\nimport { isolateFarmServerPageGraph, wrapFarmIsolatedClientGraph, renderFarmServerTreePage, renderFarmServerTreeLayout, withFarmIslandsRender } from "@farm.js/core/internal/islands-runtime";' : '\nimport { isolateFarmServerPageGraph, wrapFarmIsolatedClientGraph } from "@farm.js/core/internal/isolated-boundary";\nimport { renderFarmServerTreePage } from "@farm.js/core/internal/server-tree";' : ""}` : (
|
|
8174
8247
|
// The renderer contract is the server module's named exports, which the development
|
|
@@ -8201,6 +8274,18 @@ function renderFarmRouteServerTree(element, extra) {
|
|
|
8201
8274
|
isolate: isolateFarmRouteServerPage,${farmIslandsMode ? "\n values: true," : ""}
|
|
8202
8275
|
...extra,
|
|
8203
8276
|
});
|
|
8277
|
+
}` : hasRendererIslandsGraph ? `function wrapFarmRouteClientGraph(element) {
|
|
8278
|
+
return typeof ReactDOMServer.wrapClientGraph === "function" ? ReactDOMServer.wrapClientGraph(element) : element;
|
|
8279
|
+
}
|
|
8280
|
+
|
|
8281
|
+
function isolateFarmRouteServerPage(element) {
|
|
8282
|
+
return typeof ReactDOMServer.isolateServerPageGraph === "function" ? ReactDOMServer.isolateServerPageGraph(element) : element;
|
|
8283
|
+
}
|
|
8284
|
+
|
|
8285
|
+
function renderFarmRouteServerTree(element, extra) { return element; }
|
|
8286
|
+
|
|
8287
|
+
function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
8288
|
+
return React.createElement(Layout, { ...props, ...outlets });
|
|
8204
8289
|
}` : `function wrapFarmRouteClientGraph(element) { return element; }
|
|
8205
8290
|
|
|
8206
8291
|
function isolateFarmRouteServerPage(element) { return element; }
|
|
@@ -8214,27 +8299,27 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8214
8299
|
(image) => image.sourceType === "module"
|
|
8215
8300
|
);
|
|
8216
8301
|
const edgeMiddlewareFilePaths = farmTargetRunsEdgeMiddleware(preset) ? middlewareRoutes.filter(isFarmEdgeMiddlewareRoute).map((route) => route.filePath) : [];
|
|
8217
|
-
const hasMiddlewareRuntime = middlewareRoutes.length > 0 ||
|
|
8218
|
-
const farmDocsFontAssets = _optionalChain([config, 'access',
|
|
8302
|
+
const hasMiddlewareRuntime = middlewareRoutes.length > 0 || _chunk4B6YJ5DScjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
|
|
8303
|
+
const farmDocsFontAssets = _optionalChain([config, 'access', _183 => _183.docs, 'optionalAccess', _184 => _184.enabled]) ? _chunkERMUL73Lcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkERMUL73Lcjs.resolveFarmDocsFontAssets.call(void 0, config.root)) : [];
|
|
8219
8304
|
const integrationProviders = _chunkB3HQTGXScjs.getIntegrationProviders.call(void 0, config.integrations);
|
|
8220
8305
|
const renderedIntegrationProviders = integrationProviders.filter(
|
|
8221
8306
|
(provider) => provider.component || provider.type === "clerk"
|
|
8222
8307
|
);
|
|
8223
|
-
if (renderedIntegrationProviders.length > 0 && !
|
|
8308
|
+
if (renderedIntegrationProviders.length > 0 && !_chunk3OKSEJ33cjs.getFarmRendererCapabilities.call(void 0, config.renderer).functionComponents) {
|
|
8224
8309
|
throw new Error(
|
|
8225
8310
|
`Integration provider components are not supported by the "${config.renderer.name}" renderer.`
|
|
8226
8311
|
);
|
|
8227
8312
|
}
|
|
8228
|
-
const providerServerModules =
|
|
8313
|
+
const providerServerModules = _chunkH6C45DCFcjs.generateFarmIntegrationProviderServerModules.call(void 0,
|
|
8229
8314
|
renderedIntegrationProviders,
|
|
8230
8315
|
config.root,
|
|
8231
8316
|
_nullishCoalesce(config.renderer.componentExtensions, () => ( []))
|
|
8232
8317
|
);
|
|
8233
8318
|
const resolvedIntegrationProviderFallback = Object.fromEntries(
|
|
8234
8319
|
Object.entries(config.integrations).flatMap(([name, integration]) => {
|
|
8235
|
-
const configuredProviders = _optionalChain([integration, 'optionalAccess',
|
|
8320
|
+
const configuredProviders = _optionalChain([integration, 'optionalAccess', _185 => _185.providers]);
|
|
8236
8321
|
const providers = Array.isArray(configuredProviders) ? configuredProviders : [];
|
|
8237
|
-
if (providers.some((provider) => typeof _optionalChain([provider, 'optionalAccess',
|
|
8322
|
+
if (providers.some((provider) => typeof _optionalChain([provider, 'optionalAccess', _186 => _186.component]) === "function")) {
|
|
8238
8323
|
throw new Error(
|
|
8239
8324
|
`Integration provider components in production must use an importable component reference, for example component: { module: "@/components/provider" }.`
|
|
8240
8325
|
);
|
|
@@ -8245,22 +8330,22 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8245
8330
|
const unsupportedIntegrationProvider = renderedIntegrationProviders.find(
|
|
8246
8331
|
(provider) => provider.supportsIsolatedHydration !== true
|
|
8247
8332
|
);
|
|
8248
|
-
const isolatedHydrationMode =
|
|
8249
|
-
_optionalChain([config, 'access',
|
|
8333
|
+
const isolatedHydrationMode = _chunkOYM6VJEFcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
8334
|
+
_optionalChain([config, 'access', _187 => _187.experimental, 'optionalAccess', _188 => _188.isolatedClientHydration]),
|
|
8250
8335
|
{
|
|
8251
|
-
serverComponents:
|
|
8336
|
+
serverComponents: _chunk3OKSEJ33cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _189 => _189.experimental, 'optionalAccess', _190 => _190.serverComponents])) === "rsc",
|
|
8252
8337
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
8253
8338
|
}
|
|
8254
8339
|
);
|
|
8255
|
-
const hydrationPlanOptions =
|
|
8340
|
+
const hydrationPlanOptions = _chunkOYM6VJEFcjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
8256
8341
|
config.renderer,
|
|
8257
8342
|
Boolean(unsupportedIntegrationProvider)
|
|
8258
8343
|
);
|
|
8259
8344
|
const pageHydrationPlanOptions = {
|
|
8260
8345
|
...hydrationPlanOptions,
|
|
8261
|
-
serverOwners:
|
|
8346
|
+
serverOwners: _chunk3OKSEJ33cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _191 => _191.experimental, 'optionalAccess', _192 => _192.serverComponents])) === "islands"
|
|
8262
8347
|
};
|
|
8263
|
-
const { layoutHydrationPlans, pageHydrationPlans } =
|
|
8348
|
+
const { layoutHydrationPlans, pageHydrationPlans } = _chunkOYM6VJEFcjs.withFarmSourceSnapshot.call(void 0, () => {
|
|
8264
8349
|
const layoutHydrationPlans2 = layoutRoutes.map((layout) => ({
|
|
8265
8350
|
...layout,
|
|
8266
8351
|
hydration: getCachedClientModuleHydrationPlan(
|
|
@@ -8271,7 +8356,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8271
8356
|
{ ...hydrationPlanOptions, serverTreeLayouts: pageHydrationPlanOptions.serverOwners }
|
|
8272
8357
|
)
|
|
8273
8358
|
}));
|
|
8274
|
-
const markdownPagePlan =
|
|
8359
|
+
const markdownPagePlan = _chunkOYM6VJEFcjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
8275
8360
|
_chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), config.root),
|
|
8276
8361
|
config.root,
|
|
8277
8362
|
isolatedHydrationMode,
|
|
@@ -8291,7 +8376,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8291
8376
|
);
|
|
8292
8377
|
return { layoutHydrationPlans: layoutHydrationPlans2, pageHydrationPlans: pageHydrationPlans2 };
|
|
8293
8378
|
});
|
|
8294
|
-
|
|
8379
|
+
_chunkOYM6VJEFcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
8295
8380
|
layoutHydrationPlans.map((layout) => ({
|
|
8296
8381
|
pattern: layout.pattern,
|
|
8297
8382
|
depth: layout.pattern.split("/").filter(Boolean).length,
|
|
@@ -8300,10 +8385,10 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8300
8385
|
pageRoutes.map((route) => ({
|
|
8301
8386
|
// Compared by directory so a grouped layout applies only inside its group.
|
|
8302
8387
|
pattern: _nullishCoalesce(route.directory, () => ( route.pattern)),
|
|
8303
|
-
depth:
|
|
8388
|
+
depth: _chunk4B6YJ5DScjs.getRouteDirectoryDepth.call(void 0, _nullishCoalesce(route.directory, () => ( route.pattern))),
|
|
8304
8389
|
metadata: pageHydrationPlans.get(route.modulePath)
|
|
8305
8390
|
})),
|
|
8306
|
-
|
|
8391
|
+
_chunk4B6YJ5DScjs.routeBoundaryCoversDirectory,
|
|
8307
8392
|
{ serverOwners: pageHydrationPlanOptions.serverOwners }
|
|
8308
8393
|
);
|
|
8309
8394
|
const providerServerImports = [
|
|
@@ -8321,7 +8406,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8321
8406
|
apiRegistrations.push(`
|
|
8322
8407
|
{
|
|
8323
8408
|
path: ${JSON.stringify(route.path)},
|
|
8324
|
-
methods: ${JSON.stringify(route.methods.filter((method) => !_optionalChain([route, 'access',
|
|
8409
|
+
methods: ${JSON.stringify(route.methods.filter((method) => !_optionalChain([route, 'access', _193 => _193.pluginMethods, 'optionalAccess', _194 => _194.includes, 'call', _195 => _195(method)])))},
|
|
8325
8410
|
endpoints: ${varName},
|
|
8326
8411
|
}`);
|
|
8327
8412
|
});
|
|
@@ -8335,8 +8420,8 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8335
8420
|
orderedPageRoutes.forEach((route, index) => {
|
|
8336
8421
|
const varName = `pageRoute${index}`;
|
|
8337
8422
|
if (_chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) {
|
|
8338
|
-
const renderingDirective2 =
|
|
8339
|
-
const markdownServerTree = pageHydrationPlanOptions.serverOwners &&
|
|
8423
|
+
const renderingDirective2 = _chunkL3BSHASBcjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
|
|
8424
|
+
const markdownServerTree = pageHydrationPlanOptions.serverOwners && _chunkOYM6VJEFcjs.usesFarmServerTree.call(void 0, pageHydrationPlans.get(route.modulePath));
|
|
8340
8425
|
pageRegistrations.push(`
|
|
8341
8426
|
{
|
|
8342
8427
|
pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
|
|
@@ -8344,14 +8429,14 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8344
8429
|
rendering: ${JSON.stringify(renderingDirective2)},` : ""}${markdownServerTree ? "\n serverTree: true," : ""}
|
|
8345
8430
|
module: createFarmMarkdownRouteModule({
|
|
8346
8431
|
source: ${JSON.stringify(_nullishCoalesce(route.source, () => ( "")))},
|
|
8347
|
-
filePath: ${JSON.stringify(
|
|
8432
|
+
filePath: ${JSON.stringify(_chunkH6C45DCFcjs.toBakedMarkdownSourcePath.call(void 0, config.root, route.modulePath))},
|
|
8348
8433
|
components: farmMdxComponents,
|
|
8349
|
-
config: farmMdxConfig,${
|
|
8434
|
+
config: farmMdxConfig,${_chunk3OKSEJ33cjs.isReactRenderer.call(void 0, config.renderer) ? "" : "\n renderer: React,"}
|
|
8350
8435
|
}),
|
|
8351
8436
|
markdownSource: {
|
|
8352
8437
|
source: ${JSON.stringify(_nullishCoalesce(route.source, () => ( "")))},
|
|
8353
8438
|
filePath: ${JSON.stringify(
|
|
8354
|
-
|
|
8439
|
+
_chunkH6C45DCFcjs.toBakedMarkdownSourcePath.call(void 0, config.root, _nullishCoalesce(route.markdownSourcePath, () => ( route.modulePath)))
|
|
8355
8440
|
)},
|
|
8356
8441
|
},
|
|
8357
8442
|
}`);
|
|
@@ -8361,7 +8446,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8361
8446
|
`import * as ${varName} from ${toVirtualEntryImportSpecifier(route.modulePath)};`
|
|
8362
8447
|
);
|
|
8363
8448
|
const clientMetadata = pageHydrationPlans.get(route.modulePath);
|
|
8364
|
-
const renderingDirective =
|
|
8449
|
+
const renderingDirective = _chunkL3BSHASBcjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
|
|
8365
8450
|
pageRegistrations.push(`
|
|
8366
8451
|
{
|
|
8367
8452
|
pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
|
|
@@ -8369,8 +8454,8 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8369
8454
|
module: ${varName},
|
|
8370
8455
|
shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},${clientMetadata.shouldHydrate ? `
|
|
8371
8456
|
clientModule: ${JSON.stringify(_chunk7U4XF76Rcjs.toViteModuleId.call(void 0, route.modulePath, config.root))},` : ""}
|
|
8372
|
-
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${
|
|
8373
|
-
const rootStrategy =
|
|
8457
|
+
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunkOYM6VJEFcjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${(() => {
|
|
8458
|
+
const rootStrategy = _chunkH6C45DCFcjs.resolveFarmRouteRootStrategy.call(void 0,
|
|
8374
8459
|
route,
|
|
8375
8460
|
clientMetadata,
|
|
8376
8461
|
layoutHydrationPlans.map((layout) => ({ ...layout, ...layout.hydration })),
|
|
@@ -8383,13 +8468,13 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8383
8468
|
rendering: ${JSON.stringify(renderingDirective)},` : ""}
|
|
8384
8469
|
${route.source !== void 0 ? `markdownSource: {
|
|
8385
8470
|
source: ${JSON.stringify(route.source)},
|
|
8386
|
-
filePath: ${JSON.stringify(
|
|
8471
|
+
filePath: ${JSON.stringify(_chunkH6C45DCFcjs.toBakedMarkdownSourcePath.call(void 0, config.root, route.markdownSourcePath))},
|
|
8387
8472
|
},` : ""}
|
|
8388
8473
|
}`);
|
|
8389
8474
|
});
|
|
8390
8475
|
const layoutImports = [];
|
|
8391
8476
|
const layoutRegistrations = [];
|
|
8392
|
-
const treeLayoutPatterns = farmIslandsMode ?
|
|
8477
|
+
const treeLayoutPatterns = farmIslandsMode ? _chunk4B6YJ5DScjs.getFarmServerTreeLayoutPatterns.call(void 0,
|
|
8393
8478
|
layoutHydrationPlans.map((layout) => ({
|
|
8394
8479
|
pattern: layout.pattern,
|
|
8395
8480
|
shouldHydrate: layout.hydration.shouldHydrate,
|
|
@@ -8407,7 +8492,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8407
8492
|
pattern: ${JSON.stringify(layout.pattern)},
|
|
8408
8493
|
module: ${varName},
|
|
8409
8494
|
shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},
|
|
8410
|
-
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${treeLayoutPatterns.has(layout.pattern) ? "\n serverTree: true," : ""}${farmIslandsMode &&
|
|
8495
|
+
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${treeLayoutPatterns.has(layout.pattern) ? "\n serverTree: true," : ""}${farmIslandsMode && _chunkH6C45DCFcjs.canFarmSkipKeptLayoutRender.call(void 0, layout.modulePath, config.root) ? "\n skipKeptRender: true," : ""}${// A layout whose client components hydrate as islands of their own (islands mode,
|
|
8411
8496
|
// isolatedClientHydration, or an async layout): it wraps a docs page as an app page.
|
|
8412
8497
|
clientMetadata.hasIsolatedClientBoundaries ? "\n islands: true," : ""}
|
|
8413
8498
|
}`);
|
|
@@ -8435,7 +8520,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8435
8520
|
containerId: ${JSON.stringify(slot.containerId)},
|
|
8436
8521
|
interception: ${JSON.stringify(slot.interception)},
|
|
8437
8522
|
fallback: ${JSON.stringify(slot.fallback)},
|
|
8438
|
-
hydrates: ${!farmIslandsMode ||
|
|
8523
|
+
hydrates: ${!farmIslandsMode || _chunkOYM6VJEFcjs.getClientModuleMetadata.call(void 0, slot.modulePath, config.root).isClientComponent},
|
|
8439
8524
|
module: ${varName},
|
|
8440
8525
|
}`);
|
|
8441
8526
|
});
|
|
@@ -8446,12 +8531,12 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8446
8531
|
errorImports.push(
|
|
8447
8532
|
`import * as ${varName} from ${toVirtualEntryImportSpecifier(errorRoute.modulePath)};`
|
|
8448
8533
|
);
|
|
8449
|
-
const groupScope =
|
|
8534
|
+
const groupScope = _chunk4B6YJ5DScjs.getRouteGroupScope.call(void 0, errorRoute.pattern);
|
|
8450
8535
|
errorRegistrations.push(`
|
|
8451
8536
|
{
|
|
8452
|
-
pattern: ${JSON.stringify(
|
|
8537
|
+
pattern: ${JSON.stringify(_chunk4B6YJ5DScjs.stripRouteGroups.call(void 0, errorRoute.pattern))},${groupScope ? `
|
|
8453
8538
|
groupScope: ${JSON.stringify(groupScope)},
|
|
8454
|
-
directoryDepth: ${
|
|
8539
|
+
directoryDepth: ${_chunk4B6YJ5DScjs.getRouteDirectoryDepth.call(void 0, errorRoute.pattern)},` : ""}
|
|
8455
8540
|
module: ${varName},
|
|
8456
8541
|
}`);
|
|
8457
8542
|
});
|
|
@@ -8463,12 +8548,12 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8463
8548
|
loadingImports.push(
|
|
8464
8549
|
`import * as ${varName} from ${toVirtualEntryImportSpecifier(loadingRoute.modulePath)};`
|
|
8465
8550
|
);
|
|
8466
|
-
const groupScope =
|
|
8551
|
+
const groupScope = _chunk4B6YJ5DScjs.getRouteGroupScope.call(void 0, loadingRoute.pattern);
|
|
8467
8552
|
loadingRegistrations.push(`
|
|
8468
8553
|
{
|
|
8469
|
-
pattern: ${JSON.stringify(
|
|
8554
|
+
pattern: ${JSON.stringify(_chunk4B6YJ5DScjs.stripRouteGroups.call(void 0, loadingRoute.pattern))},${groupScope ? `
|
|
8470
8555
|
groupScope: ${JSON.stringify(groupScope)},
|
|
8471
|
-
directoryDepth: ${
|
|
8556
|
+
directoryDepth: ${_chunk4B6YJ5DScjs.getRouteDirectoryDepth.call(void 0, loadingRoute.pattern)},` : ""}
|
|
8472
8557
|
module: ${varName},
|
|
8473
8558
|
}`);
|
|
8474
8559
|
});
|
|
@@ -8481,7 +8566,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8481
8566
|
metadataImageImports.push(
|
|
8482
8567
|
`import * as ${varName} from ${toVirtualEntryImportSpecifier(image.modulePath)};`
|
|
8483
8568
|
);
|
|
8484
|
-
const component = !
|
|
8569
|
+
const component = !_chunk3OKSEJ33cjs.isReactRenderer.call(void 0, config.renderer) && _chunkH6C45DCFcjs.isRendererCompiledComponent.call(void 0, image.modulePath, _nullishCoalesce(_optionalChain([config, 'access', _196 => _196.renderer, 'optionalAccess', _197 => _197.componentExtensions]), () => ( [])));
|
|
8485
8570
|
metadataImageRegistrations.push(`
|
|
8486
8571
|
{
|
|
8487
8572
|
pattern: ${JSON.stringify(image.pattern)},
|
|
@@ -8557,7 +8642,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8557
8642
|
createDefaultErrorMarkup,
|
|
8558
8643
|
createFarmInstrumentationLifecycle,
|
|
8559
8644
|
createFarmLayoutSelector,
|
|
8560
|
-
createFarmLayoutBoundary,${_optionalChain([config, 'access',
|
|
8645
|
+
createFarmLayoutBoundary,${_optionalChain([config, 'access', _198 => _198.docs, 'optionalAccess', _199 => _199.enabled]) ? "\n createFarmDocsLayoutTree,\n farmDocsLayoutsWrapPage,\n placeFarmDocsLayoutRoot," : ""}
|
|
8561
8646
|
isInFarmRouteGroupScope,
|
|
8562
8647
|
routeBoundaryCoversDirectory,
|
|
8563
8648
|
createFarmCacheKey,
|
|
@@ -8641,7 +8726,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8641
8726
|
createFarmDeploymentMismatchResponse,
|
|
8642
8727
|
FARM_DEPLOYMENT_ID_HEADER,
|
|
8643
8728
|
getFarmDeploymentMismatch,
|
|
8644
|
-
withoutFarmDeploymentCookie,${config.mobileClient ? "\n createFarmNativeTreeResponse," : ""}${config.trailingSlash && (_optionalChain([config, 'access',
|
|
8729
|
+
withoutFarmDeploymentCookie,${config.mobileClient ? "\n createFarmNativeTreeResponse," : ""}${config.trailingSlash && (_optionalChain([config, 'access', _200 => _200.md, 'optionalAccess', _201 => _201.enabled]) || hasMarkdownPages) ? "\n toFarmTrailingSlashPageRequest," : ""}${hasInfraAnalyticsRuntime ? "\n resolveFarmDocsEngineRouteLabel,\n resolveFarmDocsRouteLabel,\n resolveFarmMarkdownRouteLabel,\n resolveFarmMCPRouteLabel,\n setFarmRouteLabel," : ""}${hasFarmServerStorageConfig(config.storage) ? "\n _registerFarmStorageModules,\n disposeFarmStorage,\n initFarmStorage," : ""}${searchPreserveRoutesSource ? "\n _setFarmSearchPreserveRoutes," : ""}
|
|
8645
8730
|
} from "@farm.js/core/internal/production-runtime";${farmMobileClient ? `
|
|
8646
8731
|
import { _applyFarmMobileShellClient } from "@farm.js/core/internal/production-runtime";
|
|
8647
8732
|
// The mobile client documents load when a mobile shell asks for them (RFC 0004, 7.2), filled in
|
|
@@ -8713,25 +8798,25 @@ function farmFormStateScript() { return ""; }`}`;
|
|
|
8713
8798
|
const infraAnalyticsImport = hasInfraAnalyticsRuntime ? `import { ${hasPluginRuntime ? "createFarmInfraAnalyticsPlugin" : "createFarmInfraAnalyticsRecorder"} } from "@farm.js/core/internal/infra-analytics-runtime";` : "";
|
|
8714
8799
|
const compressionRuntimeImport = hasCompressionRuntime ? `import { compressFarmResponse${hasPluginRuntime ? ", createCompressionPlugin" : ""} } from "@farm.js/core/internal/compression-runtime";` : "";
|
|
8715
8800
|
const i18nServerImport = config.i18n.enabled ? `import { _runWithFarmI18nRequest, _setDefaultFarmI18nRuntime, createFarmI18nRuntime, getFarmI18nClientSnapshot } from "@farm.js/core/i18n/server";` : "";
|
|
8716
|
-
const docsHandlerImport = _optionalChain([config, 'access',
|
|
8801
|
+
const docsHandlerImport = _optionalChain([config, 'access', _202 => _202.docs, 'optionalAccess', _203 => _203.enabled]) ? hasPrecompiledDocs ? `import { createFarmDocsPrecompiledRuntime } from "@farm.js/core/internal/docs-precompiled-runtime";
|
|
8717
8802
|
const isFarmDocsAPIRequest = (requestOrPathname) => {
|
|
8718
8803
|
const pathname = typeof requestOrPathname === "string"
|
|
8719
8804
|
? requestOrPathname
|
|
8720
8805
|
: new URL(requestOrPathname.url).pathname;
|
|
8721
|
-
const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess',
|
|
8806
|
+
const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _204 => _204.apiPath]) || "/api/docs")};
|
|
8722
8807
|
return pathname === apiPath || pathname.startsWith(apiPath + "/");
|
|
8723
8808
|
};` : adapterOwnsDocsRuntime ? `import { ${docsConfigModulePath ? "getFarmDocsConfigModuleRoot, " : ""}isFarmDocsAPIRequest } from "@farm.js/core/docs";
|
|
8724
|
-
import { ${_optionalChain([config, 'access',
|
|
8809
|
+
import { ${_optionalChain([config, 'access', _205 => _205.docs, 'access', _206 => _206.roots, 'optionalAccess', _207 => _207.length]) ? "createFarmDocsMultiRuntimeHandler as createFarmDocsAdapterMultiRuntimeHandler" : "createFarmDocsRuntimeHandler as createFarmDocsAdapterRuntimeHandler"} } from ${JSON.stringify(config.docs.adapter.server)};
|
|
8725
8810
|
import * as FarmDocsAdapterUI from ${JSON.stringify(_chunkL2GUEYHRcjs.getFarmDocsAdapterUIModule.call(void 0, config.docs.adapter))};${docsConfigModulePath ? `
|
|
8726
8811
|
import * as farmDocsConfigModule from ${toVirtualEntryImportSpecifier(docsConfigModulePath)};` : ""}` : `import { createFarmDocsAPIHandler, createFarmDocsHandler, isFarmDocsAPIRequest } from "@farm.js/core/docs";` : "";
|
|
8727
|
-
const docsFontImport = _optionalChain([config, 'access',
|
|
8728
|
-
const docsRuntimeImport = _optionalChain([config, 'access',
|
|
8812
|
+
const docsFontImport = _optionalChain([config, 'access', _208 => _208.docs, 'optionalAccess', _209 => _209.enabled]) && !hasPrecompiledDocs ? `import { resolveFarmLayoutFonts } from "@farm.js/core/font";` : "";
|
|
8813
|
+
const docsRuntimeImport = _optionalChain([config, 'access', _210 => _210.docs, 'optionalAccess', _211 => _211.enabled]) && !hasPrecompiledDocs ? `import { existsSync as farmDocsExistsSync } from "node:fs";
|
|
8729
8814
|
import { dirname as farmDocsDirname, join as farmDocsJoin } from "node:path";
|
|
8730
8815
|
import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
|
|
8731
|
-
const markdownHandlerImport = _optionalChain([config, 'access',
|
|
8816
|
+
const markdownHandlerImport = _optionalChain([config, 'access', _212 => _212.md, 'optionalAccess', _213 => _213.enabled]) ? `import { applyMarkdownNegotiationHeaders, createMarkdownMirrorResponse, getFarmMarkdownAlternatePath } from "@farm.js/core/markdown";` : "";
|
|
8732
8817
|
const appMarkdownImport = hasMarkdownPages ? `import { FARM_MARKDOWN_ANONYMOUS_CLIENT_ADDRESS, createFarmMarkdownRouteModule, createFarmMarkdownSourceResponse, isFarmMarkdownPublicSourceResponse } from "@farm.js/core/internal/app-markdown-runtime";` : "const createFarmMarkdownSourceResponse = null;\nconst isFarmMarkdownPublicSourceResponse = null;";
|
|
8733
8818
|
const markdownErrorImport = `import { FARM_MARKDOWN_CONTENT_TYPE, FARM_MARKDOWN_PAGE_CHECK_HEADER, _isFarmMarkdownPageCheck, createFarmMarkdownErrorBody, farmRequestWantsMarkdown } from "@farm.js/core/markdown";`;
|
|
8734
|
-
const mdxComponentsPath = typeof _optionalChain([config, 'access',
|
|
8819
|
+
const mdxComponentsPath = typeof _optionalChain([config, 'access', _214 => _214.mdx, 'optionalAccess', _215 => _215.components]) === "string" ? _path2.default.isAbsolute(config.mdx.components) ? config.mdx.components : _path2.default.join(config.root, config.mdx.components) : null;
|
|
8735
8820
|
const mdxComponentsImport = mdxComponentsPath ? `import * as FarmMdxComponentsModule from ${toVirtualEntryImportSpecifier(mdxComponentsPath)};` : "";
|
|
8736
8821
|
const layerConfigPaths = (config.layers || []).map((layer) => layer.configFile).filter((configFile) => Boolean(configFile)).filter((configFile) => configFile !== configModulePath);
|
|
8737
8822
|
const layerConfigImports = layerConfigPaths.map(
|
|
@@ -8751,14 +8836,14 @@ import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
|
|
|
8751
8836
|
const nativeAuth = generateNativeAuthIntegrationSource(config.auth);
|
|
8752
8837
|
const nativeMCP = _chunkVM57CK74cjs.generateNativeMCPPluginSource.call(void 0, config.mcp);
|
|
8753
8838
|
const mobileSession = (config.plugins || []).some(
|
|
8754
|
-
(plugin) => _optionalChain([plugin, 'optionalAccess',
|
|
8839
|
+
(plugin) => _optionalChain([plugin, 'optionalAccess', _216 => _216.name]) === _chunkMHKPXX3Jcjs.FARM_MOBILE_SESSION_PLUGIN
|
|
8755
8840
|
);
|
|
8756
8841
|
const nativeServerFns = (config.plugins || []).some(
|
|
8757
|
-
(plugin) => _optionalChain([plugin, 'optionalAccess',
|
|
8758
|
-
) ?
|
|
8842
|
+
(plugin) => _optionalChain([plugin, 'optionalAccess', _217 => _217.name]) === _chunk4EBC7EMWcjs.FARM_NATIVE_SERVER_FN_PLUGIN
|
|
8843
|
+
) ? _chunkQUHDVJMRcjs.collectFarmNativeServerFns.call(void 0, {
|
|
8759
8844
|
root: config.root,
|
|
8760
8845
|
srcDir: config.srcDir,
|
|
8761
|
-
entries:
|
|
8846
|
+
entries: _chunkQUHDVJMRcjs.findFarmNativeScreenFiles.call(void 0, _chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, config))
|
|
8762
8847
|
}) : void 0;
|
|
8763
8848
|
const integrationImports = `
|
|
8764
8849
|
${configModulePath ? `import * as FarmUserConfigModule from ${toVirtualEntryImportSpecifier(configModulePath)};` : ""}
|
|
@@ -8773,7 +8858,7 @@ ${nativeServerFns ? `const __farmNativeServerFnRegistry = Object.assign(Object.c
|
|
|
8773
8858
|
${nativeServerFns.flatMap((module, index) => module.exports.map((entry) => ` ${JSON.stringify(entry.id)}: __farmNativeServerFns${index}[${JSON.stringify(entry.name)}],`)).join("\n")}
|
|
8774
8859
|
});` : ""}
|
|
8775
8860
|
`;
|
|
8776
|
-
const imageRuntime =
|
|
8861
|
+
const imageRuntime = _chunkH6C45DCFcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
|
|
8777
8862
|
const imageRuntimeImport = imageRuntime === "none" ? "" : `import { _withFarmImageSourceClientAddress, createCloudflareImageTransformer, createFarmImageHandler } from "@farm.js/core/image/server";`;
|
|
8778
8863
|
const imageNodeRuntimeImport = imageRuntime === "node" ? `import { createNodeImageFetcher, createNodeImageUrlValidator, createSharpImageTransformer } from "@farm.js/core/image/sharp";` : "";
|
|
8779
8864
|
const apiHandlerCode = apiRoutes.length > 0 ? `
|
|
@@ -8955,7 +9040,7 @@ const farmResolvedRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs);
|
|
|
8955
9040
|
|
|
8956
9041
|
function renderFarmDefault404Page() {
|
|
8957
9042
|
return React.createElement(React.Fragment, null,
|
|
8958
|
-
React.createElement("style", null, ${JSON.stringify(
|
|
9043
|
+
React.createElement("style", null, ${JSON.stringify(_chunkH6C45DCFcjs.DEFAULT_NOT_FOUND_STYLES)}),
|
|
8959
9044
|
React.createElement("main", {
|
|
8960
9045
|
className: "farm-default-not-found",
|
|
8961
9046
|
"aria-labelledby": "farm-default-not-found-title",
|
|
@@ -9051,7 +9136,7 @@ function wrapWithFarmIntegrationProviders(element) {
|
|
|
9051
9136
|
// providers, so the server renders them inside it too. React lines an island up with its tree
|
|
9052
9137
|
// position instead, and its providers render no markup.
|
|
9053
9138
|
function wrapFarmIslandIntegrationProviders(element) {
|
|
9054
|
-
return ${
|
|
9139
|
+
return ${_chunk3OKSEJ33cjs.isReactRenderer.call(void 0, config.renderer) ? "element" : "wrapWithFarmIntegrationProviders(element)"};
|
|
9055
9140
|
}
|
|
9056
9141
|
const serverRuntimeIntegrations = Object.fromEntries(
|
|
9057
9142
|
Object.entries(configuredIntegrations).filter(([, integration]) =>
|
|
@@ -9111,24 +9196,24 @@ const farmImageHandler = ${imageRuntime === "none" ? "null" : imageRuntime === "
|
|
|
9111
9196
|
validateRemoteUrl: createNodeImageUrlValidator(${JSON.stringify(config.images)}),
|
|
9112
9197
|
onError(error) { console.error("[Farm Image]", error); },
|
|
9113
9198
|
})`};
|
|
9114
|
-
const farmMarkdownConfig = ${JSON.stringify(config.md)};${_optionalChain([config, 'access',
|
|
9199
|
+
const farmMarkdownConfig = ${JSON.stringify(config.md)};${_optionalChain([config, 'access', _218 => _218.md, 'optionalAccess', _219 => _219.enabled]) || hasMarkdownPages ? config.trailingSlash ? `
|
|
9115
9200
|
// A Markdown mirror, and a page.md source's page check, read the page at the URL it answers at
|
|
9116
9201
|
// ('/about/'), so the trailing-slash 308 never answers in its place.
|
|
9117
9202
|
const toFarmMarkdownPageRequest = (request) => toFarmTrailingSlashPageRequest(request, true);` : `
|
|
9118
9203
|
const toFarmMarkdownPageRequest = (request) => request;` : ""}
|
|
9119
|
-
const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access',
|
|
9120
|
-
${_optionalChain([config, 'access',
|
|
9204
|
+
const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _220 => _220.agent, 'optionalAccess', _221 => _221.llmsTxt]), () => ( { enabled: false, include: [], exclude: [] })))};
|
|
9205
|
+
${_optionalChain([config, 'access', _222 => _222.agent, 'optionalAccess', _223 => _223.llmsTxt, 'optionalAccess', _224 => _224.enabled]) ? "const farmLlmsFullRenderer = createFarmLlmsFullRenderer({ revalidate: farmLlmsTxtConfig.revalidate });\n" : ""}${servesAgentRobotsTxt ? `const farmAgentCrawlers = ${JSON.stringify(config.agent.crawlers)};` : ""}
|
|
9121
9206
|
const farmMdxConfig = ${JSON.stringify({
|
|
9122
9207
|
...config.mdx,
|
|
9123
|
-
components: typeof _optionalChain([config, 'access',
|
|
9208
|
+
components: typeof _optionalChain([config, 'access', _225 => _225.mdx, 'optionalAccess', _226 => _226.components]) === "string" ? config.mdx.components : void 0
|
|
9124
9209
|
})};
|
|
9125
9210
|
const configuredFarmMdxComponents = farmUserConfig?.mdx?.components;
|
|
9126
|
-
${_optionalChain([config, 'access',
|
|
9211
|
+
${_optionalChain([config, 'access', _227 => _227.agent, 'optionalAccess', _228 => _228.noindexPreviews]) ? `// agent.noindexPreviews: the runtime environment decides, falling back to the
|
|
9127
9212
|
// environment this was built in, since Netlify exposes its deploy context only
|
|
9128
9213
|
// to the build.
|
|
9129
9214
|
const farmNoindexPreview = resolveFarmPreviewDeployment(
|
|
9130
9215
|
globalThis.process?.env,
|
|
9131
|
-
${JSON.stringify(
|
|
9216
|
+
${JSON.stringify(_chunkBZN5HX7Ycjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env))},
|
|
9132
9217
|
);` : ""}
|
|
9133
9218
|
const farmMdxComponents = ${mdxComponentsPath ? `(FarmMdxComponentsModule.components || Reflect.get(FarmMdxComponentsModule, "default") || {})` : `(configuredFarmMdxComponents && typeof configuredFarmMdxComponents === "object" ? configuredFarmMdxComponents : {})`};
|
|
9134
9219
|
const farmObservabilityConfig = farmUserConfig?.observability ?? ${JSON.stringify(
|
|
@@ -9174,7 +9259,7 @@ export const farmProductionLifecycle = createFarmProductionLifecycle({
|
|
|
9174
9259
|
});
|
|
9175
9260
|
const farmI18nRuntime = ${config.i18n.enabled ? `createFarmI18nRuntime(farmI18nConfig, ${JSON.stringify(i18nCatalogs)})` : "null"};
|
|
9176
9261
|
${config.i18n.enabled ? "_setDefaultFarmI18nRuntime(farmI18nRuntime);" : ""}
|
|
9177
|
-
const farmDocsBundledContentDir = ${_optionalChain([config, 'access',
|
|
9262
|
+
const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _229 => _229.docs, 'optionalAccess', _230 => _230.enabled]) && !hasPrecompiledDocs ? `(() => {
|
|
9178
9263
|
try {
|
|
9179
9264
|
const currentDir = farmDocsDirname(farmDocsFileURLToPath(import.meta.url));
|
|
9180
9265
|
const candidates = [
|
|
@@ -9186,7 +9271,7 @@ const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _224 => _2
|
|
|
9186
9271
|
} catch {
|
|
9187
9272
|
return null;
|
|
9188
9273
|
}
|
|
9189
|
-
})()` : "null"};${_optionalChain([config, 'access',
|
|
9274
|
+
})()` : "null"};${_optionalChain([config, 'access', _231 => _231.docs, 'optionalAccess', _232 => _232.enabled]) && !hasPrecompiledDocs && _optionalChain([config, 'access', _233 => _233.docs, 'access', _234 => _234.roots, 'optionalAccess', _235 => _235.length]) ? `
|
|
9190
9275
|
const farmDocsBundledRootsDir = (() => {
|
|
9191
9276
|
try {
|
|
9192
9277
|
const currentDir = farmDocsDirname(farmDocsFileURLToPath(import.meta.url));
|
|
@@ -9239,8 +9324,8 @@ const farmDocsModulePreloadPaths = farmDocsModulePreloads
|
|
|
9239
9324
|
}
|
|
9240
9325
|
: undefined;
|
|
9241
9326
|
${adapterOwnsDocsRuntime && !hasPrecompiledDocs ? `// The renderer contract's server exports, for a docs UI that builds its pages with them.
|
|
9242
|
-
const farmDocsAppRenderer = ${
|
|
9243
|
-
` : ""}const farmDocsHandler = ${_optionalChain([config, 'access',
|
|
9327
|
+
const farmDocsAppRenderer = ${_chunk3OKSEJ33cjs.isReactRenderer.call(void 0, config.renderer) ? '{ name: "react", createElement: React.createElement, Fragment: React.Fragment, renderToString: ReactDOMServer.renderToString }' : "__farmRendererServer"};
|
|
9328
|
+
` : ""}const farmDocsHandler = ${_optionalChain([config, 'access', _236 => _236.docs, 'optionalAccess', _237 => _237.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleDocsRequest" : adapterOwnsDocsRuntime ? `${adapterHandler.factory}(${adapterHandler.config}, {
|
|
9244
9329
|
rootDir: farmDocsRuntimeRoot,
|
|
9245
9330
|
// A production build's content cannot change, so the adapter reads its
|
|
9246
9331
|
// navigation once instead of scanning the content directory per request.
|
|
@@ -9264,7 +9349,7 @@ const farmDocsAppRenderer = ${_chunkNGTZHWBGcjs.isReactRenderer.call(void 0, con
|
|
|
9264
9349
|
registerMCPServer: registerFarmMCPServer,
|
|
9265
9350
|
// A page built with this keeps its HTML string, so the preload budget and the response
|
|
9266
9351
|
// writer use it instead of reading and re-encoding the body. Older adapters ignore it.
|
|
9267
|
-
createHtmlResponse: farmOwnedHtmlResponse,${
|
|
9352
|
+
createHtmlResponse: farmOwnedHtmlResponse,${_chunkHKJIUZS5cjs.farmDocsAdapterServesGuardedPages.call(void 0, config.docs) ? `
|
|
9268
9353
|
// The adapter keeps pages a path guard covers off search, llms.txt, the sitemap and MCP. It
|
|
9269
9354
|
// asks about any path its own content lists, so the guards decide here, not a page list.
|
|
9270
9355
|
isPathGuarded: (pathname) =>
|
|
@@ -9290,7 +9375,7 @@ const farmDocsAppRenderer = ${_chunkNGTZHWBGcjs.isReactRenderer.call(void 0, con
|
|
|
9290
9375
|
isPathGuarded: isFarmDocsPathGuarded,
|
|
9291
9376
|
basePath: ${JSON.stringify(config.basePath)},
|
|
9292
9377
|
})` : "null"};
|
|
9293
|
-
const farmDocsAPIHandler = ${_optionalChain([config, 'access',
|
|
9378
|
+
const farmDocsAPIHandler = ${_optionalChain([config, 'access', _238 => _238.docs, 'optionalAccess', _239 => _239.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleAPIRequest" : adapterOwnsDocsRuntime ? "null" : `createFarmDocsAPIHandler({ rootDir: farmDocsRuntimeRoot, srcDir: ${JSON.stringify(config.srcDir)}, docs: farmDocsResolvedConfig, isPathGuarded: isFarmDocsPathGuarded, basePath: ${JSON.stringify(config.basePath)} })` : "null"};
|
|
9294
9379
|
|
|
9295
9380
|
// API routes bundled at build time
|
|
9296
9381
|
const apiRoutes = ${apiRoutes.length > 0 ? "mergePluginAPIRoutes(" : ""}[${apiRegistrations.join(",")}
|
|
@@ -9325,12 +9410,12 @@ const farmDeploymentCookiePath = ${JSON.stringify(config.basePath || "/")};
|
|
|
9325
9410
|
// runtime request.
|
|
9326
9411
|
const farmRuntimeErrorSlot = Symbol("farm.runtime.error.slot");
|
|
9327
9412
|
const farmOpenAPIReference = ${JSON.stringify(openAPIReference)};
|
|
9328
|
-
${_optionalChain([config, 'access',
|
|
9329
|
-
` : ""}${_optionalChain([config, 'access',
|
|
9330
|
-
|
|
9413
|
+
${_optionalChain([config, 'access', _240 => _240.agent, 'optionalAccess', _241 => _241.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunkTOUC6BR3cjs.resolveFarmApiCatalogInput.call(void 0, config))};
|
|
9414
|
+
` : ""}${_optionalChain([config, 'access', _242 => _242.agent, 'optionalAccess', _243 => _243.manifest]) !== false ? `const farmAppManifestInput = ${JSON.stringify(
|
|
9415
|
+
_chunkTOUC6BR3cjs.resolveFarmAppManifestInput.call(void 0, config, {
|
|
9331
9416
|
build: config.deploymentId,
|
|
9332
|
-
packages:
|
|
9333
|
-
webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ?
|
|
9417
|
+
packages: _chunkH6C45DCFcjs.resolveFarmAppPackages.call(void 0, config.root),
|
|
9418
|
+
webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunkH6C45DCFcjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
|
|
9334
9419
|
})
|
|
9335
9420
|
)};
|
|
9336
9421
|
${servesDefaultMCP ? "farmAppManifestInput.defaultMCP = getFarmDefaultMCPServer;\n" : ""}// A guard written for an MCP server's path keeps its tools out of the public view.
|
|
@@ -9343,7 +9428,7 @@ farmAppManifestInput.guardCoversPath = (path) =>
|
|
|
9343
9428
|
path,
|
|
9344
9429
|
farmLocalAPIBasePath,
|
|
9345
9430
|
);
|
|
9346
|
-
${_optionalChain([config, 'access',
|
|
9431
|
+
${_optionalChain([config, 'access', _244 => _244.docs, 'optionalAccess', _245 => _245.enabled]) ? `// A docs runtime's MCP server lists its tools when asked over MCP, in process. A build
|
|
9347
9432
|
// can't change them, so they are read once.
|
|
9348
9433
|
if (farmDocsHandler) {
|
|
9349
9434
|
farmAppManifestInput.registeredMCP = (request) =>
|
|
@@ -10118,7 +10203,7 @@ function peelFarmDocumentPrefix(markup) {
|
|
|
10118
10203
|
let inner = markup.replace(/^\\s+/, "");
|
|
10119
10204
|
let hoisted = "";
|
|
10120
10205
|
const wrapper = /^<div\\b[^>]*style=["']display\\s*:\\s*contents;?\\s*["'][^>]*>/i;
|
|
10121
|
-
const hoistable = /${
|
|
10206
|
+
const hoistable = /${_chunk4B6YJ5DScjs.HOISTED_HEAD_ELEMENT.source}/i;
|
|
10122
10207
|
let match;
|
|
10123
10208
|
while ((match = wrapper.exec(inner) || hoistable.exec(inner))) {
|
|
10124
10209
|
if (!/^<div/i.test(match[0])) hoisted += match[0];
|
|
@@ -10147,7 +10232,7 @@ function opensFarmFullDocument(markup) {
|
|
|
10147
10232
|
// them: its own head takes them. Matches the dev renderer's takeFarmHoistedHead.
|
|
10148
10233
|
function takeFarmHoistedHead(markup) {
|
|
10149
10234
|
if (opensFarmFullDocument(markup)) return { head: "", body: markup };
|
|
10150
|
-
const hoistable = /${
|
|
10235
|
+
const hoistable = /${_chunk4B6YJ5DScjs.HOISTED_HEAD_ELEMENT.source}/i;
|
|
10151
10236
|
let head = "";
|
|
10152
10237
|
let body = markup;
|
|
10153
10238
|
let match;
|
|
@@ -10342,6 +10427,8 @@ const FARM_CLIENT_MODULE_REFERENCE_PATTERN = /<f-island src="([^"]+)"([^>]*)>|"r
|
|
|
10342
10427
|
// A server action reference in a document's markup: an action in an island's or a client
|
|
10343
10428
|
// component's props (islx's \`{"$":"a",...}\`), or a server form posting one (its \`$F_REF_\` field).
|
|
10344
10429
|
const FARM_ACTION_REFERENCE_PATTERN = /"\\$":"a"|name="\\$F_REF_/;
|
|
10430
|
+
// A server tree in a document's markup: the payload a page or layout root rebuilds from.
|
|
10431
|
+
const FARM_SERVER_TREE_PATTERN = /<script type="f\\/tree"/;
|
|
10345
10432
|
|
|
10346
10433
|
function renderFarmClientModulePreload(index) {
|
|
10347
10434
|
return '\\n <link rel="modulepreload" href="/' +
|
|
@@ -10381,6 +10468,14 @@ function collectFarmClientActionModules(markup, listed) {
|
|
|
10381
10468
|
return actions.filter((index) => !listed.has(index) && listed.add(index));
|
|
10382
10469
|
}
|
|
10383
10470
|
|
|
10471
|
+
// The manifest indexes of islands mode's server trees (RFC 0013), for a document whose markup holds
|
|
10472
|
+
// one, leaving out those already listed. The islands runtime imports them with the first otherwise.
|
|
10473
|
+
function collectFarmClientServerTreeModules(markup, listed) {
|
|
10474
|
+
const trees = farmClientModulePreloads.serverTrees;
|
|
10475
|
+
if (!trees || typeof markup !== "string" || !FARM_SERVER_TREE_PATTERN.test(markup)) return [];
|
|
10476
|
+
return trees.filter((index) => !listed.has(index) && listed.add(index));
|
|
10477
|
+
}
|
|
10478
|
+
|
|
10384
10479
|
// The modulepreload links for a document: the entry's static imports and, unless it answers a
|
|
10385
10480
|
// client navigation, the renderer and, when a page or layout root hydrates in it (\`hydratesRoot\`),
|
|
10386
10481
|
// the code that renders it; then the modules its hydrating page and its markup load.
|
|
@@ -10394,6 +10489,7 @@ function renderFarmClientModulePreloads(markup, pageModule, navigation, hydrates
|
|
|
10394
10489
|
(hydratesRoot && !navigation ? farmClientRootPreloadTags : "") +
|
|
10395
10490
|
collectFarmClientDocumentModules(markup, pageModule, listed)
|
|
10396
10491
|
.concat(collectFarmClientActionModules(markup, listed))
|
|
10492
|
+
.concat(collectFarmClientServerTreeModules(markup, listed))
|
|
10397
10493
|
.map(renderFarmClientModulePreload)
|
|
10398
10494
|
.join("");
|
|
10399
10495
|
}
|
|
@@ -10426,11 +10522,14 @@ function renderFarmClientBootPreloads(markup, pageModule, root, rootStrategy, na
|
|
|
10426
10522
|
)
|
|
10427
10523
|
: [];
|
|
10428
10524
|
const waitsForClick = rootStrategy === "interaction";
|
|
10429
|
-
// A call needs a hydrated island, so the action client comes with the renderer
|
|
10525
|
+
// A call needs a hydrated island, so the action client comes with the renderer, as do the server
|
|
10526
|
+
// trees a root rebuilds.
|
|
10527
|
+
const listed = new Set(entry.concat(rootModules));
|
|
10430
10528
|
const renderer = navigation
|
|
10431
10529
|
? []
|
|
10432
10530
|
: (farmClientModulePreloads.renderer || []).concat(
|
|
10433
|
-
collectFarmClientActionModules(markup,
|
|
10531
|
+
collectFarmClientActionModules(markup, listed),
|
|
10532
|
+
collectFarmClientServerTreeModules(markup, listed),
|
|
10434
10533
|
);
|
|
10435
10534
|
return attribute("data-farm-preload", waitsForClick ? entry : entry.concat(rootModules)) +
|
|
10436
10535
|
attribute("data-farm-preload-router", farmClientModulePreloads.router || []) +
|
|
@@ -10687,10 +10786,10 @@ async function handleMetadataImageRequest(request, routePathname) {
|
|
|
10687
10786
|
path: match.pagePath,
|
|
10688
10787
|
};
|
|
10689
10788
|
|
|
10690
|
-
${hasGeneratedMetadataImages ? `const value = await resolveFarmMetadataImageValue(imageModule, props${
|
|
10789
|
+
${hasGeneratedMetadataImages ? `const value = await resolveFarmMetadataImageValue(imageModule, props${_chunk3OKSEJ33cjs.isReactRenderer.call(void 0, config.renderer) ? "" : ", {\n renderer: ReactDOMServer,\n component: image.component === true,\n }"});
|
|
10691
10790
|
return createFarmMetadataImageResponse(value, imageModule, {
|
|
10692
10791
|
method,
|
|
10693
|
-
ifNoneMatch: request.headers.get("if-none-match"),${
|
|
10792
|
+
ifNoneMatch: request.headers.get("if-none-match"),${_chunk3OKSEJ33cjs.isReactRenderer.call(void 0, config.renderer) ? "" : "\n renderer: ReactDOMServer,"}
|
|
10694
10793
|
});` : 'throw new Error("Generated metadata image runtime is unavailable");'}
|
|
10695
10794
|
} catch (error) {
|
|
10696
10795
|
console.error("Metadata image render failed:", error);
|
|
@@ -10769,7 +10868,7 @@ function createFarmAgentRobotsResponse(request) {
|
|
|
10769
10868
|
// its nearest layout's.
|
|
10770
10869
|
const farmAgentGuardedPages = new Set(${JSON.stringify(
|
|
10771
10870
|
pageRoutes.map((route) => route.pattern).filter(
|
|
10772
|
-
(pattern) => !pattern.includes("[") &&
|
|
10871
|
+
(pattern) => !pattern.includes("[") && _chunk4B6YJ5DScjs.farmPathGuardCoversPage.call(void 0,
|
|
10773
10872
|
{
|
|
10774
10873
|
config: { middleware: config.middleware, integrations: config.integrations },
|
|
10775
10874
|
middlewareRoutes
|
|
@@ -10824,7 +10923,7 @@ ${servesDefaultMCP ? `// agent.mcp: the default read-only MCP server at /mcp, as
|
|
|
10824
10923
|
// aside for a page route that answers /mcp and for any MCP server published or
|
|
10825
10924
|
// registered at runtime, such as the docs engine's.
|
|
10826
10925
|
const farmDefaultMCPServer = ${JSON.stringify(
|
|
10827
|
-
_chunkW53Z4WDIcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root),
|
|
10926
|
+
_chunkW53Z4WDIcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunk3HWNYLQVcjs.FARM_VERSION)
|
|
10828
10927
|
)};
|
|
10829
10928
|
let farmDefaultMCPRouteFree;
|
|
10830
10929
|
function getFarmDefaultMCPServer() {
|
|
@@ -11018,7 +11117,7 @@ ${edgeMiddlewareFilePaths.length > 0 ? `
|
|
|
11018
11117
|
// middleware guards is never prerendered. Read once: Nitro's prerender worker sets the variable.
|
|
11019
11118
|
const farmEdgeMiddlewareFiles = new Set(${JSON.stringify(edgeMiddlewareFilePaths)});
|
|
11020
11119
|
const farmPrerendering =
|
|
11021
|
-
typeof process !== "undefined" && process.env?.${
|
|
11120
|
+
typeof process !== "undefined" && process.env?.${_chunkRVJQHQCGcjs.FARM_PRERENDER_ENV} === "1";
|
|
11022
11121
|
` : ""}
|
|
11023
11122
|
const farmMiddlewareRunner = ${hasMiddlewareRuntime ? `createProductionMiddlewareRunner({
|
|
11024
11123
|
config: farmMiddlewareConfig,
|
|
@@ -11162,7 +11261,7 @@ function hasLocalRequestRoute(request, routePathname) {
|
|
|
11162
11261
|
if (${imageRuntime === "none" ? "false" : `pathname === ${JSON.stringify(config.images.path)}`}) {
|
|
11163
11262
|
return true;
|
|
11164
11263
|
}
|
|
11165
|
-
${_optionalChain([config, 'access',
|
|
11264
|
+
${_optionalChain([config, 'access', _246 => _246.docs, 'optionalAccess', _247 => _247.enabled]) ? `const docsPath = normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs");
|
|
11166
11265
|
// The docs answer below the basePath; their API stays at /api/docs, as API routes do.
|
|
11167
11266
|
const docsRoutePathname = stripFarmBasePath(pathname);
|
|
11168
11267
|
if (
|
|
@@ -11190,7 +11289,7 @@ function getFarmPluginRequestOptions(request) {
|
|
|
11190
11289
|
route: { ...route, pattern: normalizeRuntimePath(farmOpenAPIReference.route) },
|
|
11191
11290
|
};
|
|
11192
11291
|
}
|
|
11193
|
-
const isDocsAPIRequest = ${_optionalChain([config, 'access',
|
|
11292
|
+
const isDocsAPIRequest = ${_optionalChain([config, 'access', _248 => _248.docs, 'optionalAccess', _249 => _249.enabled]) ? "isFarmDocsAPIRequest(pathname)" : "false"};
|
|
11194
11293
|
const integrationMatch = ${hasServerRuntimeIntegrations ? `matchIntegrationRoute(serverRuntimeIntegrations, {
|
|
11195
11294
|
pathname,
|
|
11196
11295
|
method: request.method,
|
|
@@ -11274,7 +11373,7 @@ ${hasInfraAnalyticsRuntime ? `
|
|
|
11274
11373
|
// endpoints, Markdown mirrors, and docs pages have no app route pattern, so they are
|
|
11275
11374
|
// labeled here; route.pattern keeps meaning the matched app route for plugins.
|
|
11276
11375
|
const farmBuiltInRoutePaths = new Set(${JSON.stringify(
|
|
11277
|
-
|
|
11376
|
+
_chunkTOUC6BR3cjs.listFarmBuiltInRoutePaths.call(void 0, {
|
|
11278
11377
|
agent: {
|
|
11279
11378
|
...config.agent,
|
|
11280
11379
|
aiCatalog: servesAiCatalog,
|
|
@@ -11285,9 +11384,9 @@ const farmBuiltInRoutePaths = new Set(${JSON.stringify(
|
|
|
11285
11384
|
openapi: openAPIReference
|
|
11286
11385
|
})
|
|
11287
11386
|
)});
|
|
11288
|
-
${_optionalChain([config, 'access',
|
|
11387
|
+
${_optionalChain([config, 'access', _250 => _250.docs, 'optionalAccess', _251 => _251.enabled]) ? `const farmDocsRouteLabelInput = {
|
|
11289
11388
|
path: normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs"),
|
|
11290
|
-
apiPath: ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess',
|
|
11389
|
+
apiPath: ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _252 => _252.apiPath]) || "/api/docs")},${_optionalChain([config, 'access', _253 => _253.docs, 'access', _254 => _254.roots, 'optionalAccess', _255 => _255.length]) ? "\n roots: farmDocsResolvedConfig.roots.map((farmDocsRoot) => farmDocsRoot.entry)," : ""}${farmDocsAnalyticsPages.length ? `
|
|
11291
11390
|
pages: new Set(${JSON.stringify(farmDocsAnalyticsPages)}),` : ""}
|
|
11292
11391
|
};
|
|
11293
11392
|
` : ""}// The request's route payload, for a handler that learns what answered while it handles.
|
|
@@ -11303,11 +11402,11 @@ function labelFarmRequestOptions(options) {
|
|
|
11303
11402
|
setFarmRouteLabel(options.route, mcpLabel);
|
|
11304
11403
|
return options;
|
|
11305
11404
|
}
|
|
11306
|
-
${_optionalChain([config, 'access',
|
|
11405
|
+
${_optionalChain([config, 'access', _256 => _256.docs, 'optionalAccess', _257 => _257.enabled]) ? `if (options.kind === "docs") {
|
|
11307
11406
|
setFarmRouteLabel(options.route, resolveFarmDocsRouteLabel(routePathname, farmDocsRouteLabelInput));
|
|
11308
11407
|
return options;
|
|
11309
11408
|
}` : ""}
|
|
11310
|
-
${_optionalChain([config, 'access',
|
|
11409
|
+
${_optionalChain([config, 'access', _258 => _258.md, 'optionalAccess', _259 => _259.enabled]) || hasMarkdownPages ? `const markdownLabel = resolveFarmMarkdownRouteLabel(
|
|
11311
11410
|
routePathname,
|
|
11312
11411
|
(page) => matchPageRoute(page)?.route.pattern,
|
|
11313
11412
|
);
|
|
@@ -11342,7 +11441,7 @@ function getApplicableLayouts(pathname, directory) {
|
|
|
11342
11441
|
return applicable;
|
|
11343
11442
|
}
|
|
11344
11443
|
|
|
11345
|
-
${_optionalChain([config, 'access',
|
|
11444
|
+
${_optionalChain([config, 'access', _260 => _260.docs, 'optionalAccess', _261 => _261.enabled]) ? `async function wrapFarmDocsResponseWithLayouts(request, response) {
|
|
11346
11445
|
if (request.method === "HEAD") return response;
|
|
11347
11446
|
if (response.headers.get("x-farm-docs-adapter")) return response;
|
|
11348
11447
|
|
|
@@ -11448,7 +11547,7 @@ ${_optionalChain([config, 'access', _255 => _255.docs, 'optionalAccess', _256 =>
|
|
|
11448
11547
|
|
|
11449
11548
|
// Shells keep their own LRU so query-string variants never evict app cache entries.
|
|
11450
11549
|
const pprShellCache = getFarmDataCache().pprShellCache;
|
|
11451
|
-
const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access',
|
|
11550
|
+
const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access', _262 => _262.experimental, 'optionalAccess', _263 => _263.ppr]) === true)};
|
|
11452
11551
|
|
|
11453
11552
|
function resolveRouteRenderingView(route) {
|
|
11454
11553
|
// The same merge development uses: baked directive config under the
|
|
@@ -11568,7 +11667,7 @@ async function handleFarmRequest(request, adapterContext) {
|
|
|
11568
11667
|
},
|
|
11569
11668
|
{ redirect: !isFarmLocalAPIPathname(requestUrl.pathname) }
|
|
11570
11669
|
)` : "handleFarmRequestInContext(request, null, false, Date.now(), adapterContext, requestUrl)"};
|
|
11571
|
-
${_optionalChain([config, 'access',
|
|
11670
|
+
${_optionalChain([config, 'access', _264 => _264.md, 'optionalAccess', _265 => _265.enabled]) ? `const pathname = getFarmRoutePathname(requestUrl.pathname);
|
|
11572
11671
|
if (matchPageRoute(pathname)) {
|
|
11573
11672
|
// The Link header advertises the public .md URL, like the head alternate.
|
|
11574
11673
|
return applyMarkdownNegotiationHeaders(response, {
|
|
@@ -11785,7 +11884,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
11785
11884
|
return renderFarmErrorJSONResponse();` : `
|
|
11786
11885
|
if (isFarmLocalAPIPathname(pathname)) return renderFarmErrorJSONResponse();
|
|
11787
11886
|
// No page was selected, so only the root error boundary and layouts apply.
|
|
11788
|
-
const errorResponse = await renderFarmErrorResponse(middlewareResult.error, "/", {}, null);${_optionalChain([config, 'access',
|
|
11887
|
+
const errorResponse = await renderFarmErrorResponse(middlewareResult.error, "/", {}, null);${_optionalChain([config, 'access', _266 => _266.md, 'optionalAccess', _267 => _267.enabled]) ? `
|
|
11789
11888
|
// An agent asking for Markdown reads the error document as Markdown, as it
|
|
11790
11889
|
// does when a page throws. The helper answers null when Markdown is off.
|
|
11791
11890
|
const markdownErrorResponse = await createMarkdownMirrorResponse({
|
|
@@ -11827,7 +11926,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
11827
11926
|
}
|
|
11828
11927
|
` : ""}
|
|
11829
11928
|
|
|
11830
|
-
${_optionalChain([config, 'access',
|
|
11929
|
+
${_optionalChain([config, 'access', _268 => _268.docs, 'optionalAccess', _269 => _269.enabled]) ? `
|
|
11831
11930
|
// Docs responses are served after app middleware so route guards and
|
|
11832
11931
|
// middleware headers apply to the docs engine like any other page content.
|
|
11833
11932
|
// An app's own llms.txt, llms-full.txt, sitemap.xml, and robots.txt take
|
|
@@ -11943,7 +12042,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
11943
12042
|
}
|
|
11944
12043
|
` : ""}
|
|
11945
12044
|
|
|
11946
|
-
${_optionalChain([config, 'access',
|
|
12045
|
+
${_optionalChain([config, 'access', _270 => _270.md, 'optionalAccess', _271 => _271.enabled]) ? `
|
|
11947
12046
|
if (farmMarkdownConfig?.enabled) {
|
|
11948
12047
|
const markdownResponse = await createMarkdownMirrorResponse({
|
|
11949
12048
|
// The mirror helper only reads metadata and creates its own GET request.
|
|
@@ -12047,11 +12146,11 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12047
12146
|
return applyProductionMiddlewareHeaders(applicationMetadataResponse, middlewareHeaders);
|
|
12048
12147
|
}
|
|
12049
12148
|
` : ""}
|
|
12050
|
-
${_optionalChain([config, 'access',
|
|
12149
|
+
${_optionalChain([config, 'access', _272 => _272.agent, 'optionalAccess', _273 => _273.manifest]) !== false ? `
|
|
12051
12150
|
// agent.manifest: /.well-known/farmjs.json (and 0.1.34's /.well-known/farmjs), the app's
|
|
12052
12151
|
// public manifest, the same document for every request.
|
|
12053
12152
|
if (
|
|
12054
|
-
[${JSON.stringify(
|
|
12153
|
+
[${JSON.stringify(_chunkTOUC6BR3cjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunkTOUC6BR3cjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
|
|
12055
12154
|
normalizeRuntimePath(routePathname),
|
|
12056
12155
|
)
|
|
12057
12156
|
) {
|
|
@@ -12061,9 +12160,9 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12061
12160
|
);
|
|
12062
12161
|
}
|
|
12063
12162
|
` : ""}
|
|
12064
|
-
${_optionalChain([config, 'access',
|
|
12163
|
+
${_optionalChain([config, 'access', _274 => _274.agent, 'optionalAccess', _275 => _275.apiCatalog]) ? `
|
|
12065
12164
|
// agent.apiCatalog: list the OpenAPI and MCP surfaces at the RFC 9727 path.
|
|
12066
|
-
if (normalizeRuntimePath(routePathname) === ${JSON.stringify(
|
|
12165
|
+
if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkTOUC6BR3cjs.FARM_API_CATALOG_PATH)}) {
|
|
12067
12166
|
return applyProductionMiddlewareHeaders(
|
|
12068
12167
|
createFarmApiCatalogResponse(request.method, farmApiCatalogInput, request),
|
|
12069
12168
|
middlewareHeaders,
|
|
@@ -12088,11 +12187,11 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12088
12187
|
);
|
|
12089
12188
|
}
|
|
12090
12189
|
` : ""}
|
|
12091
|
-
${_optionalChain([config, 'access',
|
|
12190
|
+
${_optionalChain([config, 'access', _276 => _276.agent, 'optionalAccess', _277 => _277.llmsTxt, 'optionalAccess', _278 => _278.enabled]) ? `
|
|
12092
12191
|
// agent.llmsTxt with no llms.ts or llms-full.ts: serve the generated files.
|
|
12093
12192
|
const farmGeneratedLlmsKind = normalizeRuntimePath(routePathname) === "/llms.txt"
|
|
12094
12193
|
? "llms"
|
|
12095
|
-
: ${_optionalChain([config, 'access',
|
|
12194
|
+
: ${_optionalChain([config, 'access', _279 => _279.agent, 'optionalAccess', _280 => _280.llmsTxt, 'optionalAccess', _281 => _281.full]) ? `normalizeRuntimePath(routePathname) === "/llms-full.txt" ? "llms-full" : ` : ""}null;
|
|
12096
12195
|
if (farmGeneratedLlmsKind) {
|
|
12097
12196
|
const llmsContext = createFarmLlmsTxtContext(request, farmGeneratedLlmsKind === "llms-full");
|
|
12098
12197
|
// Renders are shared per origin the request reached, which is where pages are read.
|
|
@@ -12128,7 +12227,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12128
12227
|
}
|
|
12129
12228
|
` : ""}
|
|
12130
12229
|
|
|
12131
|
-
${_optionalChain([config, 'access',
|
|
12230
|
+
${_optionalChain([config, 'access', _282 => _282.docs, 'optionalAccess', _283 => _283.enabled]) ? `if (farmDocsAPIHandler && isFarmDocsAPIRequest(pathname)) {
|
|
12132
12231
|
const docsAPIResponse = await farmDocsAPIHandler(cloneFarmRequestWithContext(request));
|
|
12133
12232
|
if (docsAPIResponse) {
|
|
12134
12233
|
return applyProductionMiddlewareHeaders(
|
|
@@ -12623,7 +12722,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12623
12722
|
pageElement,
|
|
12624
12723
|
);
|
|
12625
12724
|
|
|
12626
|
-
${
|
|
12725
|
+
${_chunk3OKSEJ33cjs.isReactRenderer.call(void 0, config.renderer) ? "if (route.shouldHydrate && !shouldHydrateLayout) pageElement = markPagePosition(React, pageElement);" : ""}
|
|
12627
12726
|
// Wrap with layouts (from innermost to outermost)
|
|
12628
12727
|
// Layouts are sorted by depth (root first), so we process in reverse
|
|
12629
12728
|
let wrappedElement = pageElement;
|
|
@@ -12697,7 +12796,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12697
12796
|
wrappedElement = wrapFarmRouteClientGraph(wrappedElement);
|
|
12698
12797
|
}
|
|
12699
12798
|
|
|
12700
|
-
${
|
|
12799
|
+
${_chunk3OKSEJ33cjs.isReactRenderer.call(void 0, config.renderer) ? "if (route.shouldHydrate && !shouldHydrateLayout) wrappedElement = markLayoutPosition(React, wrappedElement);" : ""}
|
|
12701
12800
|
wrappedElement = wrapWithFarmIntegrationProviders(wrappedElement);
|
|
12702
12801
|
return renderFarmElement(ReactDOMServer, wrappedElement, route.pattern, farmFlushToken);
|
|
12703
12802
|
};
|
|
@@ -12768,7 +12867,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12768
12867
|
);
|
|
12769
12868
|
}
|
|
12770
12869
|
}
|
|
12771
|
-
${_optionalChain([config, 'access',
|
|
12870
|
+
${_optionalChain([config, 'access', _284 => _284.md, 'optionalAccess', _285 => _285.enabled]) ? `
|
|
12772
12871
|
// Advertise the Markdown mirror in the head as well as the Link header,
|
|
12773
12872
|
// using the public path the .md request will be resolved against.
|
|
12774
12873
|
mergedMetadata = addMetadataMarkdownAlternate(
|
|
@@ -12797,7 +12896,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12797
12896
|
emitFarmEvent({ type: "cache.bypass", route: pathname, reason: "cookie" });
|
|
12798
12897
|
}
|
|
12799
12898
|
|
|
12800
|
-
const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access',
|
|
12899
|
+
const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _286 => _286.agent, 'optionalAccess', _287 => _287.jsonLd]), () => ( false)))} });
|
|
12801
12900
|
const title = renderedMetadata.title;
|
|
12802
12901
|
const metaTags = renderedMetadata.tags;
|
|
12803
12902
|
const hasFavicon = renderedMetadata.hasFavicon;
|
|
@@ -13642,11 +13741,11 @@ function createFarmRuntimeHookErrorResponse(request, error) {
|
|
|
13642
13741
|
export async function fetch(request, context) {${imageRuntime === "none" ? "" : `
|
|
13643
13742
|
// The image optimizer's fetch of a local source is not a loopback visitor.
|
|
13644
13743
|
context = _withFarmImageSourceClientAddress(request, context);`}
|
|
13645
|
-
${_optionalChain([config, 'access',
|
|
13744
|
+
${_optionalChain([config, 'access', _288 => _288.agent, 'optionalAccess', _289 => _289.noindexPreviews]) ? "const response = await" : "return"} _runWithAPIRequestRuntime({
|
|
13646
13745
|
basePath: farmLocalAPIBasePath,
|
|
13647
13746
|
dispatch: async (localRequest) =>
|
|
13648
13747
|
(await handleAPIRequest(localRequest)) ?? Response.json({ error: "Not Found" }, { status: 404 }),
|
|
13649
|
-
}, () => handleFarmFetch(request, context));${_optionalChain([config, 'access',
|
|
13748
|
+
}, () => handleFarmFetch(request, context));${_optionalChain([config, 'access', _290 => _290.agent, 'optionalAccess', _291 => _291.noindexPreviews]) ? `
|
|
13650
13749
|
// Keep every response of a preview deployment out of search indexes.
|
|
13651
13750
|
return farmNoindexPreview ? applyFarmPreviewRobotsTag(response) : response;` : ""}
|
|
13652
13751
|
}
|
|
@@ -13856,7 +13955,7 @@ function getManifestPageEntry(manifest, pathname) {
|
|
|
13856
13955
|
})).sort((left, right) => _chunkML4TOUZPcjs.compareRouteSpecificity.call(void 0, left.specificity, right.specificity)).map(({ entry, matches }) => ({ entry, matches }));
|
|
13857
13956
|
manifestPageMatchers.set(manifest.routes, pages);
|
|
13858
13957
|
}
|
|
13859
|
-
return _optionalChain([pages, 'access',
|
|
13958
|
+
return _optionalChain([pages, 'access', _292 => _292.find, 'call', _293 => _293((page) => page.matches(pathname)), 'optionalAccess', _294 => _294.entry]);
|
|
13860
13959
|
}
|
|
13861
13960
|
function withFarmEdgeGuardedPrerenderHeaders(headers, edgeGuarded) {
|
|
13862
13961
|
if (!edgeGuarded) return headers;
|
|
@@ -13893,13 +13992,13 @@ function getPhysicalPrerenderBypassReason(options) {
|
|
|
13893
13992
|
if (rewriteSources.some((source) => middlewarePatternMatches(source, pathname))) {
|
|
13894
13993
|
return "rewrite";
|
|
13895
13994
|
}
|
|
13896
|
-
if (
|
|
13897
|
-
if (
|
|
13898
|
-
if (
|
|
13995
|
+
if (_chunk4B6YJ5DScjs.appMiddlewareMayHandlePath.call(void 0, middlewareRoutes, pathname)) return "app middleware";
|
|
13996
|
+
if (_chunk4B6YJ5DScjs.configMiddlewareMayHandlePath.call(void 0, config.middleware, pathname)) return "configured middleware";
|
|
13997
|
+
if (_chunkBBX4RPOVcjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
|
|
13899
13998
|
if (farmServerRuntimePluginsMayHandlePath(config, pathname)) return "server runtime plugin";
|
|
13900
13999
|
const manifestEntry = getManifestPageEntry(routeRuntimeManifest, pathname);
|
|
13901
|
-
if (_optionalChain([manifestEntry, 'optionalAccess',
|
|
13902
|
-
if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access',
|
|
14000
|
+
if (_optionalChain([manifestEntry, 'optionalAccess', _295 => _295.rendering]) === "dynamic") return "dynamic runtime manifest";
|
|
14001
|
+
if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access', _296 => _296.regions, 'optionalAccess', _297 => _297.length])) || manifestEntry.maxDuration !== void 0)) {
|
|
13903
14002
|
return "route runtime controls";
|
|
13904
14003
|
}
|
|
13905
14004
|
const routeRule = getEffectiveRouteRule(config, pathname);
|
|
@@ -13912,7 +14011,7 @@ function getPhysicalPrerenderBypassReason(options) {
|
|
|
13912
14011
|
return void 0;
|
|
13913
14012
|
}
|
|
13914
14013
|
async function getFarmDocsPrerenderPages(config, root, preset) {
|
|
13915
|
-
if (!_optionalChain([config, 'access',
|
|
14014
|
+
if (!_optionalChain([config, 'access', _298 => _298.docs, 'optionalAccess', _299 => _299.enabled]) || !config.docs.prerender) return [];
|
|
13916
14015
|
if (_chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) === "edge") {
|
|
13917
14016
|
_chunk7U4XF76Rcjs.logger.info(
|
|
13918
14017
|
`\u21AA Keeping docs pages in the edge docs snapshot: docs.prerender writes static files on Node and serverless targets, not "${preset}".`
|
|
@@ -13931,7 +14030,7 @@ async function getFarmDocsPrerenderPages(config, root, preset) {
|
|
|
13931
14030
|
}
|
|
13932
14031
|
return pages2;
|
|
13933
14032
|
}
|
|
13934
|
-
const pages = await
|
|
14033
|
+
const pages = await _chunkHKJIUZS5cjs.listFarmDocsAdapterPages.call(void 0, config.docs, { root, srcDir: config.srcDir });
|
|
13935
14034
|
if (!pages) {
|
|
13936
14035
|
_chunk7U4XF76Rcjs.logger.warn(
|
|
13937
14036
|
`The docs adapter ${JSON.stringify(config.docs.adapter.id)} does not list its pages for prerendering; upgrade it to prerender docs pages. They render on request until then.`
|
|
@@ -13941,11 +14040,11 @@ async function getFarmDocsPrerenderPages(config, root, preset) {
|
|
|
13941
14040
|
return pages;
|
|
13942
14041
|
}
|
|
13943
14042
|
async function listFarmDocsAnalyticsPages(config, root, preset) {
|
|
13944
|
-
if (!_optionalChain([config, 'access',
|
|
14043
|
+
if (!_optionalChain([config, 'access', _300 => _300.docs, 'optionalAccess', _301 => _301.enabled]) || config.analytics === false || _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) !== "nodejs") {
|
|
13945
14044
|
return [];
|
|
13946
14045
|
}
|
|
13947
14046
|
try {
|
|
13948
|
-
return await
|
|
14047
|
+
return await _chunkHKJIUZS5cjs.listFarmDocsPagePaths.call(void 0, config.docs, {
|
|
13949
14048
|
root,
|
|
13950
14049
|
srcDir: config.srcDir,
|
|
13951
14050
|
adapter: _chunkL2GUEYHRcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)
|
|
@@ -13959,9 +14058,9 @@ async function listFarmDocsAnalyticsPages(config, root, preset) {
|
|
|
13959
14058
|
}
|
|
13960
14059
|
function hasFarmNitroCacheRouteRule(routeRules) {
|
|
13961
14060
|
return Object.values(routeRules || {}).some((rule) => {
|
|
13962
|
-
const swr = _optionalChain([rule, 'optionalAccess',
|
|
13963
|
-
const cache = _optionalChain([rule, 'optionalAccess',
|
|
13964
|
-
const headers = _optionalChain([rule, 'optionalAccess',
|
|
14061
|
+
const swr = _optionalChain([rule, 'optionalAccess', _302 => _302.swr]);
|
|
14062
|
+
const cache = _optionalChain([rule, 'optionalAccess', _303 => _303.cache]);
|
|
14063
|
+
const headers = _optionalChain([rule, 'optionalAccess', _304 => _304.headers]);
|
|
13965
14064
|
return swr !== void 0 && swr !== false || cache !== void 0 && cache !== false || !!headers && typeof headers === "object" && Object.keys(headers).length > 0;
|
|
13966
14065
|
});
|
|
13967
14066
|
}
|
|
@@ -13974,10 +14073,10 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
13974
14073
|
const nitroBuilder = nitroBuilderResult.value;
|
|
13975
14074
|
const isVercel = preset === "vercel";
|
|
13976
14075
|
const isCloudflareWorker = preset === "cloudflare-module";
|
|
13977
|
-
const outputDir =
|
|
14076
|
+
const outputDir = _chunkBBX4RPOVcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
13978
14077
|
const runtimeServerOutputDir = isVercel ? _path2.default.join(outputDir, "functions", "__nitro.func") : _path2.default.join(outputDir, "server");
|
|
13979
14078
|
const ssrOutputDir = _path2.default.join(root, distDir, "ssr");
|
|
13980
|
-
const imageRuntime =
|
|
14079
|
+
const imageRuntime = _chunkH6C45DCFcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
|
|
13981
14080
|
const hasGeneratedMetadataImages = Array.from(routeManager.getMetadataImages().values()).some(
|
|
13982
14081
|
(image) => image.sourceType === "module"
|
|
13983
14082
|
);
|
|
@@ -14033,7 +14132,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
14033
14132
|
const edgeGuardedPrerenderRoutes = [];
|
|
14034
14133
|
const addPrerenderRoute = (pathname) => {
|
|
14035
14134
|
prerenderRoutes.push(pathname);
|
|
14036
|
-
if (
|
|
14135
|
+
if (_chunk4B6YJ5DScjs.appMiddlewareMayHandlePath.call(void 0, edgeMiddlewareRoutes, pathname)) {
|
|
14037
14136
|
edgeGuardedPrerenderRoutes.push(pathname);
|
|
14038
14137
|
}
|
|
14039
14138
|
};
|
|
@@ -14127,7 +14226,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
14127
14226
|
webEntry: clientJsSrc,
|
|
14128
14227
|
webBoot: clientBootSrc,
|
|
14129
14228
|
stylesheet: clientCssHref,
|
|
14130
|
-
webFiles: _nullishCoalesce(_optionalChain([clientModulePreloads, 'optionalAccess',
|
|
14229
|
+
webFiles: _nullishCoalesce(_optionalChain([clientModulePreloads, 'optionalAccess', _305 => _305.files]), () => ( []))
|
|
14131
14230
|
})
|
|
14132
14231
|
) : null;
|
|
14133
14232
|
for (const output of Object.values(ssrBundle)) {
|
|
@@ -14453,7 +14552,7 @@ function toFarmNodeResponse(request, response) {
|
|
|
14453
14552
|
varyFarmNitroCacheRules(_chunkIIHZ2BEEcjs.routeRulesToNitroRouteRules.call(void 0, config.routeRules), [
|
|
14454
14553
|
...config.md.enabled ? ["accept"] : [],
|
|
14455
14554
|
...shouldBuildFarmMobileClient(config) ? ["x-farm-shell"] : [],
|
|
14456
|
-
...
|
|
14555
|
+
..._chunk3OKSEJ33cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _306 => _306.experimental, 'optionalAccess', _307 => _307.serverComponents])) === "islands" ? ["f-layouts"] : []
|
|
14457
14556
|
]),
|
|
14458
14557
|
config.basePath,
|
|
14459
14558
|
_chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, config.api)
|
|
@@ -14618,22 +14717,22 @@ function toFarmNodeResponse(request, response) {
|
|
|
14618
14717
|
snapshotSSRRebundleOptions(nitroConfig)
|
|
14619
14718
|
);
|
|
14620
14719
|
const requestedBuilder = _nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER));
|
|
14621
|
-
const nitroBuildIsFarms = (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access',
|
|
14622
|
-
_optionalChain([nitroConfig, 'access',
|
|
14623
|
-
(handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess',
|
|
14720
|
+
const nitroBuildIsFarms = (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access', _308 => _308.rollupConfig, 'optionalAccess', _309 => _309.external]) === nitroRollupExternal && !hasRollupPlugins(_optionalChain([nitroConfig, 'access', _310 => _310.rollupConfig, 'optionalAccess', _311 => _311.plugins])) && customRollupKeys.length === 0 && Boolean(
|
|
14721
|
+
_optionalChain([nitroConfig, 'access', _312 => _312.handlers, 'optionalAccess', _313 => _313.some, 'call', _314 => _314(
|
|
14722
|
+
(handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess', _315 => _315.handler]) || "") === nitroEntryPath
|
|
14624
14723
|
)])
|
|
14625
14724
|
);
|
|
14626
|
-
const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && nitroBuildIsFarms && _path2.default.resolve(_optionalChain([nitroConfig, 'access',
|
|
14725
|
+
const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && nitroBuildIsFarms && _path2.default.resolve(_optionalChain([nitroConfig, 'access', _316 => _316.output, 'optionalAccess', _317 => _317.serverDir]) || "") === _path2.default.resolve(expectedServerDir);
|
|
14627
14726
|
const prerenderReusesPrebuiltSSR = prerenderRoutes.length > 0 && ssrExternalsArePackaged && nitroBuildIsFarms;
|
|
14628
14727
|
const selectRolldownBuilder = canReusePrebuiltSSR && requestedBuilder === void 0 && await canUseRolldownBuilder();
|
|
14629
14728
|
if (selectRolldownBuilder) nitroConfig.builder = "rolldown";
|
|
14630
14729
|
const useRolldownBuilder = canReusePrebuiltSSR && (_nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER))) === "rolldown";
|
|
14631
14730
|
const shouldMinify = nitroConfig.minify !== false;
|
|
14632
|
-
const keepServerNames = !(_optionalChain([config, 'access',
|
|
14731
|
+
const keepServerNames = !(_optionalChain([config, 'access', _318 => _318.docs, 'optionalAccess', _319 => _319.enabled]) && _optionalChain([config, 'access', _320 => _320.docs, 'access', _321 => _321.adapter, 'optionalAccess', _322 => _322.server]));
|
|
14633
14732
|
const useFarmServerMinifier = shouldMinify && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig;
|
|
14634
14733
|
const serverChunkMinifier = useFarmServerMinifier ? createServerChunkMinifyPlugin({ keepNames: keepServerNames, target: "esnext" }) : null;
|
|
14635
14734
|
const ssrRollupPlugin = canReusePrebuiltSSR ? prebuiltSSRPlugin : createServerReadSSRAssetsPlugin(ssrBundle, ssrOutputDir);
|
|
14636
|
-
const configuredRollupPlugins = _optionalChain([nitroConfig, 'access',
|
|
14735
|
+
const configuredRollupPlugins = _optionalChain([nitroConfig, 'access', _323 => _323.rollupConfig, 'optionalAccess', _324 => _324.plugins]);
|
|
14637
14736
|
nitroConfig.rollupConfig = {
|
|
14638
14737
|
...nitroConfig.rollupConfig,
|
|
14639
14738
|
plugins: [
|
|
@@ -14672,7 +14771,7 @@ function toFarmNodeResponse(request, response) {
|
|
|
14672
14771
|
let skippedNonHtmlPrerenderRoute = false;
|
|
14673
14772
|
nitroInstance.hooks.hook("prerender:generate", (route) => {
|
|
14674
14773
|
if (route.error || !prerenderPagePaths.has(route.route)) return;
|
|
14675
|
-
if (_optionalChain([route, 'access',
|
|
14774
|
+
if (_optionalChain([route, 'access', _325 => _325.contentType, 'optionalAccess', _326 => _326.toLowerCase, 'call', _327 => _327(), 'access', _328 => _328.includes, 'call', _329 => _329("html")])) return;
|
|
14676
14775
|
route.skip = true;
|
|
14677
14776
|
skippedNonHtmlPrerenderRoute = true;
|
|
14678
14777
|
const configuredRule = configuredNitroRouteRules[route.route];
|
|
@@ -14683,9 +14782,9 @@ function toFarmNodeResponse(request, response) {
|
|
|
14683
14782
|
nitroInstance.hooks.hook("prerender:done", () => {
|
|
14684
14783
|
if (skippedNonHtmlPrerenderRoute) nitroInstance.routing.sync();
|
|
14685
14784
|
});
|
|
14686
|
-
if (_optionalChain([config, 'access',
|
|
14785
|
+
if (_optionalChain([config, 'access', _330 => _330.md, 'optionalAccess', _331 => _331.enabled])) {
|
|
14687
14786
|
nitroInstance.hooks.hook("prerender:generate", (route) => {
|
|
14688
|
-
if (!route.contents || !_optionalChain([route, 'access',
|
|
14787
|
+
if (!route.contents || !_optionalChain([route, 'access', _332 => _332.contentType, 'optionalAccess', _333 => _333.toLowerCase, 'call', _334 => _334(), 'access', _335 => _335.includes, 'call', _336 => _336("html")])) return;
|
|
14689
14788
|
const alternatePath = _chunk2NOHVIJ3cjs.getFarmMarkdownAlternatePath.call(void 0, config.md, route.route, {
|
|
14690
14789
|
routePathname: (pathname) => routeManager.toRoutePathname(pathname)
|
|
14691
14790
|
});
|
|
@@ -14708,7 +14807,7 @@ function toFarmNodeResponse(request, response) {
|
|
|
14708
14807
|
}
|
|
14709
14808
|
if (config.security.csp && config.security.csp.nonce) {
|
|
14710
14809
|
nitroInstance.hooks.hook("prerender:generate", async (route) => {
|
|
14711
|
-
if (!route.contents || !_optionalChain([route, 'access',
|
|
14810
|
+
if (!route.contents || !_optionalChain([route, 'access', _337 => _337.contentType, 'optionalAccess', _338 => _338.toLowerCase, 'call', _339 => _339(), 'access', _340 => _340.includes, 'call', _341 => _341("html")])) return;
|
|
14712
14811
|
const staticCsp = await _chunk6JHZPB52cjs.applyFarmCspHashesToHtml.call(void 0, route.contents, config.security);
|
|
14713
14812
|
if (!staticCsp) return;
|
|
14714
14813
|
route.contents = staticCsp.html;
|
|
@@ -14744,7 +14843,7 @@ function toFarmNodeResponse(request, response) {
|
|
|
14744
14843
|
await nitroBuilder.copyPublicAssets(nitroInstance);
|
|
14745
14844
|
if (prerenderReusesPrebuiltSSR && !canReusePrebuiltSSR) {
|
|
14746
14845
|
nitroInstance.hooks.hook("prerender:config", (prerendererConfig) => {
|
|
14747
|
-
const configuredPlugins = _optionalChain([prerendererConfig, 'access',
|
|
14846
|
+
const configuredPlugins = _optionalChain([prerendererConfig, 'access', _342 => _342.rollupConfig, 'optionalAccess', _343 => _343.plugins]);
|
|
14748
14847
|
const plugins = Array.isArray(configuredPlugins) ? configuredPlugins : configuredPlugins ? [configuredPlugins] : [];
|
|
14749
14848
|
prerendererConfig.rollupConfig = {
|
|
14750
14849
|
...prerendererConfig.rollupConfig,
|
|
@@ -14801,13 +14900,13 @@ function toFarmNodeResponse(request, response) {
|
|
|
14801
14900
|
}
|
|
14802
14901
|
if (prerenderRoutes.length > 0) {
|
|
14803
14902
|
_chunk7U4XF76Rcjs.logger.info(`\u{1F4C4} Pre-rendering ${prerenderRoutes.length} SSG page(s)`);
|
|
14804
|
-
const previousPrerender = process.env[
|
|
14805
|
-
process.env[
|
|
14903
|
+
const previousPrerender = process.env[_chunkRVJQHQCGcjs.FARM_PRERENDER_ENV];
|
|
14904
|
+
process.env[_chunkRVJQHQCGcjs.FARM_PRERENDER_ENV] = "1";
|
|
14806
14905
|
try {
|
|
14807
14906
|
await nitroBuilder.prerender(nitroInstance);
|
|
14808
14907
|
} finally {
|
|
14809
|
-
if (previousPrerender === void 0) delete process.env[
|
|
14810
|
-
else process.env[
|
|
14908
|
+
if (previousPrerender === void 0) delete process.env[_chunkRVJQHQCGcjs.FARM_PRERENDER_ENV];
|
|
14909
|
+
else process.env[_chunkRVJQHQCGcjs.FARM_PRERENDER_ENV] = previousPrerender;
|
|
14811
14910
|
}
|
|
14812
14911
|
}
|
|
14813
14912
|
const sharpRuntimeStagePromise = imageRuntime === "node" ? stageSharpRuntime(config, root, distDir, fs5, preset) : Promise.resolve(null);
|
|
@@ -14984,7 +15083,7 @@ async function moveVercelOutputPath(src, dest, fs5) {
|
|
|
14984
15083
|
await fs5.rename(src, dest);
|
|
14985
15084
|
return;
|
|
14986
15085
|
} catch (error) {
|
|
14987
|
-
const code = _optionalChain([error, 'optionalAccess',
|
|
15086
|
+
const code = _optionalChain([error, 'optionalAccess', _344 => _344.code]);
|
|
14988
15087
|
if (code !== "EPERM" && code !== "EACCES" && code !== "EXDEV" && code !== "ENOTEMPTY") {
|
|
14989
15088
|
throw error;
|
|
14990
15089
|
}
|
|
@@ -15010,7 +15109,7 @@ async function postProcessVercelOutput(root, outputDir, fs5, config, farmWorkflo
|
|
|
15010
15109
|
try {
|
|
15011
15110
|
await moveVercelOutputPath(publicDir, staticDir, fs5);
|
|
15012
15111
|
} catch (error) {
|
|
15013
|
-
if (_optionalChain([error, 'optionalAccess',
|
|
15112
|
+
if (_optionalChain([error, 'optionalAccess', _345 => _345.code]) !== "ENOENT") throw error;
|
|
15014
15113
|
}
|
|
15015
15114
|
await copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs5);
|
|
15016
15115
|
await copyPrismaClientForVercel(root, nitroFuncDir, fs5);
|
|
@@ -15024,7 +15123,7 @@ async function postProcessVercelOutput(root, outputDir, fs5, config, farmWorkflo
|
|
|
15024
15123
|
config.basePath
|
|
15025
15124
|
);
|
|
15026
15125
|
const edgeMiddlewareRoutes = edgeMiddleware.middlewareRoutes.filter(
|
|
15027
|
-
(route) => edgeMiddleware.guardedPages.some((pathname) =>
|
|
15126
|
+
(route) => edgeMiddleware.guardedPages.some((pathname) => _chunk4B6YJ5DScjs.appMiddlewareMayHandlePath.call(void 0, [route], pathname))
|
|
15028
15127
|
);
|
|
15029
15128
|
if (edgeMiddlewareRoutes.length > 0) {
|
|
15030
15129
|
await writeFarmVercelEdgeMiddlewareFunction({
|
|
@@ -15052,7 +15151,7 @@ async function postProcessVercelOutput(root, outputDir, fs5, config, farmWorkflo
|
|
|
15052
15151
|
_chunk7U4XF76Rcjs.logger.info("\u2705 Post-processed Vercel output for Build Output API v3");
|
|
15053
15152
|
}
|
|
15054
15153
|
async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs5) {
|
|
15055
|
-
if (!_optionalChain([config, 'access',
|
|
15154
|
+
if (!_optionalChain([config, 'access', _346 => _346.docs, 'optionalAccess', _347 => _347.enabled])) return;
|
|
15056
15155
|
const [mainRoot, ...extraRoots] = _chunkHR5GU4UUcjs.getFarmDocsRoots.call(void 0, config.docs);
|
|
15057
15156
|
await copyFarmDocsRootContent(
|
|
15058
15157
|
mainRoot,
|
|
@@ -15077,7 +15176,7 @@ async function copyFarmDocsRootContent(docs, root, srcDir, bundledContentDir, fs
|
|
|
15077
15176
|
const lastModifiedManifest = _chunkHR5GU4UUcjs.createFarmDocsLastModifiedManifest.call(void 0, docsContentDir, {
|
|
15078
15177
|
fallback: "now"
|
|
15079
15178
|
});
|
|
15080
|
-
const undatedPages = _nullishCoalesce(_optionalChain([lastModifiedManifest, 'access',
|
|
15179
|
+
const undatedPages = _nullishCoalesce(_optionalChain([lastModifiedManifest, 'access', _348 => _348.unknown, 'optionalAccess', _349 => _349.length]), () => ( 0));
|
|
15081
15180
|
if (undatedPages > 0) {
|
|
15082
15181
|
_chunk7U4XF76Rcjs.logger.warn(
|
|
15083
15182
|
`${undatedPages} docs page(s) were last changed before this shallow clone's Git history, so they show no "Last updated" date. Build from a full clone (git fetch --unshallow) or set lastModified in the page's frontmatter.`
|
|
@@ -15162,7 +15261,7 @@ async function stageSharpRuntime(config, root, distDir, fs5, preset) {
|
|
|
15162
15261
|
try {
|
|
15163
15262
|
await copyPackage("sharp", sharpRequire);
|
|
15164
15263
|
if (!copiedPackages.has("sharp")) {
|
|
15165
|
-
throw new Error(`Farm image optimization requires sharp. ${
|
|
15264
|
+
throw new Error(`Farm image optimization requires sharp. ${_chunkH6C45DCFcjs.SHARP_INSTALL_HINT}`);
|
|
15166
15265
|
}
|
|
15167
15266
|
} catch (error) {
|
|
15168
15267
|
await fs5.rm(stageDir, { recursive: true, force: true });
|
|
@@ -15395,7 +15494,7 @@ async function createFarmProjectModuleSsrEnvironment() {
|
|
|
15395
15494
|
// src/build/index.ts
|
|
15396
15495
|
async function build(config, options = {}) {
|
|
15397
15496
|
return _chunkNG2EZ6QScjs.withProductionNodeEnv.call(void 0,
|
|
15398
|
-
() =>
|
|
15497
|
+
() => _chunkOYM6VJEFcjs.withPackageClientBoundaryCache.call(void 0, () => buildWithProductionNodeEnv(config, options))
|
|
15399
15498
|
);
|
|
15400
15499
|
}
|
|
15401
15500
|
function createBuildTargetBaseline(config) {
|
|
@@ -15406,7 +15505,7 @@ function createBuildTargetBaseline(config) {
|
|
|
15406
15505
|
preset,
|
|
15407
15506
|
distDir,
|
|
15408
15507
|
outputDir,
|
|
15409
|
-
outputWasDerived: outputDir ===
|
|
15508
|
+
outputWasDerived: outputDir === _chunkBBX4RPOVcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
|
|
15410
15509
|
};
|
|
15411
15510
|
}
|
|
15412
15511
|
function resolveBuildTargets(config, options, baseline) {
|
|
@@ -15415,8 +15514,8 @@ function resolveBuildTargets(config, options, baseline) {
|
|
|
15415
15514
|
const distDir = config.distDir || ".farm";
|
|
15416
15515
|
const outputWasReplaced = config.deploy.outputDir !== baseline.outputDir;
|
|
15417
15516
|
const shouldRefreshDerivedOutput = baseline.outputWasDerived && !outputWasReplaced && (preset !== baseline.preset || distDir !== baseline.distDir);
|
|
15418
|
-
const deployTarget = preset === config.deploy.preset ? config.deploy.target :
|
|
15419
|
-
const outputDir = shouldRefreshDerivedOutput ?
|
|
15517
|
+
const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkBBX4RPOVcjs.getDeployTargetForPreset.call(void 0, preset);
|
|
15518
|
+
const outputDir = shouldRefreshDerivedOutput ? _chunkBBX4RPOVcjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
|
|
15420
15519
|
return {
|
|
15421
15520
|
root,
|
|
15422
15521
|
preset,
|
|
@@ -15424,7 +15523,7 @@ function resolveBuildTargets(config, options, baseline) {
|
|
|
15424
15523
|
distDir,
|
|
15425
15524
|
deployTarget,
|
|
15426
15525
|
outputDir,
|
|
15427
|
-
deployOutputDir:
|
|
15526
|
+
deployOutputDir: _chunkBBX4RPOVcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
|
|
15428
15527
|
};
|
|
15429
15528
|
}
|
|
15430
15529
|
async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
@@ -15461,15 +15560,15 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
15461
15560
|
};
|
|
15462
15561
|
config = {
|
|
15463
15562
|
...config,
|
|
15464
|
-
images:
|
|
15563
|
+
images: _chunkH6C45DCFcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
|
|
15465
15564
|
root: targets.root,
|
|
15466
15565
|
preset: targets.preset
|
|
15467
15566
|
})
|
|
15468
15567
|
};
|
|
15469
|
-
if (_optionalChain([config, 'access',
|
|
15568
|
+
if (_optionalChain([config, 'access', _350 => _350.docs, 'optionalAccess', _351 => _351.enabled])) await _chunkNDOE76QCcjs.loadFarmDocsEngine.call(void 0, );
|
|
15470
15569
|
pluginManager.updateContext({ config });
|
|
15471
15570
|
const { root, preset, srcDir, distDir, deployOutputDir } = targets;
|
|
15472
|
-
|
|
15571
|
+
_chunkOYM6VJEFcjs.usePackageClientBoundaryCacheFile.call(void 0, _chunkOYM6VJEFcjs.resolvePackageClientBoundaryCacheFile.call(void 0, root, distDir));
|
|
15473
15572
|
_chunk7U4XF76Rcjs.logger.info(`\u{1F69C} Building Farm.js application with preset: ${preset}...`);
|
|
15474
15573
|
await pluginManager.setupPlugins();
|
|
15475
15574
|
await pluginManager.runHookParallel("beforeBundle", {
|
|
@@ -15481,8 +15580,8 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
15481
15580
|
});
|
|
15482
15581
|
_chunk7U4XF76Rcjs.logger.info("\u{1F50D} Discovering routes and API endpoints...");
|
|
15483
15582
|
const productionViteResult = productionViteResultPromise ? (await productionViteResultPromise)[0] : void 0;
|
|
15484
|
-
if (_optionalChain([productionViteResult, 'optionalAccess',
|
|
15485
|
-
const productionVite = _optionalChain([productionViteResult, 'optionalAccess',
|
|
15583
|
+
if (_optionalChain([productionViteResult, 'optionalAccess', _352 => _352.status]) === "rejected") throw productionViteResult.reason;
|
|
15584
|
+
const productionVite = _optionalChain([productionViteResult, 'optionalAccess', _353 => _353.value]);
|
|
15486
15585
|
const createViteServer = productionVite ? productionVite.createServer : (await import("vite")).createServer;
|
|
15487
15586
|
projectModuleServer = await createProjectModuleServer(
|
|
15488
15587
|
createViteServer,
|
|
@@ -15490,19 +15589,19 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
15490
15589
|
root,
|
|
15491
15590
|
rendererBuild.signal
|
|
15492
15591
|
);
|
|
15493
|
-
const farmApp =
|
|
15592
|
+
const farmApp = _chunkH6C45DCFcjs.createFarmApp.call(void 0, config, projectModuleServer);
|
|
15494
15593
|
if (options.universal !== false) farmApp.getRouteManager().keepBuildSourceSnapshot();
|
|
15495
15594
|
await farmApp.initialize();
|
|
15496
15595
|
const routeManager = farmApp.getRouteManager();
|
|
15497
15596
|
const serverRenderer = farmApp.getServerRenderer();
|
|
15498
|
-
const typeArtifacts =
|
|
15597
|
+
const typeArtifacts = _chunkL3BSHASBcjs.generateFarmTypeArtifacts.call(void 0, {
|
|
15499
15598
|
root,
|
|
15500
15599
|
srcDir,
|
|
15501
15600
|
layers: config.layers,
|
|
15502
15601
|
storage: config.storage,
|
|
15503
15602
|
plugins: config.plugins,
|
|
15504
15603
|
extraRoutes: [
|
|
15505
|
-
..._optionalChain([config, 'access',
|
|
15604
|
+
..._optionalChain([config, 'access', _354 => _354.openapi, 'optionalAccess', _355 => _355.enabled]) && config.openapi.route ? [config.openapi.route] : [],
|
|
15506
15605
|
..._chunkHR5GU4UUcjs.getFarmDocsRouteTypeEntries.call(void 0, config.docs)
|
|
15507
15606
|
],
|
|
15508
15607
|
suppressLintOnLink: config.suppressLintOnLink,
|
|
@@ -15588,7 +15687,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
15588
15687
|
throw error;
|
|
15589
15688
|
} finally {
|
|
15590
15689
|
try {
|
|
15591
|
-
await _optionalChain([projectModuleServer, 'optionalAccess',
|
|
15690
|
+
await _optionalChain([projectModuleServer, 'optionalAccess', _356 => _356.close, 'call', _357 => _357()]);
|
|
15592
15691
|
} finally {
|
|
15593
15692
|
rendererBuild.abort();
|
|
15594
15693
|
}
|
|
@@ -15596,11 +15695,11 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
15596
15695
|
}
|
|
15597
15696
|
async function createProjectModuleServer(createViteServer, config, root, buildLifetime) {
|
|
15598
15697
|
const { farmNavigationPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
|
|
15599
|
-
const rendererVitePlugins = await
|
|
15698
|
+
const rendererVitePlugins = await _chunk3OKSEJ33cjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, root, {
|
|
15600
15699
|
ssr: true,
|
|
15601
15700
|
buildLifetime
|
|
15602
15701
|
});
|
|
15603
|
-
const viteConfig =
|
|
15702
|
+
const viteConfig = _chunkH6C45DCFcjs.mergeFarmViteConfig.call(void 0,
|
|
15604
15703
|
{
|
|
15605
15704
|
root,
|
|
15606
15705
|
appType: "custom",
|
|
@@ -15612,12 +15711,12 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
15612
15711
|
},
|
|
15613
15712
|
plugins: [
|
|
15614
15713
|
...rendererVitePlugins,
|
|
15615
|
-
|
|
15714
|
+
_chunkH6C45DCFcjs.farmFontImportsPlugin.call(void 0, {
|
|
15616
15715
|
root,
|
|
15617
15716
|
basePath: config.basePath,
|
|
15618
15717
|
publicDir: config.publicDir
|
|
15619
15718
|
}),
|
|
15620
|
-
|
|
15719
|
+
_chunkOYM6VJEFcjs.farmEnvironmentFunctionsPlugin.call(void 0, { renderer: config.renderer }),
|
|
15621
15720
|
// Route modules load here at build time (rendering config, prerendering): `server-only`
|
|
15622
15721
|
// resolves as it does in the server build. Module-entry packages load pre-bundled, as in
|
|
15623
15722
|
// `farm dev`: unbundled, lucide-react alone is ~1,750 modules through the module runner,
|
|
@@ -15633,7 +15732,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
15633
15732
|
hmr: false
|
|
15634
15733
|
},
|
|
15635
15734
|
resolve: {
|
|
15636
|
-
alias:
|
|
15735
|
+
alias: _chunkH6C45DCFcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
15637
15736
|
dedupe: [...config.renderer.dedupe || []]
|
|
15638
15737
|
},
|
|
15639
15738
|
optimizeDeps: {
|
|
@@ -15672,10 +15771,10 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
15672
15771
|
noDiscovery: true
|
|
15673
15772
|
},
|
|
15674
15773
|
// An app or plugin that brings its own SSR environment keeps it.
|
|
15675
|
-
environments: _optionalChain([viteConfig, 'access',
|
|
15774
|
+
environments: _optionalChain([viteConfig, 'access', _358 => _358.environments, 'optionalAccess', _359 => _359.ssr, 'optionalAccess', _360 => _360.dev, 'optionalAccess', _361 => _361.createEnvironment]) ? viteConfig.environments : {
|
|
15676
15775
|
...viteConfig.environments,
|
|
15677
15776
|
ssr: {
|
|
15678
|
-
..._optionalChain([viteConfig, 'access',
|
|
15777
|
+
..._optionalChain([viteConfig, 'access', _362 => _362.environments, 'optionalAccess', _363 => _363.ssr]),
|
|
15679
15778
|
...await createFarmProjectModuleSsrEnvironment()
|
|
15680
15779
|
}
|
|
15681
15780
|
}
|
|
@@ -15711,7 +15810,7 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
|
|
|
15711
15810
|
farmNavigationPlugin(config.renderer),
|
|
15712
15811
|
farmIslandContainersPlugin(config),
|
|
15713
15812
|
farmPlugin(config, pluginManager),
|
|
15714
|
-
|
|
15813
|
+
_chunkOYM6VJEFcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
|
|
15715
15814
|
],
|
|
15716
15815
|
mode: "production"
|
|
15717
15816
|
});
|
|
@@ -15739,20 +15838,20 @@ async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
|
|
|
15739
15838
|
define: {
|
|
15740
15839
|
__FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
|
|
15741
15840
|
__FARM_ENV__: JSON.stringify(_chunk3EIPOTZVcjs.createBundledEnv.call(void 0, config.env)),
|
|
15742
|
-
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access',
|
|
15841
|
+
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _364 => _364.env, 'optionalAccess', _365 => _365.public]) || {})
|
|
15743
15842
|
},
|
|
15744
15843
|
plugins: [
|
|
15745
15844
|
farmI18nClientBridgePlugin(),
|
|
15746
15845
|
farmIslandContainersPlugin(config),
|
|
15747
15846
|
farmPlugin(config, pluginManager),
|
|
15748
|
-
|
|
15847
|
+
_chunkOYM6VJEFcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
|
|
15749
15848
|
],
|
|
15750
15849
|
mode: "production"
|
|
15751
15850
|
});
|
|
15752
15851
|
}
|
|
15753
15852
|
function resolveLegacyPageEntry(config, root, srcDir) {
|
|
15754
15853
|
const appDir = _path2.default.join(root, srcDir, "app");
|
|
15755
|
-
for (const extension of
|
|
15854
|
+
for (const extension of _chunk3OKSEJ33cjs.getFarmRendererComponentExtensions.call(void 0, config.renderer)) {
|
|
15756
15855
|
const candidate = _path2.default.join(appDir, `page${extension}`);
|
|
15757
15856
|
if (_fs.existsSync.call(void 0, candidate)) return candidate;
|
|
15758
15857
|
}
|
|
@@ -15773,7 +15872,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
15773
15872
|
if (pluginManager) {
|
|
15774
15873
|
nitroConfig = await pluginManager.runHookSerial("beforeNitroBuild", nitroConfig);
|
|
15775
15874
|
}
|
|
15776
|
-
const outputDir =
|
|
15875
|
+
const outputDir = _chunkBBX4RPOVcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
15777
15876
|
const serverOutputDir = _path2.default.join(outputDir, "server");
|
|
15778
15877
|
const publicOutputDir = _path2.default.join(outputDir, "public");
|
|
15779
15878
|
const { mkdir, cp } = await import("fs/promises");
|
|
@@ -15844,7 +15943,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
15844
15943
|
root,
|
|
15845
15944
|
preset,
|
|
15846
15945
|
distDir,
|
|
15847
|
-
outputDir:
|
|
15946
|
+
outputDir: _chunkBBX4RPOVcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
|
|
15848
15947
|
});
|
|
15849
15948
|
}
|
|
15850
15949
|
}
|