@farm.js/core 0.1.87 → 0.2.0-beta.1
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-IIWSUXSQ.cjs +17 -0
- package/dist/{analyzer-W4EB7DHL.mjs → analyzer-RYSF2BM3.mjs} +2 -2
- package/dist/api/route-manager.cjs +3 -3
- package/dist/api/route-manager.mjs +2 -2
- package/dist/api.cjs +4 -4
- package/dist/api.mjs +3 -3
- package/dist/{app.d-b3A4cca5.d.ts → app.d-CoY-zsJt.d.ts} +1 -1
- package/dist/{app.d-AVZXCfcO.d.mts → app.d-DE5KNbmf.d.mts} +1 -1
- package/dist/{chunk-B7L24VPX.cjs → chunk-22KXTL3I.cjs} +6 -4
- package/dist/{chunk-4SJ22WTT.mjs → chunk-23BZ7ZH6.mjs} +1 -1
- package/dist/{chunk-33WR5XV5.cjs → chunk-27ESPHQA.cjs} +4 -4
- package/dist/{chunk-FULX5RYX.cjs → chunk-2OR5WAD5.cjs} +19 -13
- package/dist/{chunk-3F55K4MC.mjs → chunk-2U2GRXP5.mjs} +1 -1
- package/dist/{chunk-K5FLQJW5.mjs → chunk-4A6A6P4T.mjs} +6 -4
- package/dist/chunk-65LZRVCZ.mjs +18 -0
- package/dist/{chunk-XFUPWRKT.cjs → chunk-6BMAGVDI.cjs} +4 -4
- package/dist/{chunk-VCZ4EM5K.cjs → chunk-6ETHVRFO.cjs} +143 -136
- package/dist/{chunk-LBJOHMTB.mjs → chunk-AMMFRXFW.mjs} +1 -1
- package/dist/{chunk-HQ2VAJLW.mjs → chunk-ANKMAGFJ.mjs} +1 -1
- package/dist/{chunk-EZYNIADW.mjs → chunk-CIQCJ72N.mjs} +45 -29
- package/dist/{chunk-A2PPQ5LB.mjs → chunk-CPMK7EFR.mjs} +1 -1
- package/dist/{chunk-B5QRNCIE.mjs → chunk-DATICPTO.mjs} +1 -1
- package/dist/{chunk-QLRI2BX5.mjs → chunk-DZC2XGK4.mjs} +24 -18
- package/dist/{chunk-O7K4HMAQ.mjs → chunk-EBKYRP2P.mjs} +1 -1
- package/dist/{chunk-IM422XKU.cjs → chunk-FJGA3XWL.cjs} +2 -2
- package/dist/{chunk-FLMALEY2.mjs → chunk-GGD57DJA.mjs} +3 -25
- package/dist/chunk-GTHBWZUK.mjs +17 -0
- package/dist/{chunk-CXHVRHM2.cjs → chunk-HENPVGZC.cjs} +2 -2
- package/dist/{chunk-N3VMHPIY.mjs → chunk-HZY63K5C.mjs} +2 -2
- package/dist/{chunk-5D73SKF3.mjs → chunk-ISSFWEPY.mjs} +1 -1
- package/dist/chunk-JIGWHFA5.mjs +32 -0
- package/dist/{chunk-YBXIVQCE.cjs → chunk-JP5TWUK2.cjs} +4 -4
- package/dist/{chunk-TI4BZV6M.cjs → chunk-KBIM7PFQ.cjs} +73 -67
- package/dist/{chunk-UGD53SNO.cjs → chunk-KQ6TYQU7.cjs} +16 -12
- package/dist/{chunk-XMVZXZ32.cjs → chunk-KRU3XPOW.cjs} +2 -2
- package/dist/{chunk-SDNYULFS.cjs → chunk-L4B7PB3H.cjs} +157 -141
- package/dist/{chunk-7BNVUIGL.cjs → chunk-M3JYBZO2.cjs} +2 -2
- package/dist/{chunk-VCI776NG.cjs → chunk-N2ZMSSPP.cjs} +12 -10
- package/dist/{chunk-2UYYXSUS.mjs → chunk-N5NRXLCX.mjs} +4 -2
- package/dist/{chunk-ZCX2XJPY.cjs → chunk-ND65INFS.cjs} +2 -2
- package/dist/{chunk-26HESRBL.mjs → chunk-NVXU5BEG.mjs} +47 -28
- package/dist/{chunk-OBVBII5K.cjs → chunk-NZRAUCUL.cjs} +2 -2
- package/dist/{chunk-U3A46QFD.cjs → chunk-OIPPISQ6.cjs} +81 -62
- package/dist/{chunk-6MZSTPD2.mjs → chunk-OQOII62L.mjs} +1 -1
- package/dist/{chunk-2PJVEL56.cjs → chunk-PCAEJNQF.cjs} +5 -27
- package/dist/{chunk-Q73LRKLP.mjs → chunk-PKV3JGMS.mjs} +1 -1
- package/dist/{chunk-3AV4DCXY.mjs → chunk-PWTBXYJY.mjs} +12 -6
- package/dist/{chunk-PO5MZIWK.mjs → chunk-QBXS4TNG.mjs} +6 -2
- package/dist/chunk-QZUCVJZJ.cjs +18 -0
- package/dist/chunk-SIECKBNK.cjs +17 -0
- package/dist/{chunk-HFRG2IQS.mjs → chunk-SPKZCFPH.mjs} +5 -4
- package/dist/{chunk-CN2JOTRO.cjs → chunk-THGSPDFD.cjs} +7 -7
- package/dist/{chunk-WSQ3S3NV.cjs → chunk-TWFJJPE7.cjs} +13 -12
- package/dist/{chunk-HYL372GW.cjs → chunk-V3Y3R3JJ.cjs} +1 -1
- package/dist/{chunk-QSDIJ45N.mjs → chunk-VZWAXQME.mjs} +1 -1
- package/dist/{chunk-A4WWKG2B.cjs → chunk-WEZTGM7N.cjs} +2 -2
- package/dist/{chunk-JB4BHRFK.cjs → chunk-WP77JDKI.cjs} +16 -16
- package/dist/{chunk-VPGEYX5Y.mjs → chunk-WX752VMN.mjs} +2 -2
- package/dist/chunk-YIGUFJMR.cjs +32 -0
- package/dist/{chunk-4FGTNYHE.mjs → chunk-YPAOC3FO.mjs} +2 -2
- package/dist/{chunk-LIWVPE72.mjs → chunk-Z7ZRBCAB.mjs} +23 -16
- package/dist/{chunk-RGYS5OPL.cjs → chunk-ZPQY7O64.cjs} +3 -3
- package/dist/client.cjs +8 -6
- package/dist/client.d.mts +5 -5
- package/dist/client.d.ts +5 -5
- package/dist/client.mjs +7 -5
- package/dist/{devtools-GWJZPWIW.mjs → devtools-5DBTT2DI.mjs} +1 -1
- package/dist/{devtools-GPIKZ5AV.cjs → devtools-JTJA2KIZ.cjs} +2 -2
- package/dist/docs.cjs +3 -3
- package/dist/docs.mjs +2 -2
- package/dist/environment/vite.cjs +3 -3
- package/dist/environment/vite.mjs +2 -2
- package/dist/i18n/client.cjs +11 -10
- package/dist/i18n/client.mjs +3 -2
- package/dist/index.cjs +30 -28
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.mjs +25 -23
- package/dist/internal/build-runtime.cjs +17 -17
- package/dist/internal/build-runtime.mjs +16 -16
- 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/client-runtime.cjs +11 -12
- package/dist/internal/client-runtime.d.mts +6 -4
- package/dist/internal/client-runtime.d.ts +6 -4
- package/dist/internal/client-runtime.mjs +11 -12
- package/dist/internal/config-runtime.cjs +3 -3
- package/dist/internal/config-runtime.mjs +2 -2
- package/dist/internal/infra-analytics-runtime.cjs +6 -6
- package/dist/internal/infra-analytics-runtime.mjs +4 -4
- package/dist/internal/islands-boot.cjs +20 -15
- package/dist/internal/islands-boot.mjs +6 -1
- 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 +4 -4
- package/dist/internal/production-runtime.mjs +3 -3
- package/dist/internal/spa-router.cjs +4 -3
- package/dist/internal/spa-router.d.mts +1 -1
- package/dist/internal/spa-router.d.ts +1 -1
- package/dist/internal/spa-router.mjs +3 -2
- package/dist/{manager-PX4QN4HK.cjs → manager-37UJPUN4.cjs} +4 -4
- package/dist/{manager-OMTC5FOJ.mjs → manager-7BNSJKME.mjs} +3 -3
- package/dist/{navigation-delegate.d-ChfinbWB.d.mts → navigation-delegate.d-B9GjWbov.d.mts} +1 -1
- package/dist/{navigation-delegate.d-fMgELdAe.d.ts → navigation-delegate.d-BbW1_pf_.d.ts} +1 -1
- package/dist/navigation.cjs +6 -5
- package/dist/navigation.d.mts +2 -2
- package/dist/navigation.d.ts +2 -2
- package/dist/navigation.mjs +5 -4
- package/dist/plugin.cjs +12 -12
- package/dist/plugin.mjs +11 -11
- package/dist/query/client.cjs +8 -7
- package/dist/query/client.mjs +3 -2
- package/dist/renderer-client.cjs +14 -13
- package/dist/renderer-client.d.mts +3 -3
- package/dist/renderer-client.d.ts +3 -3
- package/dist/renderer-client.mjs +5 -4
- package/dist/{router.d-D5Mp7bpO.d.ts → router.d-Bm9FNSu3.d.ts} +1 -1
- package/dist/{router.d-DrQ1QDFk.d.mts → router.d-YKVirmj4.d.mts} +1 -1
- package/dist/{rsc-pipeline-TQOSDWOU.cjs → rsc-pipeline-LGXJGGMW.cjs} +3 -3
- package/dist/{rsc-pipeline-KLMQU3YP.mjs → rsc-pipeline-W5DSWDHD.mjs} +2 -2
- package/dist/{runtime-BDPBO65S.mjs → runtime-UOZKSM5S.mjs} +2 -2
- package/dist/{runtime-CQSCRVZ7.cjs → runtime-YV4X5FAK.cjs} +4 -4
- package/dist/server.cjs +48 -33
- package/dist/server.d.mts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.mjs +28 -13
- package/dist/{spa-router.d-CXgvy-7L.d.mts → spa-router.d-DGmropfK.d.mts} +3 -1
- package/dist/{spa-router.d-BXxoU3Cv.d.ts → spa-router.d-nE1jHNGt.d.ts} +3 -1
- package/dist/{store-core.d-D00BsbnO.d.ts → store-core.d-B5cwOd8g.d.ts} +2 -2
- package/dist/{store-core.d-CDbVAbTn.d.mts → store-core.d-C-gATBwd.d.mts} +2 -2
- package/dist/testing.cjs +2 -2
- package/dist/testing.mjs +2 -2
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +12 -12
- package/dist/vite.mjs +11 -11
- package/package.json +3 -3
- package/dist/analyzer-LLU2Z6I4.cjs +0 -17
- package/dist/chunk-SBDWCDS6.cjs +0 -8
- package/dist/chunk-YX6AFPXC.mjs +0 -8
- /package/dist/{chunk-MZR22RAC.cjs → chunk-FLKG2PYH.cjs} +0 -0
- /package/dist/{chunk-ALOFMAFA.mjs → chunk-OOOUYA6L.mjs} +0 -0
|
@@ -32,7 +32,7 @@ var _chunkMHKPXX3Jcjs = require('./chunk-MHKPXX3J.cjs');
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
var
|
|
35
|
+
var _chunkZPQY7O64cjs = require('./chunk-ZPQY7O64.cjs');
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
|
|
@@ -40,7 +40,7 @@ var _chunkRGYS5OPLcjs = require('./chunk-RGYS5OPL.cjs');
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
var
|
|
43
|
+
var _chunkHENPVGZCcjs = require('./chunk-HENPVGZC.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 _chunkFLKG2PYHcjs = require('./chunk-FLKG2PYH.cjs');
|
|
74
74
|
|
|
75
75
|
|
|
76
76
|
var _chunk3BTN3NP7cjs = require('./chunk-3BTN3NP7.cjs');
|
|
@@ -116,7 +116,7 @@ var _chunkO4JYMU5Ncjs = require('./chunk-O4JYMU5N.cjs');
|
|
|
116
116
|
|
|
117
117
|
|
|
118
118
|
|
|
119
|
-
var
|
|
119
|
+
var _chunkKBIM7PFQcjs = require('./chunk-KBIM7PFQ.cjs');
|
|
120
120
|
|
|
121
121
|
|
|
122
122
|
|
|
@@ -132,11 +132,11 @@ var _chunkVACYUMXWcjs = require('./chunk-VACYUMXW.cjs');
|
|
|
132
132
|
|
|
133
133
|
|
|
134
134
|
|
|
135
|
-
var
|
|
135
|
+
var _chunkKRU3XPOWcjs = require('./chunk-KRU3XPOW.cjs');
|
|
136
136
|
|
|
137
137
|
|
|
138
138
|
|
|
139
|
-
var
|
|
139
|
+
var _chunk27ESPHQAcjs = require('./chunk-27ESPHQA.cjs');
|
|
140
140
|
|
|
141
141
|
|
|
142
142
|
|
|
@@ -163,7 +163,7 @@ var _chunk47JV57DAcjs = require('./chunk-47JV57DA.cjs');
|
|
|
163
163
|
|
|
164
164
|
|
|
165
165
|
|
|
166
|
-
var
|
|
166
|
+
var _chunk6BMAGVDIcjs = require('./chunk-6BMAGVDI.cjs');
|
|
167
167
|
|
|
168
168
|
|
|
169
169
|
|
|
@@ -171,7 +171,7 @@ var _chunkXFUPWRKTcjs = require('./chunk-XFUPWRKT.cjs');
|
|
|
171
171
|
var _chunkW53Z4WDIcjs = require('./chunk-W53Z4WDI.cjs');
|
|
172
172
|
|
|
173
173
|
|
|
174
|
-
var
|
|
174
|
+
var _chunkFJGA3XWLcjs = require('./chunk-FJGA3XWL.cjs');
|
|
175
175
|
|
|
176
176
|
|
|
177
177
|
var _chunk4EBC7EMWcjs = require('./chunk-4EBC7EMW.cjs');
|
|
@@ -192,7 +192,7 @@ var _chunk4EBC7EMWcjs = require('./chunk-4EBC7EMW.cjs');
|
|
|
192
192
|
|
|
193
193
|
|
|
194
194
|
|
|
195
|
-
var
|
|
195
|
+
var _chunkOIPPISQ6cjs = require('./chunk-OIPPISQ6.cjs');
|
|
196
196
|
|
|
197
197
|
|
|
198
198
|
|
|
@@ -281,7 +281,10 @@ var _chunkNW3DL2PMcjs = require('./chunk-NW3DL2PM.cjs');
|
|
|
281
281
|
var _chunkSHDCKRP4cjs = require('./chunk-SHDCKRP4.cjs');
|
|
282
282
|
|
|
283
283
|
|
|
284
|
-
var
|
|
284
|
+
var _chunkTWFJJPE7cjs = require('./chunk-TWFJJPE7.cjs');
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
var _chunkSIECKBNKcjs = require('./chunk-SIECKBNK.cjs');
|
|
285
288
|
|
|
286
289
|
|
|
287
290
|
var _chunkCYOTNHDFcjs = require('./chunk-CYOTNHDF.cjs');
|
|
@@ -309,7 +312,7 @@ var _chunk7U4XF76Rcjs = require('./chunk-7U4XF76R.cjs');
|
|
|
309
312
|
var _chunk2OF5RPVUcjs = require('./chunk-2OF5RPVU.cjs');
|
|
310
313
|
|
|
311
314
|
|
|
312
|
-
var
|
|
315
|
+
var _chunkV3Y3R3JJcjs = require('./chunk-V3Y3R3JJ.cjs');
|
|
313
316
|
|
|
314
317
|
|
|
315
318
|
var _chunkY3DO7BIJcjs = require('./chunk-Y3DO7BIJ.cjs');
|
|
@@ -662,7 +665,7 @@ async function compileFarmDocsManifest(docs, options) {
|
|
|
662
665
|
isPathGuarded: options.isPathGuarded,
|
|
663
666
|
basePath
|
|
664
667
|
});
|
|
665
|
-
const apiHandler =
|
|
668
|
+
const apiHandler = _chunkHENPVGZCcjs.createFarmDocsAPIHandler.call(void 0, {
|
|
666
669
|
rootDir: options.root,
|
|
667
670
|
srcDir: options.srcDir,
|
|
668
671
|
docs,
|
|
@@ -1128,7 +1131,7 @@ async function createFarmRouteRuntimeManifest(options) {
|
|
|
1128
1131
|
const routes = [];
|
|
1129
1132
|
for (const [pattern, entry] of options.routeManager.getRoutes()) {
|
|
1130
1133
|
const routeModule = await options.routeManager.loadRouteModule(entry.modulePath);
|
|
1131
|
-
const rendering = await
|
|
1134
|
+
const rendering = await _chunkKRU3XPOWcjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
|
|
1132
1135
|
const runtimeConfig = await options.routeManager.resolveRouteRuntimeConfig(pattern);
|
|
1133
1136
|
routes.push({
|
|
1134
1137
|
kind: "page",
|
|
@@ -1506,7 +1509,7 @@ function collectServerReadSSRAssets(bundle) {
|
|
|
1506
1509
|
}
|
|
1507
1510
|
return assets;
|
|
1508
1511
|
}
|
|
1509
|
-
function collectServerOnlySSRAssets(bundle) {
|
|
1512
|
+
function collectServerOnlySSRAssets(bundle, polyroute = false) {
|
|
1510
1513
|
const serverOnly = /* @__PURE__ */ new Set();
|
|
1511
1514
|
const publicReferenceSources = [];
|
|
1512
1515
|
for (const [fileName, output] of Object.entries(bundle)) {
|
|
@@ -1529,6 +1532,7 @@ function collectServerOnlySSRAssets(bundle) {
|
|
|
1529
1532
|
}
|
|
1530
1533
|
}
|
|
1531
1534
|
for (const fileName of serverOnly) {
|
|
1535
|
+
if (polyroute && /(?:^|\/)polyroute\/[a-f0-9]+\/[^/]+\.wasm$/.test(fileName)) continue;
|
|
1532
1536
|
const name = _path2.default.posix.basename(fileName);
|
|
1533
1537
|
if (publicReferenceSources.some((source) => source.includes(name))) {
|
|
1534
1538
|
serverOnly.delete(fileName);
|
|
@@ -1741,7 +1745,7 @@ function farmStripPlatformConfigPlugin(configFiles) {
|
|
|
1741
1745
|
// removed block used (`readFileSync` for a version, say).
|
|
1742
1746
|
enforce: "pre",
|
|
1743
1747
|
transform: {
|
|
1744
|
-
filter: { id:
|
|
1748
|
+
filter: { id: _chunkKBIM7PFQcjs.fileNamePattern.call(void 0, configFiles) },
|
|
1745
1749
|
async handler(code, id) {
|
|
1746
1750
|
const file = id.split("?", 1)[0];
|
|
1747
1751
|
if (!files.has(_path2.default.resolve(file)) && !files.has(realPath(file))) return null;
|
|
@@ -2060,7 +2064,7 @@ async function writeFarmVercelEdgeMiddlewareFunction(options) {
|
|
|
2060
2064
|
logLevel: "silent",
|
|
2061
2065
|
plugins: [edgeNodeModulesPlugin(coreDir, unsupported)],
|
|
2062
2066
|
resolve: {
|
|
2063
|
-
alias:
|
|
2067
|
+
alias: _chunkKBIM7PFQcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
2064
2068
|
conditionNames: ["edge-light", "worker", "browser", "import", "module", "default"]
|
|
2065
2069
|
},
|
|
2066
2070
|
transform: {
|
|
@@ -2462,7 +2466,7 @@ function createOmittedMetadataImageRuntimePlugin(externalizeOtherImports) {
|
|
|
2462
2466
|
return {
|
|
2463
2467
|
name: "farm-omitted-metadata-image-runtime",
|
|
2464
2468
|
resolveId: {
|
|
2465
|
-
filter: { id:
|
|
2469
|
+
filter: { id: _chunkKBIM7PFQcjs.exactIdPattern.call(void 0, ["@vercel/og"]) },
|
|
2466
2470
|
handler(source, importer) {
|
|
2467
2471
|
if (source !== "@vercel/og") return null;
|
|
2468
2472
|
const fromCoreRuntime = importer !== void 0 && isFarmCoreModule(importer) && !/^og\.[cm]?[jt]sx?$/.test(_path2.default.basename(importer.split("?", 1)[0]));
|
|
@@ -2471,7 +2475,7 @@ function createOmittedMetadataImageRuntimePlugin(externalizeOtherImports) {
|
|
|
2471
2475
|
}
|
|
2472
2476
|
},
|
|
2473
2477
|
load: {
|
|
2474
|
-
filter: { id:
|
|
2478
|
+
filter: { id: _chunkKBIM7PFQcjs.exactIdPattern.call(void 0, [FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID]) },
|
|
2475
2479
|
handler(id) {
|
|
2476
2480
|
if (id !== FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID) return null;
|
|
2477
2481
|
return `
|
|
@@ -3038,7 +3042,7 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
3038
3042
|
}
|
|
3039
3043
|
const { bundle: ssrBundle, entryFile: ssrEntryFile, configuredHeaderRoutes } = ssrResult;
|
|
3040
3044
|
assertServerReadSSRAssetsSupported(ssrBundle, preset, root);
|
|
3041
|
-
await writeSSRAssetsToClient(ssrBundle, clientOutputDir);
|
|
3045
|
+
await writeSSRAssetsToClient(ssrBundle, clientOutputDir, ssrResult.polyroute);
|
|
3042
3046
|
if (!rendererDisabled) {
|
|
3043
3047
|
await writeFarmVideoPlayerToClient(clientOutputDir);
|
|
3044
3048
|
}
|
|
@@ -3091,7 +3095,7 @@ function collectFarmPrerenderedMarkdownBodies(pageRoutes) {
|
|
|
3091
3095
|
for (const route of pageRoutes) {
|
|
3092
3096
|
if (route.source === void 0 || !_chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) continue;
|
|
3093
3097
|
const { body } = _chunk26WP75W5cjs.parseMarkdownFrontmatter.call(void 0, route.source);
|
|
3094
|
-
const rendering =
|
|
3098
|
+
const rendering = _chunkKRU3XPOWcjs.resolveRouteRenderingConfig.call(void 0,
|
|
3095
3099
|
_chunk26WP75W5cjs.readFarmMarkdownRouteConfig.call(void 0, body),
|
|
3096
3100
|
route.source
|
|
3097
3101
|
);
|
|
@@ -3116,9 +3120,9 @@ function varyFarmNitroCacheRules(rules, headerNames) {
|
|
|
3116
3120
|
})
|
|
3117
3121
|
);
|
|
3118
3122
|
}
|
|
3119
|
-
async function writeSSRAssetsToClient(bundle, outputDir) {
|
|
3123
|
+
async function writeSSRAssetsToClient(bundle, outputDir, polyroute) {
|
|
3120
3124
|
const fs5 = await import("fs/promises");
|
|
3121
|
-
const serverOnlyAssets = collectServerOnlySSRAssets(bundle);
|
|
3125
|
+
const serverOnlyAssets = collectServerOnlySSRAssets(bundle, polyroute);
|
|
3122
3126
|
for (const [fileName, output] of Object.entries(bundle)) {
|
|
3123
3127
|
if (output.type !== "asset" || serverOnlyAssets.has(fileName)) continue;
|
|
3124
3128
|
if (fileName === "farm-fonts.css") {
|
|
@@ -3135,7 +3139,7 @@ async function writeFarmVideoPlayerToClient(outputDir) {
|
|
|
3135
3139
|
const filePath = _path2.default.join(outputDir, _chunkY3DO7BIJcjs.FARM_VIDEO_PLAYER_PATH.slice(1));
|
|
3136
3140
|
await fs5.mkdir(_path2.default.dirname(filePath), { recursive: true });
|
|
3137
3141
|
try {
|
|
3138
|
-
await fs5.writeFile(filePath,
|
|
3142
|
+
await fs5.writeFile(filePath, _chunkKBIM7PFQcjs.FARM_VIDEO_PLAYER_HTML, { flag: "wx" });
|
|
3139
3143
|
} catch (error) {
|
|
3140
3144
|
if (error.code !== "EEXIST") throw error;
|
|
3141
3145
|
}
|
|
@@ -3169,7 +3173,7 @@ async function mergeBuiltFontCss(outputDir, fontCssSource) {
|
|
|
3169
3173
|
}
|
|
3170
3174
|
const normalizedFontCss = typeof fontCss === "string" ? fontCss : Buffer.from(fontCss).toString("utf8");
|
|
3171
3175
|
await fs5.writeFile(fontCssPath, normalizedFontCss);
|
|
3172
|
-
await fs5.writeFile(clientCssPath,
|
|
3176
|
+
await fs5.writeFile(clientCssPath, _chunkKBIM7PFQcjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
|
|
3173
3177
|
}
|
|
3174
3178
|
function importsFarmClientBlockedPackage(id, packageName) {
|
|
3175
3179
|
return id === packageName || id.startsWith(`${packageName}/`);
|
|
@@ -3219,10 +3223,10 @@ async function validateClientBuildOutput(root, srcDir, outputDir) {
|
|
|
3219
3223
|
}
|
|
3220
3224
|
}
|
|
3221
3225
|
function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, options = {}) {
|
|
3222
|
-
const key =
|
|
3226
|
+
const key = _chunkOIPPISQ6cjs.getClientModuleHydrationPlanKey.call(void 0, modulePath, root, mode, options);
|
|
3223
3227
|
let plan = cache.get(key);
|
|
3224
3228
|
if (!plan) {
|
|
3225
|
-
plan =
|
|
3229
|
+
plan = _chunkOIPPISQ6cjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
|
|
3226
3230
|
cache.set(key, plan);
|
|
3227
3231
|
}
|
|
3228
3232
|
return { ...plan, isolatedBoundaries: [...plan.isolatedBoundaries] };
|
|
@@ -3256,14 +3260,14 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3256
3260
|
`[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
|
|
3257
3261
|
);
|
|
3258
3262
|
}
|
|
3259
|
-
const isolatedMode =
|
|
3263
|
+
const isolatedMode = _chunkOIPPISQ6cjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
3260
3264
|
_optionalChain([config, 'access', _98 => _98.experimental, 'optionalAccess', _99 => _99.isolatedClientHydration]),
|
|
3261
3265
|
{
|
|
3262
3266
|
serverComponents: _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _100 => _100.experimental, 'optionalAccess', _101 => _101.serverComponents])) === "rsc",
|
|
3263
3267
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
3264
3268
|
}
|
|
3265
3269
|
);
|
|
3266
|
-
const planOptions =
|
|
3270
|
+
const planOptions = _chunkOIPPISQ6cjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
3267
3271
|
config.renderer,
|
|
3268
3272
|
Boolean(unsupportedIntegrationProvider)
|
|
3269
3273
|
);
|
|
@@ -3288,7 +3292,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3288
3292
|
);
|
|
3289
3293
|
const syntheticDocsEntry = _optionalChain([config, 'access', _108 => _108.docs, 'optionalAccess', _109 => _109.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
|
|
3290
3294
|
const syntheticDocsPatterns = syntheticDocsEntry ? syntheticDocsEntry === "/" ? ["/", "/[...slug]"] : [syntheticDocsEntry, `${syntheticDocsEntry}/[...slug]`] : [];
|
|
3291
|
-
const plan = (operation) => sourceSnapshot ?
|
|
3295
|
+
const plan = (operation) => sourceSnapshot ? _chunkOIPPISQ6cjs.withFarmSourceSnapshotOf.call(void 0, sourceSnapshot, operation) : _chunkOIPPISQ6cjs.withFarmSourceSnapshot.call(void 0, operation);
|
|
3292
3296
|
const { clientLayouts, clientRouteSlots } = plan(() => {
|
|
3293
3297
|
const clientLayouts2 = layoutRoutes.map((layout) => {
|
|
3294
3298
|
try {
|
|
@@ -3335,7 +3339,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3335
3339
|
};
|
|
3336
3340
|
}
|
|
3337
3341
|
});
|
|
3338
|
-
const markdownPagePlan =
|
|
3342
|
+
const markdownPagePlan = _chunkOIPPISQ6cjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
3339
3343
|
_chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), root),
|
|
3340
3344
|
root,
|
|
3341
3345
|
isolatedMode,
|
|
@@ -3351,7 +3355,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3351
3355
|
pagePlanOptions
|
|
3352
3356
|
)
|
|
3353
3357
|
}));
|
|
3354
|
-
|
|
3358
|
+
_chunkOIPPISQ6cjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
3355
3359
|
clientLayouts2.map((layout) => ({
|
|
3356
3360
|
pattern: layout.pattern,
|
|
3357
3361
|
depth: layout.pattern.split("/").filter(Boolean).length,
|
|
@@ -3385,7 +3389,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3385
3389
|
const matchesBuiltRoute = pageRoutes.some((route) => layoutAppliesToRoute(layout.pattern, routeDirectory(route))) || docsEntries.some((docsEntry) => layoutAppliesToRoute(layout.pattern, docsEntry));
|
|
3386
3390
|
if (matchesBuiltRoute && layout.suppressedAsyncHydration) {
|
|
3387
3391
|
_chunk7U4XF76Rcjs.logger.warn(
|
|
3388
|
-
`\u26A0\uFE0F ${
|
|
3392
|
+
`\u26A0\uFE0F ${_chunkOIPPISQ6cjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`
|
|
3389
3393
|
);
|
|
3390
3394
|
}
|
|
3391
3395
|
}
|
|
@@ -3420,7 +3424,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3420
3424
|
);
|
|
3421
3425
|
if (metadata.suppressedAsyncHydration) {
|
|
3422
3426
|
_chunk7U4XF76Rcjs.logger.warn(
|
|
3423
|
-
`\u26A0\uFE0F ${
|
|
3427
|
+
`\u26A0\uFE0F ${_chunkOIPPISQ6cjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
|
|
3424
3428
|
);
|
|
3425
3429
|
}
|
|
3426
3430
|
const slotBoundaries = serverSlotPlans.filter(
|
|
@@ -3428,7 +3432,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3428
3432
|
).flatMap(({ plan: plan2 }) => plan2.isolatedBoundaries);
|
|
3429
3433
|
if (metadata.shouldHydrate || metadata.hasIsolatedClientBoundaries || applicableClientLayouts.length > 0 || slotBoundaries.length > 0) {
|
|
3430
3434
|
const relativePath = route.modulePath.replace(root, "").replace(/^\//, "");
|
|
3431
|
-
const islandStrategy =
|
|
3435
|
+
const islandStrategy = _chunkKBIM7PFQcjs.resolveFarmRouteRootStrategy.call(void 0,
|
|
3432
3436
|
route,
|
|
3433
3437
|
metadata,
|
|
3434
3438
|
clientLayouts2,
|
|
@@ -3447,7 +3451,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3447
3451
|
...applicableClientLayouts.filter((layout) => layout.hasIsolatedClientBoundaries || layout.serverTreeLayout).flatMap((layout) => layout.isolatedBoundaries)
|
|
3448
3452
|
],
|
|
3449
3453
|
// The server renders a server tree only below a hydrating layout.
|
|
3450
|
-
...
|
|
3454
|
+
..._chunkOIPPISQ6cjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
|
|
3451
3455
|
});
|
|
3452
3456
|
_chunk7U4XF76Rcjs.logger.info(`\u{1F4F1} Found hydratable route: ${route.pattern} -> ${route.modulePath}`);
|
|
3453
3457
|
}
|
|
@@ -3484,7 +3488,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3484
3488
|
}
|
|
3485
3489
|
const clientRouteSlots2 = routeSlots.filter((slot) => {
|
|
3486
3490
|
try {
|
|
3487
|
-
const metadata =
|
|
3491
|
+
const metadata = _chunkOIPPISQ6cjs.getClientModuleMetadata.call(void 0, slot.modulePath, root);
|
|
3488
3492
|
return metadata.shouldHydrate && (!islandsMode || metadata.isClientComponent);
|
|
3489
3493
|
} catch (error) {
|
|
3490
3494
|
_chunk7U4XF76Rcjs.logger.warn(`\u26A0\uFE0F Could not inspect route slot ${slot.modulePath}: ${error}`);
|
|
@@ -3537,11 +3541,11 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3537
3541
|
config.trailingSlash,
|
|
3538
3542
|
_chunkB3HQTGXScjs.getIntegrationProviders.call(void 0, config.integrations),
|
|
3539
3543
|
config.basePath,
|
|
3540
|
-
|
|
3544
|
+
_chunkKBIM7PFQcjs.generateClientCachePersistenceCode.call(void 0, _chunkKBIM7PFQcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
|
|
3541
3545
|
adapterOwnsDocsRuntime ? _chunkXJDB564Acjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0,
|
|
3542
3546
|
_chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _112 => _112.experimental, 'optionalAccess', _113 => _113.serverComponents])) === "islands",
|
|
3543
3547
|
platform,
|
|
3544
|
-
islandsMode ?
|
|
3548
|
+
islandsMode ? _chunkOIPPISQ6cjs.collectFarmServerStylesheets.call(void 0,
|
|
3545
3549
|
[
|
|
3546
3550
|
...layoutRoutes.map((layout) => layout.modulePath),
|
|
3547
3551
|
...pageRoutes.filter((route) => !isAdapterDocsRoute(route.pattern)).map((route) => route.modulePath)
|
|
@@ -3565,7 +3569,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3565
3569
|
await fs5.writeFile(_path2.default.join(clientEntryDir, "farm-client-root.tsx"), clientEntry.root);
|
|
3566
3570
|
}
|
|
3567
3571
|
const clientInput = { [entryName]: clientEntryPath };
|
|
3568
|
-
if (platform === "web" &&
|
|
3572
|
+
if (platform === "web" && _chunkKBIM7PFQcjs.canBootFarmIslandsClient.call(void 0, config)) {
|
|
3569
3573
|
const clientBootPath = _path2.default.join(clientEntryDir, "farm-client-boot.tsx");
|
|
3570
3574
|
await fs5.writeFile(
|
|
3571
3575
|
clientBootPath,
|
|
@@ -3640,7 +3644,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3640
3644
|
}
|
|
3641
3645
|
},
|
|
3642
3646
|
plugins: [
|
|
3643
|
-
|
|
3647
|
+
_chunkKBIM7PFQcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
3644
3648
|
createFarmPrivateClientSourcemapsPlugin({
|
|
3645
3649
|
outDir: _path2.default.join(
|
|
3646
3650
|
_path2.default.dirname(outputDir),
|
|
@@ -3694,7 +3698,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3694
3698
|
...islandsMode && _chunkT7UC2ORAcjs.isReactRenderer.call(void 0, config.renderer) ? [createFarmIslandsReactChunkPlugin()] : [],
|
|
3695
3699
|
farmServerOnlyEntriesPlugin({ platform, distDir: config.distDir || ".farm" }),
|
|
3696
3700
|
farmNavigationPlugin(config.renderer),
|
|
3697
|
-
|
|
3701
|
+
_chunkKBIM7PFQcjs.farmDocsClientConfigPlugin.call(void 0,
|
|
3698
3702
|
adapterOwnsDocsRuntime ? _chunkXJDB564Acjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
|
|
3699
3703
|
),
|
|
3700
3704
|
// Plugin to redirect @farm.js/core imports to client-only exports
|
|
@@ -3727,7 +3731,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3727
3731
|
},
|
|
3728
3732
|
load: {
|
|
3729
3733
|
filter: {
|
|
3730
|
-
id:
|
|
3734
|
+
id: _chunkKBIM7PFQcjs.exactIdPattern.call(void 0, [
|
|
3731
3735
|
"\0empty-module",
|
|
3732
3736
|
"\0empty-api-route",
|
|
3733
3737
|
"\0farm-i18n-client-bridge",
|
|
@@ -3765,7 +3769,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3765
3769
|
{ ...config, isolatedClientBoundaryModules, programmaticClientRoutes, sourceSnapshot },
|
|
3766
3770
|
pluginManager
|
|
3767
3771
|
),
|
|
3768
|
-
|
|
3772
|
+
_chunkOIPPISQ6cjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
|
|
3769
3773
|
],
|
|
3770
3774
|
mode: "production",
|
|
3771
3775
|
css: postcssSearchPath ? {
|
|
@@ -3773,7 +3777,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3773
3777
|
} : void 0,
|
|
3774
3778
|
// Ensure React is bundled for client
|
|
3775
3779
|
resolve: {
|
|
3776
|
-
alias:
|
|
3780
|
+
alias: _chunkKBIM7PFQcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
3777
3781
|
dedupe: [...config.renderer.dedupe || []]
|
|
3778
3782
|
},
|
|
3779
3783
|
// Optimize dependencies - exclude server-side code from client bundle
|
|
@@ -3787,7 +3791,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3787
3791
|
}
|
|
3788
3792
|
};
|
|
3789
3793
|
await viteBuild(
|
|
3790
|
-
|
|
3794
|
+
_chunkKBIM7PFQcjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite, { clientOutput: true })
|
|
3791
3795
|
);
|
|
3792
3796
|
if (platform === "mobile") {
|
|
3793
3797
|
await fs5.rm(_path2.default.join(outputDir, `${entryName}.css`), { force: true });
|
|
@@ -3881,9 +3885,9 @@ async function fetchFarmNavigationDocument(url, headers, recover = true, signal)
|
|
|
3881
3885
|
return response;
|
|
3882
3886
|
}
|
|
3883
3887
|
|
|
3884
|
-
${streamNavigations ? `${
|
|
3888
|
+
${streamNavigations ? `${_chunkKBIM7PFQcjs.FARM_NAVIGATION_STREAM_READER_SOURCE}
|
|
3885
3889
|
|
|
3886
|
-
${
|
|
3890
|
+
${_chunkKBIM7PFQcjs.FARM_EARLY_NAVIGATION_SOURCE}` : ""}
|
|
3887
3891
|
|
|
3888
3892
|
function clearFarmPrefetchCacheOnDeploymentMismatch(router, error) {
|
|
3889
3893
|
if (error?.name === "FarmDeploymentMismatchError") {
|
|
@@ -5218,7 +5222,7 @@ import { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};
|
|
|
5218
5222
|
const React = { ...__farmRendererClient };`
|
|
5219
5223
|
);
|
|
5220
5224
|
const hydrateFarmRouteCall = _chunkT7UC2ORAcjs.isReactRenderer.call(void 0, renderer) ? "return hydrateRoot(container, route.element);" : "return route.layouts.length > 0 ? hydrateRoot(container, route.element, route) : hydrateRoot(container, route.element);";
|
|
5221
|
-
const providerClientCode =
|
|
5225
|
+
const providerClientCode = _chunkKBIM7PFQcjs.generateFarmIntegrationProviderClientCode.call(void 0,
|
|
5222
5226
|
integrationProviders,
|
|
5223
5227
|
root,
|
|
5224
5228
|
_nullishCoalesce(renderer.componentExtensions, () => ( []))
|
|
@@ -5335,7 +5339,7 @@ function isFarmDocsPath() {
|
|
|
5335
5339
|
// Farm.js Client Runtime (no client components)
|
|
5336
5340
|
${cssImport}
|
|
5337
5341
|
${layoutImports}
|
|
5338
|
-
import { createClientCancellation, createClientPluginManager, createPluginlessClientRuntime, getFarmIslandValueHeaders, getHashTargetElement, installChunkErrorRecovery, installFarmLinkPrefetch, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, readFarmLinkNavigateOptions, rememberFarmLinkLocale, reconcileFarmDocumentHead, runFarmNavigationDelegates, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
|
|
5342
|
+
import { createClientCancellation, createClientPluginManager, createPluginlessClientRuntime, getFarmIslandValueHeaders, getHashTargetElement, installChunkErrorRecovery, installFarmLinkPrefetch, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, isFarmSameDocumentFragment, readFarmLinkNavigateOptions, targetsCurrentContext, rememberFarmLinkLocale, reconcileFarmDocumentHead, runFarmNavigationDelegates, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
|
|
5339
5343
|
import { createFarmDeploymentMismatchError, createFarmDeploymentRequestHeaders, isFarmDeploymentMismatchResponse } from "@farm.js/core/deployment";
|
|
5340
5344
|
${clientPluginEntry.imports}
|
|
5341
5345
|
${clientCachePersistence.imports}
|
|
@@ -5352,7 +5356,7 @@ mountFarmDocsSearch();
|
|
|
5352
5356
|
|
|
5353
5357
|
${generateUniversalRouterStateRuntime()}
|
|
5354
5358
|
|
|
5355
|
-
${
|
|
5359
|
+
${_chunkKBIM7PFQcjs.FARM_NAVIGATION_SCRIPT_SOURCE}
|
|
5356
5360
|
|
|
5357
5361
|
// SPA Router for server-rendered pages (HTML swap)
|
|
5358
5362
|
const spaRouter = {
|
|
@@ -5551,6 +5555,7 @@ ${generateUniversalRouterStateProperties()}
|
|
|
5551
5555
|
}
|
|
5552
5556
|
});
|
|
5553
5557
|
}
|
|
5558
|
+
if (isFarmSameDocumentFragment(url.href, window.location.href)) return;
|
|
5554
5559
|
|
|
5555
5560
|
const pathname = url.pathname + url.search;
|
|
5556
5561
|
if (this.readFreshPrefetch(pathname) !== undefined) return;
|
|
@@ -5622,7 +5627,7 @@ document.addEventListener("click", function(e) {
|
|
|
5622
5627
|
if (anchor.hasAttribute("download")) return;
|
|
5623
5628
|
if (hasAbsoluteNavigationHref(href)) return;
|
|
5624
5629
|
if (href.startsWith("#")) return;
|
|
5625
|
-
if (anchor
|
|
5630
|
+
if (!targetsCurrentContext(anchor)) return;
|
|
5626
5631
|
if (document.documentElement.dataset.farmDocsRuntime === "true") return;
|
|
5627
5632
|
if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) return;
|
|
5628
5633
|
if (e.button !== 0) return;
|
|
@@ -5847,7 +5852,7 @@ ${lazyRoot ? "" : layoutImports}
|
|
|
5847
5852
|
${rendererClientImports}
|
|
5848
5853
|
${isolatedHydrationImport}
|
|
5849
5854
|
${providerClientCode.imports}
|
|
5850
|
-
import { createClientCancellation, createClientPluginManager, createPluginlessClientRuntime, getFarmIslandValueHeaders, getHashTargetElement, keepFarmIslandValues, installChunkErrorRecovery, installFarmLinkPrefetch, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, readFarmLinkNavigateOptions, rememberFarmLinkLocale, reconcileFarmDocumentHead, replayFarmQueuedInteraction, runFarmNavigationDelegates, scheduleFarmIslandHydration, createFarmSearchParams, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
|
|
5855
|
+
import { createClientCancellation, createClientPluginManager, createPluginlessClientRuntime, getFarmIslandValueHeaders, getHashTargetElement, keepFarmIslandValues, installChunkErrorRecovery, installFarmLinkPrefetch, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, isFarmSameDocumentFragment, readFarmLinkNavigateOptions, targetsCurrentContext, rememberFarmLinkLocale, reconcileFarmDocumentHead, replayFarmQueuedInteraction, runFarmNavigationDelegates, scheduleFarmIslandHydration, createFarmSearchParams, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
|
|
5851
5856
|
import { createFarmDeploymentMismatchError, createFarmDeploymentRequestHeaders, isFarmDeploymentMismatchResponse } from "@farm.js/core/deployment";
|
|
5852
5857
|
${lazyMatcher ? "" : 'import { createFarmRouter, isFarmRouteActive, matchFarmRoute } from "@farm.js/core/router";'}
|
|
5853
5858
|
${clientPluginEntry.imports}
|
|
@@ -5893,7 +5898,7 @@ ${layoutRegistrations.join(",\n")}
|
|
|
5893
5898
|
${generateFarmClientRouteMatchSource({ lazyMatcher })}
|
|
5894
5899
|
|
|
5895
5900
|
${layoutComponentsRuntime}/*farm-root-start*/
|
|
5896
|
-
${
|
|
5901
|
+
${_chunkKBIM7PFQcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
|
|
5897
5902
|
// Wrap a page element with applicable layouts
|
|
5898
5903
|
function wrapWithLayouts(pageElement, pathname, params) {
|
|
5899
5904
|
const layouts = getApplicableLayouts(pathname);
|
|
@@ -5928,7 +5933,7 @@ function createLayoutPageBoundary(route, pageElement, serverHtml) {
|
|
|
5928
5933
|
return React.createElement("div", props, pageElement);
|
|
5929
5934
|
}
|
|
5930
5935
|
let farmLastRouteState = null;
|
|
5931
|
-
${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${
|
|
5936
|
+
${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${_chunkKBIM7PFQcjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
|
|
5932
5937
|
function farmTreeLayoutsOf(pathname) {
|
|
5933
5938
|
return getApplicableLayouts(pathname).filter(function(layout) {
|
|
5934
5939
|
return layout.serverTree === true;
|
|
@@ -6562,7 +6567,7 @@ function fitsSegmentResponse(currentRoot, nextRoot) {
|
|
|
6562
6567
|
return true;
|
|
6563
6568
|
}` : ""}
|
|
6564
6569
|
|
|
6565
|
-
${
|
|
6570
|
+
${_chunkKBIM7PFQcjs.FARM_NAVIGATION_SCRIPT_SOURCE}
|
|
6566
6571
|
|
|
6567
6572
|
function activateNavigationScripts(root) {
|
|
6568
6573
|
for (const script of Array.from(root?.querySelectorAll?.("script") || [])) {
|
|
@@ -6668,7 +6673,7 @@ function getLayoutShell(root, patterns, index) {
|
|
|
6668
6673
|
return shell.innerHTML;
|
|
6669
6674
|
}
|
|
6670
6675
|
|
|
6671
|
-
${islandValues ?
|
|
6676
|
+
${islandValues ? _chunkKBIM7PFQcjs.FARM_REFRESH_FIELDS_SOURCE : ""}function replaceSharedLayoutBoundary(currentRoot, nextRoot, refresh = false) {
|
|
6672
6677
|
// A refresh keeps the islands still on the page: the ones in streamed Suspense content too.
|
|
6673
6678
|
if (refresh) revealFarmStreamedContent(nextRoot);
|
|
6674
6679
|
const currentPatterns = getLayoutPatterns(currentRoot);
|
|
@@ -7240,6 +7245,7 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
|
|
|
7240
7245
|
}
|
|
7241
7246
|
});
|
|
7242
7247
|
}
|
|
7248
|
+
if (isFarmSameDocumentFragment(url.href, window.location.href)) return;
|
|
7243
7249
|
prefetchFarmClientRouteTable();
|
|
7244
7250
|
|
|
7245
7251
|
// A prefetch warms an ordinary future navigation, which reads the bare
|
|
@@ -7321,7 +7327,7 @@ document.addEventListener("click", function(e) {
|
|
|
7321
7327
|
if (anchor.hasAttribute("download")) return;
|
|
7322
7328
|
if (hasAbsoluteNavigationHref(href)) return;
|
|
7323
7329
|
if (href.startsWith("#")) return;
|
|
7324
|
-
if (anchor
|
|
7330
|
+
if (!targetsCurrentContext(anchor)) return;
|
|
7325
7331
|
if (document.documentElement.dataset.farmDocsRuntime === "true") return;
|
|
7326
7332
|
if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) return;
|
|
7327
7333
|
if (e.button !== 0) return;
|
|
@@ -7373,6 +7379,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7373
7379
|
label: "for SSR"
|
|
7374
7380
|
});
|
|
7375
7381
|
}
|
|
7382
|
+
let polyroute = false;
|
|
7376
7383
|
let ssrBundle;
|
|
7377
7384
|
let ssrEntryFile;
|
|
7378
7385
|
const pageRoutes = collectedPageRoutes.map((route) => ({ ...route }));
|
|
@@ -7450,7 +7457,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7450
7457
|
const appDirs = _chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, config);
|
|
7451
7458
|
let openAPIReference = null;
|
|
7452
7459
|
if (config.openapi.enabled && config.openapi.route) {
|
|
7453
|
-
const { OpenAPIManager, renderOpenAPIReferenceHTML } = await import("./manager-
|
|
7460
|
+
const { OpenAPIManager, renderOpenAPIReferenceHTML } = await import("./manager-37UJPUN4.cjs");
|
|
7454
7461
|
const openAPIManager = new OpenAPIManager(appDirs, config.openapi, {
|
|
7455
7462
|
mode: "production",
|
|
7456
7463
|
apiBaseURL: config.api.baseURL,
|
|
@@ -7475,7 +7482,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7475
7482
|
}))
|
|
7476
7483
|
);
|
|
7477
7484
|
const instrumentationPath = _chunk3BTN3NP7cjs.resolveFarmInstrumentationFile.call(void 0, root, config.srcDir || "src");
|
|
7478
|
-
const notFoundPath =
|
|
7485
|
+
const notFoundPath = _chunkKBIM7PFQcjs.resolveFarmNotFoundComponentPath.call(void 0,
|
|
7479
7486
|
config,
|
|
7480
7487
|
appDirs,
|
|
7481
7488
|
routeManager.getRendererNotFoundPath()
|
|
@@ -7502,7 +7509,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7502
7509
|
const hasObservabilityHandler = !!config.observability && typeof config.observability === "object" && "onEvent" in config.observability;
|
|
7503
7510
|
const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _131 => _131.mdx, 'optionalAccess', _132 => _132.components]));
|
|
7504
7511
|
const hasMiddlewareConfig = _chunk4ZVKDHS6cjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
|
|
7505
|
-
const hasRouteContextConfig =
|
|
7512
|
+
const hasRouteContextConfig = _chunkFLKG2PYHcjs.hasCustomFarmRouteContext.call(void 0, config);
|
|
7506
7513
|
const hasServerRuntimePlugins = _chunkDMSXZNQRcjs.hasFarmServerRuntimePlugins.call(void 0, config.plugins);
|
|
7507
7514
|
const hasPluginRoutes = hasFarmPluginRoutes(config);
|
|
7508
7515
|
const hasServerCacheConfig = hasFarmServerCacheConfig(config.cache);
|
|
@@ -7514,7 +7521,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7514
7521
|
);
|
|
7515
7522
|
if (_chunkL2GUEYHRcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
|
|
7516
7523
|
const adapterGuardedPaths = new Set(getFarmDocsGuardedPaths(config, middlewareRoutes));
|
|
7517
|
-
|
|
7524
|
+
_chunkHENPVGZCcjs.assertFarmDocsAdapterServesNoGuardedPages.call(void 0,
|
|
7518
7525
|
config.docs,
|
|
7519
7526
|
{ root, srcDir: config.srcDir },
|
|
7520
7527
|
(pathname) => adapterGuardedPaths.has(pathname),
|
|
@@ -7524,7 +7531,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7524
7531
|
const farmDocsCspNonceMarker = _chunk6JHZPB52cjs.createFarmCspNonce.call(void 0, config.security);
|
|
7525
7532
|
const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _133 => _133.docs, 'optionalAccess', _134 => _134.enabled]) && _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? await _chunk2RSVYJT6cjs._runWithFarmCspNonce.call(void 0,
|
|
7526
7533
|
farmDocsCspNonceMarker,
|
|
7527
|
-
async () => _optionalChain([config, 'access', _135 => _135.docs, 'access', _136 => _136.adapter, 'optionalAccess', _137 => _137.server]) ? await
|
|
7534
|
+
async () => _optionalChain([config, 'access', _135 => _135.docs, 'access', _136 => _136.adapter, 'optionalAccess', _137 => _137.server]) ? await _chunkHENPVGZCcjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
|
|
7528
7535
|
root,
|
|
7529
7536
|
srcDir: config.srcDir,
|
|
7530
7537
|
clientEntry: FARM_CLIENT_JS_SRC_PLACEHOLDER,
|
|
@@ -7691,7 +7698,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7691
7698
|
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _143 => _143.env, 'optionalAccess', _144 => _144.public]) || {})
|
|
7692
7699
|
},
|
|
7693
7700
|
plugins: [
|
|
7694
|
-
|
|
7701
|
+
_chunkKBIM7PFQcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
7695
7702
|
...tailwindVitePlugin ? [tailwindVitePlugin] : [],
|
|
7696
7703
|
...rendererVitePlugins,
|
|
7697
7704
|
...config.vite.plugins || [],
|
|
@@ -7723,7 +7730,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7723
7730
|
},
|
|
7724
7731
|
pluginManager
|
|
7725
7732
|
),
|
|
7726
|
-
|
|
7733
|
+
_chunkOIPPISQ6cjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
|
|
7727
7734
|
...hasRuntimeConfigModule ? [
|
|
7728
7735
|
farmStripPlatformConfigPlugin(
|
|
7729
7736
|
[
|
|
@@ -7735,7 +7742,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7735
7742
|
{
|
|
7736
7743
|
name: "farm-virtual-ssr-entry",
|
|
7737
7744
|
resolveId: {
|
|
7738
|
-
filter: { id:
|
|
7745
|
+
filter: { id: _chunkKBIM7PFQcjs.exactIdPattern.call(void 0, [virtualEntryId, "\0virtual:farm-ssr-entry"]) },
|
|
7739
7746
|
handler(id) {
|
|
7740
7747
|
if (id === virtualEntryId || id === "\0virtual:farm-ssr-entry") {
|
|
7741
7748
|
return virtualEntryId;
|
|
@@ -7744,7 +7751,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7744
7751
|
}
|
|
7745
7752
|
},
|
|
7746
7753
|
load: {
|
|
7747
|
-
filter: { id:
|
|
7754
|
+
filter: { id: _chunkKBIM7PFQcjs.exactIdPattern.call(void 0, [virtualEntryId]) },
|
|
7748
7755
|
handler(id) {
|
|
7749
7756
|
if (id === virtualEntryId) {
|
|
7750
7757
|
return virtualEntryCode;
|
|
@@ -7755,16 +7762,24 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7755
7762
|
},
|
|
7756
7763
|
{
|
|
7757
7764
|
name: "capture-ssr-bundle",
|
|
7758
|
-
|
|
7759
|
-
|
|
7760
|
-
|
|
7761
|
-
|
|
7762
|
-
|
|
7763
|
-
|
|
7765
|
+
configResolved(config2) {
|
|
7766
|
+
polyroute = _chunkSIECKBNKcjs.hasPolyroutePlugin.call(void 0, config2.plugins);
|
|
7767
|
+
},
|
|
7768
|
+
enforce: "post",
|
|
7769
|
+
generateBundle: {
|
|
7770
|
+
// Retain assets emitted by user plugins, including post-generateBundle hooks.
|
|
7771
|
+
order: "post",
|
|
7772
|
+
handler(_options, bundle) {
|
|
7773
|
+
ssrBundle = bundle;
|
|
7774
|
+
for (const [fileName, file] of Object.entries(bundle)) {
|
|
7775
|
+
if (file.type === "chunk" && file.isEntry) {
|
|
7776
|
+
ssrEntryFile = fileName;
|
|
7777
|
+
break;
|
|
7778
|
+
}
|
|
7779
|
+
}
|
|
7780
|
+
if (!ssrEntryFile) {
|
|
7781
|
+
throw new Error("No entry point found in SSR bundle");
|
|
7764
7782
|
}
|
|
7765
|
-
}
|
|
7766
|
-
if (!ssrEntryFile) {
|
|
7767
|
-
throw new Error("No entry point found in SSR bundle");
|
|
7768
7783
|
}
|
|
7769
7784
|
}
|
|
7770
7785
|
}
|
|
@@ -7776,7 +7791,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7776
7791
|
resolve: {
|
|
7777
7792
|
alias: [
|
|
7778
7793
|
...shouldAliasReactServerToWebBuild(config.renderer, preset) ? [createFarmReactWebServerAlias(hasReactDomEdgeServerBuild(root))] : [],
|
|
7779
|
-
...Object.entries(
|
|
7794
|
+
...Object.entries(_chunkKBIM7PFQcjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
|
|
7780
7795
|
([find, replacement]) => ({ find, replacement })
|
|
7781
7796
|
)
|
|
7782
7797
|
],
|
|
@@ -7784,7 +7799,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7784
7799
|
dedupe: [...config.renderer.dedupe || []]
|
|
7785
7800
|
}
|
|
7786
7801
|
};
|
|
7787
|
-
await viteBuild(
|
|
7802
|
+
await viteBuild(_chunkKBIM7PFQcjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
|
|
7788
7803
|
} finally {
|
|
7789
7804
|
if (postcssConfigDir) {
|
|
7790
7805
|
try {
|
|
@@ -7794,6 +7809,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7794
7809
|
}
|
|
7795
7810
|
}
|
|
7796
7811
|
return {
|
|
7812
|
+
polyroute,
|
|
7797
7813
|
bundle: ssrBundle,
|
|
7798
7814
|
entryFile: ssrEntryFile,
|
|
7799
7815
|
configuredHeaderRoutes
|
|
@@ -8234,8 +8250,8 @@ function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlot
|
|
|
8234
8250
|
);
|
|
8235
8251
|
const searchPreserveRoutesSource = searchPreserveRoutes.length > 0 ? JSON.stringify(searchPreserveRoutes) : "";
|
|
8236
8252
|
const farmIslandsMode = _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _161 => _161.experimental, 'optionalAccess', _162 => _162.serverComponents])) === "islands";
|
|
8237
|
-
const farmRendererActions =
|
|
8238
|
-
const farmClientBoot =
|
|
8253
|
+
const farmRendererActions = _chunkKBIM7PFQcjs.resolveFarmIslxActionsMode.call(void 0, config) === "renderer";
|
|
8254
|
+
const farmClientBoot = _chunkKBIM7PFQcjs.canBootFarmIslandsClient.call(void 0, config);
|
|
8239
8255
|
const farmMobileClient = shouldBuildFarmMobileClient(config);
|
|
8240
8256
|
const farmMobileShells = farmMobileClient && config.mobileShells ? config.mobileShells : null;
|
|
8241
8257
|
const hasCompressionRuntime = config.compress && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) !== "edge";
|
|
@@ -8249,7 +8265,7 @@ function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlot
|
|
|
8249
8265
|
const servesAiCatalog = _optionalChain([config, 'access', _171 => _171.agent, 'optionalAccess', _172 => _172.aiCatalog]) !== false;
|
|
8250
8266
|
const hasPluginRuntime = hasRuntimeIntegrationConfig || hasServerRuntimePlugins;
|
|
8251
8267
|
const hasInfraAnalyticsRuntime = config.analytics !== false && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
|
|
8252
|
-
const reportsWebMCPCalls = hasInfraAnalyticsRuntime &&
|
|
8268
|
+
const reportsWebMCPCalls = hasInfraAnalyticsRuntime && _chunk27ESPHQAcjs._farmWebMCPReportsEnabled.call(void 0, config.plugins);
|
|
8253
8269
|
const hasPrecompiledDocs = Boolean(farmDocsPrecompiledManifest);
|
|
8254
8270
|
const adapterOwnsDocsRuntime = _chunkL2GUEYHRcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs);
|
|
8255
8271
|
if (_optionalChain([config, 'access', _173 => _173.docs, 'optionalAccess', _174 => _174.enabled]) && _optionalChain([config, 'access', _175 => _175.docs, 'access', _176 => _176.roots, 'optionalAccess', _177 => _177.length]) && !adapterOwnsDocsRuntime) {
|
|
@@ -8335,7 +8351,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8335
8351
|
`Integration provider components are not supported by the "${config.renderer.name}" renderer.`
|
|
8336
8352
|
);
|
|
8337
8353
|
}
|
|
8338
|
-
const providerServerModules =
|
|
8354
|
+
const providerServerModules = _chunkKBIM7PFQcjs.generateFarmIntegrationProviderServerModules.call(void 0,
|
|
8339
8355
|
renderedIntegrationProviders,
|
|
8340
8356
|
config.root,
|
|
8341
8357
|
_nullishCoalesce(config.renderer.componentExtensions, () => ( []))
|
|
@@ -8355,14 +8371,14 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8355
8371
|
const unsupportedIntegrationProvider = renderedIntegrationProviders.find(
|
|
8356
8372
|
(provider) => provider.supportsIsolatedHydration !== true
|
|
8357
8373
|
);
|
|
8358
|
-
const isolatedHydrationMode =
|
|
8374
|
+
const isolatedHydrationMode = _chunkOIPPISQ6cjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
8359
8375
|
_optionalChain([config, 'access', _182 => _182.experimental, 'optionalAccess', _183 => _183.isolatedClientHydration]),
|
|
8360
8376
|
{
|
|
8361
8377
|
serverComponents: _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _184 => _184.experimental, 'optionalAccess', _185 => _185.serverComponents])) === "rsc",
|
|
8362
8378
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
8363
8379
|
}
|
|
8364
8380
|
);
|
|
8365
|
-
const hydrationPlanOptions =
|
|
8381
|
+
const hydrationPlanOptions = _chunkOIPPISQ6cjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
8366
8382
|
config.renderer,
|
|
8367
8383
|
Boolean(unsupportedIntegrationProvider)
|
|
8368
8384
|
);
|
|
@@ -8370,7 +8386,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8370
8386
|
...hydrationPlanOptions,
|
|
8371
8387
|
serverOwners: _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _186 => _186.experimental, 'optionalAccess', _187 => _187.serverComponents])) === "islands"
|
|
8372
8388
|
};
|
|
8373
|
-
const { layoutHydrationPlans, pageHydrationPlans } =
|
|
8389
|
+
const { layoutHydrationPlans, pageHydrationPlans } = _chunkOIPPISQ6cjs.withFarmSourceSnapshot.call(void 0, () => {
|
|
8374
8390
|
const layoutHydrationPlans2 = layoutRoutes.map((layout) => ({
|
|
8375
8391
|
...layout,
|
|
8376
8392
|
hydration: getCachedClientModuleHydrationPlan(
|
|
@@ -8381,7 +8397,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8381
8397
|
{ ...hydrationPlanOptions, serverTreeLayouts: pageHydrationPlanOptions.serverOwners }
|
|
8382
8398
|
)
|
|
8383
8399
|
}));
|
|
8384
|
-
const markdownPagePlan =
|
|
8400
|
+
const markdownPagePlan = _chunkOIPPISQ6cjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
8385
8401
|
_chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), config.root),
|
|
8386
8402
|
config.root,
|
|
8387
8403
|
isolatedHydrationMode,
|
|
@@ -8401,7 +8417,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8401
8417
|
);
|
|
8402
8418
|
return { layoutHydrationPlans: layoutHydrationPlans2, pageHydrationPlans: pageHydrationPlans2 };
|
|
8403
8419
|
});
|
|
8404
|
-
|
|
8420
|
+
_chunkOIPPISQ6cjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
8405
8421
|
layoutHydrationPlans.map((layout) => ({
|
|
8406
8422
|
pattern: layout.pattern,
|
|
8407
8423
|
depth: layout.pattern.split("/").filter(Boolean).length,
|
|
@@ -8445,8 +8461,8 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8445
8461
|
orderedPageRoutes.forEach((route, index) => {
|
|
8446
8462
|
const varName = `pageRoute${index}`;
|
|
8447
8463
|
if (_chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) {
|
|
8448
|
-
const renderingDirective2 =
|
|
8449
|
-
const markdownServerTree = pageHydrationPlanOptions.serverOwners &&
|
|
8464
|
+
const renderingDirective2 = _chunkKRU3XPOWcjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
|
|
8465
|
+
const markdownServerTree = pageHydrationPlanOptions.serverOwners && _chunkOIPPISQ6cjs.usesFarmServerTree.call(void 0, pageHydrationPlans.get(route.modulePath));
|
|
8450
8466
|
pageRegistrations.push(`
|
|
8451
8467
|
{
|
|
8452
8468
|
pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
|
|
@@ -8454,14 +8470,14 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8454
8470
|
rendering: ${JSON.stringify(renderingDirective2)},` : ""}${markdownServerTree ? "\n serverTree: true," : ""}
|
|
8455
8471
|
module: createFarmMarkdownRouteModule({
|
|
8456
8472
|
source: ${JSON.stringify(_nullishCoalesce(route.source, () => ( "")))},
|
|
8457
|
-
filePath: ${JSON.stringify(
|
|
8473
|
+
filePath: ${JSON.stringify(_chunkKBIM7PFQcjs.toBakedMarkdownSourcePath.call(void 0, config.root, route.modulePath))},
|
|
8458
8474
|
components: farmMdxComponents,
|
|
8459
8475
|
config: farmMdxConfig,${_chunkT7UC2ORAcjs.isReactRenderer.call(void 0, config.renderer) ? "" : "\n renderer: React,"}
|
|
8460
8476
|
}),
|
|
8461
8477
|
markdownSource: {
|
|
8462
8478
|
source: ${JSON.stringify(_nullishCoalesce(route.source, () => ( "")))},
|
|
8463
8479
|
filePath: ${JSON.stringify(
|
|
8464
|
-
|
|
8480
|
+
_chunkKBIM7PFQcjs.toBakedMarkdownSourcePath.call(void 0, config.root, _nullishCoalesce(route.markdownSourcePath, () => ( route.modulePath)))
|
|
8465
8481
|
)},
|
|
8466
8482
|
},
|
|
8467
8483
|
}`);
|
|
@@ -8471,7 +8487,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8471
8487
|
`import * as ${varName} from ${toVirtualEntryImportSpecifier(route.modulePath)};`
|
|
8472
8488
|
);
|
|
8473
8489
|
const clientMetadata = pageHydrationPlans.get(route.modulePath);
|
|
8474
|
-
const renderingDirective =
|
|
8490
|
+
const renderingDirective = _chunkKRU3XPOWcjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
|
|
8475
8491
|
pageRegistrations.push(`
|
|
8476
8492
|
{
|
|
8477
8493
|
pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
|
|
@@ -8479,8 +8495,8 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8479
8495
|
module: ${varName},
|
|
8480
8496
|
shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},${clientMetadata.shouldHydrate ? `
|
|
8481
8497
|
clientModule: ${JSON.stringify(_chunk7U4XF76Rcjs.toViteModuleId.call(void 0, route.modulePath, config.root))},` : ""}
|
|
8482
|
-
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${
|
|
8483
|
-
const rootStrategy =
|
|
8498
|
+
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunkOIPPISQ6cjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${(() => {
|
|
8499
|
+
const rootStrategy = _chunkKBIM7PFQcjs.resolveFarmRouteRootStrategy.call(void 0,
|
|
8484
8500
|
route,
|
|
8485
8501
|
clientMetadata,
|
|
8486
8502
|
layoutHydrationPlans.map((layout) => ({ ...layout, ...layout.hydration })),
|
|
@@ -8493,7 +8509,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8493
8509
|
rendering: ${JSON.stringify(renderingDirective)},` : ""}
|
|
8494
8510
|
${route.source !== void 0 ? `markdownSource: {
|
|
8495
8511
|
source: ${JSON.stringify(route.source)},
|
|
8496
|
-
filePath: ${JSON.stringify(
|
|
8512
|
+
filePath: ${JSON.stringify(_chunkKBIM7PFQcjs.toBakedMarkdownSourcePath.call(void 0, config.root, route.markdownSourcePath))},
|
|
8497
8513
|
},` : ""}
|
|
8498
8514
|
}`);
|
|
8499
8515
|
});
|
|
@@ -8517,7 +8533,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8517
8533
|
pattern: ${JSON.stringify(layout.pattern)},
|
|
8518
8534
|
module: ${varName},
|
|
8519
8535
|
shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},
|
|
8520
|
-
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${treeLayoutPatterns.has(layout.pattern) ? "\n serverTree: true," : ""}${farmIslandsMode &&
|
|
8536
|
+
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${treeLayoutPatterns.has(layout.pattern) ? "\n serverTree: true," : ""}${farmIslandsMode && _chunkKBIM7PFQcjs.canFarmSkipKeptLayoutRender.call(void 0, layout.modulePath, config.root) ? "\n skipKeptRender: true," : ""}${// A layout whose client components hydrate as islands of their own (islands mode,
|
|
8521
8537
|
// isolatedClientHydration, or an async layout): it wraps a docs page as an app page.
|
|
8522
8538
|
clientMetadata.hasIsolatedClientBoundaries ? "\n islands: true," : ""}
|
|
8523
8539
|
}`);
|
|
@@ -8545,7 +8561,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8545
8561
|
containerId: ${JSON.stringify(slot.containerId)},
|
|
8546
8562
|
interception: ${JSON.stringify(slot.interception)},
|
|
8547
8563
|
fallback: ${JSON.stringify(slot.fallback)},
|
|
8548
|
-
hydrates: ${!farmIslandsMode ||
|
|
8564
|
+
hydrates: ${!farmIslandsMode || _chunkOIPPISQ6cjs.getClientModuleMetadata.call(void 0, slot.modulePath, config.root).isClientComponent},
|
|
8549
8565
|
module: ${varName},
|
|
8550
8566
|
}`);
|
|
8551
8567
|
});
|
|
@@ -8591,7 +8607,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8591
8607
|
metadataImageImports.push(
|
|
8592
8608
|
`import * as ${varName} from ${toVirtualEntryImportSpecifier(image.modulePath)};`
|
|
8593
8609
|
);
|
|
8594
|
-
const component = !_chunkT7UC2ORAcjs.isReactRenderer.call(void 0, config.renderer) &&
|
|
8610
|
+
const component = !_chunkT7UC2ORAcjs.isReactRenderer.call(void 0, config.renderer) && _chunkKBIM7PFQcjs.isRendererCompiledComponent.call(void 0, image.modulePath, _nullishCoalesce(_optionalChain([config, 'access', _191 => _191.renderer, 'optionalAccess', _192 => _192.componentExtensions]), () => ( [])));
|
|
8595
8611
|
metadataImageRegistrations.push(`
|
|
8596
8612
|
{
|
|
8597
8613
|
pattern: ${JSON.stringify(image.pattern)},
|
|
@@ -8865,10 +8881,10 @@ import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
|
|
|
8865
8881
|
);
|
|
8866
8882
|
const nativeServerFns = (config.plugins || []).some(
|
|
8867
8883
|
(plugin) => _optionalChain([plugin, 'optionalAccess', _212 => _212.name]) === _chunk4EBC7EMWcjs.FARM_NATIVE_SERVER_FN_PLUGIN
|
|
8868
|
-
) ?
|
|
8884
|
+
) ? _chunkZPQY7O64cjs.collectFarmNativeServerFns.call(void 0, {
|
|
8869
8885
|
root: config.root,
|
|
8870
8886
|
srcDir: config.srcDir,
|
|
8871
|
-
entries:
|
|
8887
|
+
entries: _chunkZPQY7O64cjs.findFarmNativeScreenFiles.call(void 0, _chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, config))
|
|
8872
8888
|
}) : void 0;
|
|
8873
8889
|
const integrationImports = `
|
|
8874
8890
|
${configModulePath ? `import * as FarmUserConfigModule from ${toVirtualEntryImportSpecifier(configModulePath)};` : ""}
|
|
@@ -8883,7 +8899,7 @@ ${nativeServerFns ? `const __farmNativeServerFnRegistry = Object.assign(Object.c
|
|
|
8883
8899
|
${nativeServerFns.flatMap((module, index) => module.exports.map((entry) => ` ${JSON.stringify(entry.id)}: __farmNativeServerFns${index}[${JSON.stringify(entry.name)}],`)).join("\n")}
|
|
8884
8900
|
});` : ""}
|
|
8885
8901
|
`;
|
|
8886
|
-
const imageRuntime =
|
|
8902
|
+
const imageRuntime = _chunkKBIM7PFQcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
|
|
8887
8903
|
const imageRuntimeImport = imageRuntime === "none" ? "" : `import { _withFarmImageSourceClientAddress, createCloudflareImageTransformer, createFarmImageHandler } from "@farm.js/core/image/server";`;
|
|
8888
8904
|
const imageNodeRuntimeImport = imageRuntime === "node" ? `import { createNodeImageFetcher, createNodeImageUrlValidator, createSharpImageTransformer } from "@farm.js/core/image/sharp";` : "";
|
|
8889
8905
|
const apiHandlerCode = apiRoutes.length > 0 ? `
|
|
@@ -9065,7 +9081,7 @@ const farmResolvedRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs);
|
|
|
9065
9081
|
|
|
9066
9082
|
function renderFarmDefault404Page() {
|
|
9067
9083
|
return React.createElement(React.Fragment, null,
|
|
9068
|
-
React.createElement("style", null, ${JSON.stringify(
|
|
9084
|
+
React.createElement("style", null, ${JSON.stringify(_chunkKBIM7PFQcjs.DEFAULT_NOT_FOUND_STYLES)}),
|
|
9069
9085
|
React.createElement("main", {
|
|
9070
9086
|
className: "farm-default-not-found",
|
|
9071
9087
|
"aria-labelledby": "farm-default-not-found-title",
|
|
@@ -9238,7 +9254,7 @@ ${_optionalChain([config, 'access', _222 => _222.agent, 'optionalAccess', _223 =
|
|
|
9238
9254
|
// to the build.
|
|
9239
9255
|
const farmNoindexPreview = resolveFarmPreviewDeployment(
|
|
9240
9256
|
globalThis.process?.env,
|
|
9241
|
-
${JSON.stringify(
|
|
9257
|
+
${JSON.stringify(_chunkFJGA3XWLcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env))},
|
|
9242
9258
|
);` : ""}
|
|
9243
9259
|
const farmMdxComponents = ${mdxComponentsPath ? `(FarmMdxComponentsModule.components || Reflect.get(FarmMdxComponentsModule, "default") || {})` : `(configuredFarmMdxComponents && typeof configuredFarmMdxComponents === "object" ? configuredFarmMdxComponents : {})`};
|
|
9244
9260
|
const farmObservabilityConfig = farmUserConfig?.observability ?? ${JSON.stringify(
|
|
@@ -9374,7 +9390,7 @@ const farmDocsAppRenderer = ${_chunkT7UC2ORAcjs.isReactRenderer.call(void 0, con
|
|
|
9374
9390
|
registerMCPServer: registerFarmMCPServer,
|
|
9375
9391
|
// A page built with this keeps its HTML string, so the preload budget and the response
|
|
9376
9392
|
// writer use it instead of reading and re-encoding the body. Older adapters ignore it.
|
|
9377
|
-
createHtmlResponse: farmOwnedHtmlResponse,${
|
|
9393
|
+
createHtmlResponse: farmOwnedHtmlResponse,${_chunkHENPVGZCcjs.farmDocsAdapterServesGuardedPages.call(void 0, config.docs) ? `
|
|
9378
9394
|
// The adapter keeps pages a path guard covers off search, llms.txt, the sitemap and MCP. It
|
|
9379
9395
|
// asks about any path its own content lists, so the guards decide here, not a page list.
|
|
9380
9396
|
isPathGuarded: (pathname) =>
|
|
@@ -9435,12 +9451,12 @@ const farmDeploymentCookiePath = ${JSON.stringify(config.basePath || "/")};
|
|
|
9435
9451
|
// runtime request.
|
|
9436
9452
|
const farmRuntimeErrorSlot = Symbol("farm.runtime.error.slot");
|
|
9437
9453
|
const farmOpenAPIReference = ${JSON.stringify(openAPIReference)};
|
|
9438
|
-
${_optionalChain([config, 'access', _235 => _235.agent, 'optionalAccess', _236 => _236.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(
|
|
9454
|
+
${_optionalChain([config, 'access', _235 => _235.agent, 'optionalAccess', _236 => _236.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunk6BMAGVDIcjs.resolveFarmApiCatalogInput.call(void 0, config))};
|
|
9439
9455
|
` : ""}${_optionalChain([config, 'access', _237 => _237.agent, 'optionalAccess', _238 => _238.manifest]) !== false ? `const farmAppManifestInput = ${JSON.stringify(
|
|
9440
|
-
|
|
9456
|
+
_chunk6BMAGVDIcjs.resolveFarmAppManifestInput.call(void 0, config, {
|
|
9441
9457
|
build: config.deploymentId,
|
|
9442
|
-
packages:
|
|
9443
|
-
webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ?
|
|
9458
|
+
packages: _chunkKBIM7PFQcjs.resolveFarmAppPackages.call(void 0, config.root),
|
|
9459
|
+
webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunkKBIM7PFQcjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
|
|
9444
9460
|
})
|
|
9445
9461
|
)};
|
|
9446
9462
|
${servesDefaultMCP ? "farmAppManifestInput.defaultMCP = getFarmDefaultMCPServer;\n" : ""}// A guard written for an MCP server's path keeps its tools out of the public view.
|
|
@@ -10948,7 +10964,7 @@ ${servesDefaultMCP ? `// agent.mcp: the default read-only MCP server at /mcp, as
|
|
|
10948
10964
|
// aside for a page route that answers /mcp and for any MCP server published or
|
|
10949
10965
|
// registered at runtime, such as the docs engine's.
|
|
10950
10966
|
const farmDefaultMCPServer = ${JSON.stringify(
|
|
10951
|
-
_chunkW53Z4WDIcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root),
|
|
10967
|
+
_chunkW53Z4WDIcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunkV3Y3R3JJcjs.FARM_VERSION)
|
|
10952
10968
|
)};
|
|
10953
10969
|
let farmDefaultMCPRouteFree;
|
|
10954
10970
|
function getFarmDefaultMCPServer() {
|
|
@@ -11142,7 +11158,7 @@ ${edgeMiddlewareFilePaths.length > 0 ? `
|
|
|
11142
11158
|
// middleware guards is never prerendered. Read once: Nitro's prerender worker sets the variable.
|
|
11143
11159
|
const farmEdgeMiddlewareFiles = new Set(${JSON.stringify(edgeMiddlewareFilePaths)});
|
|
11144
11160
|
const farmPrerendering =
|
|
11145
|
-
typeof process !== "undefined" && process.env?.${
|
|
11161
|
+
typeof process !== "undefined" && process.env?.${_chunk27ESPHQAcjs.FARM_PRERENDER_ENV} === "1";
|
|
11146
11162
|
` : ""}
|
|
11147
11163
|
const farmMiddlewareRunner = ${hasMiddlewareRuntime ? `createProductionMiddlewareRunner({
|
|
11148
11164
|
config: farmMiddlewareConfig,
|
|
@@ -11398,7 +11414,7 @@ ${hasInfraAnalyticsRuntime ? `
|
|
|
11398
11414
|
// endpoints, Markdown mirrors, and docs pages have no app route pattern, so they are
|
|
11399
11415
|
// labeled here; route.pattern keeps meaning the matched app route for plugins.
|
|
11400
11416
|
const farmBuiltInRoutePaths = new Set(${JSON.stringify(
|
|
11401
|
-
|
|
11417
|
+
_chunk6BMAGVDIcjs.listFarmBuiltInRoutePaths.call(void 0, {
|
|
11402
11418
|
agent: {
|
|
11403
11419
|
...config.agent,
|
|
11404
11420
|
aiCatalog: servesAiCatalog,
|
|
@@ -12175,7 +12191,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12175
12191
|
// agent.manifest: /.well-known/farmjs.json (and 0.1.34's /.well-known/farmjs), the app's
|
|
12176
12192
|
// public manifest, the same document for every request.
|
|
12177
12193
|
if (
|
|
12178
|
-
[${JSON.stringify(
|
|
12194
|
+
[${JSON.stringify(_chunk6BMAGVDIcjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunk6BMAGVDIcjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
|
|
12179
12195
|
normalizeRuntimePath(routePathname),
|
|
12180
12196
|
)
|
|
12181
12197
|
) {
|
|
@@ -12187,7 +12203,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12187
12203
|
` : ""}
|
|
12188
12204
|
${_optionalChain([config, 'access', _269 => _269.agent, 'optionalAccess', _270 => _270.apiCatalog]) ? `
|
|
12189
12205
|
// agent.apiCatalog: list the OpenAPI and MCP surfaces at the RFC 9727 path.
|
|
12190
|
-
if (normalizeRuntimePath(routePathname) === ${JSON.stringify(
|
|
12206
|
+
if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunk6BMAGVDIcjs.FARM_API_CATALOG_PATH)}) {
|
|
12191
12207
|
return applyProductionMiddlewareHeaders(
|
|
12192
12208
|
createFarmApiCatalogResponse(request.method, farmApiCatalogInput, request),
|
|
12193
12209
|
middlewareHeaders,
|
|
@@ -14019,7 +14035,7 @@ function getPhysicalPrerenderBypassReason(options) {
|
|
|
14019
14035
|
}
|
|
14020
14036
|
if (_chunk4ZVKDHS6cjs.appMiddlewareMayHandlePath.call(void 0, middlewareRoutes, pathname)) return "app middleware";
|
|
14021
14037
|
if (_chunk4ZVKDHS6cjs.configMiddlewareMayHandlePath.call(void 0, config.middleware, pathname)) return "configured middleware";
|
|
14022
|
-
if (
|
|
14038
|
+
if (_chunkFLKG2PYHcjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
|
|
14023
14039
|
if (farmServerRuntimePluginsMayHandlePath(config, pathname)) return "server runtime plugin";
|
|
14024
14040
|
const manifestEntry = getManifestPageEntry(routeRuntimeManifest, pathname);
|
|
14025
14041
|
if (_optionalChain([manifestEntry, 'optionalAccess', _290 => _290.rendering]) === "dynamic") return "dynamic runtime manifest";
|
|
@@ -14055,7 +14071,7 @@ async function getFarmDocsPrerenderPages(config, root, preset) {
|
|
|
14055
14071
|
}
|
|
14056
14072
|
return pages2;
|
|
14057
14073
|
}
|
|
14058
|
-
const pages = await
|
|
14074
|
+
const pages = await _chunkHENPVGZCcjs.listFarmDocsAdapterPages.call(void 0, config.docs, { root, srcDir: config.srcDir });
|
|
14059
14075
|
if (!pages) {
|
|
14060
14076
|
_chunk7U4XF76Rcjs.logger.warn(
|
|
14061
14077
|
`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.`
|
|
@@ -14069,7 +14085,7 @@ async function listFarmDocsAnalyticsPages(config, root, preset) {
|
|
|
14069
14085
|
return [];
|
|
14070
14086
|
}
|
|
14071
14087
|
try {
|
|
14072
|
-
return await
|
|
14088
|
+
return await _chunkHENPVGZCcjs.listFarmDocsPagePaths.call(void 0, config.docs, {
|
|
14073
14089
|
root,
|
|
14074
14090
|
srcDir: config.srcDir,
|
|
14075
14091
|
adapter: _chunkL2GUEYHRcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)
|
|
@@ -14098,10 +14114,10 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
14098
14114
|
const nitroBuilder = nitroBuilderResult.value;
|
|
14099
14115
|
const isVercel = preset === "vercel";
|
|
14100
14116
|
const isCloudflareWorker = preset === "cloudflare-module";
|
|
14101
|
-
const outputDir =
|
|
14117
|
+
const outputDir = _chunkFLKG2PYHcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
14102
14118
|
const runtimeServerOutputDir = isVercel ? _path2.default.join(outputDir, "functions", "__nitro.func") : _path2.default.join(outputDir, "server");
|
|
14103
14119
|
const ssrOutputDir = _path2.default.join(root, distDir, "ssr");
|
|
14104
|
-
const imageRuntime =
|
|
14120
|
+
const imageRuntime = _chunkKBIM7PFQcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
|
|
14105
14121
|
const hasGeneratedMetadataImages = Array.from(routeManager.getMetadataImages().values()).some(
|
|
14106
14122
|
(image) => image.sourceType === "module"
|
|
14107
14123
|
);
|
|
@@ -14925,13 +14941,13 @@ function toFarmNodeResponse(request, response) {
|
|
|
14925
14941
|
}
|
|
14926
14942
|
if (prerenderRoutes.length > 0) {
|
|
14927
14943
|
_chunk7U4XF76Rcjs.logger.info(`\u{1F4C4} Pre-rendering ${prerenderRoutes.length} SSG page(s)`);
|
|
14928
|
-
const previousPrerender = process.env[
|
|
14929
|
-
process.env[
|
|
14944
|
+
const previousPrerender = process.env[_chunk27ESPHQAcjs.FARM_PRERENDER_ENV];
|
|
14945
|
+
process.env[_chunk27ESPHQAcjs.FARM_PRERENDER_ENV] = "1";
|
|
14930
14946
|
try {
|
|
14931
14947
|
await nitroBuilder.prerender(nitroInstance);
|
|
14932
14948
|
} finally {
|
|
14933
|
-
if (previousPrerender === void 0) delete process.env[
|
|
14934
|
-
else process.env[
|
|
14949
|
+
if (previousPrerender === void 0) delete process.env[_chunk27ESPHQAcjs.FARM_PRERENDER_ENV];
|
|
14950
|
+
else process.env[_chunk27ESPHQAcjs.FARM_PRERENDER_ENV] = previousPrerender;
|
|
14935
14951
|
}
|
|
14936
14952
|
}
|
|
14937
14953
|
const sharpRuntimeStagePromise = imageRuntime === "node" ? stageSharpRuntime(config, root, distDir, fs5, preset) : Promise.resolve(null);
|
|
@@ -15286,7 +15302,7 @@ async function stageSharpRuntime(config, root, distDir, fs5, preset) {
|
|
|
15286
15302
|
try {
|
|
15287
15303
|
await copyPackage("sharp", sharpRequire);
|
|
15288
15304
|
if (!copiedPackages.has("sharp")) {
|
|
15289
|
-
throw new Error(`Farm image optimization requires sharp. ${
|
|
15305
|
+
throw new Error(`Farm image optimization requires sharp. ${_chunkKBIM7PFQcjs.SHARP_INSTALL_HINT}`);
|
|
15290
15306
|
}
|
|
15291
15307
|
} catch (error) {
|
|
15292
15308
|
await fs5.rm(stageDir, { recursive: true, force: true });
|
|
@@ -15519,7 +15535,7 @@ async function createFarmProjectModuleSsrEnvironment() {
|
|
|
15519
15535
|
// src/build/index.ts
|
|
15520
15536
|
async function build(config, options = {}) {
|
|
15521
15537
|
return _chunkNG2EZ6QScjs.withProductionNodeEnv.call(void 0,
|
|
15522
|
-
() =>
|
|
15538
|
+
() => _chunkOIPPISQ6cjs.withPackageClientBoundaryCache.call(void 0, () => buildWithProductionNodeEnv(config, options))
|
|
15523
15539
|
);
|
|
15524
15540
|
}
|
|
15525
15541
|
function createBuildTargetBaseline(config) {
|
|
@@ -15530,7 +15546,7 @@ function createBuildTargetBaseline(config) {
|
|
|
15530
15546
|
preset,
|
|
15531
15547
|
distDir,
|
|
15532
15548
|
outputDir,
|
|
15533
|
-
outputWasDerived: outputDir ===
|
|
15549
|
+
outputWasDerived: outputDir === _chunkFLKG2PYHcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
|
|
15534
15550
|
};
|
|
15535
15551
|
}
|
|
15536
15552
|
function resolveBuildTargets(config, options, baseline) {
|
|
@@ -15539,8 +15555,8 @@ function resolveBuildTargets(config, options, baseline) {
|
|
|
15539
15555
|
const distDir = config.distDir || ".farm";
|
|
15540
15556
|
const outputWasReplaced = config.deploy.outputDir !== baseline.outputDir;
|
|
15541
15557
|
const shouldRefreshDerivedOutput = baseline.outputWasDerived && !outputWasReplaced && (preset !== baseline.preset || distDir !== baseline.distDir);
|
|
15542
|
-
const deployTarget = preset === config.deploy.preset ? config.deploy.target :
|
|
15543
|
-
const outputDir = shouldRefreshDerivedOutput ?
|
|
15558
|
+
const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkFLKG2PYHcjs.getDeployTargetForPreset.call(void 0, preset);
|
|
15559
|
+
const outputDir = shouldRefreshDerivedOutput ? _chunkFLKG2PYHcjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
|
|
15544
15560
|
return {
|
|
15545
15561
|
root,
|
|
15546
15562
|
preset,
|
|
@@ -15548,7 +15564,7 @@ function resolveBuildTargets(config, options, baseline) {
|
|
|
15548
15564
|
distDir,
|
|
15549
15565
|
deployTarget,
|
|
15550
15566
|
outputDir,
|
|
15551
|
-
deployOutputDir:
|
|
15567
|
+
deployOutputDir: _chunkFLKG2PYHcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
|
|
15552
15568
|
};
|
|
15553
15569
|
}
|
|
15554
15570
|
async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
@@ -15585,7 +15601,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
15585
15601
|
};
|
|
15586
15602
|
config = {
|
|
15587
15603
|
...config,
|
|
15588
|
-
images:
|
|
15604
|
+
images: _chunkKBIM7PFQcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
|
|
15589
15605
|
root: targets.root,
|
|
15590
15606
|
preset: targets.preset
|
|
15591
15607
|
})
|
|
@@ -15593,7 +15609,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
15593
15609
|
if (_optionalChain([config, 'access', _345 => _345.docs, 'optionalAccess', _346 => _346.enabled])) await _chunkNDOE76QCcjs.loadFarmDocsEngine.call(void 0, );
|
|
15594
15610
|
pluginManager.updateContext({ config });
|
|
15595
15611
|
const { root, preset, srcDir, distDir, deployOutputDir } = targets;
|
|
15596
|
-
|
|
15612
|
+
_chunkOIPPISQ6cjs.usePackageClientBoundaryCacheFile.call(void 0, _chunkOIPPISQ6cjs.resolvePackageClientBoundaryCacheFile.call(void 0, root, distDir));
|
|
15597
15613
|
_chunk7U4XF76Rcjs.logger.info(`\u{1F69C} Building Farm.js application with preset: ${preset}...`);
|
|
15598
15614
|
await pluginManager.setupPlugins();
|
|
15599
15615
|
await pluginManager.runHookParallel("beforeBundle", {
|
|
@@ -15614,12 +15630,12 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
15614
15630
|
root,
|
|
15615
15631
|
rendererBuild.signal
|
|
15616
15632
|
);
|
|
15617
|
-
const farmApp =
|
|
15633
|
+
const farmApp = _chunkKBIM7PFQcjs.createFarmApp.call(void 0, config, projectModuleServer);
|
|
15618
15634
|
if (options.universal !== false) farmApp.getRouteManager().keepBuildSourceSnapshot();
|
|
15619
15635
|
await farmApp.initialize();
|
|
15620
15636
|
const routeManager = farmApp.getRouteManager();
|
|
15621
15637
|
const serverRenderer = farmApp.getServerRenderer();
|
|
15622
|
-
const typeArtifacts =
|
|
15638
|
+
const typeArtifacts = _chunkKRU3XPOWcjs.generateFarmTypeArtifacts.call(void 0, {
|
|
15623
15639
|
root,
|
|
15624
15640
|
srcDir,
|
|
15625
15641
|
layers: config.layers,
|
|
@@ -15637,7 +15653,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
15637
15653
|
const message = error instanceof Error ? error.message : String(error);
|
|
15638
15654
|
_chunk7U4XF76Rcjs.logger.warn(`Route type generation failed (farm.d.ts may be stale): ${message}`);
|
|
15639
15655
|
});
|
|
15640
|
-
const apiRouteManager = new (0,
|
|
15656
|
+
const apiRouteManager = new (0, _chunkTWFJJPE7cjs.APIRouteManager)(
|
|
15641
15657
|
_chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, config),
|
|
15642
15658
|
projectModuleServer,
|
|
15643
15659
|
{
|
|
@@ -15724,7 +15740,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
15724
15740
|
ssr: true,
|
|
15725
15741
|
buildLifetime
|
|
15726
15742
|
});
|
|
15727
|
-
const viteConfig =
|
|
15743
|
+
const viteConfig = _chunkKBIM7PFQcjs.mergeFarmViteConfig.call(void 0,
|
|
15728
15744
|
{
|
|
15729
15745
|
root,
|
|
15730
15746
|
appType: "custom",
|
|
@@ -15736,13 +15752,13 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
15736
15752
|
},
|
|
15737
15753
|
plugins: [
|
|
15738
15754
|
...rendererVitePlugins,
|
|
15739
|
-
|
|
15755
|
+
_chunkKBIM7PFQcjs.farmFontImportsPlugin.call(void 0, {
|
|
15740
15756
|
root,
|
|
15741
15757
|
basePath: config.basePath,
|
|
15742
15758
|
publicDir: config.publicDir,
|
|
15743
|
-
isLayoutModule: (id) =>
|
|
15759
|
+
isLayoutModule: (id) => _chunkKBIM7PFQcjs.isFarmLayoutModule.call(void 0, id, _chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, config))
|
|
15744
15760
|
}),
|
|
15745
|
-
|
|
15761
|
+
_chunkOIPPISQ6cjs.farmEnvironmentFunctionsPlugin.call(void 0, { renderer: config.renderer }),
|
|
15746
15762
|
// Route modules load here at build time (rendering config, prerendering): `server-only`
|
|
15747
15763
|
// resolves as it does in the server build. Module-entry packages load pre-bundled, as in
|
|
15748
15764
|
// `farm dev`: unbundled, lucide-react alone is ~1,750 modules through the module runner,
|
|
@@ -15758,7 +15774,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
15758
15774
|
hmr: false
|
|
15759
15775
|
},
|
|
15760
15776
|
resolve: {
|
|
15761
|
-
alias:
|
|
15777
|
+
alias: _chunkKBIM7PFQcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
15762
15778
|
dedupe: [...config.renderer.dedupe || []]
|
|
15763
15779
|
},
|
|
15764
15780
|
optimizeDeps: {
|
|
@@ -15836,7 +15852,7 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
|
|
|
15836
15852
|
farmNavigationPlugin(config.renderer),
|
|
15837
15853
|
farmIslandContainersPlugin(config),
|
|
15838
15854
|
farmPlugin(config, pluginManager),
|
|
15839
|
-
|
|
15855
|
+
_chunkOIPPISQ6cjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
|
|
15840
15856
|
],
|
|
15841
15857
|
mode: "production"
|
|
15842
15858
|
});
|
|
@@ -15870,7 +15886,7 @@ async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
|
|
|
15870
15886
|
farmI18nClientBridgePlugin(),
|
|
15871
15887
|
farmIslandContainersPlugin(config),
|
|
15872
15888
|
farmPlugin(config, pluginManager),
|
|
15873
|
-
|
|
15889
|
+
_chunkOIPPISQ6cjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
|
|
15874
15890
|
],
|
|
15875
15891
|
mode: "production"
|
|
15876
15892
|
});
|
|
@@ -15898,7 +15914,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
15898
15914
|
if (pluginManager) {
|
|
15899
15915
|
nitroConfig = await pluginManager.runHookSerial("beforeNitroBuild", nitroConfig);
|
|
15900
15916
|
}
|
|
15901
|
-
const outputDir =
|
|
15917
|
+
const outputDir = _chunkFLKG2PYHcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
15902
15918
|
const serverOutputDir = _path2.default.join(outputDir, "server");
|
|
15903
15919
|
const publicOutputDir = _path2.default.join(outputDir, "public");
|
|
15904
15920
|
const { mkdir, cp } = await import("fs/promises");
|
|
@@ -15969,7 +15985,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
15969
15985
|
root,
|
|
15970
15986
|
preset,
|
|
15971
15987
|
distDir,
|
|
15972
|
-
outputDir:
|
|
15988
|
+
outputDir: _chunkFLKG2PYHcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
|
|
15973
15989
|
});
|
|
15974
15990
|
}
|
|
15975
15991
|
}
|