@farm.js/core 0.1.23 → 0.1.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/api/route-manager.cjs +4 -4
- package/dist/api/route-manager.d.mts +1 -1
- package/dist/api/route-manager.d.ts +1 -1
- package/dist/api/route-manager.mjs +3 -3
- package/dist/api/runtime.cjs +3 -3
- package/dist/api/runtime.mjs +2 -2
- package/dist/api.cjs +7 -7
- package/dist/api.d.mts +2 -2
- package/dist/api.d.ts +2 -2
- package/dist/api.mjs +6 -6
- package/dist/{app-BV-7wV5q.d.ts → app-BF-ctoxh.d.ts} +3 -3
- package/dist/{app-BZDWwwFa.d.mts → app-ZuWrAMc_.d.mts} +3 -3
- package/dist/app-markdown.cjs +4 -4
- package/dist/app-markdown.d.mts +2 -2
- package/dist/app-markdown.d.ts +2 -2
- package/dist/app-markdown.mjs +3 -3
- package/dist/{chunk-MVUREHPN.mjs → chunk-2BIJGZR3.mjs} +1 -1
- package/dist/chunk-2ITKVAIF.cjs +1077 -0
- package/dist/{chunk-47H7VENP.mjs → chunk-2KI3CL3N.mjs} +1 -1
- package/dist/{chunk-KNPRCKXK.cjs → chunk-3TQWUUNP.cjs} +9 -7
- package/dist/{chunk-GZ3ZPTQV.mjs → chunk-52SH7TKB.mjs} +2 -2
- package/dist/{chunk-BDJNP7AQ.mjs → chunk-5YYJ6Q2L.mjs} +10 -3
- package/dist/{chunk-OYDRPBBV.cjs → chunk-65P6OGYN.cjs} +73 -3
- package/dist/{chunk-JIKGGIOL.mjs → chunk-6D242YGO.mjs} +1 -1
- package/dist/{chunk-AH7HOAQ3.cjs → chunk-6K4SPQWL.cjs} +9 -4
- package/dist/{chunk-LYM7HY34.cjs → chunk-AXYTGLF3.cjs} +4 -4
- package/dist/{chunk-2QLBIPFT.cjs → chunk-B6ZCT36X.cjs} +4 -4
- package/dist/{chunk-IMBMOEWT.cjs → chunk-BD2U4ZL6.cjs} +8 -8
- package/dist/{chunk-2M435BUE.mjs → chunk-CEYUWDWA.mjs} +7 -5
- package/dist/{chunk-I5YBCWQ6.cjs → chunk-CFNOGDUS.cjs} +2 -2
- package/dist/{chunk-XI3GWPUS.cjs → chunk-CRQPYWLK.cjs} +14 -14
- package/dist/{chunk-ISTFC3MZ.cjs → chunk-E3RDL2DA.cjs} +48 -5
- package/dist/{chunk-QTBEAKCJ.cjs → chunk-H7CJRJ4L.cjs} +16 -16
- package/dist/{chunk-VPY755R2.mjs → chunk-N2Z4ZFDE.mjs} +25 -11
- package/dist/{chunk-DNLQMFER.cjs → chunk-O5DVPF3R.cjs} +26 -19
- package/dist/{chunk-WNUBR4CA.mjs → chunk-QGG336NI.mjs} +1 -1
- package/dist/{chunk-4DKZ6JR3.cjs → chunk-QYMRIVG6.cjs} +184 -130
- package/dist/{chunk-III667SJ.cjs → chunk-R7LCG3BT.cjs} +189 -175
- package/dist/{chunk-7BC6GAL7.mjs → chunk-RR6UGYUT.mjs} +44 -1
- package/dist/{chunk-LQIRVSBY.cjs → chunk-RYDW7GPR.cjs} +13 -13
- package/dist/{chunk-PGQBL5DN.mjs → chunk-T2OPSH6S.mjs} +72 -2
- package/dist/{chunk-5UX4C5QI.mjs → chunk-TKDY6AJP.mjs} +1 -1
- package/dist/{chunk-VXCA7RZP.cjs → chunk-TTVHACQV.cjs} +1 -1
- package/dist/{chunk-OFEY6KHO.mjs → chunk-U4MP7XTD.mjs} +504 -27
- package/dist/{chunk-YJJLXIIS.cjs → chunk-U74A3P2P.cjs} +7 -7
- package/dist/{chunk-72VJRKJD.mjs → chunk-VZWO3XVL.mjs} +2 -2
- package/dist/{chunk-7LU4IOXQ.mjs → chunk-WJYCI56T.mjs} +87 -33
- package/dist/{chunk-EHUZ2MKO.mjs → chunk-WOI2HOGA.mjs} +1 -1
- package/dist/{chunk-N255VYFP.mjs → chunk-XM4ZDVD7.mjs} +8 -3
- package/dist/{chunk-YGMK6ESJ.mjs → chunk-XME4TCLB.mjs} +2 -2
- package/dist/{client-plugins-B_XzCegf.d.mts → client-plugins-DPG0NeZN.d.mts} +41 -3
- package/dist/{client-plugins-CKsXQfXY.d.ts → client-plugins-Fgni-_25.d.ts} +41 -3
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client.cjs +4 -4
- package/dist/client.d.mts +5 -5
- package/dist/client.d.ts +5 -5
- package/dist/client.mjs +3 -3
- package/dist/config.d.mts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/{devtools-UHRSZ7VA.cjs → devtools-6OA7FEF6.cjs} +4 -4
- package/dist/{devtools-OY4SNU3P.mjs → devtools-I7TBFOKD.mjs} +3 -3
- package/dist/docs.cjs +6 -6
- package/dist/docs.mjs +5 -5
- package/dist/index.cjs +24 -22
- package/dist/index.d.mts +13 -13
- package/dist/index.d.ts +13 -13
- package/dist/index.mjs +23 -21
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/internal/app-markdown-runtime.cjs +3 -3
- package/dist/internal/app-markdown-runtime.d.mts +1 -1
- package/dist/internal/app-markdown-runtime.d.ts +1 -1
- package/dist/internal/app-markdown-runtime.mjs +2 -2
- package/dist/internal/build-runtime.cjs +16 -16
- package/dist/internal/build-runtime.d.mts +3 -3
- package/dist/internal/build-runtime.d.ts +3 -3
- package/dist/internal/build-runtime.mjs +15 -15
- package/dist/internal/cli-runtime.cjs +5 -5
- package/dist/internal/cli-runtime.mjs +4 -4
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/compression-runtime.d.mts +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/config-runtime.cjs +4 -4
- package/dist/internal/config-runtime.d.mts +2 -2
- package/dist/internal/config-runtime.d.ts +2 -2
- package/dist/internal/config-runtime.mjs +3 -3
- package/dist/internal/product-telemetry-runtime.cjs +2 -2
- package/dist/internal/product-telemetry-runtime.mjs +1 -1
- package/dist/internal/production-runtime.cjs +11 -5
- package/dist/internal/production-runtime.d.mts +30 -8
- package/dist/internal/production-runtime.d.ts +30 -8
- package/dist/internal/production-runtime.mjs +10 -4
- package/dist/markdown.cjs +4 -2
- package/dist/markdown.d.mts +63 -1
- package/dist/markdown.d.ts +63 -1
- package/dist/markdown.mjs +3 -1
- package/dist/{metadata-IQEblkZp.d.ts → metadata-CDnRHKVq.d.ts} +1 -1
- package/dist/{metadata-B08w4EYV.d.mts → metadata-D0EF7esB.d.mts} +1 -1
- package/dist/middleware.d.mts +3 -3
- package/dist/middleware.d.ts +3 -3
- package/dist/navigation.cjs +5 -5
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/navigation.mjs +4 -4
- package/dist/plugin.cjs +12 -12
- package/dist/plugin.d.mts +1 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.mjs +11 -11
- package/dist/{production-runtime-DRSOkc-d.d.ts → production-runtime-DpCt0opU.d.ts} +1 -1
- package/dist/{production-runtime-C3bGFEaM.d.mts → production-runtime-x3W4wVqx.d.mts} +1 -1
- package/dist/query/client.cjs +6 -6
- package/dist/query/client.mjs +2 -2
- package/dist/{render-plan-CCFuMLNS.d.ts → render-plan-D5oFRVBV.d.ts} +1 -1
- package/dist/{render-plan-B6CKNl4e.d.mts → render-plan-tazUJalK.d.mts} +1 -1
- package/dist/renderer-client.cjs +5 -5
- package/dist/renderer-client.d.mts +3 -3
- package/dist/renderer-client.d.ts +3 -3
- package/dist/renderer-client.mjs +2 -2
- package/dist/{request-DgD1XsTx.d.mts → request-CXmQy5ks.d.mts} +1 -1
- package/dist/{request-Dn6VURbE.d.ts → request-CzZX0Aew.d.ts} +1 -1
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/{route-rendering-76A5I_kE.d.mts → route-rendering-B-qpe32B.d.mts} +1 -1
- package/dist/{route-rendering-LAmQEdyG.d.ts → route-rendering-Dw3C362T.d.ts} +1 -1
- package/dist/{router-BSOOGya2.d.ts → router-CLl3xHwl.d.ts} +1 -1
- package/dist/{router-CnrRSa9d.d.mts → router-CafM2jlw.d.mts} +1 -1
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/server-plugins.d.mts +2 -2
- package/dist/server-plugins.d.ts +2 -2
- package/dist/server.cjs +27 -27
- package/dist/server.d.mts +7 -7
- package/dist/server.d.ts +7 -7
- package/dist/server.mjs +12 -12
- package/dist/{spa-router-DnYhWCvI.d.mts → spa-router-6sJfsMlQ.d.mts} +2 -2
- package/dist/{spa-router-BMrSsG5b.d.ts → spa-router-DePr2aZ6.d.ts} +2 -2
- package/dist/testing.cjs +4 -4
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.mjs +3 -3
- package/dist/{utils-C3GguS-Q.d.ts → utils-BBKC3cf3.d.ts} +1 -1
- package/dist/{utils-ABkktwku.d.mts → utils-BPHr-1mP.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +12 -12
- package/dist/vite.d.mts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.mjs +11 -11
- package/package.json +1 -1
- package/dist/chunk-BBVSJVBZ.cjs +0 -600
- package/dist/{chunk-XP777LRD.mjs → chunk-GDUYXFIS.mjs} +3 -3
- package/dist/{chunk-4PNUXIVU.cjs → chunk-YAOX43YI.cjs} +3 -3
|
@@ -7,7 +7,7 @@ var _chunkMT763TDWcjs = require('./chunk-MT763TDW.cjs');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkRYDW7GPRcjs = require('./chunk-RYDW7GPR.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
@@ -17,7 +17,7 @@ var _chunkLQIRVSBYcjs = require('./chunk-LQIRVSBY.cjs');
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunkAXYTGLF3cjs = require('./chunk-AXYTGLF3.cjs');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
@@ -34,7 +34,7 @@ var _chunkIK6LVLKCcjs = require('./chunk-IK6LVLKC.cjs');
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
var
|
|
37
|
+
var _chunkO5DVPF3Rcjs = require('./chunk-O5DVPF3R.cjs');
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
var _chunkKCMTCM6Icjs = require('./chunk-KCMTCM6I.cjs');
|
|
@@ -69,7 +69,7 @@ var _chunk2SJ4RQ6Pcjs = require('./chunk-2SJ4RQ6P.cjs');
|
|
|
69
69
|
|
|
70
70
|
|
|
71
71
|
|
|
72
|
-
var
|
|
72
|
+
var _chunkR7LCG3BTcjs = require('./chunk-R7LCG3BT.cjs');
|
|
73
73
|
|
|
74
74
|
|
|
75
75
|
|
|
@@ -78,6 +78,10 @@ var _chunkIII667SJcjs = require('./chunk-III667SJ.cjs');
|
|
|
78
78
|
var _chunkDW34V5SMcjs = require('./chunk-DW34V5SM.cjs');
|
|
79
79
|
|
|
80
80
|
|
|
81
|
+
|
|
82
|
+
var _chunk65P6OGYNcjs = require('./chunk-65P6OGYN.cjs');
|
|
83
|
+
|
|
84
|
+
|
|
81
85
|
var _chunkCXP5U3RWcjs = require('./chunk-CXP5U3RW.cjs');
|
|
82
86
|
|
|
83
87
|
|
|
@@ -107,7 +111,7 @@ var _chunkVPTDD5XFcjs = require('./chunk-VPTDD5XF.cjs');
|
|
|
107
111
|
var _chunkPSV6XKPOcjs = require('./chunk-PSV6XKPO.cjs');
|
|
108
112
|
|
|
109
113
|
|
|
110
|
-
var
|
|
114
|
+
var _chunkE3RDL2DAcjs = require('./chunk-E3RDL2DA.cjs');
|
|
111
115
|
|
|
112
116
|
|
|
113
117
|
|
|
@@ -119,13 +123,16 @@ var _chunk6EXBPJ24cjs = require('./chunk-6EXBPJ24.cjs');
|
|
|
119
123
|
var _chunkVEKFLAQMcjs = require('./chunk-VEKFLAQM.cjs');
|
|
120
124
|
|
|
121
125
|
|
|
122
|
-
var
|
|
126
|
+
var _chunk6K4SPQWLcjs = require('./chunk-6K4SPQWL.cjs');
|
|
123
127
|
|
|
124
128
|
|
|
125
129
|
|
|
126
130
|
var _chunkOHY2ZWUGcjs = require('./chunk-OHY2ZWUG.cjs');
|
|
127
131
|
|
|
128
132
|
|
|
133
|
+
var _chunk2ITKVAIFcjs = require('./chunk-2ITKVAIF.cjs');
|
|
134
|
+
|
|
135
|
+
|
|
129
136
|
|
|
130
137
|
var _chunkMPEYMSCFcjs = require('./chunk-MPEYMSCF.cjs');
|
|
131
138
|
|
|
@@ -137,7 +144,7 @@ var _chunkZ5HIWVDPcjs = require('./chunk-Z5HIWVDP.cjs');
|
|
|
137
144
|
var _chunkWM6HL7E7cjs = require('./chunk-WM6HL7E7.cjs');
|
|
138
145
|
|
|
139
146
|
|
|
140
|
-
var
|
|
147
|
+
var _chunkBD2U4ZL6cjs = require('./chunk-BD2U4ZL6.cjs');
|
|
141
148
|
|
|
142
149
|
|
|
143
150
|
var _chunkIQXFRNY2cjs = require('./chunk-IQXFRNY2.cjs');
|
|
@@ -271,7 +278,7 @@ function getDocsTitle(docs) {
|
|
|
271
278
|
}
|
|
272
279
|
_chunkS3JO3N4Hcjs.__name.call(void 0, getDocsTitle, "getDocsTitle");
|
|
273
280
|
function loadPages(contentDir, docs) {
|
|
274
|
-
return
|
|
281
|
+
return _chunkAXYTGLF3cjs.discoverFarmDocsPages.call(void 0, contentDir, docs).map((page) => _chunkAXYTGLF3cjs.loadFarmDocsPage.call(void 0, contentDir, docs, page.slug)).filter((page) => Boolean(page)).sort((a, b) => a.href.localeCompare(b.href));
|
|
275
282
|
}
|
|
276
283
|
_chunkS3JO3N4Hcjs.__name.call(void 0, loadPages, "loadPages");
|
|
277
284
|
function findSocialImagePath(html) {
|
|
@@ -292,14 +299,14 @@ async function addHandlerRoute(routes, pathname, handler, absolutePaths) {
|
|
|
292
299
|
}
|
|
293
300
|
_chunkS3JO3N4Hcjs.__name.call(void 0, addHandlerRoute, "addHandlerRoute");
|
|
294
301
|
async function compileFarmDocsManifest(docs, options) {
|
|
295
|
-
const contentDir =
|
|
302
|
+
const contentDir = _chunkAXYTGLF3cjs.resolveFarmDocsContentDir.call(void 0, docs, options);
|
|
296
303
|
const pages = loadPages(contentDir, docs);
|
|
297
304
|
const absolutePaths = [
|
|
298
305
|
_path2.default.resolve(options.root),
|
|
299
306
|
_path2.default.resolve(contentDir),
|
|
300
307
|
docs.configPath || ""
|
|
301
308
|
];
|
|
302
|
-
const handler =
|
|
309
|
+
const handler = _chunkAXYTGLF3cjs.createFarmDocsHandler.call(void 0, docs, {
|
|
303
310
|
root: options.root,
|
|
304
311
|
srcDir: options.srcDir,
|
|
305
312
|
clientEntry: options.clientEntry,
|
|
@@ -307,7 +314,7 @@ async function compileFarmDocsManifest(docs, options) {
|
|
|
307
314
|
fontStylesheetHref: options.fontStylesheetHref,
|
|
308
315
|
globalStylesheetHref: options.globalStylesheetHref
|
|
309
316
|
});
|
|
310
|
-
const apiHandler =
|
|
317
|
+
const apiHandler = _chunkRYDW7GPRcjs.createFarmDocsAPIHandler.call(void 0, {
|
|
311
318
|
rootDir: options.root,
|
|
312
319
|
srcDir: options.srcDir,
|
|
313
320
|
docs
|
|
@@ -399,7 +406,7 @@ async function compileFarmDocsManifest(docs, options) {
|
|
|
399
406
|
post: await compileResponse(postResponse, absolutePaths),
|
|
400
407
|
search: {
|
|
401
408
|
pages: pages.map((page) => ({
|
|
402
|
-
...
|
|
409
|
+
..._chunkAXYTGLF3cjs.toFarmDocsMarkdownPage.call(void 0, page),
|
|
403
410
|
sourcePath: `farm-docs:${page.slug || "index"}`
|
|
404
411
|
})),
|
|
405
412
|
search: _nullishCoalesce(searchConfig, () => ( true)),
|
|
@@ -1479,7 +1486,7 @@ function hasFarmPluginRoutes(config) {
|
|
|
1479
1486
|
_chunkS3JO3N4Hcjs.__name.call(void 0, hasFarmPluginRoutes, "hasFarmPluginRoutes");
|
|
1480
1487
|
function farmServerRuntimePluginsMayHandlePath(config, pathname) {
|
|
1481
1488
|
return (config.plugins || []).some(
|
|
1482
|
-
(plugin) => _chunkZ5HIWVDPcjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) !== false &&
|
|
1489
|
+
(plugin) => _chunkZ5HIWVDPcjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) !== false && _chunkR7LCG3BTcjs.farmPluginMayAffectRuntimePath.call(void 0, plugin, pathname)
|
|
1483
1490
|
);
|
|
1484
1491
|
}
|
|
1485
1492
|
_chunkS3JO3N4Hcjs.__name.call(void 0, farmServerRuntimePluginsMayHandlePath, "farmServerRuntimePluginsMayHandlePath");
|
|
@@ -1541,7 +1548,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
|
|
|
1541
1548
|
assertFarmDocsRuntimeSupported(config, preset);
|
|
1542
1549
|
const srcDir = config.srcDir || "src";
|
|
1543
1550
|
const distDir = config.distDir || ".farm";
|
|
1544
|
-
const deployOutputDir =
|
|
1551
|
+
const deployOutputDir = _chunkO5DVPF3Rcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
1545
1552
|
const lifecyclePluginManager = options.pluginManager;
|
|
1546
1553
|
const productionViteResultPromise = Promise.allSettled([
|
|
1547
1554
|
Promise.resolve(_nullishCoalesce(options.productionVite, () => ( _chunkA6WIQH5Zcjs.loadFarmProductionVite.call(void 0, ))))
|
|
@@ -1560,7 +1567,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
|
|
|
1560
1567
|
const routeRuntimeManifestResultPromise = Promise.allSettled([routeRuntimeManifestPromise]);
|
|
1561
1568
|
const pageRoutes = [];
|
|
1562
1569
|
for (const [pattern, entry] of routeManager.getRoutes()) {
|
|
1563
|
-
const markdownSourcePath = entry.markdownSourcePath || (
|
|
1570
|
+
const markdownSourcePath = entry.markdownSourcePath || (_chunk6K4SPQWLcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? entry.modulePath : void 0);
|
|
1564
1571
|
pageRoutes.push({
|
|
1565
1572
|
pattern,
|
|
1566
1573
|
modulePath: entry.modulePath,
|
|
@@ -1789,7 +1796,7 @@ async function mergeBuiltFontCss(outputDir, fontCssSource) {
|
|
|
1789
1796
|
}
|
|
1790
1797
|
const normalizedFontCss = typeof fontCss === "string" ? fontCss : Buffer.from(fontCss).toString("utf8");
|
|
1791
1798
|
await fs.writeFile(fontCssPath, normalizedFontCss);
|
|
1792
|
-
await fs.writeFile(clientCssPath,
|
|
1799
|
+
await fs.writeFile(clientCssPath, _chunkR7LCG3BTcjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
|
|
1793
1800
|
}
|
|
1794
1801
|
_chunkS3JO3N4Hcjs.__name.call(void 0, mergeBuiltFontCss, "mergeBuiltFontCss");
|
|
1795
1802
|
var _IncompleteClientBuildOutputError = class _IncompleteClientBuildOutputError extends Error {
|
|
@@ -1839,7 +1846,7 @@ function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, optio
|
|
|
1839
1846
|
const key = `${_path2.default.resolve(root)}\0${mode}\0${options.asyncOwnerIslands === true}\0${_path2.default.resolve(modulePath)}`;
|
|
1840
1847
|
let plan = cache.get(key);
|
|
1841
1848
|
if (!plan) {
|
|
1842
|
-
plan =
|
|
1849
|
+
plan = _chunkR7LCG3BTcjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
|
|
1843
1850
|
cache.set(key, plan);
|
|
1844
1851
|
}
|
|
1845
1852
|
return { ...plan, isolatedBoundaries: [...plan.isolatedBoundaries] };
|
|
@@ -1868,14 +1875,14 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
1868
1875
|
`[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
|
|
1869
1876
|
);
|
|
1870
1877
|
}
|
|
1871
|
-
const isolatedMode =
|
|
1878
|
+
const isolatedMode = _chunkR7LCG3BTcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
1872
1879
|
_optionalChain([config, 'access', _35 => _35.experimental, 'optionalAccess', _36 => _36.isolatedClientHydration]),
|
|
1873
1880
|
{
|
|
1874
1881
|
serverComponents: _optionalChain([config, 'access', _37 => _37.experimental, 'optionalAccess', _38 => _38.serverComponents]) === true,
|
|
1875
1882
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
1876
1883
|
}
|
|
1877
1884
|
);
|
|
1878
|
-
const planOptions =
|
|
1885
|
+
const planOptions = _chunkR7LCG3BTcjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
1879
1886
|
config.renderer,
|
|
1880
1887
|
Boolean(unsupportedIntegrationProvider)
|
|
1881
1888
|
);
|
|
@@ -1932,7 +1939,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
1932
1939
|
), "isAdapterDocsRoute");
|
|
1933
1940
|
const syntheticDocsEntry = _optionalChain([config, 'access', _46 => _46.docs, 'optionalAccess', _47 => _47.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
|
|
1934
1941
|
const syntheticDocsPatterns = syntheticDocsEntry ? syntheticDocsEntry === "/" ? ["/", "/[...slug]"] : [syntheticDocsEntry, `${syntheticDocsEntry}/[...slug]`] : [];
|
|
1935
|
-
const markdownPagePlan =
|
|
1942
|
+
const markdownPagePlan = _chunkR7LCG3BTcjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
1936
1943
|
_chunkOHY2ZWUGcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, config.mdx), root),
|
|
1937
1944
|
root,
|
|
1938
1945
|
isolatedMode,
|
|
@@ -1940,7 +1947,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
1940
1947
|
);
|
|
1941
1948
|
const routePlans = pageRoutes.map((route) => ({
|
|
1942
1949
|
route,
|
|
1943
|
-
metadata:
|
|
1950
|
+
metadata: _chunk6K4SPQWLcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
|
|
1944
1951
|
route.modulePath,
|
|
1945
1952
|
root,
|
|
1946
1953
|
isolatedMode,
|
|
@@ -1948,7 +1955,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
1948
1955
|
planOptions
|
|
1949
1956
|
)
|
|
1950
1957
|
}));
|
|
1951
|
-
|
|
1958
|
+
_chunkR7LCG3BTcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
1952
1959
|
clientLayouts.map((layout) => ({
|
|
1953
1960
|
pattern: layout.pattern,
|
|
1954
1961
|
depth: layout.pattern.split("/").filter(Boolean).length,
|
|
@@ -1980,7 +1987,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
1980
1987
|
for (const layout of clientLayouts) {
|
|
1981
1988
|
const matchesBuiltRoute = pageRoutes.some((route) => layoutAppliesToRoute(layout.pattern, route.pattern)) || Boolean(adapterDocsEntry && layoutAppliesToRoute(layout.pattern, adapterDocsEntry));
|
|
1982
1989
|
if (matchesBuiltRoute && layout.suppressedAsyncHydration) {
|
|
1983
|
-
_chunk5QIKR7RRcjs.logger.warn(`\u26A0\uFE0F ${
|
|
1990
|
+
_chunk5QIKR7RRcjs.logger.warn(`\u26A0\uFE0F ${_chunkR7LCG3BTcjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`);
|
|
1984
1991
|
}
|
|
1985
1992
|
}
|
|
1986
1993
|
if (isolatedMode === "analyze") {
|
|
@@ -2004,7 +2011,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2004
2011
|
);
|
|
2005
2012
|
if (metadata.suppressedAsyncHydration) {
|
|
2006
2013
|
_chunk5QIKR7RRcjs.logger.warn(
|
|
2007
|
-
`\u26A0\uFE0F ${
|
|
2014
|
+
`\u26A0\uFE0F ${_chunkR7LCG3BTcjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
|
|
2008
2015
|
);
|
|
2009
2016
|
}
|
|
2010
2017
|
if (metadata.shouldHydrate || metadata.hasIsolatedClientBoundaries || applicableClientLayouts.length > 0) {
|
|
@@ -2063,7 +2070,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2063
2070
|
}
|
|
2064
2071
|
const clientRouteSlots = routeSlots.filter((slot) => {
|
|
2065
2072
|
try {
|
|
2066
|
-
return
|
|
2073
|
+
return _chunkR7LCG3BTcjs.getClientModuleMetadata.call(void 0, slot.modulePath, root).shouldHydrate;
|
|
2067
2074
|
} catch (error) {
|
|
2068
2075
|
_chunk5QIKR7RRcjs.logger.warn(`\u26A0\uFE0F Could not inspect route slot ${slot.modulePath}: ${error}`);
|
|
2069
2076
|
return false;
|
|
@@ -2093,7 +2100,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2093
2100
|
config.trailingSlash,
|
|
2094
2101
|
_chunkZ5HIWVDPcjs.getIntegrationProviders.call(void 0, config.integrations),
|
|
2095
2102
|
config.basePath,
|
|
2096
|
-
|
|
2103
|
+
_chunkR7LCG3BTcjs.generateClientCachePersistenceCode.call(void 0, _chunkR7LCG3BTcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
|
|
2097
2104
|
adapterOwnsDocsRuntime ? _chunk75WGQVQAcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
|
|
2098
2105
|
);
|
|
2099
2106
|
await fs.writeFile(clientEntryPath, clientHydrationCode);
|
|
@@ -2110,7 +2117,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2110
2117
|
const postcssConfigPath = _path2.default.join(clientEntryDir, "postcss.config.cjs");
|
|
2111
2118
|
await fs.writeFile(postcssConfigPath, "module.exports = { plugins: [] };\n");
|
|
2112
2119
|
postcssSearchPath = clientEntryDir;
|
|
2113
|
-
tailwindVitePlugin = await
|
|
2120
|
+
tailwindVitePlugin = await _chunkR7LCG3BTcjs.loadTailwindVitePlugin.call(void 0, {
|
|
2114
2121
|
builder: productionVite.builder,
|
|
2115
2122
|
announce: true
|
|
2116
2123
|
});
|
|
@@ -2179,7 +2186,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2179
2186
|
}
|
|
2180
2187
|
},
|
|
2181
2188
|
plugins: [
|
|
2182
|
-
|
|
2189
|
+
_chunkR7LCG3BTcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
2183
2190
|
...tailwindVitePlugin ? [tailwindVitePlugin] : [],
|
|
2184
2191
|
...rendererVitePlugins,
|
|
2185
2192
|
...config.vite.plugins || [],
|
|
@@ -2240,7 +2247,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2240
2247
|
} : void 0,
|
|
2241
2248
|
// Ensure React is bundled for client
|
|
2242
2249
|
resolve: {
|
|
2243
|
-
alias:
|
|
2250
|
+
alias: _chunkR7LCG3BTcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
2244
2251
|
dedupe: [...config.renderer.dedupe || []]
|
|
2245
2252
|
},
|
|
2246
2253
|
// Optimize dependencies - exclude server-side code from client bundle
|
|
@@ -2253,7 +2260,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2253
2260
|
]
|
|
2254
2261
|
}
|
|
2255
2262
|
};
|
|
2256
|
-
await viteBuild(
|
|
2263
|
+
await viteBuild(_chunkR7LCG3BTcjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite));
|
|
2257
2264
|
await mergeBuiltFontCss(outputDir);
|
|
2258
2265
|
await validateClientBuildOutput(root, srcDir, outputDir);
|
|
2259
2266
|
} finally {
|
|
@@ -3012,7 +3019,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
|
|
|
3012
3019
|
direction: {}
|
|
3013
3020
|
}, plugins = [], renderer = _chunkPSV6XKPOcjs.REACT_RENDERER, publicRuntimeConfig = void 0, trailingSlash = false, integrationProviders = [], basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule) {
|
|
3014
3021
|
const toImportPath = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (targetPath) => targetPath.replace(/\\/g, "/"), "toImportPath");
|
|
3015
|
-
const clientPluginEntry =
|
|
3022
|
+
const clientPluginEntry = _chunkR7LCG3BTcjs.generateFarmClientPluginEntryCode.call(void 0,
|
|
3016
3023
|
plugins,
|
|
3017
3024
|
root,
|
|
3018
3025
|
srcDir,
|
|
@@ -3023,7 +3030,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
|
|
|
3023
3030
|
import { createRoot, hydrateRoot } from "react-dom/client";` : appSetupPath ? `import React, { createRoot, hydrateRoot, configureApp as __farmConfigureApp } from ${JSON.stringify(renderer.client)};
|
|
3024
3031
|
import __farmAppSetup from ${JSON.stringify(_chunk5QIKR7RRcjs.toPosixPath.call(void 0, appSetupPath))};
|
|
3025
3032
|
__farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};`;
|
|
3026
|
-
const providerClientCode =
|
|
3033
|
+
const providerClientCode = _chunkR7LCG3BTcjs.generateFarmIntegrationProviderClientCode.call(void 0,
|
|
3027
3034
|
integrationProviders,
|
|
3028
3035
|
root,
|
|
3029
3036
|
_nullishCoalesce(renderer.componentExtensions, () => ( []))
|
|
@@ -3508,7 +3515,7 @@ function hasHydratableLayout(pathname) {
|
|
|
3508
3515
|
});
|
|
3509
3516
|
}
|
|
3510
3517
|
|
|
3511
|
-
${
|
|
3518
|
+
${_chunkR7LCG3BTcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
|
|
3512
3519
|
// Wrap a page element with applicable layouts
|
|
3513
3520
|
function wrapWithLayouts(pageElement, pathname, params) {
|
|
3514
3521
|
const layouts = getApplicableLayouts(pathname);
|
|
@@ -4423,7 +4430,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
4423
4430
|
_path2.default.join(postcssConfigDir, "postcss.config.cjs"),
|
|
4424
4431
|
"module.exports = { plugins: [] };\n"
|
|
4425
4432
|
);
|
|
4426
|
-
tailwindVitePlugin = await
|
|
4433
|
+
tailwindVitePlugin = await _chunkR7LCG3BTcjs.loadTailwindVitePlugin.call(void 0, {
|
|
4427
4434
|
builder: productionVite.builder,
|
|
4428
4435
|
label: "for SSR"
|
|
4429
4436
|
});
|
|
@@ -4519,7 +4526,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
4519
4526
|
}
|
|
4520
4527
|
const middlewareRoutes = await discoverMiddlewareRoutes(appDirs);
|
|
4521
4528
|
const instrumentationPath = _chunkKCMTCM6Icjs.resolveFarmInstrumentationFile.call(void 0, root, config.srcDir || "src");
|
|
4522
|
-
const notFoundPath =
|
|
4529
|
+
const notFoundPath = _chunkR7LCG3BTcjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
|
|
4523
4530
|
if (notFoundPath) _chunk5QIKR7RRcjs.logger.info(`\u{1F4CB} Found custom 404 page: ${notFoundPath}`);
|
|
4524
4531
|
layoutRoutes.sort((a, b) => {
|
|
4525
4532
|
const depthA = a.pattern.split("/").filter(Boolean).length;
|
|
@@ -4542,7 +4549,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
4542
4549
|
const hasObservabilityHandler = !!config.observability && typeof config.observability === "object" && "onEvent" in config.observability;
|
|
4543
4550
|
const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _56 => _56.mdx, 'optionalAccess', _57 => _57.components]));
|
|
4544
4551
|
const hasMiddlewareConfig = hasFarmMiddlewareConfig(config.middleware);
|
|
4545
|
-
const hasRouteContextConfig =
|
|
4552
|
+
const hasRouteContextConfig = _chunkO5DVPF3Rcjs.hasCustomFarmRouteContext.call(void 0, config);
|
|
4546
4553
|
const hasServerRuntimePlugins = hasFarmServerRuntimePlugins(config);
|
|
4547
4554
|
const hasPluginRoutes = hasFarmPluginRoutes(config);
|
|
4548
4555
|
const configModulePath = hasServerRuntimeIntegrations || hasObservabilityHandler || hasMdxComponentConfig || hasMiddlewareConfig || hasRouteContextConfig || hasServerRuntimePlugins || hasPluginRoutes || hasIntegrationProviders ? await findFarmConfigPath(root) : null;
|
|
@@ -4551,7 +4558,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
4551
4558
|
const hasConfiguredRuntimePlugins = Boolean(
|
|
4552
4559
|
hasRuntimeConfigModule && (config.plugins || []).length > 0
|
|
4553
4560
|
);
|
|
4554
|
-
const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _58 => _58.docs, 'optionalAccess', _59 => _59.enabled]) && _chunkC5GUTBZKcjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? _optionalChain([config, 'access', _60 => _60.docs, 'access', _61 => _61.adapter, 'optionalAccess', _62 => _62.server]) ? await
|
|
4561
|
+
const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _58 => _58.docs, 'optionalAccess', _59 => _59.enabled]) && _chunkC5GUTBZKcjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? _optionalChain([config, 'access', _60 => _60.docs, 'access', _61 => _61.adapter, 'optionalAccess', _62 => _62.server]) ? await _chunkRYDW7GPRcjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
|
|
4555
4562
|
root,
|
|
4556
4563
|
srcDir: config.srcDir,
|
|
4557
4564
|
clientEntry: FARM_CLIENT_JS_SRC_PLACEHOLDER,
|
|
@@ -4701,7 +4708,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
4701
4708
|
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _68 => _68.env, 'optionalAccess', _69 => _69.public]) || {})
|
|
4702
4709
|
},
|
|
4703
4710
|
plugins: [
|
|
4704
|
-
|
|
4711
|
+
_chunkR7LCG3BTcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
4705
4712
|
...tailwindVitePlugin ? [tailwindVitePlugin] : [],
|
|
4706
4713
|
...rendererVitePlugins,
|
|
4707
4714
|
...config.vite.plugins || [],
|
|
@@ -4761,7 +4768,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
4761
4768
|
resolve: {
|
|
4762
4769
|
alias: [
|
|
4763
4770
|
...shouldAliasReactServerToWebBuild(config.renderer, preset) ? [createFarmReactWebServerAlias(hasReactDomEdgeServerBuild(root))] : [],
|
|
4764
|
-
...Object.entries(
|
|
4771
|
+
...Object.entries(_chunkR7LCG3BTcjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
|
|
4765
4772
|
([find, replacement]) => ({ find, replacement })
|
|
4766
4773
|
)
|
|
4767
4774
|
],
|
|
@@ -4769,7 +4776,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
4769
4776
|
dedupe: [...config.renderer.dedupe || []]
|
|
4770
4777
|
}
|
|
4771
4778
|
};
|
|
4772
|
-
await viteBuild(
|
|
4779
|
+
await viteBuild(_chunkR7LCG3BTcjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
|
|
4773
4780
|
} finally {
|
|
4774
4781
|
if (postcssConfigDir) {
|
|
4775
4782
|
try {
|
|
@@ -5146,7 +5153,7 @@ function isolateFarmRouteServerPage(element) { return element; }`;
|
|
|
5146
5153
|
`Integration provider components are not supported by the "${config.renderer.name}" renderer.`
|
|
5147
5154
|
);
|
|
5148
5155
|
}
|
|
5149
|
-
const providerServerModules =
|
|
5156
|
+
const providerServerModules = _chunkR7LCG3BTcjs.generateFarmIntegrationProviderServerModules.call(void 0,
|
|
5150
5157
|
renderedIntegrationProviders,
|
|
5151
5158
|
config.root,
|
|
5152
5159
|
_nullishCoalesce(config.renderer.componentExtensions, () => ( []))
|
|
@@ -5166,14 +5173,14 @@ function isolateFarmRouteServerPage(element) { return element; }`;
|
|
|
5166
5173
|
const unsupportedIntegrationProvider = renderedIntegrationProviders.find(
|
|
5167
5174
|
(provider) => provider.supportsIsolatedHydration !== true
|
|
5168
5175
|
);
|
|
5169
|
-
const isolatedHydrationMode =
|
|
5176
|
+
const isolatedHydrationMode = _chunkR7LCG3BTcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
5170
5177
|
_optionalChain([config, 'access', _89 => _89.experimental, 'optionalAccess', _90 => _90.isolatedClientHydration]),
|
|
5171
5178
|
{
|
|
5172
5179
|
serverComponents: _optionalChain([config, 'access', _91 => _91.experimental, 'optionalAccess', _92 => _92.serverComponents]) === true,
|
|
5173
5180
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
5174
5181
|
}
|
|
5175
5182
|
);
|
|
5176
|
-
const hydrationPlanOptions =
|
|
5183
|
+
const hydrationPlanOptions = _chunkR7LCG3BTcjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
5177
5184
|
config.renderer,
|
|
5178
5185
|
Boolean(unsupportedIntegrationProvider)
|
|
5179
5186
|
);
|
|
@@ -5188,7 +5195,7 @@ function isolateFarmRouteServerPage(element) { return element; }`;
|
|
|
5188
5195
|
hydrationPlanOptions
|
|
5189
5196
|
)
|
|
5190
5197
|
}));
|
|
5191
|
-
const markdownPagePlan =
|
|
5198
|
+
const markdownPagePlan = _chunkR7LCG3BTcjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
5192
5199
|
_chunkOHY2ZWUGcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, config.mdx), config.root),
|
|
5193
5200
|
config.root,
|
|
5194
5201
|
isolatedHydrationMode,
|
|
@@ -5197,7 +5204,7 @@ function isolateFarmRouteServerPage(element) { return element; }`;
|
|
|
5197
5204
|
const pageHydrationPlans = new Map(
|
|
5198
5205
|
pageRoutes.map((route) => [
|
|
5199
5206
|
route.modulePath,
|
|
5200
|
-
|
|
5207
|
+
_chunk6K4SPQWLcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
|
|
5201
5208
|
route.modulePath,
|
|
5202
5209
|
config.root,
|
|
5203
5210
|
isolatedHydrationMode,
|
|
@@ -5206,7 +5213,7 @@ function isolateFarmRouteServerPage(element) { return element; }`;
|
|
|
5206
5213
|
)
|
|
5207
5214
|
])
|
|
5208
5215
|
);
|
|
5209
|
-
|
|
5216
|
+
_chunkR7LCG3BTcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
5210
5217
|
layoutHydrationPlans.map((layout) => ({
|
|
5211
5218
|
pattern: layout.pattern,
|
|
5212
5219
|
depth: layout.pattern.split("/").filter(Boolean).length,
|
|
@@ -5247,7 +5254,7 @@ function isolateFarmRouteServerPage(element) { return element; }`;
|
|
|
5247
5254
|
}).map(({ route }) => route);
|
|
5248
5255
|
orderedPageRoutes.forEach((route, index) => {
|
|
5249
5256
|
const varName = `pageRoute${index}`;
|
|
5250
|
-
if (
|
|
5257
|
+
if (_chunk6K4SPQWLcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) {
|
|
5251
5258
|
pageRegistrations.push(`
|
|
5252
5259
|
{
|
|
5253
5260
|
pattern: ${JSON.stringify(route.pattern)},
|
|
@@ -5414,10 +5421,12 @@ function isolateFarmRouteServerPage(element) { return element; }`;
|
|
|
5414
5421
|
createFarmCacheKey,
|
|
5415
5422
|
createFarmMetadataRouteResponse,
|
|
5416
5423
|
createFarmAgentRobots,
|
|
5424
|
+
createFarmApiCatalogResponse,
|
|
5417
5425
|
collectFarmLlmsTxtPages,
|
|
5418
5426
|
createFarmDefaultLlmsTxt,
|
|
5419
5427
|
createFarmLlmsMarkdownReader,
|
|
5420
5428
|
renderFarmLlmsFullTxt,
|
|
5429
|
+
createFarmLlmsFullRenderer,
|
|
5421
5430
|
createFarmThemeDocumentParts,
|
|
5422
5431
|
createFarmLocaleCookie,
|
|
5423
5432
|
createFarmProductionLifecycle,
|
|
@@ -5687,7 +5696,7 @@ const farmResolvedRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs);
|
|
|
5687
5696
|
|
|
5688
5697
|
function FarmDefault404Page() {
|
|
5689
5698
|
return React.createElement(React.Fragment, null,
|
|
5690
|
-
React.createElement("style", null, ${JSON.stringify(
|
|
5699
|
+
React.createElement("style", null, ${JSON.stringify(_chunkR7LCG3BTcjs.DEFAULT_NOT_FOUND_STYLES)}),
|
|
5691
5700
|
React.createElement("main", {
|
|
5692
5701
|
className: "farm-default-not-found",
|
|
5693
5702
|
"aria-labelledby": "farm-default-not-found-title",
|
|
@@ -5816,13 +5825,13 @@ const farmImageHandler = ${imageRuntime === "none" ? "null" : imageRuntime === "
|
|
|
5816
5825
|
})`};
|
|
5817
5826
|
const farmMarkdownConfig = ${JSON.stringify(config.md)};
|
|
5818
5827
|
const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _107 => _107.agent, 'optionalAccess', _108 => _108.llmsTxt]), () => ( { enabled: false, include: [], exclude: [] })))};
|
|
5819
|
-
${servesAgentRobotsTxt ? `const farmAgentCrawlers = ${JSON.stringify(config.agent.crawlers)};` : ""}
|
|
5828
|
+
${_optionalChain([config, 'access', _109 => _109.agent, 'optionalAccess', _110 => _110.llmsTxt, 'optionalAccess', _111 => _111.enabled]) ? "const farmLlmsFullRenderer = createFarmLlmsFullRenderer({ revalidate: farmLlmsTxtConfig.revalidate });\n" : ""}${servesAgentRobotsTxt ? `const farmAgentCrawlers = ${JSON.stringify(config.agent.crawlers)};` : ""}
|
|
5820
5829
|
const farmMdxConfig = ${JSON.stringify({
|
|
5821
5830
|
...config.mdx,
|
|
5822
|
-
components: typeof _optionalChain([config, 'access',
|
|
5831
|
+
components: typeof _optionalChain([config, 'access', _112 => _112.mdx, 'optionalAccess', _113 => _113.components]) === "string" ? config.mdx.components : void 0
|
|
5823
5832
|
})};
|
|
5824
5833
|
const configuredFarmMdxComponents = farmUserConfig?.mdx?.components;
|
|
5825
|
-
${_optionalChain([config, 'access',
|
|
5834
|
+
${_optionalChain([config, 'access', _114 => _114.agent, 'optionalAccess', _115 => _115.noindexPreviews]) ? `// agent.noindexPreviews: the runtime environment decides, falling back to the
|
|
5826
5835
|
// environment this was built in, since Netlify exposes its deploy context only
|
|
5827
5836
|
// to the build.
|
|
5828
5837
|
const farmNoindexPreview = resolveFarmPreviewDeployment(
|
|
@@ -5870,7 +5879,7 @@ export const farmProductionLifecycle = createFarmProductionLifecycle({
|
|
|
5870
5879
|
});
|
|
5871
5880
|
const farmI18nRuntime = ${config.i18n.enabled ? `createFarmI18nRuntime(farmI18nConfig, ${JSON.stringify(i18nCatalogs)})` : "null"};
|
|
5872
5881
|
${config.i18n.enabled ? "_setDefaultFarmI18nRuntime(farmI18nRuntime);" : ""}
|
|
5873
|
-
const farmDocsBundledContentDir = ${_optionalChain([config, 'access',
|
|
5882
|
+
const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _116 => _116.docs, 'optionalAccess', _117 => _117.enabled]) && !hasPrecompiledDocs ? `(() => {
|
|
5874
5883
|
try {
|
|
5875
5884
|
const currentDir = farmDocsDirname(farmDocsFileURLToPath(import.meta.url));
|
|
5876
5885
|
const candidates = [
|
|
@@ -5891,7 +5900,7 @@ globalThis.__FARM_DOCS_RUNTIME_CONFIG__ = {
|
|
|
5891
5900
|
docs: farmDocsResolvedConfig,
|
|
5892
5901
|
};
|
|
5893
5902
|
const farmDocsPrecompiledRuntime = ${hasPrecompiledDocs ? `createFarmDocsPrecompiledRuntime(${JSON.stringify(farmDocsPrecompiledManifest)})` : "null"};
|
|
5894
|
-
const farmDocsHandler = ${_optionalChain([config, 'access',
|
|
5903
|
+
const farmDocsHandler = ${_optionalChain([config, 'access', _118 => _118.docs, 'optionalAccess', _119 => _119.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleDocsRequest" : adapterOwnsDocsRuntime ? `createFarmDocsAdapterRuntimeHandler({
|
|
5895
5904
|
${docsConfigModulePath ? "...(farmDocsConfigModule.default || farmDocsConfigModule),\n ...farmDocsResolvedConfig.configOverrides," : "...farmDocsResolvedConfig.config,"}
|
|
5896
5905
|
entry: farmDocsResolvedConfig.config?.entry || String(farmDocsResolvedConfig.entry || "/docs").replace(/^\\/+|\\/+$/g, "") || "docs",
|
|
5897
5906
|
docsPath: farmDocsResolvedConfig.entry,
|
|
@@ -5919,14 +5928,15 @@ const farmDocsHandler = ${_optionalChain([config, 'access', _115 => _115.docs, '
|
|
|
5919
5928
|
fontStylesheetHref: "/farm-fonts.css",
|
|
5920
5929
|
globalStylesheetHref: "/assets/globals.css",
|
|
5921
5930
|
})` : "null"};
|
|
5922
|
-
const farmDocsAPIHandler = ${_optionalChain([config, 'access',
|
|
5931
|
+
const farmDocsAPIHandler = ${_optionalChain([config, 'access', _120 => _120.docs, 'optionalAccess', _121 => _121.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleAPIRequest" : adapterOwnsDocsRuntime ? "null" : `createFarmDocsAPIHandler({ rootDir: farmDocsRuntimeRoot, srcDir: ${JSON.stringify(config.srcDir)}, docs: farmDocsResolvedConfig })` : "null"};
|
|
5923
5932
|
|
|
5924
5933
|
// API routes bundled at build time
|
|
5925
5934
|
const apiRoutes = ${apiRoutes.length > 0 ? "mergePluginAPIRoutes(" : ""}[${apiRegistrations.join(",")}
|
|
5926
5935
|
]${apiRoutes.length > 0 ? `, configuredPlugins, ${JSON.stringify(apiRoutes.map(({ path: path7, methods }) => ({ path: path7, methods })))}, { bodySizeLimit: ${JSON.stringify(config.server.bodySizeLimit)} })` : ""};
|
|
5927
5936
|
const farmLocalAPIBasePath = ${JSON.stringify(_chunkWPYFSQKKcjs.resolveFarmAPIServerBasePath.call(void 0, config.api))};
|
|
5928
5937
|
const farmOpenAPIReference = ${JSON.stringify(openAPIReference)};
|
|
5929
|
-
|
|
5938
|
+
${_optionalChain([config, 'access', _122 => _122.agent, 'optionalAccess', _123 => _123.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunk65P6OGYNcjs.resolveFarmApiCatalogInput.call(void 0, config))};
|
|
5939
|
+
` : ""}
|
|
5930
5940
|
function isFarmLocalAPIPathname(pathname) {
|
|
5931
5941
|
return farmLocalAPIBasePath !== "/" &&
|
|
5932
5942
|
(pathname === farmLocalAPIBasePath ||
|
|
@@ -7030,7 +7040,7 @@ function hasLocalRequestRoute(request, routePathname) {
|
|
|
7030
7040
|
if (${imageRuntime === "none" ? "false" : `pathname === ${JSON.stringify(config.images.path)}`}) {
|
|
7031
7041
|
return true;
|
|
7032
7042
|
}
|
|
7033
|
-
${_optionalChain([config, 'access',
|
|
7043
|
+
${_optionalChain([config, 'access', _124 => _124.docs, 'optionalAccess', _125 => _125.enabled]) ? `const docsPath = normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs");
|
|
7034
7044
|
if (
|
|
7035
7045
|
isFarmDocsAPIRequest(pathname) ||
|
|
7036
7046
|
docsPath === "/" ||
|
|
@@ -7056,7 +7066,7 @@ function getFarmPluginRequestOptions(request) {
|
|
|
7056
7066
|
route: { ...route, pattern: normalizeRuntimePath(farmOpenAPIReference.route) },
|
|
7057
7067
|
};
|
|
7058
7068
|
}
|
|
7059
|
-
const isDocsAPIRequest = ${_optionalChain([config, 'access',
|
|
7069
|
+
const isDocsAPIRequest = ${_optionalChain([config, 'access', _126 => _126.docs, 'optionalAccess', _127 => _127.enabled]) ? "isFarmDocsAPIRequest(pathname)" : "false"};
|
|
7060
7070
|
const integrationMatch = ${hasServerRuntimeIntegrations ? `matchIntegrationRoute(serverRuntimeIntegrations, {
|
|
7061
7071
|
pathname,
|
|
7062
7072
|
method: request.method,
|
|
@@ -7146,7 +7156,7 @@ function getApplicableLayouts(pathname) {
|
|
|
7146
7156
|
return applicable;
|
|
7147
7157
|
}
|
|
7148
7158
|
|
|
7149
|
-
${_optionalChain([config, 'access',
|
|
7159
|
+
${_optionalChain([config, 'access', _128 => _128.docs, 'optionalAccess', _129 => _129.enabled]) ? `async function wrapFarmDocsResponseWithLayouts(request, response) {
|
|
7150
7160
|
if (request.method === "HEAD") return response;
|
|
7151
7161
|
if (response.headers.get("x-farm-docs-adapter")) return response;
|
|
7152
7162
|
|
|
@@ -7253,7 +7263,7 @@ ${_optionalChain([config, 'access', _123 => _123.docs, 'optionalAccess', _124 =>
|
|
|
7253
7263
|
}` : ""}
|
|
7254
7264
|
|
|
7255
7265
|
const pprShellCache = getFarmDataCache();
|
|
7256
|
-
const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access',
|
|
7266
|
+
const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access', _130 => _130.experimental, 'optionalAccess', _131 => _131.ppr]) === true)};
|
|
7257
7267
|
|
|
7258
7268
|
function resolveRouteRenderingView(route) {
|
|
7259
7269
|
// The same merge development uses: baked directive config under the
|
|
@@ -7376,7 +7386,7 @@ async function handleFarmRequest(request, adapterContext) {
|
|
|
7376
7386
|
},
|
|
7377
7387
|
{ redirect: !isFarmLocalAPIPathname(requestUrl.pathname) }
|
|
7378
7388
|
)` : "handleFarmRequestInContext(request, null, false, Date.now(), adapterContext, requestUrl)"};
|
|
7379
|
-
${_optionalChain([config, 'access',
|
|
7389
|
+
${_optionalChain([config, 'access', _132 => _132.md, 'optionalAccess', _133 => _133.enabled]) ? `const pathname = getFarmRoutePathname(requestUrl.pathname);
|
|
7380
7390
|
if (matchPageRoute(pathname)) {
|
|
7381
7391
|
// The Link header advertises the public .md URL, like the head alternate.
|
|
7382
7392
|
return applyMarkdownNegotiationHeaders(response, {
|
|
@@ -7495,7 +7505,7 @@ async function handleFarmRequestInContext(
|
|
|
7495
7505
|
const middlewareHeaders = ${hasServerRuntimeIntegrations ? "withFarmIntegrationSetCookies(undefined, farmIntegrationSetCookies)" : "undefined"};
|
|
7496
7506
|
`}
|
|
7497
7507
|
|
|
7498
|
-
${_optionalChain([config, 'access',
|
|
7508
|
+
${_optionalChain([config, 'access', _134 => _134.docs, 'optionalAccess', _135 => _135.enabled]) ? `
|
|
7499
7509
|
// Docs responses are served after app middleware so route guards and
|
|
7500
7510
|
// middleware headers apply to the docs engine like any other page content.
|
|
7501
7511
|
// An app's own llms.txt, llms-full.txt, sitemap.xml, and robots.txt take
|
|
@@ -7540,7 +7550,7 @@ async function handleFarmRequestInContext(
|
|
|
7540
7550
|
}
|
|
7541
7551
|
` : ""}
|
|
7542
7552
|
|
|
7543
|
-
${_optionalChain([config, 'access',
|
|
7553
|
+
${_optionalChain([config, 'access', _136 => _136.md, 'optionalAccess', _137 => _137.enabled]) ? `
|
|
7544
7554
|
if (farmMarkdownConfig?.enabled) {
|
|
7545
7555
|
const markdownResponse = await createMarkdownMirrorResponse({
|
|
7546
7556
|
// The mirror helper only reads metadata and creates its own GET request.
|
|
@@ -7634,6 +7644,15 @@ async function handleFarmRequestInContext(
|
|
|
7634
7644
|
return applyProductionMiddlewareHeaders(applicationMetadataResponse, middlewareHeaders);
|
|
7635
7645
|
}
|
|
7636
7646
|
` : ""}
|
|
7647
|
+
${_optionalChain([config, 'access', _138 => _138.agent, 'optionalAccess', _139 => _139.apiCatalog]) ? `
|
|
7648
|
+
// agent.apiCatalog: list the OpenAPI and MCP surfaces at the RFC 9727 path.
|
|
7649
|
+
if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunk65P6OGYNcjs.FARM_API_CATALOG_PATH)}) {
|
|
7650
|
+
return applyProductionMiddlewareHeaders(
|
|
7651
|
+
createFarmApiCatalogResponse(request.method, farmApiCatalogInput),
|
|
7652
|
+
middlewareHeaders,
|
|
7653
|
+
);
|
|
7654
|
+
}
|
|
7655
|
+
` : ""}
|
|
7637
7656
|
${servesAgentRobotsTxt ? `
|
|
7638
7657
|
// agent.crawlers with no robots.ts: serve the generated file.
|
|
7639
7658
|
if (normalizeRuntimePath(routePathname) === "/robots.txt") {
|
|
@@ -7643,19 +7662,25 @@ async function handleFarmRequestInContext(
|
|
|
7643
7662
|
);
|
|
7644
7663
|
}
|
|
7645
7664
|
` : ""}
|
|
7646
|
-
${_optionalChain([config, 'access',
|
|
7665
|
+
${_optionalChain([config, 'access', _140 => _140.agent, 'optionalAccess', _141 => _141.llmsTxt, 'optionalAccess', _142 => _142.enabled]) ? `
|
|
7647
7666
|
// agent.llmsTxt with no llms.ts or llms-full.ts: serve the generated files.
|
|
7648
7667
|
const farmGeneratedLlmsKind = normalizeRuntimePath(routePathname) === "/llms.txt"
|
|
7649
7668
|
? "llms"
|
|
7650
|
-
: ${_optionalChain([config, 'access',
|
|
7669
|
+
: ${_optionalChain([config, 'access', _143 => _143.agent, 'optionalAccess', _144 => _144.llmsTxt, 'optionalAccess', _145 => _145.full]) ? `normalizeRuntimePath(routePathname) === "/llms-full.txt" ? "llms-full" : ` : ""}null;
|
|
7651
7670
|
if (farmGeneratedLlmsKind) {
|
|
7652
7671
|
const llmsContext = createFarmLlmsTxtContext(request, farmGeneratedLlmsKind === "llms-full");
|
|
7653
|
-
const
|
|
7654
|
-
|
|
7655
|
-
|
|
7656
|
-
|
|
7657
|
-
|
|
7658
|
-
|
|
7672
|
+
const llmsOrigin = new URL(request.url).origin;
|
|
7673
|
+
const renderLlmsFull = () =>
|
|
7674
|
+
renderFarmLlmsFullTxt(llmsContext.defaults, {
|
|
7675
|
+
origin: llmsOrigin,
|
|
7676
|
+
readMarkdown: llmsContext.markdown,
|
|
7677
|
+
});
|
|
7678
|
+
// HEAD reads no pages, so it neither waits for nor fills the shared render.
|
|
7679
|
+
const llmsBody = farmGeneratedLlmsKind !== "llms-full"
|
|
7680
|
+
? llmsContext.defaults
|
|
7681
|
+
: request.method.toUpperCase() === "HEAD"
|
|
7682
|
+
? await renderLlmsFull()
|
|
7683
|
+
: await farmLlmsFullRenderer(llmsOrigin, renderLlmsFull);
|
|
7659
7684
|
return applyProductionMiddlewareHeaders(
|
|
7660
7685
|
createFarmMetadataRouteResponse(
|
|
7661
7686
|
farmGeneratedLlmsKind,
|
|
@@ -7668,7 +7693,7 @@ async function handleFarmRequestInContext(
|
|
|
7668
7693
|
}
|
|
7669
7694
|
` : ""}
|
|
7670
7695
|
|
|
7671
|
-
${_optionalChain([config, 'access',
|
|
7696
|
+
${_optionalChain([config, 'access', _146 => _146.docs, 'optionalAccess', _147 => _147.enabled]) ? `if (farmDocsAPIHandler && isFarmDocsAPIRequest(pathname)) {
|
|
7672
7697
|
const docsAPIResponse = await farmDocsAPIHandler(cloneFarmRequestWithContext(request));
|
|
7673
7698
|
if (docsAPIResponse) {
|
|
7674
7699
|
return applyProductionMiddlewareHeaders(docsAPIResponse, middlewareHeaders);
|
|
@@ -8103,7 +8128,7 @@ async function handleFarmRequestInContext(
|
|
|
8103
8128
|
);
|
|
8104
8129
|
}
|
|
8105
8130
|
}
|
|
8106
|
-
${_optionalChain([config, 'access',
|
|
8131
|
+
${_optionalChain([config, 'access', _148 => _148.md, 'optionalAccess', _149 => _149.enabled]) ? `
|
|
8107
8132
|
// Advertise the Markdown mirror in the head as well as the Link header,
|
|
8108
8133
|
// using the public path the .md request will be resolved against.
|
|
8109
8134
|
mergedMetadata = addMetadataMarkdownAlternate(
|
|
@@ -8111,7 +8136,7 @@ async function handleFarmRequestInContext(
|
|
|
8111
8136
|
getFarmMarkdownAlternatePath(farmMarkdownConfig, pathname),
|
|
8112
8137
|
);` : ""}
|
|
8113
8138
|
|
|
8114
|
-
const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access',
|
|
8139
|
+
const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _150 => _150.agent, 'optionalAccess', _151 => _151.jsonLd]), () => ( false)))} });
|
|
8115
8140
|
const title = renderedMetadata.title;
|
|
8116
8141
|
const metaTags = renderedMetadata.tags;
|
|
8117
8142
|
const hasFavicon = renderedMetadata.hasFavicon;
|
|
@@ -8726,11 +8751,11 @@ ${generatePreloadResponseRuntimeSource()}
|
|
|
8726
8751
|
|
|
8727
8752
|
// Export as Web Standard fetch API
|
|
8728
8753
|
export async function fetch(request, context) {
|
|
8729
|
-
${_optionalChain([config, 'access',
|
|
8754
|
+
${_optionalChain([config, 'access', _152 => _152.agent, 'optionalAccess', _153 => _153.noindexPreviews]) ? "const response = await" : "return"} _runWithAPIRequestRuntime({
|
|
8730
8755
|
basePath: farmLocalAPIBasePath,
|
|
8731
8756
|
dispatch: async (localRequest) =>
|
|
8732
8757
|
(await handleAPIRequest(localRequest)) ?? Response.json({ error: "Not Found" }, { status: 404 }),
|
|
8733
|
-
}, () => handleFarmFetch(request, context));${_optionalChain([config, 'access',
|
|
8758
|
+
}, () => handleFarmFetch(request, context));${_optionalChain([config, 'access', _154 => _154.agent, 'optionalAccess', _155 => _155.noindexPreviews]) ? `
|
|
8734
8759
|
// Keep every response of a preview deployment out of search indexes.
|
|
8735
8760
|
return farmNoindexPreview ? applyFarmPreviewRobotsTag(response) : response;` : ""}
|
|
8736
8761
|
}
|
|
@@ -8873,7 +8898,7 @@ function configMiddlewareMayHandlePath(config, pathname) {
|
|
|
8873
8898
|
if (!hasFarmMiddlewareConfig(config)) return false;
|
|
8874
8899
|
const entries = Array.isArray(config) ? config : [config];
|
|
8875
8900
|
return entries.some((entry) => {
|
|
8876
|
-
if (_optionalChain([entry, 'access',
|
|
8901
|
+
if (_optionalChain([entry, 'access', _156 => _156.exclude, 'optionalAccess', _157 => _157.some, 'call', _158 => _158((pattern) => middlewarePatternMatches(pattern, pathname))])) {
|
|
8877
8902
|
return false;
|
|
8878
8903
|
}
|
|
8879
8904
|
if (!entry.matcher) return true;
|
|
@@ -8929,11 +8954,11 @@ function getPhysicalPrerenderBypassReason(options) {
|
|
|
8929
8954
|
}
|
|
8930
8955
|
if (appMiddlewareMayHandlePath(middlewareRoutes, pathname)) return "app middleware";
|
|
8931
8956
|
if (configMiddlewareMayHandlePath(config.middleware, pathname)) return "configured middleware";
|
|
8932
|
-
if (
|
|
8957
|
+
if (_chunkO5DVPF3Rcjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
|
|
8933
8958
|
if (farmServerRuntimePluginsMayHandlePath(config, pathname)) return "server runtime plugin";
|
|
8934
8959
|
const manifestEntry = getManifestPageEntry(routeRuntimeManifest, pathname);
|
|
8935
|
-
if (_optionalChain([manifestEntry, 'optionalAccess',
|
|
8936
|
-
if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access',
|
|
8960
|
+
if (_optionalChain([manifestEntry, 'optionalAccess', _159 => _159.rendering]) === "dynamic") return "dynamic runtime manifest";
|
|
8961
|
+
if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access', _160 => _160.regions, 'optionalAccess', _161 => _161.length])) || manifestEntry.maxDuration !== void 0)) {
|
|
8937
8962
|
return "route runtime controls";
|
|
8938
8963
|
}
|
|
8939
8964
|
const routeRule = getEffectiveRouteRule(config, pathname);
|
|
@@ -8955,7 +8980,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
8955
8980
|
const nitroBuilder = nitroBuilderResult.value;
|
|
8956
8981
|
const isVercel = preset === "vercel" || preset === "vercel-edge";
|
|
8957
8982
|
const isCloudflareWorker = preset === "cloudflare-module";
|
|
8958
|
-
const outputDir =
|
|
8983
|
+
const outputDir = _chunkO5DVPF3Rcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
8959
8984
|
const runtimeServerOutputDir = isVercel ? _path2.default.join(outputDir, "functions", "__nitro.func") : _path2.default.join(outputDir, "server");
|
|
8960
8985
|
const ssrOutputDir = _path2.default.join(root, distDir, "ssr");
|
|
8961
8986
|
const imageRuntime = resolveImageRuntime(config, preset);
|
|
@@ -9286,20 +9311,20 @@ export default async function farmNitroEventHandler(event) {
|
|
|
9286
9311
|
snapshotSSRRebundleOptions(nitroConfig)
|
|
9287
9312
|
);
|
|
9288
9313
|
const requestedBuilder = _nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER));
|
|
9289
|
-
const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access',
|
|
9290
|
-
_optionalChain([nitroConfig, 'access',
|
|
9291
|
-
(handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess',
|
|
9314
|
+
const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access', _162 => _162.rollupConfig, 'optionalAccess', _163 => _163.external]) === nitroRollupExternal && !hasRollupPlugins(_optionalChain([nitroConfig, 'access', _164 => _164.rollupConfig, 'optionalAccess', _165 => _165.plugins])) && customRollupKeys.length === 0 && _path2.default.resolve(_optionalChain([nitroConfig, 'access', _166 => _166.output, 'optionalAccess', _167 => _167.serverDir]) || "") === _path2.default.resolve(expectedServerDir) && Boolean(
|
|
9315
|
+
_optionalChain([nitroConfig, 'access', _168 => _168.handlers, 'optionalAccess', _169 => _169.some, 'call', _170 => _170(
|
|
9316
|
+
(handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess', _171 => _171.handler]) || "") === nitroEntryPath
|
|
9292
9317
|
)])
|
|
9293
9318
|
);
|
|
9294
9319
|
const selectRolldownBuilder = canReusePrebuiltSSR && requestedBuilder === void 0 && await canUseRolldownBuilder();
|
|
9295
9320
|
if (selectRolldownBuilder) nitroConfig.builder = "rolldown";
|
|
9296
9321
|
const useRolldownBuilder = canReusePrebuiltSSR && (_nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER))) === "rolldown";
|
|
9297
9322
|
const shouldMinify = nitroConfig.minify !== false;
|
|
9298
|
-
const keepServerNames = !(_optionalChain([config, 'access',
|
|
9323
|
+
const keepServerNames = !(_optionalChain([config, 'access', _172 => _172.docs, 'optionalAccess', _173 => _173.enabled]) && _optionalChain([config, 'access', _174 => _174.docs, 'access', _175 => _175.adapter, 'optionalAccess', _176 => _176.server]));
|
|
9299
9324
|
const useFarmServerMinifier = shouldMinify && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig;
|
|
9300
9325
|
const serverChunkMinifier = useFarmServerMinifier ? createServerChunkMinifyPlugin({ keepNames: keepServerNames, target: "esnext" }) : null;
|
|
9301
9326
|
if (canReusePrebuiltSSR) {
|
|
9302
|
-
const configuredRollupPlugins = _optionalChain([nitroConfig, 'access',
|
|
9327
|
+
const configuredRollupPlugins = _optionalChain([nitroConfig, 'access', _177 => _177.rollupConfig, 'optionalAccess', _178 => _178.plugins]);
|
|
9303
9328
|
nitroConfig.rollupConfig = {
|
|
9304
9329
|
...nitroConfig.rollupConfig,
|
|
9305
9330
|
plugins: [
|
|
@@ -9310,10 +9335,28 @@ export default async function farmNitroEventHandler(event) {
|
|
|
9310
9335
|
}
|
|
9311
9336
|
nitroConfig.minify = useFarmServerMinifier ? false : shouldMinify;
|
|
9312
9337
|
const nitroInstance = await nitroBuilder.createNitro(nitroConfig);
|
|
9338
|
+
if (_optionalChain([config, 'access', _179 => _179.md, 'optionalAccess', _180 => _180.enabled])) {
|
|
9339
|
+
nitroInstance.hooks.hook("prerender:generate", (route) => {
|
|
9340
|
+
if (!route.contents || !_optionalChain([route, 'access', _181 => _181.contentType, 'optionalAccess', _182 => _182.toLowerCase, 'call', _183 => _183(), 'access', _184 => _184.includes, 'call', _185 => _185("html")])) return;
|
|
9341
|
+
const alternatePath = _chunk2ITKVAIFcjs.getFarmMarkdownAlternatePath.call(void 0, config.md, route.route);
|
|
9342
|
+
if (!alternatePath) return;
|
|
9343
|
+
const routeRule = nitroInstance.options.routeRules[route.route] || {};
|
|
9344
|
+
nitroInstance.options.routeRules[route.route] = {
|
|
9345
|
+
...routeRule,
|
|
9346
|
+
headers: {
|
|
9347
|
+
...routeRule.headers,
|
|
9348
|
+
Link: `<${alternatePath}>; rel="alternate"; type="text/markdown"`
|
|
9349
|
+
}
|
|
9350
|
+
};
|
|
9351
|
+
});
|
|
9352
|
+
nitroInstance.hooks.hook("prerender:done", () => {
|
|
9353
|
+
nitroInstance.routing.sync();
|
|
9354
|
+
});
|
|
9355
|
+
}
|
|
9313
9356
|
if (config.security.csp && config.security.csp.nonce) {
|
|
9314
9357
|
nitroInstance.hooks.hook("prerender:generate", async (route) => {
|
|
9315
|
-
if (!route.contents || !_optionalChain([route, 'access',
|
|
9316
|
-
const staticCsp = await
|
|
9358
|
+
if (!route.contents || !_optionalChain([route, 'access', _186 => _186.contentType, 'optionalAccess', _187 => _187.toLowerCase, 'call', _188 => _188(), 'access', _189 => _189.includes, 'call', _190 => _190("html")])) return;
|
|
9359
|
+
const staticCsp = await _chunkE3RDL2DAcjs.applyFarmCspHashesToHtml.call(void 0, route.contents, config.security);
|
|
9317
9360
|
if (!staticCsp) return;
|
|
9318
9361
|
route.contents = staticCsp.html;
|
|
9319
9362
|
const routeRule = nitroInstance.options.routeRules[route.route] || {};
|
|
@@ -9393,9 +9436,14 @@ export default async function farmNitroEventHandler(event) {
|
|
|
9393
9436
|
}
|
|
9394
9437
|
}
|
|
9395
9438
|
const sharpRuntimeStagePromise = imageRuntime === "node" ? stageSharpRuntime(config, root, distDir, fs, preset) : Promise.resolve(null);
|
|
9396
|
-
const
|
|
9439
|
+
const prebuiltSSRFilesPromise = canReusePrebuiltSSR ? prepareSSRBundleFiles(
|
|
9440
|
+
ssrBundle,
|
|
9441
|
+
shouldMinify ? { keepNames: keepServerNames, target: "node18" } : null
|
|
9442
|
+
) : Promise.resolve(null);
|
|
9443
|
+
const [nitroBuildResult, sharpRuntimeStageResult, prebuiltSSRFilesResult] = await Promise.allSettled([
|
|
9397
9444
|
nitroBuilder.build(nitroInstance),
|
|
9398
|
-
sharpRuntimeStagePromise
|
|
9445
|
+
sharpRuntimeStagePromise,
|
|
9446
|
+
prebuiltSSRFilesPromise
|
|
9399
9447
|
]);
|
|
9400
9448
|
await nitroInstance.close();
|
|
9401
9449
|
if (nitroBuildResult.status === "rejected") {
|
|
@@ -9410,6 +9458,9 @@ export default async function farmNitroEventHandler(event) {
|
|
|
9410
9458
|
if (sharpRuntimeStageResult.status === "rejected") {
|
|
9411
9459
|
throw sharpRuntimeStageResult.reason;
|
|
9412
9460
|
}
|
|
9461
|
+
if (prebuiltSSRFilesResult.status === "rejected") {
|
|
9462
|
+
throw prebuiltSSRFilesResult.reason;
|
|
9463
|
+
}
|
|
9413
9464
|
const stagedSharpRuntime = await _asyncNullishCoalesce(sharpRuntimeStageResult.value, async () => ( (imageRuntime === "node" ? await stageSharpRuntime(config, root, distDir, fs, preset) : null)));
|
|
9414
9465
|
const runtimeCopyPromise = (async () => {
|
|
9415
9466
|
if (stagedSharpRuntime) {
|
|
@@ -9420,10 +9471,9 @@ export default async function farmNitroEventHandler(event) {
|
|
|
9420
9471
|
}
|
|
9421
9472
|
})();
|
|
9422
9473
|
const copyResults = await Promise.allSettled([
|
|
9423
|
-
|
|
9424
|
-
|
|
9474
|
+
prebuiltSSRFilesResult.value ? writeSSRBundleFiles(
|
|
9475
|
+
prebuiltSSRFilesResult.value,
|
|
9425
9476
|
_path2.default.join(outputDir, "server", FARM_SSR_OUTPUT_DIR),
|
|
9426
|
-
shouldMinify ? { keepNames: keepServerNames, target: "node18" } : null,
|
|
9427
9477
|
fs
|
|
9428
9478
|
) : Promise.resolve(),
|
|
9429
9479
|
runtimeCopyPromise
|
|
@@ -9467,21 +9517,29 @@ function resolveFarmNitroOutputConfig(preset, outputDir) {
|
|
|
9467
9517
|
};
|
|
9468
9518
|
}
|
|
9469
9519
|
_chunkS3JO3N4Hcjs.__name.call(void 0, resolveFarmNitroOutputConfig, "resolveFarmNitroOutputConfig");
|
|
9470
|
-
|
|
9520
|
+
function prepareSSRBundleFiles(ssrBundle, minifyOptions) {
|
|
9521
|
+
return Promise.all(
|
|
9522
|
+
Object.entries(ssrBundle).map(async ([fileName, output]) => ({
|
|
9523
|
+
fileName,
|
|
9524
|
+
contents: output.type === "asset" ? output.source : minifyOptions ? await minifyFarmServerChunk(output.code, fileName, minifyOptions) : output.code
|
|
9525
|
+
}))
|
|
9526
|
+
);
|
|
9527
|
+
}
|
|
9528
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, prepareSSRBundleFiles, "prepareSSRBundleFiles");
|
|
9529
|
+
async function writeSSRBundleFiles(files, targetDir, fs) {
|
|
9471
9530
|
await fs.rm(targetDir, { recursive: true, force: true });
|
|
9472
9531
|
await Promise.all(
|
|
9473
|
-
|
|
9532
|
+
files.map(async ({ fileName, contents }) => {
|
|
9474
9533
|
const targetPath = _path2.default.join(targetDir, fileName);
|
|
9475
9534
|
await fs.mkdir(_path2.default.dirname(targetPath), { recursive: true });
|
|
9476
|
-
|
|
9477
|
-
await fs.writeFile(targetPath, output.source);
|
|
9478
|
-
return;
|
|
9479
|
-
}
|
|
9480
|
-
const code = minifyOptions ? await minifyFarmServerChunk(output.code, fileName, minifyOptions) : output.code;
|
|
9481
|
-
await fs.writeFile(targetPath, code);
|
|
9535
|
+
await fs.writeFile(targetPath, contents);
|
|
9482
9536
|
})
|
|
9483
9537
|
);
|
|
9484
9538
|
}
|
|
9539
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, writeSSRBundleFiles, "writeSSRBundleFiles");
|
|
9540
|
+
async function copyPrebuiltSSRBundle(ssrBundle, targetDir, minifyOptions, fs) {
|
|
9541
|
+
await writeSSRBundleFiles(await prepareSSRBundleFiles(ssrBundle, minifyOptions), targetDir, fs);
|
|
9542
|
+
}
|
|
9485
9543
|
_chunkS3JO3N4Hcjs.__name.call(void 0, copyPrebuiltSSRBundle, "copyPrebuiltSSRBundle");
|
|
9486
9544
|
async function registerPrebuiltSSRPackageImport(serverDir, ssrEntryFile, fs) {
|
|
9487
9545
|
const packagePath = _path2.default.join(serverDir, "package.json");
|
|
@@ -9505,7 +9563,7 @@ async function moveVercelOutputPath(src, dest, fs) {
|
|
|
9505
9563
|
await fs.rename(src, dest);
|
|
9506
9564
|
return;
|
|
9507
9565
|
} catch (error) {
|
|
9508
|
-
const code = _optionalChain([error, 'optionalAccess',
|
|
9566
|
+
const code = _optionalChain([error, 'optionalAccess', _191 => _191.code]);
|
|
9509
9567
|
if (code !== "EPERM" && code !== "EACCES" && code !== "EXDEV" && code !== "ENOTEMPTY") {
|
|
9510
9568
|
throw error;
|
|
9511
9569
|
}
|
|
@@ -9532,7 +9590,7 @@ async function postProcessVercelOutput(root, outputDir, fs, config, farmWorkflow
|
|
|
9532
9590
|
try {
|
|
9533
9591
|
await moveVercelOutputPath(publicDir, staticDir, fs);
|
|
9534
9592
|
} catch (error) {
|
|
9535
|
-
if (_optionalChain([error, 'optionalAccess',
|
|
9593
|
+
if (_optionalChain([error, 'optionalAccess', _192 => _192.code]) !== "ENOENT") throw error;
|
|
9536
9594
|
}
|
|
9537
9595
|
await copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs);
|
|
9538
9596
|
await copyPrismaClientForVercel(root, nitroFuncDir, fs);
|
|
@@ -9565,7 +9623,7 @@ async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs) {
|
|
|
9565
9623
|
const docsContentDir = resolveBuildDocsContentDir(config, root);
|
|
9566
9624
|
if (!docsContentDir) return;
|
|
9567
9625
|
const bundledContentDir = _path2.default.join(nitroFuncDir, "farm-docs-content");
|
|
9568
|
-
const lastModifiedManifest =
|
|
9626
|
+
const lastModifiedManifest = _chunkAXYTGLF3cjs.createFarmDocsLastModifiedManifest.call(void 0, docsContentDir, {
|
|
9569
9627
|
fallback: "now"
|
|
9570
9628
|
});
|
|
9571
9629
|
await fs.rm(bundledContentDir, { recursive: true, force: true });
|
|
@@ -9575,7 +9633,7 @@ async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs) {
|
|
|
9575
9633
|
force: true
|
|
9576
9634
|
});
|
|
9577
9635
|
await fs.writeFile(
|
|
9578
|
-
_path2.default.join(bundledContentDir,
|
|
9636
|
+
_path2.default.join(bundledContentDir, _chunkAXYTGLF3cjs.FARM_DOCS_LAST_MODIFIED_MANIFEST),
|
|
9579
9637
|
`${JSON.stringify(lastModifiedManifest, null, 2)}
|
|
9580
9638
|
`
|
|
9581
9639
|
);
|
|
@@ -9652,7 +9710,7 @@ async function stageSharpRuntime(config, root, distDir, fs, preset) {
|
|
|
9652
9710
|
try {
|
|
9653
9711
|
await copyPackage("sharp", sharpRequire);
|
|
9654
9712
|
if (!copiedPackages.has("sharp")) {
|
|
9655
|
-
throw new Error(`Farm image optimization requires sharp. ${
|
|
9713
|
+
throw new Error(`Farm image optimization requires sharp. ${_chunkR7LCG3BTcjs.SHARP_INSTALL_HINT}`);
|
|
9656
9714
|
}
|
|
9657
9715
|
} catch (error) {
|
|
9658
9716
|
await fs.rm(stageDir, { recursive: true, force: true });
|
|
@@ -9746,11 +9804,7 @@ function resolveMetadataImageRuntimePackageJson(root) {
|
|
|
9746
9804
|
_chunkS3JO3N4Hcjs.__name.call(void 0, resolveMetadataImageRuntimePackageJson, "resolveMetadataImageRuntimePackageJson");
|
|
9747
9805
|
async function copyMetadataImageRuntime(root, nitroFuncDir, fs) {
|
|
9748
9806
|
const packageJsonPath = resolveMetadataImageRuntimePackageJson(root);
|
|
9749
|
-
if (!packageJsonPath)
|
|
9750
|
-
throw new Error(
|
|
9751
|
-
`The server output imports @vercel/og, which is not installed. ${_chunkLYLEZIG3cjs.VERCEL_OG_INSTALL_HINT}`
|
|
9752
|
-
);
|
|
9753
|
-
}
|
|
9807
|
+
if (!packageJsonPath) return;
|
|
9754
9808
|
const packageJson = JSON.parse(await fs.readFile(packageJsonPath, "utf8"));
|
|
9755
9809
|
const packageDir = _path2.default.dirname(packageJsonPath);
|
|
9756
9810
|
const targetDir = _path2.default.join(nitroFuncDir, "node_modules", "@vercel", "og");
|
|
@@ -9870,7 +9924,7 @@ function createBuildTargetBaseline(config) {
|
|
|
9870
9924
|
preset,
|
|
9871
9925
|
distDir,
|
|
9872
9926
|
outputDir,
|
|
9873
|
-
outputWasDerived: outputDir ===
|
|
9927
|
+
outputWasDerived: outputDir === _chunkO5DVPF3Rcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
|
|
9874
9928
|
};
|
|
9875
9929
|
}
|
|
9876
9930
|
_chunkS3JO3N4Hcjs.__name.call(void 0, createBuildTargetBaseline, "createBuildTargetBaseline");
|
|
@@ -9880,8 +9934,8 @@ function resolveBuildTargets(config, options, baseline) {
|
|
|
9880
9934
|
const distDir = config.distDir || ".farm";
|
|
9881
9935
|
const outputWasReplaced = config.deploy.outputDir !== baseline.outputDir;
|
|
9882
9936
|
const shouldRefreshDerivedOutput = baseline.outputWasDerived && !outputWasReplaced && (preset !== baseline.preset || distDir !== baseline.distDir);
|
|
9883
|
-
const deployTarget = preset === config.deploy.preset ? config.deploy.target :
|
|
9884
|
-
const outputDir = shouldRefreshDerivedOutput ?
|
|
9937
|
+
const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkO5DVPF3Rcjs.getDeployTargetForPreset.call(void 0, preset);
|
|
9938
|
+
const outputDir = shouldRefreshDerivedOutput ? _chunkO5DVPF3Rcjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
|
|
9885
9939
|
return {
|
|
9886
9940
|
root,
|
|
9887
9941
|
preset,
|
|
@@ -9889,7 +9943,7 @@ function resolveBuildTargets(config, options, baseline) {
|
|
|
9889
9943
|
distDir,
|
|
9890
9944
|
deployTarget,
|
|
9891
9945
|
outputDir,
|
|
9892
|
-
deployOutputDir:
|
|
9946
|
+
deployOutputDir: _chunkO5DVPF3Rcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
|
|
9893
9947
|
};
|
|
9894
9948
|
}
|
|
9895
9949
|
_chunkS3JO3N4Hcjs.__name.call(void 0, resolveBuildTargets, "resolveBuildTargets");
|
|
@@ -9898,7 +9952,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
9898
9952
|
const targetBaseline = createBuildTargetBaseline(config);
|
|
9899
9953
|
let targets;
|
|
9900
9954
|
const productionViteResultPromise = options.universal === false ? void 0 : Promise.allSettled([Promise.resolve(_nullishCoalesce(options.productionVite, () => ( _chunkA6WIQH5Zcjs.loadFarmProductionVite.call(void 0, ))))]);
|
|
9901
|
-
const pluginManager = new (0,
|
|
9955
|
+
const pluginManager = new (0, _chunkR7LCG3BTcjs.PluginManager)({
|
|
9902
9956
|
config,
|
|
9903
9957
|
isDev: false,
|
|
9904
9958
|
isProd: true
|
|
@@ -9927,12 +9981,12 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
9927
9981
|
};
|
|
9928
9982
|
config = {
|
|
9929
9983
|
...config,
|
|
9930
|
-
images:
|
|
9984
|
+
images: _chunkR7LCG3BTcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
|
|
9931
9985
|
root: targets.root,
|
|
9932
9986
|
preset: targets.preset
|
|
9933
9987
|
})
|
|
9934
9988
|
};
|
|
9935
|
-
if (_optionalChain([config, 'access',
|
|
9989
|
+
if (_optionalChain([config, 'access', _193 => _193.docs, 'optionalAccess', _194 => _194.enabled])) await _chunkIK6LVLKCcjs.loadFarmDocsEngine.call(void 0, );
|
|
9936
9990
|
pluginManager.updateContext({ config });
|
|
9937
9991
|
const { root, preset, srcDir, distDir, deployOutputDir } = targets;
|
|
9938
9992
|
_chunk5QIKR7RRcjs.logger.info(`\u{1F69C} Building Farm.js application with preset: ${preset}...`);
|
|
@@ -9946,8 +10000,8 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
9946
10000
|
});
|
|
9947
10001
|
_chunk5QIKR7RRcjs.logger.info("\u{1F50D} Discovering routes and API endpoints...");
|
|
9948
10002
|
const productionViteResult = productionViteResultPromise ? (await productionViteResultPromise)[0] : void 0;
|
|
9949
|
-
if (_optionalChain([productionViteResult, 'optionalAccess',
|
|
9950
|
-
const productionVite = _optionalChain([productionViteResult, 'optionalAccess',
|
|
10003
|
+
if (_optionalChain([productionViteResult, 'optionalAccess', _195 => _195.status]) === "rejected") throw productionViteResult.reason;
|
|
10004
|
+
const productionVite = _optionalChain([productionViteResult, 'optionalAccess', _196 => _196.value]);
|
|
9951
10005
|
const createViteServer = productionVite ? productionVite.createServer : (await import("vite")).createServer;
|
|
9952
10006
|
projectModuleServer = await createProjectModuleServer(
|
|
9953
10007
|
createViteServer,
|
|
@@ -9955,7 +10009,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
9955
10009
|
root,
|
|
9956
10010
|
rendererBuild.signal
|
|
9957
10011
|
);
|
|
9958
|
-
const farmApp =
|
|
10012
|
+
const farmApp = _chunkR7LCG3BTcjs.createFarmApp.call(void 0, config, projectModuleServer);
|
|
9959
10013
|
await farmApp.initialize();
|
|
9960
10014
|
const routeManager = farmApp.getRouteManager();
|
|
9961
10015
|
const serverRenderer = farmApp.getServerRenderer();
|
|
@@ -9965,8 +10019,8 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
9965
10019
|
layers: config.layers,
|
|
9966
10020
|
plugins: config.plugins,
|
|
9967
10021
|
extraRoutes: [
|
|
9968
|
-
..._optionalChain([config, 'access',
|
|
9969
|
-
...
|
|
10022
|
+
..._optionalChain([config, 'access', _197 => _197.openapi, 'optionalAccess', _198 => _198.enabled]) && config.openapi.route ? [config.openapi.route] : [],
|
|
10023
|
+
..._chunkAXYTGLF3cjs.getFarmDocsRouteTypeEntries.call(void 0, config.docs)
|
|
9970
10024
|
],
|
|
9971
10025
|
suppressLintOnLink: config.suppressLintOnLink,
|
|
9972
10026
|
componentExtensions: config.renderer.componentExtensions,
|
|
@@ -9975,7 +10029,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
9975
10029
|
const message = error instanceof Error ? error.message : String(error);
|
|
9976
10030
|
_chunk5QIKR7RRcjs.logger.warn(`Route type generation failed (farm.d.ts may be stale): ${message}`);
|
|
9977
10031
|
});
|
|
9978
|
-
const apiRouteManager = new (0,
|
|
10032
|
+
const apiRouteManager = new (0, _chunkBD2U4ZL6cjs.APIRouteManager)(
|
|
9979
10033
|
_chunkVPTDD5XFcjs.getFarmAppDirectories.call(void 0, config),
|
|
9980
10034
|
projectModuleServer,
|
|
9981
10035
|
{
|
|
@@ -10050,7 +10104,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
10050
10104
|
throw error;
|
|
10051
10105
|
} finally {
|
|
10052
10106
|
try {
|
|
10053
|
-
await _optionalChain([projectModuleServer, 'optionalAccess',
|
|
10107
|
+
await _optionalChain([projectModuleServer, 'optionalAccess', _199 => _199.close, 'call', _200 => _200()]);
|
|
10054
10108
|
} finally {
|
|
10055
10109
|
rendererBuild.abort();
|
|
10056
10110
|
}
|
|
@@ -10062,7 +10116,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
10062
10116
|
ssr: true,
|
|
10063
10117
|
buildLifetime
|
|
10064
10118
|
});
|
|
10065
|
-
const viteConfig =
|
|
10119
|
+
const viteConfig = _chunkR7LCG3BTcjs.mergeFarmViteConfig.call(void 0,
|
|
10066
10120
|
{
|
|
10067
10121
|
root,
|
|
10068
10122
|
appType: "custom",
|
|
@@ -10074,7 +10128,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
10074
10128
|
},
|
|
10075
10129
|
plugins: [
|
|
10076
10130
|
...rendererVitePlugins,
|
|
10077
|
-
|
|
10131
|
+
_chunkR7LCG3BTcjs.farmFontImportsPlugin.call(void 0, {
|
|
10078
10132
|
root,
|
|
10079
10133
|
basePath: config.basePath,
|
|
10080
10134
|
publicDir: config.publicDir
|
|
@@ -10086,7 +10140,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
10086
10140
|
hmr: false
|
|
10087
10141
|
},
|
|
10088
10142
|
resolve: {
|
|
10089
|
-
alias:
|
|
10143
|
+
alias: _chunkR7LCG3BTcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
10090
10144
|
dedupe: [...config.renderer.dedupe || []]
|
|
10091
10145
|
},
|
|
10092
10146
|
optimizeDeps: {
|
|
@@ -10172,7 +10226,7 @@ async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
|
|
|
10172
10226
|
define: {
|
|
10173
10227
|
__FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
|
|
10174
10228
|
__FARM_ENV__: JSON.stringify(_chunkVEKFLAQMcjs.createBundledEnv.call(void 0, config.env)),
|
|
10175
|
-
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access',
|
|
10229
|
+
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _201 => _201.env, 'optionalAccess', _202 => _202.public]) || {})
|
|
10176
10230
|
},
|
|
10177
10231
|
plugins: [
|
|
10178
10232
|
farmI18nClientBridgePlugin(),
|
|
@@ -10207,7 +10261,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
10207
10261
|
if (pluginManager) {
|
|
10208
10262
|
nitroConfig = await pluginManager.runHookSerial("beforeNitroBuild", nitroConfig);
|
|
10209
10263
|
}
|
|
10210
|
-
const outputDir =
|
|
10264
|
+
const outputDir = _chunkO5DVPF3Rcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
10211
10265
|
const serverOutputDir = _path2.default.join(outputDir, "server");
|
|
10212
10266
|
const publicOutputDir = _path2.default.join(outputDir, "public");
|
|
10213
10267
|
const { mkdir, cp } = await import("fs/promises");
|
|
@@ -10278,7 +10332,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
10278
10332
|
root,
|
|
10279
10333
|
preset,
|
|
10280
10334
|
distDir,
|
|
10281
|
-
outputDir:
|
|
10335
|
+
outputDir: _chunkO5DVPF3Rcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
|
|
10282
10336
|
});
|
|
10283
10337
|
}
|
|
10284
10338
|
}
|