@farm.js/core 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-mcp.d-gI3ahrF6.d.mts → agent-mcp.d-CaJJsAVy.d.mts} +1 -1
- package/dist/{agent-mcp.d-DuZjglYX.d.ts → agent-mcp.d-klsG_XKS.d.ts} +1 -1
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/{analyzer-UXWYUTBK.mjs → analyzer-CY7BS4GB.mjs} +2 -2
- package/dist/analyzer-KHCOL6JF.cjs +17 -0
- package/dist/api/node.d.mts +3 -3
- package/dist/api/node.d.ts +3 -3
- package/dist/api/route-manager.cjs +4 -4
- package/dist/api/route-manager.d.mts +3 -3
- package/dist/api/route-manager.d.ts +3 -3
- package/dist/api/route-manager.mjs +3 -3
- package/dist/api/runtime.d.mts +2 -2
- package/dist/api/runtime.d.ts +2 -2
- package/dist/api.cjs +5 -5
- package/dist/api.d.mts +4 -4
- package/dist/api.d.ts +4 -4
- package/dist/api.mjs +4 -4
- package/dist/{app-manifest.d-bHK9EGPI.d.mts → app-manifest.d-BIdn8Whr.d.mts} +1 -1
- package/dist/{app-manifest.d-B3h89j6a.d.ts → app-manifest.d-DkIbmExG.d.ts} +1 -1
- package/dist/app-markdown.d.mts +2 -2
- package/dist/app-markdown.d.ts +2 -2
- package/dist/{app.d-C3uyET_L.d.ts → app.d-DhZ61V9X.d.ts} +8 -5
- package/dist/{app.d-Cr7fXGvJ.d.mts → app.d-DnqxbvCI.d.mts} +8 -5
- package/dist/{chunk-YOVSWY2E.mjs → chunk-2XDRRAAD.mjs} +1 -1
- package/dist/{chunk-2T4GGCQT.cjs → chunk-6UBGXEIH.cjs} +2 -2
- package/dist/{chunk-BEAQVRMQ.cjs → chunk-76ES7BCO.cjs} +80 -75
- package/dist/{chunk-TK2JJCP5.mjs → chunk-7FNKBP3J.mjs} +186 -29
- package/dist/{chunk-ST3U7XVO.mjs → chunk-7IM2MKRK.mjs} +1 -1
- package/dist/{chunk-GL4SPJTE.cjs → chunk-7Q6KUXH6.cjs} +58 -27
- package/dist/{chunk-5CG2UD6B.cjs → chunk-AMSX2U4D.cjs} +304 -7
- package/dist/{chunk-NPR6SCEV.mjs → chunk-AOSZIHL7.mjs} +1 -1
- package/dist/chunk-APVJJCMB.mjs +547 -0
- package/dist/{chunk-LQZXCSYG.mjs → chunk-B6K2ZM3C.mjs} +5 -3
- package/dist/{chunk-IEXZMDF4.mjs → chunk-BCIUG6EQ.mjs} +2 -2
- package/dist/{chunk-JCERO6YF.mjs → chunk-BUIZTM3Q.mjs} +1 -1
- package/dist/{chunk-SJQ24IB5.cjs → chunk-BY5VQ57W.cjs} +11 -11
- package/dist/{chunk-GKDOKES3.mjs → chunk-CQ5LVPBL.mjs} +1 -1
- package/dist/{chunk-Q4FHYBFT.cjs → chunk-CSCORWIQ.cjs} +11 -11
- package/dist/{chunk-6VMBLDWY.mjs → chunk-CV7C75LN.mjs} +1 -1
- package/dist/{chunk-CZMMU3FP.mjs → chunk-D4DAL7KK.mjs} +35 -4
- package/dist/{chunk-ZVT2F3JU.mjs → chunk-DR65XXXD.mjs} +2 -2
- package/dist/{chunk-PRKFECGT.cjs → chunk-DZWX7FDX.cjs} +6 -4
- package/dist/{chunk-A4AYTO2E.cjs → chunk-EZRB5N6S.cjs} +1 -1
- package/dist/{chunk-B7CZ7T2I.cjs → chunk-JEJXSTYR.cjs} +2 -2
- package/dist/{chunk-56F4CDKE.cjs → chunk-JRPCCBGL.cjs} +449 -291
- package/dist/{chunk-JM5VSEYC.cjs → chunk-KHTDVXXR.cjs} +2 -2
- package/dist/{chunk-PYPHM7AS.cjs → chunk-LH7S7FI3.cjs} +5 -1
- package/dist/{chunk-ZND5D4IC.cjs → chunk-LJZZDRD5.cjs} +363 -326
- package/dist/{chunk-WXPY5FRF.cjs → chunk-P2PF5FUW.cjs} +2 -2
- package/dist/{chunk-CPL7WIMP.mjs → chunk-P3UT3OLV.mjs} +2 -2
- package/dist/{chunk-PZ5ZJAAO.mjs → chunk-POCWXRXW.mjs} +1 -1
- package/dist/{chunk-L7Z6OAE2.cjs → chunk-PVR63WHW.cjs} +4 -4
- package/dist/{chunk-Z23OCU33.cjs → chunk-RF3VCNV7.cjs} +6 -6
- package/dist/{chunk-5AOARZJT.cjs → chunk-T2VXOAC3.cjs} +4 -4
- package/dist/{chunk-FEWGKBMM.mjs → chunk-UIBCPZFO.mjs} +85 -48
- package/dist/{chunk-MYJPW4XN.mjs → chunk-UKGAP2OK.mjs} +3 -3
- package/dist/{chunk-DZXD6CYJ.mjs → chunk-V2RXBDV6.mjs} +4 -0
- package/dist/{chunk-ALGAGXWB.mjs → chunk-XEOIZ4QC.mjs} +1 -1
- package/dist/{chunk-D2VLHRBN.cjs → chunk-Y3MTKPLN.cjs} +4 -4
- package/dist/{chunk-FDS6U2NT.cjs → chunk-Y7FLPQSL.cjs} +3 -3
- package/dist/{chunk-MEXGQE4T.mjs → chunk-YR7ZI57S.mjs} +17 -12
- package/dist/{client-component.d-BavTzqsn.d.ts → client-component.d-BHE9Ns8s.d.ts} +1 -1
- package/dist/{client-component.d-X3j9FOZ2.d.mts → client-component.d-uya-qDZu.d.mts} +1 -1
- package/dist/{client-plugins.d-DnnAopKG.d.mts → client-plugins.d-CqFAvu-W.d.mts} +38 -1
- package/dist/{client-plugins.d-CqTr5IrQ.d.ts → client-plugins.d-Dp89a9Gf.d.ts} +38 -1
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client.d.mts +7 -7
- package/dist/client.d.ts +7 -7
- package/dist/config.d.mts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/desktop.d.mts +2 -2
- package/dist/desktop.d.ts +2 -2
- package/dist/{devtools-RFVGDHXH.mjs → devtools-CRZCFRRL.mjs} +1 -1
- package/dist/{devtools-4LMM3DDJ.cjs → devtools-ZHYYPMZ3.cjs} +2 -2
- package/dist/docs.cjs +3 -3
- package/dist/docs.d.mts +3 -3
- package/dist/docs.d.ts +3 -3
- package/dist/docs.mjs +2 -2
- package/dist/environment/vite.cjs +4 -4
- package/dist/environment/vite.mjs +3 -3
- package/dist/{handler.d-BSlpYCDB.d.mts → handler.d-BgJGywnq.d.mts} +1 -1
- package/dist/{handler.d-DgX7gPO6.d.ts → handler.d-DHxaRQr7.d.ts} +1 -1
- package/dist/{headers.d-CmxW42R2.d.ts → headers.d-DVm2BMtR.d.ts} +1 -1
- package/dist/{headers.d-Cf8l5LMo.d.mts → headers.d-QrzpChrN.d.mts} +1 -1
- package/dist/index.cjs +19 -19
- package/dist/{index.d-BZZt7kxO.d.ts → index.d-B8lXhfTs.d.ts} +1 -1
- package/dist/{index.d-7xoJqKRZ.d.mts → index.d-Bpu1TV0-.d.mts} +1 -1
- package/dist/index.d.mts +22 -22
- package/dist/index.d.ts +22 -22
- package/dist/index.mjs +18 -18
- package/dist/integrations/orm.d.mts +1 -1
- package/dist/integrations/orm.d.ts +1 -1
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/internal/app-markdown-runtime.d.mts +2 -2
- package/dist/internal/app-markdown-runtime.d.ts +2 -2
- package/dist/internal/build-runtime.cjs +18 -18
- package/dist/internal/build-runtime.d.mts +4 -4
- package/dist/internal/build-runtime.d.ts +4 -4
- package/dist/internal/build-runtime.mjs +17 -17
- package/dist/internal/cli-runtime.cjs +7 -7
- package/dist/internal/cli-runtime.d.mts +7 -7
- package/dist/internal/cli-runtime.d.ts +7 -7
- package/dist/internal/cli-runtime.mjs +6 -6
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.d.mts +5 -5
- package/dist/internal/client-runtime.d.ts +5 -5
- package/dist/internal/compression-runtime.d.mts +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/config-runtime.cjs +3 -3
- package/dist/internal/config-runtime.d.mts +3 -3
- package/dist/internal/config-runtime.d.ts +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/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.d.mts +10 -10
- package/dist/internal/production-runtime.d.ts +10 -10
- package/dist/internal/production-runtime.mjs +3 -3
- package/dist/internal/spa-router.d.mts +3 -3
- package/dist/internal/spa-router.d.ts +3 -3
- package/dist/internal/start-manifest.d.mts +1 -1
- package/dist/internal/start-manifest.d.ts +1 -1
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/middleware.d.mts +1 -1
- package/dist/middleware.d.ts +1 -1
- package/dist/{mount.d-CD-xVBu7.d.ts → mount.d-Cw_75kb9.d.ts} +1 -1
- package/dist/{mount.d-Dd0xeRMl.d.mts → mount.d-CyfNKOHK.d.mts} +1 -1
- package/dist/{navigation-delegate.d-Bses_F-y.d.ts → navigation-delegate.d--imR0rY7.d.ts} +1 -1
- package/dist/{navigation-delegate.d-dBNg976E.d.mts → navigation-delegate.d-DVEtyGYw.d.mts} +1 -1
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/plugin.cjs +13 -13
- package/dist/plugin.d.mts +5 -5
- package/dist/plugin.d.ts +5 -5
- package/dist/plugin.mjs +12 -12
- package/dist/{render-plan.d-vOdZHHLI.d.mts → render-plan.d-CTehM6y8.d.mts} +1 -1
- package/dist/{render-plan.d-DaIwnRK2.d.ts → render-plan.d-DpxLd_1i.d.ts} +1 -1
- package/dist/renderer-client.d.mts +5 -5
- package/dist/renderer-client.d.ts +5 -5
- package/dist/{request.d-CgXp3EEc.d.ts → request.d-BFXzOr32.d.ts} +1 -1
- package/dist/{request.d-B8U4pVFP.d.mts → request.d-BmQzlKtT.d.mts} +1 -1
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/{route-rendering.d-Di0AxFix.d.ts → route-rendering.d-bEil1VkF.d.ts} +1 -1
- package/dist/{route-rendering.d-BQvNYQqu.d.mts → route-rendering.d-geg68qd0.d.mts} +1 -1
- package/dist/{router.d-BJVGhSAJ.d.ts → router.d-4OCT2ak5.d.ts} +1 -1
- package/dist/{router.d-hNedVdoB.d.mts → router.d-CQjEcNih.d.mts} +1 -1
- package/dist/routes.cjs +3 -3
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/routes.mjs +2 -2
- package/dist/{rsc-pipeline-NCJ3NIE5.mjs → rsc-pipeline-JISGZS6G.mjs} +2 -2
- package/dist/{rsc-pipeline-HT4G3QGT.cjs → rsc-pipeline-R5W3PAAL.cjs} +3 -3
- package/dist/{runtime-6UF5XKUP.cjs → runtime-HSTND4FF.cjs} +8 -8
- package/dist/{runtime-VHXIEXL7.mjs → runtime-I2SBIB2Q.mjs} +5 -5
- package/dist/{runtime.d-0R8nHCM6.d.ts → runtime.d-BKoa6J55.d.ts} +1 -1
- package/dist/{runtime.d-DpeuF_T-.d.mts → runtime.d-DjYo5E1n.d.mts} +1 -1
- package/dist/{schema-dependencies.d-_Wyey4Wv.d.mts → schema-dependencies.d-CGNgsyKS.d.mts} +1 -1
- package/dist/{schema-dependencies.d-tkUHREqz.d.ts → schema-dependencies.d-CRoN2Q9N.d.ts} +1 -1
- package/dist/{server-components-status.d-sN7ju-ie.d.mts → server-components-status.d-Crl3IonP.d.mts} +1 -1
- package/dist/{server-components-status.d-B2Z5WvO5.d.ts → server-components-status.d-CwfcQD6n.d.ts} +1 -1
- package/dist/server-plugins.d.mts +3 -3
- package/dist/server-plugins.d.ts +3 -3
- package/dist/server.cjs +34 -34
- package/dist/server.d.mts +11 -11
- package/dist/server.d.ts +11 -11
- package/dist/server.mjs +14 -14
- package/dist/{spa-router.d-MjT6sGb9.d.ts → spa-router.d-Bv-r3AAK.d.ts} +2 -2
- package/dist/{spa-router.d-D3AtR2Bc.d.mts → spa-router.d-DhO_PJHP.d.mts} +2 -2
- package/dist/{ssg.d-C1SNuPz5.d.ts → ssg.d-CzFOAkqy.d.mts} +13 -2
- package/dist/{ssg.d-B32Cp_XW.d.mts → ssg.d-SfEQfMsA.d.ts} +13 -2
- package/dist/{store-core.d-BZ3YXs70.d.ts → store-core.d-Ch0N8dni.d.ts} +2 -2
- package/dist/{store-core.d-BbVdaoA0.d.mts → store-core.d-pKJCUdTR.d.mts} +2 -2
- package/dist/testing.cjs +5 -5
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.mjs +4 -4
- package/dist/{utils.d-Bjbm44fP.d.ts → utils.d-BaLODLrK.d.ts} +1 -1
- package/dist/{utils.d-CoLozp7-.d.mts → utils.d-TPjb_Q7w.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +13 -13
- package/dist/vite.d.mts +6 -6
- package/dist/vite.d.ts +6 -6
- package/dist/vite.mjs +12 -12
- package/package.json +2 -2
- package/dist/analyzer-ENHO4SA5.cjs +0 -17
- package/dist/chunk-Q4CPBKPT.mjs +0 -251
- /package/dist/{chunk-JL2HNLMC.mjs → chunk-3QC2XTCN.mjs} +0 -0
- /package/dist/{chunk-COXMHCIV.cjs → chunk-GDKJGL7D.cjs} +0 -0
|
@@ -32,7 +32,7 @@ var _chunk6AUPJYHFcjs = require('./chunk-6AUPJYHF.cjs');
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
var
|
|
35
|
+
var _chunkY7FLPQSLcjs = require('./chunk-Y7FLPQSL.cjs');
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
|
|
@@ -41,7 +41,7 @@ var _chunkFDS6U2NTcjs = require('./chunk-FDS6U2NT.cjs');
|
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
var
|
|
44
|
+
var _chunkJEJXSTYRcjs = require('./chunk-JEJXSTYR.cjs');
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
@@ -71,7 +71,7 @@ var _chunkTDAH76RRcjs = require('./chunk-TDAH76RR.cjs');
|
|
|
71
71
|
|
|
72
72
|
|
|
73
73
|
|
|
74
|
-
var
|
|
74
|
+
var _chunkGDKJGL7Dcjs = require('./chunk-GDKJGL7D.cjs');
|
|
75
75
|
|
|
76
76
|
|
|
77
77
|
var _chunkI5PDHLKEcjs = require('./chunk-I5PDHLKE.cjs');
|
|
@@ -117,7 +117,7 @@ var _chunkKDUVIJSZcjs = require('./chunk-KDUVIJSZ.cjs');
|
|
|
117
117
|
|
|
118
118
|
|
|
119
119
|
|
|
120
|
-
var
|
|
120
|
+
var _chunk76ES7BCOcjs = require('./chunk-76ES7BCO.cjs');
|
|
121
121
|
|
|
122
122
|
|
|
123
123
|
|
|
@@ -133,11 +133,11 @@ var _chunkIGA3OTFYcjs = require('./chunk-IGA3OTFY.cjs');
|
|
|
133
133
|
|
|
134
134
|
|
|
135
135
|
|
|
136
|
-
var
|
|
136
|
+
var _chunk7Q6KUXH6cjs = require('./chunk-7Q6KUXH6.cjs');
|
|
137
137
|
|
|
138
138
|
|
|
139
139
|
|
|
140
|
-
var
|
|
140
|
+
var _chunkT2VXOAC3cjs = require('./chunk-T2VXOAC3.cjs');
|
|
141
141
|
|
|
142
142
|
|
|
143
143
|
|
|
@@ -165,7 +165,7 @@ var _chunkUOFTT6S4cjs = require('./chunk-UOFTT6S4.cjs');
|
|
|
165
165
|
|
|
166
166
|
|
|
167
167
|
|
|
168
|
-
var
|
|
168
|
+
var _chunkPVR63WHWcjs = require('./chunk-PVR63WHW.cjs');
|
|
169
169
|
|
|
170
170
|
|
|
171
171
|
|
|
@@ -173,7 +173,7 @@ var _chunkL7Z6OAE2cjs = require('./chunk-L7Z6OAE2.cjs');
|
|
|
173
173
|
var _chunkR6GOH5CHcjs = require('./chunk-R6GOH5CH.cjs');
|
|
174
174
|
|
|
175
175
|
|
|
176
|
-
var
|
|
176
|
+
var _chunk6UBGXEIHcjs = require('./chunk-6UBGXEIH.cjs');
|
|
177
177
|
|
|
178
178
|
|
|
179
179
|
var _chunk323JTLXRcjs = require('./chunk-323JTLXR.cjs');
|
|
@@ -194,7 +194,7 @@ var _chunk323JTLXRcjs = require('./chunk-323JTLXR.cjs');
|
|
|
194
194
|
|
|
195
195
|
|
|
196
196
|
|
|
197
|
-
var
|
|
197
|
+
var _chunkBY5VQ57Wcjs = require('./chunk-BY5VQ57W.cjs');
|
|
198
198
|
|
|
199
199
|
|
|
200
200
|
|
|
@@ -288,7 +288,7 @@ var _chunkOCQSYDMGcjs = require('./chunk-OCQSYDMG.cjs');
|
|
|
288
288
|
var _chunkNQUZDXKJcjs = require('./chunk-NQUZDXKJ.cjs');
|
|
289
289
|
|
|
290
290
|
|
|
291
|
-
var
|
|
291
|
+
var _chunkY3MTKPLNcjs = require('./chunk-Y3MTKPLN.cjs');
|
|
292
292
|
|
|
293
293
|
|
|
294
294
|
|
|
@@ -320,7 +320,7 @@ var _chunk7ZDLE77Pcjs = require('./chunk-7ZDLE77P.cjs');
|
|
|
320
320
|
var _chunkH5AC3XSEcjs = require('./chunk-H5AC3XSE.cjs');
|
|
321
321
|
|
|
322
322
|
|
|
323
|
-
var
|
|
323
|
+
var _chunkEZRB5N6Scjs = require('./chunk-EZRB5N6S.cjs');
|
|
324
324
|
|
|
325
325
|
|
|
326
326
|
var _chunkO7B6LJWEcjs = require('./chunk-O7B6LJWE.cjs');
|
|
@@ -686,7 +686,7 @@ async function compileFarmDocsManifest(docs, options) {
|
|
|
686
686
|
isPathGuarded: options.isPathGuarded,
|
|
687
687
|
basePath
|
|
688
688
|
});
|
|
689
|
-
const apiHandler =
|
|
689
|
+
const apiHandler = _chunkJEJXSTYRcjs.createFarmDocsAPIHandler.call(void 0, {
|
|
690
690
|
rootDir: options.root,
|
|
691
691
|
srcDir: options.srcDir,
|
|
692
692
|
docs,
|
|
@@ -1113,7 +1113,7 @@ async function createFarmRouteRuntimeManifest(options) {
|
|
|
1113
1113
|
const routes = [];
|
|
1114
1114
|
for (const [pattern, entry] of options.routeManager.getRoutes()) {
|
|
1115
1115
|
const routeModule = await options.routeManager.loadRouteModule(entry.modulePath);
|
|
1116
|
-
const rendering = await
|
|
1116
|
+
const rendering = await _chunk7Q6KUXH6cjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
|
|
1117
1117
|
const runtimeConfig = await options.routeManager.resolveRouteRuntimeConfig(pattern);
|
|
1118
1118
|
routes.push({
|
|
1119
1119
|
kind: "page",
|
|
@@ -1584,6 +1584,30 @@ function escapeRegExp3(value) {
|
|
|
1584
1584
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1585
1585
|
}
|
|
1586
1586
|
|
|
1587
|
+
// src/nitro/static-pages.ts
|
|
1588
|
+
_chunkUGL4BDNBcjs.init_define_import_meta.call(void 0, );
|
|
1589
|
+
var FARM_STATIC_PAGE_REFUSAL_TYPE = "application/x-farm-static-page-refusal";
|
|
1590
|
+
function resolveFarmStaticPagesMode(value) {
|
|
1591
|
+
if (value === void 0 || value === "off") return "off";
|
|
1592
|
+
if (value === "analyze" || value === "enabled") return value;
|
|
1593
|
+
throw new TypeError(
|
|
1594
|
+
`\`experimental.staticPages\` must be "off", "analyze" or "enabled", got ${JSON.stringify(
|
|
1595
|
+
value
|
|
1596
|
+
)}. Use "analyze" to see which pages would be written as files.`
|
|
1597
|
+
);
|
|
1598
|
+
}
|
|
1599
|
+
function getFarmStaticPageRefusal(route) {
|
|
1600
|
+
if (route.error) {
|
|
1601
|
+
return route.error.status ? `its build-time render answered ${route.error.status}` : `its build-time render failed: ${_nullishCoalesce(route.error.message, () => ( "unknown error"))}`;
|
|
1602
|
+
}
|
|
1603
|
+
const contentType = _nullishCoalesce(_optionalChain([route, 'access', _31 => _31.contentType, 'optionalAccess', _32 => _32.toLowerCase, 'call', _33 => _33()]), () => ( ""));
|
|
1604
|
+
if (contentType.includes(FARM_STATIC_PAGE_REFUSAL_TYPE)) {
|
|
1605
|
+
return route.contents || "its render read request state";
|
|
1606
|
+
}
|
|
1607
|
+
if (!contentType.includes("html")) return "it does not render HTML";
|
|
1608
|
+
return null;
|
|
1609
|
+
}
|
|
1610
|
+
|
|
1587
1611
|
// src/nitro/ssr-public-assets.ts
|
|
1588
1612
|
_chunkUGL4BDNBcjs.init_define_import_meta.call(void 0, );
|
|
1589
1613
|
|
|
@@ -1603,7 +1627,7 @@ function resolveBundleFileName(chunkFileName, relativeUrl) {
|
|
|
1603
1627
|
function replaceServerFileReferences(bundle, chunkFileName, code, replace) {
|
|
1604
1628
|
return code.replace(SERVER_FILE_URL_RE, (reference, _quote, relativeUrl) => {
|
|
1605
1629
|
const target = resolveBundleFileName(chunkFileName, relativeUrl);
|
|
1606
|
-
return target && _optionalChain([bundle, 'access',
|
|
1630
|
+
return target && _optionalChain([bundle, 'access', _34 => _34[target], 'optionalAccess', _35 => _35.type]) === "asset" ? replace(target) : reference;
|
|
1607
1631
|
});
|
|
1608
1632
|
}
|
|
1609
1633
|
function collectServerReadSSRAssets(bundle) {
|
|
@@ -1657,7 +1681,7 @@ function assertServerReadSSRAssetsSupported(bundle, preset, root) {
|
|
|
1657
1681
|
if (assets.length === 0) return;
|
|
1658
1682
|
const sources = assets.map((fileName) => {
|
|
1659
1683
|
const output = bundle[fileName];
|
|
1660
|
-
const original = _optionalChain([output, 'optionalAccess',
|
|
1684
|
+
const original = _optionalChain([output, 'optionalAccess', _36 => _36.type]) === "asset" ? _optionalChain([output, 'access', _37 => _37.originalFileNames, 'optionalAccess', _38 => _38[0]]) : void 0;
|
|
1661
1685
|
if (!original) return fileName;
|
|
1662
1686
|
return _path2.default.relative(root, _path2.default.resolve(root, original)).split(_path2.default.sep).join("/");
|
|
1663
1687
|
});
|
|
@@ -1676,7 +1700,7 @@ function createServerReadSSRAssetsPlugin(bundle, ssrOutputDir) {
|
|
|
1676
1700
|
transform(code, id) {
|
|
1677
1701
|
if (!code.includes("import.meta.url")) return null;
|
|
1678
1702
|
const chunkFileName = _path2.default.relative(ssrOutputDir, id.split("?", 1)[0]).split(_path2.default.sep).join("/");
|
|
1679
|
-
if (_optionalChain([bundle, 'access',
|
|
1703
|
+
if (_optionalChain([bundle, 'access', _39 => _39[chunkFileName], 'optionalAccess', _40 => _40.type]) !== "chunk") return null;
|
|
1680
1704
|
let changed = false;
|
|
1681
1705
|
const transformed = replaceServerFileReferences(
|
|
1682
1706
|
bundle,
|
|
@@ -1774,7 +1798,7 @@ _chunkUGL4BDNBcjs.init_define_import_meta.call(void 0, );
|
|
|
1774
1798
|
var PLATFORM_CONFIG_KEYS = /* @__PURE__ */ new Set(["desktop", "mobile"]);
|
|
1775
1799
|
var CONFIG_FACTORIES = /* @__PURE__ */ new Set(["defineConfig", "defineFarmConfig"]);
|
|
1776
1800
|
function isConfigObject(node) {
|
|
1777
|
-
return _optionalChain([node, 'optionalAccess',
|
|
1801
|
+
return _optionalChain([node, 'optionalAccess', _41 => _41.type]) === "ObjectExpression";
|
|
1778
1802
|
}
|
|
1779
1803
|
function propertyName(property) {
|
|
1780
1804
|
if (property.type !== "Property" || property.computed) return void 0;
|
|
@@ -1795,7 +1819,7 @@ function collectConfigObjects(node, found) {
|
|
|
1795
1819
|
}
|
|
1796
1820
|
if (current.type === "CallExpression") {
|
|
1797
1821
|
const callee = current.callee;
|
|
1798
|
-
const name = callee.type === "Identifier" ? callee.name : _optionalChain([callee, 'access',
|
|
1822
|
+
const name = callee.type === "Identifier" ? callee.name : _optionalChain([callee, 'access', _42 => _42.property, 'optionalAccess', _43 => _43.name]);
|
|
1799
1823
|
const argument = current.arguments[0];
|
|
1800
1824
|
if (name && CONFIG_FACTORIES.has(name) && isConfigObject(argument)) found.push(argument);
|
|
1801
1825
|
}
|
|
@@ -1828,7 +1852,7 @@ function stripPlatformConfigSource(code, parse) {
|
|
|
1828
1852
|
const trailingComma = /^\s*,/.exec(code.slice(properties[last].end));
|
|
1829
1853
|
removals.push([
|
|
1830
1854
|
properties[first].start,
|
|
1831
|
-
properties[last].end + (_nullishCoalesce(_optionalChain([trailingComma, 'optionalAccess',
|
|
1855
|
+
properties[last].end + (_nullishCoalesce(_optionalChain([trailingComma, 'optionalAccess', _44 => _44[0], 'access', _45 => _45.length]), () => ( 0)))
|
|
1832
1856
|
]);
|
|
1833
1857
|
}
|
|
1834
1858
|
first = last;
|
|
@@ -1855,7 +1879,7 @@ function farmStripPlatformConfigPlugin(configFiles) {
|
|
|
1855
1879
|
// removed block used (`readFileSync` for a version, say).
|
|
1856
1880
|
enforce: "pre",
|
|
1857
1881
|
transform: {
|
|
1858
|
-
filter: { id:
|
|
1882
|
+
filter: { id: _chunk76ES7BCOcjs.fileNamePattern.call(void 0, configFiles) },
|
|
1859
1883
|
async handler(code, id) {
|
|
1860
1884
|
const file = id.split("?", 1)[0];
|
|
1861
1885
|
if (!files.has(_path2.default.resolve(file)) && !files.has(realPath(file))) return null;
|
|
@@ -1909,7 +1933,7 @@ function precompileFarmMarkdownPages(bodies, coreRoot) {
|
|
|
1909
1933
|
return;
|
|
1910
1934
|
}
|
|
1911
1935
|
worker.once("message", (entries) => {
|
|
1912
|
-
void _optionalChain([worker, 'optionalAccess',
|
|
1936
|
+
void _optionalChain([worker, 'optionalAccess', _46 => _46.terminate, 'call', _47 => _47()]);
|
|
1913
1937
|
done(entries);
|
|
1914
1938
|
});
|
|
1915
1939
|
worker.once("error", () => done());
|
|
@@ -1918,7 +1942,7 @@ function precompileFarmMarkdownPages(bodies, coreRoot) {
|
|
|
1918
1942
|
return {
|
|
1919
1943
|
pages,
|
|
1920
1944
|
dispose() {
|
|
1921
|
-
void _optionalChain([worker, 'optionalAccess',
|
|
1945
|
+
void _optionalChain([worker, 'optionalAccess', _48 => _48.terminate, 'call', _49 => _49()]);
|
|
1922
1946
|
}
|
|
1923
1947
|
};
|
|
1924
1948
|
}
|
|
@@ -2070,7 +2094,7 @@ function createFarmClientChunksPlugin(options) {
|
|
|
2070
2094
|
const islands = options.islandsReact ? createFarmIslandsReactOutput() : void 0;
|
|
2071
2095
|
if (!inline && !islands) return null;
|
|
2072
2096
|
const codeSplitting = {
|
|
2073
|
-
..._optionalChain([islands, 'optionalAccess',
|
|
2097
|
+
..._optionalChain([islands, 'optionalAccess', _50 => _50.codeSplitting]),
|
|
2074
2098
|
...inline ? {
|
|
2075
2099
|
experimentalInlineCommonChunks: {
|
|
2076
2100
|
maxSize: FARM_CLIENT_INLINE_CHUNK_BYTES,
|
|
@@ -2096,7 +2120,7 @@ function literalMatcher(node) {
|
|
|
2096
2120
|
if (node.type === "Literal" && node.regex)
|
|
2097
2121
|
return new RegExp(node.regex.pattern, node.regex.flags);
|
|
2098
2122
|
if (node.type === "TemplateLiteral" && node.expressions.length === 0) {
|
|
2099
|
-
return _nullishCoalesce(_optionalChain([node, 'access',
|
|
2123
|
+
return _nullishCoalesce(_optionalChain([node, 'access', _51 => _51.quasis, 'access', _52 => _52[0], 'optionalAccess', _53 => _53.value, 'optionalAccess', _54 => _54.cooked]), () => ( void 0));
|
|
2100
2124
|
}
|
|
2101
2125
|
return void 0;
|
|
2102
2126
|
}
|
|
@@ -2120,7 +2144,7 @@ function readStaticMiddlewareConfig(program) {
|
|
|
2120
2144
|
let found = null;
|
|
2121
2145
|
for (const statement of program.body) {
|
|
2122
2146
|
if (statement.type === "ExportNamedDeclaration" && !statement.declaration) {
|
|
2123
|
-
if (statement.specifiers.some((specifier) => _optionalChain([specifier, 'access',
|
|
2147
|
+
if (statement.specifiers.some((specifier) => _optionalChain([specifier, 'access', _55 => _55.exported, 'optionalAccess', _56 => _56.name]) === "config")) {
|
|
2124
2148
|
return "unknown";
|
|
2125
2149
|
}
|
|
2126
2150
|
continue;
|
|
@@ -2128,14 +2152,14 @@ function readStaticMiddlewareConfig(program) {
|
|
|
2128
2152
|
const declaration = statement.type === "ExportNamedDeclaration" ? statement.declaration : null;
|
|
2129
2153
|
if (!declaration || declaration.type !== "VariableDeclaration") continue;
|
|
2130
2154
|
for (const declarator of declaration.declarations) {
|
|
2131
|
-
if (_optionalChain([declarator, 'access',
|
|
2155
|
+
if (_optionalChain([declarator, 'access', _57 => _57.id, 'optionalAccess', _58 => _58.type]) !== "Identifier" || declarator.id.name !== "config") continue;
|
|
2132
2156
|
if (declaration.kind !== "const" || !declarator.init) return "unknown";
|
|
2133
2157
|
const init = unwrap(declarator.init);
|
|
2134
2158
|
if (init.type !== "ObjectExpression") return "unknown";
|
|
2135
2159
|
const config = {};
|
|
2136
2160
|
for (const property of init.properties) {
|
|
2137
2161
|
if (property.type !== "Property" || property.computed) return "unknown";
|
|
2138
|
-
const key = _nullishCoalesce(_optionalChain([property, 'access',
|
|
2162
|
+
const key = _nullishCoalesce(_optionalChain([property, 'access', _59 => _59.key, 'optionalAccess', _60 => _60.name]), () => ( _optionalChain([property, 'access', _61 => _61.key, 'optionalAccess', _62 => _62.value])));
|
|
2139
2163
|
if (key === "runtime") {
|
|
2140
2164
|
const runtime = literalMatcher(unwrap(property.value));
|
|
2141
2165
|
if (runtime === "edge" || runtime === "nodejs") config.runtime = runtime;
|
|
@@ -2156,7 +2180,7 @@ async function readMiddlewareFileConfig(filePath) {
|
|
|
2156
2180
|
try {
|
|
2157
2181
|
const [{ readFile: readFile2 }, vite] = await Promise.all([import("fs/promises"), import("vite")]);
|
|
2158
2182
|
const parsed = vite.parseSync(filePath, await readFile2(filePath, "utf8"));
|
|
2159
|
-
if (_optionalChain([parsed, 'access',
|
|
2183
|
+
if (_optionalChain([parsed, 'access', _63 => _63.errors, 'optionalAccess', _64 => _64.length])) return "unknown";
|
|
2160
2184
|
return readStaticMiddlewareConfig(parsed.program);
|
|
2161
2185
|
} catch (e14) {
|
|
2162
2186
|
return "unknown";
|
|
@@ -2176,7 +2200,7 @@ function farmTargetRunsEdgeMiddleware(preset) {
|
|
|
2176
2200
|
return preset === "vercel";
|
|
2177
2201
|
}
|
|
2178
2202
|
function isFarmEdgeMiddlewareRoute(route) {
|
|
2179
|
-
return typeof route.config === "object" && _optionalChain([route, 'access',
|
|
2203
|
+
return typeof route.config === "object" && _optionalChain([route, 'access', _65 => _65.config, 'optionalAccess', _66 => _66.runtime]) === "edge";
|
|
2180
2204
|
}
|
|
2181
2205
|
function escapeRegExp4(value) {
|
|
2182
2206
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
@@ -2213,7 +2237,7 @@ export default createFarmVercelEdgeMiddleware({
|
|
|
2213
2237
|
${modules.join("\n")}
|
|
2214
2238
|
],
|
|
2215
2239
|
i18n: ${JSON.stringify(config.i18n)},
|
|
2216
|
-
server: ${JSON.stringify({ trustProxy: _optionalChain([config, 'access',
|
|
2240
|
+
server: ${JSON.stringify({ trustProxy: _optionalChain([config, 'access', _67 => _67.server, 'optionalAccess', _68 => _68.trustProxy]) === true })},
|
|
2217
2241
|
apiBasePath: ${JSON.stringify(_chunkH5AC3XSEcjs.resolveFarmAPIServerBasePath.call(void 0, config.api))},
|
|
2218
2242
|
notFoundPath: ${JSON.stringify(_chunkTFCBJFP7cjs.applyFarmBasePath.call(void 0, FARM_VERCEL_EDGE_NOT_FOUND_PATH, config.basePath))},
|
|
2219
2243
|
pages: ${JSON.stringify(toFarmVercelEdgeGuardedUrls(guardedPages, config.basePath))},
|
|
@@ -2272,7 +2296,7 @@ async function writeFarmVercelEdgeMiddlewareFunction(options) {
|
|
|
2272
2296
|
logLevel: "silent",
|
|
2273
2297
|
plugins: [edgeNodeModulesPlugin(coreDir, unsupported)],
|
|
2274
2298
|
resolve: {
|
|
2275
|
-
alias:
|
|
2299
|
+
alias: _chunk76ES7BCOcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
2276
2300
|
conditionNames: ["edge-light", "worker", "browser", "import", "module", "default"]
|
|
2277
2301
|
},
|
|
2278
2302
|
transform: {
|
|
@@ -2505,7 +2529,7 @@ function createPrerenderRuntimeResolverPlugin(root, resolveNitroEntry = resolveN
|
|
|
2505
2529
|
return {
|
|
2506
2530
|
name: "farm-prerender-runtime-resolver",
|
|
2507
2531
|
async resolveId(id, _importer, options) {
|
|
2508
|
-
if (_optionalChain([options, 'access',
|
|
2532
|
+
if (_optionalChain([options, 'access', _69 => _69.custom, 'optionalAccess', _70 => _70.farmPrerenderRuntimeResolve])) return null;
|
|
2509
2533
|
if (id.startsWith("\0") || id.startsWith(".") || id.startsWith("#") || id.startsWith("virtual:") || _path2.default.isAbsolute(id) || NODE_BUILTIN_MODULES.has(id)) {
|
|
2510
2534
|
return null;
|
|
2511
2535
|
}
|
|
@@ -2675,7 +2699,7 @@ function createOmittedMetadataImageRuntimePlugin(externalizeOtherImports) {
|
|
|
2675
2699
|
return {
|
|
2676
2700
|
name: "farm-omitted-metadata-image-runtime",
|
|
2677
2701
|
resolveId: {
|
|
2678
|
-
filter: { id:
|
|
2702
|
+
filter: { id: _chunk76ES7BCOcjs.exactIdPattern.call(void 0, ["@vercel/og"]) },
|
|
2679
2703
|
handler(source, importer) {
|
|
2680
2704
|
if (source !== "@vercel/og") return null;
|
|
2681
2705
|
const fromCoreRuntime = importer !== void 0 && isFarmCoreModule(importer) && !/^og\.[cm]?[jt]sx?$/.test(_path2.default.basename(importer.split("?", 1)[0]));
|
|
@@ -2684,7 +2708,7 @@ function createOmittedMetadataImageRuntimePlugin(externalizeOtherImports) {
|
|
|
2684
2708
|
}
|
|
2685
2709
|
},
|
|
2686
2710
|
load: {
|
|
2687
|
-
filter: { id:
|
|
2711
|
+
filter: { id: _chunk76ES7BCOcjs.exactIdPattern.call(void 0, [FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID]) },
|
|
2688
2712
|
handler(id) {
|
|
2689
2713
|
if (id !== FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID) return null;
|
|
2690
2714
|
return `
|
|
@@ -2712,8 +2736,8 @@ function readVercelOgManifest(file) {
|
|
|
2712
2736
|
}
|
|
2713
2737
|
function resolveVercelOgConditionEntry(resolvedId, condition) {
|
|
2714
2738
|
const vercelOg = readVercelOgManifest(resolvedId);
|
|
2715
|
-
const entry = _optionalChain([vercelOg, 'optionalAccess',
|
|
2716
|
-
const file = typeof entry === "string" ? entry : _optionalChain([entry, 'optionalAccess',
|
|
2739
|
+
const entry = _optionalChain([vercelOg, 'optionalAccess', _71 => _71.manifest, 'access', _72 => _72.exports, 'optionalAccess', _73 => _73["."], 'optionalAccess', _74 => _74[condition]]);
|
|
2740
|
+
const file = typeof entry === "string" ? entry : _optionalChain([entry, 'optionalAccess', _75 => _75.default]);
|
|
2717
2741
|
return vercelOg && typeof file === "string" ? _path2.default.join(vercelOg.dir, file) : null;
|
|
2718
2742
|
}
|
|
2719
2743
|
function createEdgeMetadataImageRuntimePlugin({
|
|
@@ -2729,7 +2753,7 @@ function createEdgeMetadataImageRuntimePlugin({
|
|
|
2729
2753
|
const edgeEntry = resolveVercelOgConditionEntry(resolved.id, condition);
|
|
2730
2754
|
return edgeEntry ? { ...resolved, id: edgeEntry } : resolved;
|
|
2731
2755
|
}
|
|
2732
|
-
if (wasm !== "module" || !source.endsWith(".wasm?module") || !_optionalChain([importer, 'optionalAccess',
|
|
2756
|
+
if (wasm !== "module" || !source.endsWith(".wasm?module") || !_optionalChain([importer, 'optionalAccess', _76 => _76.replace, 'call', _77 => _77(/\\/g, "/"), 'access', _78 => _78.includes, 'call', _79 => _79("/@vercel/og/")])) {
|
|
2733
2757
|
return null;
|
|
2734
2758
|
}
|
|
2735
2759
|
const resolvedPath = _path2.default.resolve(_path2.default.dirname(importer.split("?", 1)[0]), source);
|
|
@@ -2751,7 +2775,7 @@ function createVercelOgFontInlinePlugin(runtime = "Cloudflare Workers") {
|
|
|
2751
2775
|
return `Promise.resolve({ arrayBuffer: () => Uint8Array.from(atob(${JSON.stringify(encoded)}), (character) => character.charCodeAt(0)).buffer })`;
|
|
2752
2776
|
});
|
|
2753
2777
|
if (inlined !== code) return { code: inlined, map: null };
|
|
2754
|
-
const version = _nullishCoalesce(_optionalChain([readVercelOgManifest, 'call',
|
|
2778
|
+
const version = _nullishCoalesce(_optionalChain([readVercelOgManifest, 'call', _80 => _80(file), 'optionalAccess', _81 => _81.manifest, 'access', _82 => _82.version]), () => ( "(unknown version)"));
|
|
2755
2779
|
this.error(
|
|
2756
2780
|
`@vercel/og ${version} cannot be bundled for ${runtime}: ${file} does not load its default font with fetch(new URL("./<font>.ttf", import.meta.url)), the pattern Farm inlines because an edge function cannot fetch it. Install a @vercel/og version whose edge build does, such as 1.0.1.`
|
|
2757
2781
|
);
|
|
@@ -2762,7 +2786,7 @@ function createMetadataImageWasmPlugin() {
|
|
|
2762
2786
|
return {
|
|
2763
2787
|
name: "farm-metadata-image-wasm",
|
|
2764
2788
|
resolveId(source, importer) {
|
|
2765
|
-
if (!source.endsWith(".wasm?module") || !_optionalChain([importer, 'optionalAccess',
|
|
2789
|
+
if (!source.endsWith(".wasm?module") || !_optionalChain([importer, 'optionalAccess', _83 => _83.replace, 'call', _84 => _84(/\\/g, "/"), 'access', _85 => _85.includes, 'call', _86 => _86("/@vercel/og/")])) {
|
|
2766
2790
|
return null;
|
|
2767
2791
|
}
|
|
2768
2792
|
const requestPath = source.slice(0, -"?module".length);
|
|
@@ -2838,9 +2862,9 @@ function hasFarmRuntimeConfigModule(config, configModulePath) {
|
|
|
2838
2862
|
return Boolean(configModulePath || (config.layers || []).some((layer) => layer.configFile));
|
|
2839
2863
|
}
|
|
2840
2864
|
function nameCodeSplittingGroups(bundlerConfig) {
|
|
2841
|
-
const outputs = _optionalChain([bundlerConfig, 'optionalAccess',
|
|
2865
|
+
const outputs = _optionalChain([bundlerConfig, 'optionalAccess', _87 => _87.output]);
|
|
2842
2866
|
for (const output of Array.isArray(outputs) ? outputs : [outputs]) {
|
|
2843
|
-
const groups = _optionalChain([output, 'optionalAccess',
|
|
2867
|
+
const groups = _optionalChain([output, 'optionalAccess', _88 => _88.codeSplitting, 'optionalAccess', _89 => _89.groups]);
|
|
2844
2868
|
if (!Array.isArray(groups)) continue;
|
|
2845
2869
|
groups.forEach((group, index) => {
|
|
2846
2870
|
if (group && typeof group.name === "function" && !group.debugName) {
|
|
@@ -2901,9 +2925,9 @@ function restoreLiteralModuleSpecifiers(code, fileName, { parseSync, Visitor })
|
|
|
2901
2925
|
throw new Error(`Failed to minify ${fileName}: ${parsed.errors[0].message}`);
|
|
2902
2926
|
}
|
|
2903
2927
|
const restore = (node) => {
|
|
2904
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
2928
|
+
if (_optionalChain([node, 'optionalAccess', _90 => _90.type]) !== "TemplateLiteral") return;
|
|
2905
2929
|
const template = node;
|
|
2906
|
-
const value = _optionalChain([template, 'access',
|
|
2930
|
+
const value = _optionalChain([template, 'access', _91 => _91.quasis, 'access', _92 => _92[0], 'optionalAccess', _93 => _93.value, 'access', _94 => _94.cooked]);
|
|
2907
2931
|
if (template.expressions.length > 0 || typeof value !== "string") return;
|
|
2908
2932
|
replacements.push({
|
|
2909
2933
|
start: template.start,
|
|
@@ -3068,7 +3092,7 @@ async function discoverMiddlewareRoutes(appDir) {
|
|
|
3068
3092
|
return Array.from(routes.values()).sort(_chunkNQUZDXKJcjs.compareMiddlewareRouteLocations).map(({ path: routePath, filePath }) => ({ path: routePath, filePath }));
|
|
3069
3093
|
}
|
|
3070
3094
|
function assertFarmDocsRuntimeSupported(config, preset) {
|
|
3071
|
-
if (!_optionalChain([config, 'access',
|
|
3095
|
+
if (!_optionalChain([config, 'access', _95 => _95.docs, 'optionalAccess', _96 => _96.enabled]) || !_optionalChain([config, 'access', _97 => _97.docs, 'access', _98 => _98.adapter, 'optionalAccess', _99 => _99.server]) || _chunkVIDUNAQEcjs.getFarmPresetRuntime.call(void 0, preset) !== "edge" || Boolean(config.docs.adapter.edgeCompiler)) {
|
|
3072
3096
|
return;
|
|
3073
3097
|
}
|
|
3074
3098
|
throw new Error(
|
|
@@ -3249,7 +3273,7 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
3249
3273
|
);
|
|
3250
3274
|
}
|
|
3251
3275
|
}
|
|
3252
|
-
_optionalChain([sourceSnapshot, 'optionalAccess',
|
|
3276
|
+
_optionalChain([sourceSnapshot, 'optionalAccess', _100 => _100.clear, 'call', _101 => _101()]);
|
|
3253
3277
|
const ssrResult = ssrBuildResult.value;
|
|
3254
3278
|
const routeRuntimeManifest = routeRuntimeManifestResult.value;
|
|
3255
3279
|
const runtimeValidation = validateFarmRouteRuntimeDeployment(routeRuntimeManifest, preset);
|
|
@@ -3281,7 +3305,7 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
3281
3305
|
configuredHeaderRoutes,
|
|
3282
3306
|
nitroBuilderResultPromise,
|
|
3283
3307
|
lifecyclePluginManager,
|
|
3284
|
-
_optionalChain([markdownPrecompile, 'optionalAccess',
|
|
3308
|
+
_optionalChain([markdownPrecompile, 'optionalAccess', _102 => _102.pages])
|
|
3285
3309
|
);
|
|
3286
3310
|
const runtimeManifestPath = await writeFarmRouteRuntimeManifest(
|
|
3287
3311
|
_path2.default.join(root, distDir),
|
|
@@ -3302,8 +3326,8 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
3302
3326
|
_chunk7ZDLE77Pcjs.logger.error(`\u274C Build failed: ${error}`);
|
|
3303
3327
|
throw error;
|
|
3304
3328
|
} finally {
|
|
3305
|
-
_optionalChain([rendererBuild, 'optionalAccess',
|
|
3306
|
-
_optionalChain([markdownPrecompile, 'optionalAccess',
|
|
3329
|
+
_optionalChain([rendererBuild, 'optionalAccess', _103 => _103.abort, 'call', _104 => _104()]);
|
|
3330
|
+
_optionalChain([markdownPrecompile, 'optionalAccess', _105 => _105.dispose, 'call', _106 => _106()]);
|
|
3307
3331
|
}
|
|
3308
3332
|
}
|
|
3309
3333
|
function collectFarmPrerenderedMarkdownBodies(pageRoutes) {
|
|
@@ -3311,7 +3335,7 @@ function collectFarmPrerenderedMarkdownBodies(pageRoutes) {
|
|
|
3311
3335
|
for (const route of pageRoutes) {
|
|
3312
3336
|
if (route.source === void 0 || !_chunk27IPPPCVcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) continue;
|
|
3313
3337
|
const { body } = _chunk27IPPPCVcjs.parseMarkdownFrontmatter.call(void 0, route.source);
|
|
3314
|
-
const rendering =
|
|
3338
|
+
const rendering = _chunk7Q6KUXH6cjs.resolveRouteRenderingConfig.call(void 0,
|
|
3315
3339
|
_chunk27IPPPCVcjs.readFarmMarkdownRouteConfig.call(void 0, body),
|
|
3316
3340
|
route.source
|
|
3317
3341
|
);
|
|
@@ -3326,7 +3350,7 @@ function varyFarmNitroCacheRules(rules, headerNames) {
|
|
|
3326
3350
|
if (headerNames.length === 0) return rules;
|
|
3327
3351
|
return Object.fromEntries(
|
|
3328
3352
|
Object.entries(rules).map(([source, rule]) => {
|
|
3329
|
-
const cached = _optionalChain([rule, 'optionalAccess',
|
|
3353
|
+
const cached = _optionalChain([rule, 'optionalAccess', _107 => _107.swr]) !== void 0 && rule.swr !== false || _optionalChain([rule, 'optionalAccess', _108 => _108.cache]) !== void 0 && rule.cache !== false;
|
|
3330
3354
|
if (!cached || rule.cache === false) return [source, rule];
|
|
3331
3355
|
const cache = rule.cache && typeof rule.cache === "object" ? rule.cache : {};
|
|
3332
3356
|
const varies = [
|
|
@@ -3359,7 +3383,7 @@ async function writeFarmVideoPlayerToClient(outputDir) {
|
|
|
3359
3383
|
const filePath = _path2.default.join(outputDir, _chunkO7B6LJWEcjs.FARM_VIDEO_PLAYER_PATH.slice(1));
|
|
3360
3384
|
await fs5.mkdir(_path2.default.dirname(filePath), { recursive: true });
|
|
3361
3385
|
try {
|
|
3362
|
-
await fs5.writeFile(filePath,
|
|
3386
|
+
await fs5.writeFile(filePath, _chunk76ES7BCOcjs.FARM_VIDEO_PLAYER_HTML, { flag: "wx" });
|
|
3363
3387
|
} catch (error) {
|
|
3364
3388
|
if (error.code !== "EEXIST") throw error;
|
|
3365
3389
|
}
|
|
@@ -3393,7 +3417,7 @@ async function mergeBuiltFontCss(outputDir, fontCssSource) {
|
|
|
3393
3417
|
}
|
|
3394
3418
|
const normalizedFontCss = typeof fontCss === "string" ? fontCss : Buffer.from(fontCss).toString("utf8");
|
|
3395
3419
|
await fs5.writeFile(fontCssPath, normalizedFontCss);
|
|
3396
|
-
await fs5.writeFile(clientCssPath,
|
|
3420
|
+
await fs5.writeFile(clientCssPath, _chunk76ES7BCOcjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
|
|
3397
3421
|
}
|
|
3398
3422
|
function importsFarmClientBlockedPackage(id, packageName) {
|
|
3399
3423
|
return id === packageName || id.startsWith(`${packageName}/`);
|
|
@@ -3443,10 +3467,10 @@ async function validateClientBuildOutput(root, srcDir, outputDir) {
|
|
|
3443
3467
|
}
|
|
3444
3468
|
}
|
|
3445
3469
|
function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, options = {}) {
|
|
3446
|
-
const key =
|
|
3470
|
+
const key = _chunkBY5VQ57Wcjs.getClientModuleHydrationPlanKey.call(void 0, modulePath, root, mode, options);
|
|
3447
3471
|
let plan = cache.get(key);
|
|
3448
3472
|
if (!plan) {
|
|
3449
|
-
plan =
|
|
3473
|
+
plan = _chunkBY5VQ57Wcjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
|
|
3450
3474
|
cache.set(key, plan);
|
|
3451
3475
|
}
|
|
3452
3476
|
return { ...plan, isolatedBoundaries: [...plan.isolatedBoundaries] };
|
|
@@ -3475,19 +3499,19 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3475
3499
|
const unsupportedIntegrationProvider = integrationProviders.find(
|
|
3476
3500
|
(provider) => !_chunkN4AM7Q34cjs.providerSupportsIslands.call(void 0, provider)
|
|
3477
3501
|
);
|
|
3478
|
-
if (_optionalChain([config, 'access',
|
|
3502
|
+
if (_optionalChain([config, 'access', _109 => _109.experimental, 'optionalAccess', _110 => _110.isolatedClientHydration]) === "enabled" && _chunkCYUTK4JPcjs.resolveFarmServerComponentsMode.call(void 0, _chunkCYUTK4JPcjs.readFarmServerComponentsConfig.call(void 0, config)) !== "rsc" && unsupportedIntegrationProvider) {
|
|
3479
3503
|
_chunk7ZDLE77Pcjs.logger.warn(
|
|
3480
3504
|
`[Farm.js] Client components hydrate with their route, not as islands, because integration provider "${unsupportedIntegrationProvider.name}" doesn't declare \`islands: true\`.`
|
|
3481
3505
|
);
|
|
3482
3506
|
}
|
|
3483
|
-
const isolatedMode =
|
|
3484
|
-
_optionalChain([config, 'access',
|
|
3507
|
+
const isolatedMode = _chunkBY5VQ57Wcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
3508
|
+
_optionalChain([config, 'access', _111 => _111.experimental, 'optionalAccess', _112 => _112.isolatedClientHydration]),
|
|
3485
3509
|
{
|
|
3486
3510
|
serverComponents: _chunkCYUTK4JPcjs.resolveFarmServerComponentsMode.call(void 0, _chunkCYUTK4JPcjs.readFarmServerComponentsConfig.call(void 0, config)) === "rsc",
|
|
3487
3511
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
3488
3512
|
}
|
|
3489
3513
|
);
|
|
3490
|
-
const planOptions =
|
|
3514
|
+
const planOptions = _chunkBY5VQ57Wcjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
3491
3515
|
config.renderer,
|
|
3492
3516
|
Boolean(unsupportedIntegrationProvider)
|
|
3493
3517
|
);
|
|
@@ -3503,16 +3527,16 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3503
3527
|
const routeDirectory = (route) => _nullishCoalesce(route.directory, () => ( route.pattern));
|
|
3504
3528
|
const islandsMode = _chunkCYUTK4JPcjs.resolveFarmServerComponentsMode.call(void 0, _chunkCYUTK4JPcjs.readFarmServerComponentsConfig.call(void 0, config)) === "islands";
|
|
3505
3529
|
const adapterOwnsDocsRuntime = _chunkVZ2P6GRCcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs);
|
|
3506
|
-
const docsEntries = _optionalChain([config, 'access',
|
|
3530
|
+
const docsEntries = _optionalChain([config, 'access', _113 => _113.docs, 'optionalAccess', _114 => _114.enabled]) ? _chunk4A6WSOZHcjs.getFarmDocsRoots.call(void 0, config.docs).map(
|
|
3507
3531
|
(docsRoot) => `/${docsRoot.entry || "docs"}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/"
|
|
3508
3532
|
) : [];
|
|
3509
3533
|
const adapterDocsEntry = _nullishCoalesce(docsEntries[0], () => ( null));
|
|
3510
3534
|
const isAdapterDocsRoute = (routePattern) => adapterOwnsDocsRuntime && docsEntries.some(
|
|
3511
3535
|
(docsEntry) => docsEntry === "/" || routePattern === docsEntry || routePattern.startsWith(`${docsEntry}/`)
|
|
3512
3536
|
);
|
|
3513
|
-
const syntheticDocsEntry = _optionalChain([config, 'access',
|
|
3537
|
+
const syntheticDocsEntry = _optionalChain([config, 'access', _115 => _115.docs, 'optionalAccess', _116 => _116.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
|
|
3514
3538
|
const syntheticDocsPatterns = syntheticDocsEntry ? syntheticDocsEntry === "/" ? ["/", "/[...slug]"] : [syntheticDocsEntry, `${syntheticDocsEntry}/[...slug]`] : [];
|
|
3515
|
-
const plan = (operation) => sourceSnapshot ?
|
|
3539
|
+
const plan = (operation) => sourceSnapshot ? _chunkBY5VQ57Wcjs.withFarmSourceSnapshotOf.call(void 0, sourceSnapshot, operation) : _chunkBY5VQ57Wcjs.withFarmSourceSnapshot.call(void 0, operation);
|
|
3516
3540
|
const { clientLayouts, clientRouteSlots } = plan(() => {
|
|
3517
3541
|
const clientLayouts2 = layoutRoutes.map((layout) => {
|
|
3518
3542
|
try {
|
|
@@ -3559,7 +3583,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3559
3583
|
};
|
|
3560
3584
|
}
|
|
3561
3585
|
});
|
|
3562
|
-
const markdownPagePlan =
|
|
3586
|
+
const markdownPagePlan = _chunkBY5VQ57Wcjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
3563
3587
|
_chunkYQ5NVEFScjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunkYQ5NVEFScjs.resolveMdxConfig.call(void 0, config.mdx), root),
|
|
3564
3588
|
root,
|
|
3565
3589
|
isolatedMode,
|
|
@@ -3575,7 +3599,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3575
3599
|
pagePlanOptions
|
|
3576
3600
|
)
|
|
3577
3601
|
}));
|
|
3578
|
-
|
|
3602
|
+
_chunkBY5VQ57Wcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
3579
3603
|
clientLayouts2.map((layout) => ({
|
|
3580
3604
|
pattern: layout.pattern,
|
|
3581
3605
|
depth: layout.pattern.split("/").filter(Boolean).length,
|
|
@@ -3609,7 +3633,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3609
3633
|
const matchesBuiltRoute = pageRoutes.some((route) => layoutAppliesToRoute(layout.pattern, routeDirectory(route))) || docsEntries.some((docsEntry) => layoutAppliesToRoute(layout.pattern, docsEntry));
|
|
3610
3634
|
if (matchesBuiltRoute && layout.suppressedAsyncHydration) {
|
|
3611
3635
|
_chunk7ZDLE77Pcjs.logger.warn(
|
|
3612
|
-
`\u26A0\uFE0F ${
|
|
3636
|
+
`\u26A0\uFE0F ${_chunkBY5VQ57Wcjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`
|
|
3613
3637
|
);
|
|
3614
3638
|
}
|
|
3615
3639
|
}
|
|
@@ -3644,7 +3668,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3644
3668
|
);
|
|
3645
3669
|
if (metadata.suppressedAsyncHydration) {
|
|
3646
3670
|
_chunk7ZDLE77Pcjs.logger.warn(
|
|
3647
|
-
`\u26A0\uFE0F ${
|
|
3671
|
+
`\u26A0\uFE0F ${_chunkBY5VQ57Wcjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
|
|
3648
3672
|
);
|
|
3649
3673
|
}
|
|
3650
3674
|
const slotBoundaries = serverSlotPlans.filter(
|
|
@@ -3652,7 +3676,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3652
3676
|
).flatMap(({ plan: plan2 }) => plan2.isolatedBoundaries);
|
|
3653
3677
|
if (metadata.shouldHydrate || metadata.hasIsolatedClientBoundaries || applicableClientLayouts.length > 0 || slotBoundaries.length > 0) {
|
|
3654
3678
|
const relativePath = route.modulePath.replace(root, "").replace(/^\//, "");
|
|
3655
|
-
const islandStrategy =
|
|
3679
|
+
const islandStrategy = _chunk76ES7BCOcjs.resolveFarmRouteRootStrategy.call(void 0,
|
|
3656
3680
|
route,
|
|
3657
3681
|
metadata,
|
|
3658
3682
|
clientLayouts2,
|
|
@@ -3671,7 +3695,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3671
3695
|
...applicableClientLayouts.filter((layout) => layout.hasIsolatedClientBoundaries || layout.serverTreeLayout).flatMap((layout) => layout.isolatedBoundaries)
|
|
3672
3696
|
],
|
|
3673
3697
|
// The server renders a server tree only below a hydrating layout.
|
|
3674
|
-
...
|
|
3698
|
+
..._chunkBY5VQ57Wcjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
|
|
3675
3699
|
});
|
|
3676
3700
|
_chunk7ZDLE77Pcjs.logger.info(`\u{1F4F1} Found hydratable route: ${route.pattern} -> ${route.modulePath}`);
|
|
3677
3701
|
}
|
|
@@ -3708,7 +3732,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3708
3732
|
}
|
|
3709
3733
|
const clientRouteSlots2 = routeSlots.filter((slot) => {
|
|
3710
3734
|
try {
|
|
3711
|
-
const metadata =
|
|
3735
|
+
const metadata = _chunkBY5VQ57Wcjs.getClientModuleMetadata.call(void 0, slot.modulePath, root);
|
|
3712
3736
|
return metadata.shouldHydrate && (!islandsMode || metadata.isClientComponent);
|
|
3713
3737
|
} catch (error) {
|
|
3714
3738
|
_chunk7ZDLE77Pcjs.logger.warn(`\u26A0\uFE0F Could not inspect route slot ${slot.modulePath}: ${error}`);
|
|
@@ -3752,7 +3776,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3752
3776
|
srcDir,
|
|
3753
3777
|
adapterOwnsDocsRuntime ? false : _chunk3EZHMZGDcjs.isFarmDocsSearchEnabled.call(void 0, config.docs),
|
|
3754
3778
|
adapterOwnsDocsRuntime ? void 0 : _chunk3EZHMZGDcjs.resolveFarmDocsSearchClientModule.call(void 0, root),
|
|
3755
|
-
_optionalChain([config, 'access',
|
|
3779
|
+
_optionalChain([config, 'access', _117 => _117.docs, 'optionalAccess', _118 => _118.enabled]) ? _chunk4A6WSOZHcjs.getFarmDocsRoots.call(void 0, config.docs).map((docsRoot) => docsRoot.entry) : void 0,
|
|
3756
3780
|
adapterOwnsDocsRuntime ? _chunkVZ2P6GRCcjs.getFarmDocsAdapterUIModule.call(void 0, config.docs.adapter) : void 0,
|
|
3757
3781
|
config.i18n,
|
|
3758
3782
|
config.plugins,
|
|
@@ -3761,11 +3785,11 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3761
3785
|
config.trailingSlash,
|
|
3762
3786
|
_chunkN4AM7Q34cjs.getIntegrationProviders.call(void 0, config.integrations),
|
|
3763
3787
|
config.basePath,
|
|
3764
|
-
|
|
3788
|
+
_chunk76ES7BCOcjs.generateClientCachePersistenceCode.call(void 0, _chunk76ES7BCOcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
|
|
3765
3789
|
adapterOwnsDocsRuntime ? _chunkP4ZLFUNBcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0,
|
|
3766
3790
|
_chunkCYUTK4JPcjs.resolveFarmServerComponentsMode.call(void 0, _chunkCYUTK4JPcjs.readFarmServerComponentsConfig.call(void 0, config)) === "islands",
|
|
3767
3791
|
platform,
|
|
3768
|
-
islandsMode ?
|
|
3792
|
+
islandsMode ? _chunkBY5VQ57Wcjs.collectFarmServerStylesheets.call(void 0,
|
|
3769
3793
|
[
|
|
3770
3794
|
...layoutRoutes.map((layout) => layout.modulePath),
|
|
3771
3795
|
...pageRoutes.filter((route) => !isAdapterDocsRoute(route.pattern)).map((route) => route.modulePath)
|
|
@@ -3789,7 +3813,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3789
3813
|
await fs5.writeFile(_path2.default.join(clientEntryDir, "farm-client-root.tsx"), clientEntry.root);
|
|
3790
3814
|
}
|
|
3791
3815
|
const clientInput = { [entryName]: clientEntryPath };
|
|
3792
|
-
if (platform === "web" &&
|
|
3816
|
+
if (platform === "web" && _chunk76ES7BCOcjs.canBootFarmIslandsClient.call(void 0, config)) {
|
|
3793
3817
|
const clientBootPath = _path2.default.join(clientEntryDir, "farm-client-boot.tsx");
|
|
3794
3818
|
await fs5.writeFile(
|
|
3795
3819
|
clientBootPath,
|
|
@@ -3831,11 +3855,11 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3831
3855
|
target: FARM_CLIENT_BUILD_TARGET,
|
|
3832
3856
|
// Tailwind CSS 4 already requires newer browsers than that baseline. An app's own
|
|
3833
3857
|
// `build.target` or `build.cssTarget` still decides, as Vite derives one from the other.
|
|
3834
|
-
..._optionalChain([config, 'access',
|
|
3858
|
+
..._optionalChain([config, 'access', _119 => _119.vite, 'optionalAccess', _120 => _120.build, 'optionalAccess', _121 => _121.target]) === void 0 && _optionalChain([config, 'access', _122 => _122.vite, 'optionalAccess', _123 => _123.build, 'optionalAccess', _124 => _124.cssTarget]) === void 0 && (_chunkWAQIO2VDcjs.includesTailwindVitePlugin.call(void 0, tailwindVitePlugin) || _chunkWAQIO2VDcjs.includesTailwindVitePlugin.call(void 0, _optionalChain([config, 'access', _125 => _125.vite, 'optionalAccess', _126 => _126.plugins]))) ? { cssTarget: _chunkWAQIO2VDcjs.TAILWIND_CSS_BROWSER_TARGET } : {},
|
|
3835
3859
|
outDir: outputDir,
|
|
3836
3860
|
emptyOutDir: platform === "web",
|
|
3837
3861
|
// Never public: see resolveFarmClientSourcemap.
|
|
3838
|
-
sourcemap: resolveFarmClientSourcemap(_optionalChain([config, 'access',
|
|
3862
|
+
sourcemap: resolveFarmClientSourcemap(_optionalChain([config, 'access', _127 => _127.vite, 'optionalAccess', _128 => _128.build, 'optionalAccess', _129 => _129.sourcemap])),
|
|
3839
3863
|
assetsInlineLimit: 0,
|
|
3840
3864
|
cssCodeSplit: false,
|
|
3841
3865
|
// Bundle all CSS into one file
|
|
@@ -3847,7 +3871,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3847
3871
|
hashCharacters: "hex",
|
|
3848
3872
|
// Use predictable name for CSS so we can reference it in SSR HTML
|
|
3849
3873
|
assetFileNames: (assetInfo) => {
|
|
3850
|
-
if (_optionalChain([assetInfo, 'access',
|
|
3874
|
+
if (_optionalChain([assetInfo, 'access', _130 => _130.name, 'optionalAccess', _131 => _131.endsWith, 'call', _132 => _132(".css")])) {
|
|
3851
3875
|
return `${entryName}.css`;
|
|
3852
3876
|
}
|
|
3853
3877
|
return "assets/[name]-h[hash][extname]";
|
|
@@ -3864,7 +3888,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3864
3888
|
}
|
|
3865
3889
|
},
|
|
3866
3890
|
plugins: [
|
|
3867
|
-
|
|
3891
|
+
_chunk76ES7BCOcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
3868
3892
|
createFarmPrivateClientSourcemapsPlugin({
|
|
3869
3893
|
outDir: _path2.default.join(
|
|
3870
3894
|
_path2.default.dirname(outputDir),
|
|
@@ -3926,7 +3950,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3926
3950
|
distDir: config.distDir || ".farm"
|
|
3927
3951
|
}),
|
|
3928
3952
|
farmNavigationPlugin(config.renderer),
|
|
3929
|
-
|
|
3953
|
+
_chunk76ES7BCOcjs.farmDocsClientConfigPlugin.call(void 0,
|
|
3930
3954
|
adapterOwnsDocsRuntime ? _chunkP4ZLFUNBcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
|
|
3931
3955
|
),
|
|
3932
3956
|
// Plugin to redirect @farm.js/core imports to client-only exports
|
|
@@ -3959,7 +3983,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3959
3983
|
},
|
|
3960
3984
|
load: {
|
|
3961
3985
|
filter: {
|
|
3962
|
-
id:
|
|
3986
|
+
id: _chunk76ES7BCOcjs.exactIdPattern.call(void 0, [
|
|
3963
3987
|
"\0empty-module",
|
|
3964
3988
|
"\0empty-api-route",
|
|
3965
3989
|
"\0farm-i18n-client-bridge",
|
|
@@ -3997,7 +4021,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3997
4021
|
{ ...config, isolatedClientBoundaryModules, programmaticClientRoutes, sourceSnapshot },
|
|
3998
4022
|
pluginManager
|
|
3999
4023
|
),
|
|
4000
|
-
|
|
4024
|
+
_chunkBY5VQ57Wcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
|
|
4001
4025
|
],
|
|
4002
4026
|
mode: "production",
|
|
4003
4027
|
css: postcssSearchPath ? {
|
|
@@ -4005,7 +4029,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
4005
4029
|
} : void 0,
|
|
4006
4030
|
// Ensure React is bundled for client
|
|
4007
4031
|
resolve: {
|
|
4008
|
-
alias:
|
|
4032
|
+
alias: _chunk76ES7BCOcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
4009
4033
|
dedupe: [...config.renderer.dedupe || []]
|
|
4010
4034
|
},
|
|
4011
4035
|
// Optimize dependencies - exclude server-side code from client bundle
|
|
@@ -4019,7 +4043,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
4019
4043
|
}
|
|
4020
4044
|
};
|
|
4021
4045
|
await viteBuild(
|
|
4022
|
-
|
|
4046
|
+
_chunk76ES7BCOcjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite, { clientOutput: true })
|
|
4023
4047
|
);
|
|
4024
4048
|
if (platform === "mobile") {
|
|
4025
4049
|
await fs5.rm(_path2.default.join(outputDir, `${entryName}.css`), { force: true });
|
|
@@ -4113,9 +4137,9 @@ async function fetchFarmNavigationDocument(url, headers, recover = true, signal)
|
|
|
4113
4137
|
return response;
|
|
4114
4138
|
}
|
|
4115
4139
|
|
|
4116
|
-
${streamNavigations ? `${
|
|
4140
|
+
${streamNavigations ? `${_chunk76ES7BCOcjs.FARM_NAVIGATION_STREAM_READER_SOURCE}
|
|
4117
4141
|
|
|
4118
|
-
${
|
|
4142
|
+
${_chunk76ES7BCOcjs.FARM_EARLY_NAVIGATION_SOURCE}` : ""}
|
|
4119
4143
|
|
|
4120
4144
|
function clearFarmPrefetchCacheOnDeploymentMismatch(router, error) {
|
|
4121
4145
|
if (error?.name === "FarmDeploymentMismatchError") {
|
|
@@ -5288,7 +5312,7 @@ function readFarmEntryImports(source) {
|
|
|
5288
5312
|
for (const match of source.matchAll(/^import\s+([^"';]+?)\s+from\s+(["'][^"']+["'])/gm)) {
|
|
5289
5313
|
const from = match[2];
|
|
5290
5314
|
const named = /\{([^}]*)\}/.exec(match[1]);
|
|
5291
|
-
for (const specifier of _nullishCoalesce(_optionalChain([named, 'optionalAccess',
|
|
5315
|
+
for (const specifier of _nullishCoalesce(_optionalChain([named, 'optionalAccess', _133 => _133[1], 'optionalAccess', _134 => _134.split, 'call', _135 => _135(",")]), () => ( []))) {
|
|
5292
5316
|
const [imported, local] = specifier.trim().split(/\s+as\s+/);
|
|
5293
5317
|
if (imported)
|
|
5294
5318
|
bindings.push({ local: _nullishCoalesce(local, () => ( imported)), clause: `{ ${specifier.trim()} }`, from });
|
|
@@ -5450,7 +5474,7 @@ import { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};
|
|
|
5450
5474
|
const React = { ...__farmRendererClient };`
|
|
5451
5475
|
);
|
|
5452
5476
|
const hydrateFarmRouteCall = _chunkLEZJZX4Ccjs.isReactRenderer.call(void 0, renderer) ? "return hydrateRoot(container, route.element);" : "return route.layouts.length > 0 ? hydrateRoot(container, route.element, route) : hydrateRoot(container, route.element);";
|
|
5453
|
-
const providerClientCode =
|
|
5477
|
+
const providerClientCode = _chunk76ES7BCOcjs.generateFarmIntegrationProviderClientCode.call(void 0,
|
|
5454
5478
|
integrationProviders,
|
|
5455
5479
|
root,
|
|
5456
5480
|
_nullishCoalesce(renderer.componentExtensions, () => ( []))
|
|
@@ -5584,7 +5608,7 @@ mountFarmDocsSearch();
|
|
|
5584
5608
|
|
|
5585
5609
|
${generateUniversalRouterStateRuntime()}
|
|
5586
5610
|
|
|
5587
|
-
${
|
|
5611
|
+
${_chunk76ES7BCOcjs.FARM_NAVIGATION_SCRIPT_SOURCE}
|
|
5588
5612
|
|
|
5589
5613
|
// SPA Router for server-rendered pages (HTML swap)
|
|
5590
5614
|
const spaRouter = {
|
|
@@ -6126,7 +6150,7 @@ ${layoutRegistrations.join(",\n")}
|
|
|
6126
6150
|
${generateFarmClientRouteMatchSource({ lazyMatcher })}
|
|
6127
6151
|
|
|
6128
6152
|
${layoutComponentsRuntime}/*farm-root-start*/
|
|
6129
|
-
${
|
|
6153
|
+
${_chunk76ES7BCOcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
|
|
6130
6154
|
// Wrap a page element with applicable layouts
|
|
6131
6155
|
function wrapWithLayouts(pageElement, pathname, params) {
|
|
6132
6156
|
const layouts = getApplicableLayouts(pathname);
|
|
@@ -6161,7 +6185,7 @@ function createLayoutPageBoundary(route, pageElement, serverHtml) {
|
|
|
6161
6185
|
return React.createElement("div", props, pageElement);
|
|
6162
6186
|
}
|
|
6163
6187
|
let farmLastRouteState = null;
|
|
6164
|
-
${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${
|
|
6188
|
+
${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${_chunk76ES7BCOcjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
|
|
6165
6189
|
function farmTreeLayoutsOf(pathname) {
|
|
6166
6190
|
return getApplicableLayouts(pathname).filter(function(layout) {
|
|
6167
6191
|
return layout.serverTree === true;
|
|
@@ -6795,7 +6819,7 @@ function fitsSegmentResponse(currentRoot, nextRoot) {
|
|
|
6795
6819
|
return true;
|
|
6796
6820
|
}` : ""}
|
|
6797
6821
|
|
|
6798
|
-
${
|
|
6822
|
+
${_chunk76ES7BCOcjs.FARM_NAVIGATION_SCRIPT_SOURCE}
|
|
6799
6823
|
|
|
6800
6824
|
function activateNavigationScripts(root) {
|
|
6801
6825
|
for (const script of Array.from(root?.querySelectorAll?.("script") || [])) {
|
|
@@ -6901,7 +6925,7 @@ function getLayoutShell(root, patterns, index) {
|
|
|
6901
6925
|
return shell.innerHTML;
|
|
6902
6926
|
}
|
|
6903
6927
|
|
|
6904
|
-
${islandValues ?
|
|
6928
|
+
${islandValues ? _chunk76ES7BCOcjs.FARM_REFRESH_FIELDS_SOURCE : ""}function replaceSharedLayoutBoundary(currentRoot, nextRoot, refresh = false) {
|
|
6905
6929
|
// A refresh keeps the islands still on the page: the ones in streamed Suspense content too.
|
|
6906
6930
|
if (refresh) revealFarmStreamedContent(nextRoot);
|
|
6907
6931
|
const currentPatterns = getLayoutPatterns(currentRoot);
|
|
@@ -7710,7 +7734,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7710
7734
|
}))
|
|
7711
7735
|
);
|
|
7712
7736
|
const instrumentationPath = _chunkI5PDHLKEcjs.resolveFarmInstrumentationFile.call(void 0, root, config.srcDir || "src");
|
|
7713
|
-
const notFoundPath =
|
|
7737
|
+
const notFoundPath = _chunk76ES7BCOcjs.resolveFarmNotFoundComponentPath.call(void 0,
|
|
7714
7738
|
config,
|
|
7715
7739
|
appDirs,
|
|
7716
7740
|
routeManager.getRendererNotFoundPath()
|
|
@@ -7735,9 +7759,9 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7735
7759
|
(provider) => provider.component || provider.type === "clerk"
|
|
7736
7760
|
);
|
|
7737
7761
|
const hasObservabilityHandler = !!config.observability && typeof config.observability === "object" && "onEvent" in config.observability;
|
|
7738
|
-
const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access',
|
|
7762
|
+
const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _136 => _136.mdx, 'optionalAccess', _137 => _137.components]));
|
|
7739
7763
|
const hasMiddlewareConfig = _chunkIGBQSUT5cjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
|
|
7740
|
-
const hasRouteContextConfig =
|
|
7764
|
+
const hasRouteContextConfig = _chunkGDKJGL7Dcjs.hasCustomFarmRouteContext.call(void 0, config);
|
|
7741
7765
|
const hasServerRuntimePlugins = _chunkWAQIO2VDcjs.hasFarmServerRuntimePlugins.call(void 0, config.plugins);
|
|
7742
7766
|
const hasPluginRoutes = hasFarmPluginRoutes(config);
|
|
7743
7767
|
const hasServerCacheConfig = hasFarmServerCacheConfig(config.cache);
|
|
@@ -7749,7 +7773,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7749
7773
|
);
|
|
7750
7774
|
if (_chunkVZ2P6GRCcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
|
|
7751
7775
|
const adapterGuardedPaths = new Set(getFarmDocsGuardedPaths(config, middlewareRoutes));
|
|
7752
|
-
|
|
7776
|
+
_chunkJEJXSTYRcjs.assertFarmDocsAdapterServesNoGuardedPages.call(void 0,
|
|
7753
7777
|
config.docs,
|
|
7754
7778
|
{ root, srcDir: config.srcDir },
|
|
7755
7779
|
(pathname) => adapterGuardedPaths.has(pathname),
|
|
@@ -7757,9 +7781,9 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7757
7781
|
);
|
|
7758
7782
|
}
|
|
7759
7783
|
const farmDocsCspNonceMarker = _chunkIEZFFXSCcjs.createFarmCspNonce.call(void 0, config.security);
|
|
7760
|
-
const farmDocsPrecompiledManifest = _optionalChain([config, 'access',
|
|
7784
|
+
const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _138 => _138.docs, 'optionalAccess', _139 => _139.enabled]) && _chunkVIDUNAQEcjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? await _chunkIBZW57NWcjs._runWithFarmCspNonce.call(void 0,
|
|
7761
7785
|
farmDocsCspNonceMarker,
|
|
7762
|
-
async () => _optionalChain([config, 'access',
|
|
7786
|
+
async () => _optionalChain([config, 'access', _140 => _140.docs, 'access', _141 => _141.adapter, 'optionalAccess', _142 => _142.server]) ? await _chunkJEJXSTYRcjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
|
|
7763
7787
|
root,
|
|
7764
7788
|
srcDir: config.srcDir,
|
|
7765
7789
|
clientEntry: FARM_CLIENT_JS_SRC_PLACEHOLDER,
|
|
@@ -7873,7 +7897,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7873
7897
|
// Adapters can render provider scripts by serializing function source.
|
|
7874
7898
|
// keepNames injects helper calls into those functions; after Nitro
|
|
7875
7899
|
// minifies the server chunk the helper is no longer in script scope.
|
|
7876
|
-
keepNames: !(_optionalChain([config, 'access',
|
|
7900
|
+
keepNames: !(_optionalChain([config, 'access', _143 => _143.docs, 'optionalAccess', _144 => _144.enabled]) && _optionalChain([config, 'access', _145 => _145.docs, 'access', _146 => _146.adapter, 'optionalAccess', _147 => _147.server])),
|
|
7877
7901
|
jsxDev: false
|
|
7878
7902
|
},
|
|
7879
7903
|
// SSR configuration to externalize problematic modules
|
|
@@ -7923,10 +7947,10 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7923
7947
|
define: {
|
|
7924
7948
|
__FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
|
|
7925
7949
|
__FARM_ENV__: JSON.stringify(_chunkTP7JAC3Tcjs.createBundledEnv.call(void 0, config.env)),
|
|
7926
|
-
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access',
|
|
7950
|
+
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _148 => _148.env, 'optionalAccess', _149 => _149.public]) || {})
|
|
7927
7951
|
},
|
|
7928
7952
|
plugins: [
|
|
7929
|
-
|
|
7953
|
+
_chunk76ES7BCOcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
7930
7954
|
...tailwindVitePlugin ? [tailwindVitePlugin] : [],
|
|
7931
7955
|
...rendererVitePlugins,
|
|
7932
7956
|
...config.vite.plugins || [],
|
|
@@ -7958,7 +7982,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7958
7982
|
},
|
|
7959
7983
|
pluginManager
|
|
7960
7984
|
),
|
|
7961
|
-
|
|
7985
|
+
_chunkBY5VQ57Wcjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
|
|
7962
7986
|
...hasRuntimeConfigModule ? [
|
|
7963
7987
|
farmStripPlatformConfigPlugin(
|
|
7964
7988
|
[
|
|
@@ -7970,7 +7994,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7970
7994
|
{
|
|
7971
7995
|
name: "farm-virtual-ssr-entry",
|
|
7972
7996
|
resolveId: {
|
|
7973
|
-
filter: { id:
|
|
7997
|
+
filter: { id: _chunk76ES7BCOcjs.exactIdPattern.call(void 0, [virtualEntryId, "\0virtual:farm-ssr-entry"]) },
|
|
7974
7998
|
handler(id) {
|
|
7975
7999
|
if (id === virtualEntryId || id === "\0virtual:farm-ssr-entry") {
|
|
7976
8000
|
return virtualEntryId;
|
|
@@ -7979,7 +8003,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7979
8003
|
}
|
|
7980
8004
|
},
|
|
7981
8005
|
load: {
|
|
7982
|
-
filter: { id:
|
|
8006
|
+
filter: { id: _chunk76ES7BCOcjs.exactIdPattern.call(void 0, [virtualEntryId]) },
|
|
7983
8007
|
handler(id) {
|
|
7984
8008
|
if (id === virtualEntryId) {
|
|
7985
8009
|
return virtualEntryCode;
|
|
@@ -8019,7 +8043,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
8019
8043
|
resolve: {
|
|
8020
8044
|
alias: [
|
|
8021
8045
|
...shouldAliasReactServerToWebBuild(config.renderer, preset) ? [createFarmReactWebServerAlias(hasReactDomEdgeServerBuild(root))] : [],
|
|
8022
|
-
...Object.entries(
|
|
8046
|
+
...Object.entries(_chunk76ES7BCOcjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
|
|
8023
8047
|
([find, replacement]) => ({ find, replacement })
|
|
8024
8048
|
)
|
|
8025
8049
|
],
|
|
@@ -8027,7 +8051,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
8027
8051
|
dedupe: [...config.renderer.dedupe || []]
|
|
8028
8052
|
}
|
|
8029
8053
|
};
|
|
8030
|
-
await viteBuild(
|
|
8054
|
+
await viteBuild(_chunk76ES7BCOcjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
|
|
8031
8055
|
} finally {
|
|
8032
8056
|
if (postcssConfigDir) {
|
|
8033
8057
|
try {
|
|
@@ -8064,7 +8088,7 @@ function readFarmPageLastModified(pageRoutes) {
|
|
|
8064
8088
|
return lastModified;
|
|
8065
8089
|
}
|
|
8066
8090
|
function getFarmDocsGuardedPaths(config, middlewareRoutes) {
|
|
8067
|
-
if (!_optionalChain([config, 'access',
|
|
8091
|
+
if (!_optionalChain([config, 'access', _150 => _150.docs, 'optionalAccess', _151 => _151.enabled])) return [];
|
|
8068
8092
|
const options = { root: config.root, srcDir: config.srcDir };
|
|
8069
8093
|
const guards = {
|
|
8070
8094
|
config: { middleware: config.middleware, integrations: config.integrations },
|
|
@@ -8075,15 +8099,15 @@ function getFarmDocsGuardedPaths(config, middlewareRoutes) {
|
|
|
8075
8099
|
).flatMap((page) => [page.href, _chunk4A6WSOZHcjs.getFarmDocsMarkdownPath.call(void 0, page.href)]).filter((pathname) => _chunkIGBQSUT5cjs.farmPathGuardCoversPage.call(void 0, guards, pathname));
|
|
8076
8100
|
}
|
|
8077
8101
|
function getFarmAppOwnedDocsEnginePaths(agent, applicationMetadataRoutes) {
|
|
8078
|
-
const llmsTxt = _optionalChain([agent, 'optionalAccess',
|
|
8102
|
+
const llmsTxt = _optionalChain([agent, 'optionalAccess', _152 => _152.llmsTxt]);
|
|
8079
8103
|
const ownedByFile = (kind) => applicationMetadataRoutes.some(
|
|
8080
8104
|
(metadata) => metadata.kind === kind && metadata.pattern === "/"
|
|
8081
8105
|
);
|
|
8082
8106
|
return [
|
|
8083
|
-
..._optionalChain([llmsTxt, 'optionalAccess',
|
|
8084
|
-
..._optionalChain([llmsTxt, 'optionalAccess',
|
|
8085
|
-
..._optionalChain([agent, 'optionalAccess',
|
|
8086
|
-
..._optionalChain([agent, 'optionalAccess',
|
|
8107
|
+
..._optionalChain([llmsTxt, 'optionalAccess', _153 => _153.enabled]) || ownedByFile("llms") ? ["/llms.txt"] : [],
|
|
8108
|
+
..._optionalChain([llmsTxt, 'optionalAccess', _154 => _154.enabled]) && llmsTxt.full || ownedByFile("llms-full") ? ["/llms-full.txt"] : [],
|
|
8109
|
+
..._optionalChain([agent, 'optionalAccess', _155 => _155.sitemap, 'optionalAccess', _156 => _156.enabled]) || ownedByFile("sitemap") ? ["/sitemap.xml"] : [],
|
|
8110
|
+
..._optionalChain([agent, 'optionalAccess', _157 => _157.crawlers, 'optionalAccess', _158 => _158.enabled]) || ownedByFile("robots") ? ["/robots.txt"] : []
|
|
8087
8111
|
];
|
|
8088
8112
|
}
|
|
8089
8113
|
function generateFarmDocsAdapterHandlerArguments(docs, docsConfigModulePath) {
|
|
@@ -8094,7 +8118,7 @@ function generateFarmDocsAdapterHandlerArguments(docs, docsConfigModulePath) {
|
|
|
8094
8118
|
docsPath: ${root}.entry,
|
|
8095
8119
|
contentDir: ${root}.contentDir || ${root}.config?.contentDir,
|
|
8096
8120
|
}`;
|
|
8097
|
-
if (_optionalChain([docs, 'optionalAccess',
|
|
8121
|
+
if (_optionalChain([docs, 'optionalAccess', _159 => _159.roots, 'optionalAccess', _160 => _160.length])) {
|
|
8098
8122
|
return {
|
|
8099
8123
|
factory: "createFarmDocsAdapterMultiRuntimeHandler",
|
|
8100
8124
|
config: `[farmDocsResolvedConfig, ...farmDocsResolvedConfig.roots].map((farmDocsRoot) => ({
|
|
@@ -8110,7 +8134,7 @@ function generateFarmDocsAdapterHandlerArguments(docs, docsConfigModulePath) {
|
|
|
8110
8134
|
}
|
|
8111
8135
|
function generateFarmDocsRuntimeConfigExpression(docs, precompiled = false, bundledRootPaths = []) {
|
|
8112
8136
|
if (!docs.enabled) return "null";
|
|
8113
|
-
const serializableDocs = _optionalChain([docs, 'access',
|
|
8137
|
+
const serializableDocs = _optionalChain([docs, 'access', _161 => _161.roots, 'optionalAccess', _162 => _162.length]) ? {
|
|
8114
8138
|
...docs,
|
|
8115
8139
|
// React elements and functions do not survive JSON; see runtimeConfig below.
|
|
8116
8140
|
roots: docs.roots.map((docsRoot) => ({ ...docsRoot, runtimeConfig: void 0 }))
|
|
@@ -8144,7 +8168,7 @@ function generateFarmDocsRuntimeConfigExpression(docs, precompiled = false, bund
|
|
|
8144
8168
|
},
|
|
8145
8169
|
}
|
|
8146
8170
|
: ${JSON.stringify({ ...serializableDocs, runtimeConfig: void 0 })}`;
|
|
8147
|
-
if (!_optionalChain([docs, 'access',
|
|
8171
|
+
if (!_optionalChain([docs, 'access', _163 => _163.roots, 'optionalAccess', _164 => _164.length])) return expression;
|
|
8148
8172
|
return `((farmDocs, farmDocsBundledRootPaths) => ({
|
|
8149
8173
|
...farmDocs,
|
|
8150
8174
|
roots: farmDocs.roots.map((farmDocsRoot, index) => {
|
|
@@ -8162,7 +8186,7 @@ function toVirtualEntryImportSpecifier(modulePath) {
|
|
|
8162
8186
|
return JSON.stringify(modulePath.replace(/\\/g, "/"));
|
|
8163
8187
|
}
|
|
8164
8188
|
function generateNativeAuthIntegrationSource(auth) {
|
|
8165
|
-
if (_optionalChain([auth, 'optionalAccess',
|
|
8189
|
+
if (_optionalChain([auth, 'optionalAccess', _165 => _165.enabled]) !== true) {
|
|
8166
8190
|
return { importSource: "", registerSource: "" };
|
|
8167
8191
|
}
|
|
8168
8192
|
return {
|
|
@@ -8477,31 +8501,32 @@ ReactDOMServer.configureApp(__farmAppSetup);`;
|
|
|
8477
8501
|
}
|
|
8478
8502
|
function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlots, errorRoutes, metadataImageRoutes, applicationMetadataRoutes, middlewareRoutes, redirectRoutes, configuredRewriteRoutes, configuredHeaderRoutes, openAPIReference, notFoundPath, instrumentationPath, config, farmDocsPrecompiledManifest, configModulePath, hasServerRuntimeIntegrations, hasRuntimeIntegrationConfig, hasConfiguredRuntimePlugins, hasServerRuntimePlugins, preset, i18nCatalogs, isolatedClientBoundaryModules, hydrationPlanCache, mobileShellLoadingRoutes = [], farmDocsAnalyticsPages = []) {
|
|
8479
8503
|
const farmRendererDisabled = _chunkLEZJZX4Ccjs.isFarmRendererDisabled.call(void 0, config.renderer);
|
|
8480
|
-
const farmStaticNotFoundBuild = preset === "vercel" && _optionalChain([config, 'access',
|
|
8504
|
+
const farmStaticNotFoundBuild = preset === "vercel" && _optionalChain([config, 'access', _166 => _166.experimental, 'optionalAccess', _167 => _167.staticNotFound]) === true && !farmRendererDisabled;
|
|
8505
|
+
const farmStaticPagesBuild = resolveFarmStaticPagesMode(_optionalChain([config, 'access', _168 => _168.experimental, 'optionalAccess', _169 => _169.staticPages])) !== "off" && !farmRendererDisabled;
|
|
8481
8506
|
const searchPreserveRoutes = pageRoutes.flatMap(
|
|
8482
8507
|
(route) => route.searchPreserve ? [route.searchPreserve] : []
|
|
8483
8508
|
);
|
|
8484
8509
|
const searchPreserveRoutesSource = searchPreserveRoutes.length > 0 ? JSON.stringify(searchPreserveRoutes) : "";
|
|
8485
8510
|
const farmIslandsMode = _chunkCYUTK4JPcjs.resolveFarmServerComponentsMode.call(void 0, _chunkCYUTK4JPcjs.readFarmServerComponentsConfig.call(void 0, config)) === "islands";
|
|
8486
|
-
const farmRendererActions =
|
|
8487
|
-
const farmClientBoot =
|
|
8511
|
+
const farmRendererActions = _chunk76ES7BCOcjs.resolveFarmIslxActionsMode.call(void 0, config) === "renderer";
|
|
8512
|
+
const farmClientBoot = _chunk76ES7BCOcjs.canBootFarmIslandsClient.call(void 0, config);
|
|
8488
8513
|
const farmMobileClient = shouldBuildFarmMobileClient(config);
|
|
8489
8514
|
const farmMobileShells = farmMobileClient && config.mobileShells ? config.mobileShells : null;
|
|
8490
8515
|
const hasCompressionRuntime = config.compress && _chunkRLC7NNTAcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) !== "edge";
|
|
8491
|
-
const servesAgentRobotsTxt = Boolean(_optionalChain([config, 'access',
|
|
8516
|
+
const servesAgentRobotsTxt = Boolean(_optionalChain([config, 'access', _170 => _170.agent, 'optionalAccess', _171 => _171.crawlers, 'optionalAccess', _172 => _172.enabled])) && !applicationMetadataRoutes.some(
|
|
8492
8517
|
(metadata) => metadata.kind === "robots" && metadata.pattern === "/"
|
|
8493
8518
|
);
|
|
8494
|
-
const servesAgentSitemap = Boolean(_optionalChain([config, 'access',
|
|
8519
|
+
const servesAgentSitemap = Boolean(_optionalChain([config, 'access', _173 => _173.agent, 'optionalAccess', _174 => _174.sitemap, 'optionalAccess', _175 => _175.enabled])) && !applicationMetadataRoutes.some(
|
|
8495
8520
|
(metadata) => metadata.kind === "sitemap" && metadata.pattern === "/"
|
|
8496
8521
|
);
|
|
8497
|
-
const servesDefaultMCP = _optionalChain([config, 'access',
|
|
8498
|
-
const servesAiCatalog = _optionalChain([config, 'access',
|
|
8522
|
+
const servesDefaultMCP = _optionalChain([config, 'access', _176 => _176.agent, 'optionalAccess', _177 => _177.mcp]) === true && !_chunkR6GOH5CHcjs.farmConfigMountsMCP.call(void 0, config) && !apiRoutes.some((route) => route.path === "/api/mcp");
|
|
8523
|
+
const servesAiCatalog = _optionalChain([config, 'access', _178 => _178.agent, 'optionalAccess', _179 => _179.aiCatalog]) !== false;
|
|
8499
8524
|
const hasPluginRuntime = hasRuntimeIntegrationConfig || hasServerRuntimePlugins;
|
|
8500
8525
|
const hasInfraAnalyticsRuntime = config.analytics !== false && _chunkRLC7NNTAcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
|
|
8501
|
-
const reportsWebMCPCalls = hasInfraAnalyticsRuntime &&
|
|
8526
|
+
const reportsWebMCPCalls = hasInfraAnalyticsRuntime && _chunkT2VXOAC3cjs._farmWebMCPReportsEnabled.call(void 0, config.plugins);
|
|
8502
8527
|
const hasPrecompiledDocs = Boolean(farmDocsPrecompiledManifest);
|
|
8503
8528
|
const adapterOwnsDocsRuntime = _chunkVZ2P6GRCcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs);
|
|
8504
|
-
if (_optionalChain([config, 'access',
|
|
8529
|
+
if (_optionalChain([config, 'access', _180 => _180.docs, 'optionalAccess', _181 => _181.enabled]) && _optionalChain([config, 'access', _182 => _182.docs, 'access', _183 => _183.roots, 'optionalAccess', _184 => _184.length]) && !adapterOwnsDocsRuntime) {
|
|
8505
8530
|
throw new Error(
|
|
8506
8531
|
"Several docs roots need a docs adapter; Farm's built-in docs renderer serves a single docs root."
|
|
8507
8532
|
);
|
|
@@ -8574,7 +8599,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8574
8599
|
);
|
|
8575
8600
|
const edgeMiddlewareFilePaths = farmTargetRunsEdgeMiddleware(preset) ? middlewareRoutes.filter(isFarmEdgeMiddlewareRoute).map((route) => route.filePath) : [];
|
|
8576
8601
|
const hasMiddlewareRuntime = middlewareRoutes.length > 0 || _chunkIGBQSUT5cjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
|
|
8577
|
-
const farmDocsFontAssets = _optionalChain([config, 'access',
|
|
8602
|
+
const farmDocsFontAssets = _optionalChain([config, 'access', _185 => _185.docs, 'optionalAccess', _186 => _186.enabled]) ? _chunkQTGYT2DFcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkQTGYT2DFcjs.resolveFarmDocsFontAssets.call(void 0, config.root)) : [];
|
|
8578
8603
|
const integrationProviders = _chunkN4AM7Q34cjs.getIntegrationProviders.call(void 0, config.integrations);
|
|
8579
8604
|
const renderedIntegrationProviders = integrationProviders.filter(
|
|
8580
8605
|
(provider) => provider.component || provider.type === "clerk"
|
|
@@ -8584,16 +8609,16 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8584
8609
|
`Integration provider components are not supported by the "${config.renderer.name}" renderer.`
|
|
8585
8610
|
);
|
|
8586
8611
|
}
|
|
8587
|
-
const providerServerModules =
|
|
8612
|
+
const providerServerModules = _chunk76ES7BCOcjs.generateFarmIntegrationProviderServerModules.call(void 0,
|
|
8588
8613
|
renderedIntegrationProviders,
|
|
8589
8614
|
config.root,
|
|
8590
8615
|
_nullishCoalesce(config.renderer.componentExtensions, () => ( []))
|
|
8591
8616
|
);
|
|
8592
8617
|
const resolvedIntegrationProviderFallback = Object.fromEntries(
|
|
8593
8618
|
Object.entries(config.integrations).flatMap(([name, integration]) => {
|
|
8594
|
-
const configuredProviders = _optionalChain([integration, 'optionalAccess',
|
|
8619
|
+
const configuredProviders = _optionalChain([integration, 'optionalAccess', _187 => _187.providers]);
|
|
8595
8620
|
const providers = Array.isArray(configuredProviders) ? configuredProviders : [];
|
|
8596
|
-
if (providers.some((provider) => typeof _optionalChain([provider, 'optionalAccess',
|
|
8621
|
+
if (providers.some((provider) => typeof _optionalChain([provider, 'optionalAccess', _188 => _188.component]) === "function")) {
|
|
8597
8622
|
throw new Error(
|
|
8598
8623
|
`Integration provider components in production must use an importable component reference, for example component: { module: "@/components/provider" }.`
|
|
8599
8624
|
);
|
|
@@ -8604,14 +8629,14 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8604
8629
|
const unsupportedIntegrationProvider = renderedIntegrationProviders.find(
|
|
8605
8630
|
(provider) => !_chunkN4AM7Q34cjs.providerSupportsIslands.call(void 0, provider)
|
|
8606
8631
|
);
|
|
8607
|
-
const isolatedHydrationMode =
|
|
8608
|
-
_optionalChain([config, 'access',
|
|
8632
|
+
const isolatedHydrationMode = _chunkBY5VQ57Wcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
8633
|
+
_optionalChain([config, 'access', _189 => _189.experimental, 'optionalAccess', _190 => _190.isolatedClientHydration]),
|
|
8609
8634
|
{
|
|
8610
8635
|
serverComponents: _chunkCYUTK4JPcjs.resolveFarmServerComponentsMode.call(void 0, _chunkCYUTK4JPcjs.readFarmServerComponentsConfig.call(void 0, config)) === "rsc",
|
|
8611
8636
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
8612
8637
|
}
|
|
8613
8638
|
);
|
|
8614
|
-
const hydrationPlanOptions =
|
|
8639
|
+
const hydrationPlanOptions = _chunkBY5VQ57Wcjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
8615
8640
|
config.renderer,
|
|
8616
8641
|
Boolean(unsupportedIntegrationProvider)
|
|
8617
8642
|
);
|
|
@@ -8619,7 +8644,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8619
8644
|
...hydrationPlanOptions,
|
|
8620
8645
|
serverOwners: _chunkCYUTK4JPcjs.resolveFarmServerComponentsMode.call(void 0, _chunkCYUTK4JPcjs.readFarmServerComponentsConfig.call(void 0, config)) === "islands"
|
|
8621
8646
|
};
|
|
8622
|
-
const { layoutHydrationPlans, pageHydrationPlans } =
|
|
8647
|
+
const { layoutHydrationPlans, pageHydrationPlans } = _chunkBY5VQ57Wcjs.withFarmSourceSnapshot.call(void 0, () => {
|
|
8623
8648
|
const layoutHydrationPlans2 = layoutRoutes.map((layout) => ({
|
|
8624
8649
|
...layout,
|
|
8625
8650
|
hydration: getCachedClientModuleHydrationPlan(
|
|
@@ -8630,7 +8655,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8630
8655
|
{ ...hydrationPlanOptions, serverTreeLayouts: pageHydrationPlanOptions.serverOwners }
|
|
8631
8656
|
)
|
|
8632
8657
|
}));
|
|
8633
|
-
const markdownPagePlan =
|
|
8658
|
+
const markdownPagePlan = _chunkBY5VQ57Wcjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
8634
8659
|
_chunkYQ5NVEFScjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunkYQ5NVEFScjs.resolveMdxConfig.call(void 0, config.mdx), config.root),
|
|
8635
8660
|
config.root,
|
|
8636
8661
|
isolatedHydrationMode,
|
|
@@ -8650,7 +8675,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8650
8675
|
);
|
|
8651
8676
|
return { layoutHydrationPlans: layoutHydrationPlans2, pageHydrationPlans: pageHydrationPlans2 };
|
|
8652
8677
|
});
|
|
8653
|
-
|
|
8678
|
+
_chunkBY5VQ57Wcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
8654
8679
|
layoutHydrationPlans.map((layout) => ({
|
|
8655
8680
|
pattern: layout.pattern,
|
|
8656
8681
|
depth: layout.pattern.split("/").filter(Boolean).length,
|
|
@@ -8684,7 +8709,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8684
8709
|
apiRegistrations.push(`
|
|
8685
8710
|
{
|
|
8686
8711
|
path: ${JSON.stringify(route.path)},
|
|
8687
|
-
methods: ${JSON.stringify(route.methods.filter((method) => !_optionalChain([route, 'access',
|
|
8712
|
+
methods: ${JSON.stringify(route.methods.filter((method) => !_optionalChain([route, 'access', _191 => _191.pluginMethods, 'optionalAccess', _192 => _192.includes, 'call', _193 => _193(method)])))},
|
|
8688
8713
|
endpoints: ${varName},
|
|
8689
8714
|
}`);
|
|
8690
8715
|
});
|
|
@@ -8698,8 +8723,8 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8698
8723
|
orderedPageRoutes.forEach((route, index) => {
|
|
8699
8724
|
const varName = `pageRoute${index}`;
|
|
8700
8725
|
if (_chunk27IPPPCVcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) {
|
|
8701
|
-
const renderingDirective2 =
|
|
8702
|
-
const markdownServerTree = pageHydrationPlanOptions.serverOwners &&
|
|
8726
|
+
const renderingDirective2 = _chunk7Q6KUXH6cjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
|
|
8727
|
+
const markdownServerTree = pageHydrationPlanOptions.serverOwners && _chunkBY5VQ57Wcjs.usesFarmServerTree.call(void 0, pageHydrationPlans.get(route.modulePath));
|
|
8703
8728
|
pageRegistrations.push(`
|
|
8704
8729
|
{
|
|
8705
8730
|
pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
|
|
@@ -8707,14 +8732,14 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8707
8732
|
rendering: ${JSON.stringify(renderingDirective2)},` : ""}${markdownServerTree ? "\n serverTree: true," : ""}
|
|
8708
8733
|
module: createFarmMarkdownRouteModule({
|
|
8709
8734
|
source: ${JSON.stringify(_nullishCoalesce(route.source, () => ( "")))},
|
|
8710
|
-
filePath: ${JSON.stringify(
|
|
8735
|
+
filePath: ${JSON.stringify(_chunk76ES7BCOcjs.toBakedMarkdownSourcePath.call(void 0, config.root, route.modulePath))},
|
|
8711
8736
|
components: farmMdxComponents,
|
|
8712
8737
|
config: farmMdxConfig,${_chunkLEZJZX4Ccjs.isReactRenderer.call(void 0, config.renderer) ? "" : "\n renderer: React,"}
|
|
8713
8738
|
}),
|
|
8714
8739
|
markdownSource: {
|
|
8715
8740
|
source: ${JSON.stringify(_nullishCoalesce(route.source, () => ( "")))},
|
|
8716
8741
|
filePath: ${JSON.stringify(
|
|
8717
|
-
|
|
8742
|
+
_chunk76ES7BCOcjs.toBakedMarkdownSourcePath.call(void 0, config.root, _nullishCoalesce(route.markdownSourcePath, () => ( route.modulePath)))
|
|
8718
8743
|
)},
|
|
8719
8744
|
},
|
|
8720
8745
|
}`);
|
|
@@ -8724,7 +8749,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8724
8749
|
`import * as ${varName} from ${toVirtualEntryImportSpecifier(route.modulePath)};`
|
|
8725
8750
|
);
|
|
8726
8751
|
const clientMetadata = pageHydrationPlans.get(route.modulePath);
|
|
8727
|
-
const renderingDirective =
|
|
8752
|
+
const renderingDirective = _chunk7Q6KUXH6cjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
|
|
8728
8753
|
pageRegistrations.push(`
|
|
8729
8754
|
{
|
|
8730
8755
|
pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
|
|
@@ -8732,8 +8757,8 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8732
8757
|
module: ${varName},
|
|
8733
8758
|
shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},${clientMetadata.shouldHydrate ? `
|
|
8734
8759
|
clientModule: ${JSON.stringify(_chunk7ZDLE77Pcjs.toViteModuleId.call(void 0, route.modulePath, config.root))},` : ""}
|
|
8735
|
-
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${
|
|
8736
|
-
const rootStrategy =
|
|
8760
|
+
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunkBY5VQ57Wcjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${(() => {
|
|
8761
|
+
const rootStrategy = _chunk76ES7BCOcjs.resolveFarmRouteRootStrategy.call(void 0,
|
|
8737
8762
|
route,
|
|
8738
8763
|
clientMetadata,
|
|
8739
8764
|
layoutHydrationPlans.map((layout) => ({ ...layout, ...layout.hydration })),
|
|
@@ -8746,7 +8771,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8746
8771
|
rendering: ${JSON.stringify(renderingDirective)},` : ""}
|
|
8747
8772
|
${route.source !== void 0 ? `markdownSource: {
|
|
8748
8773
|
source: ${JSON.stringify(route.source)},
|
|
8749
|
-
filePath: ${JSON.stringify(
|
|
8774
|
+
filePath: ${JSON.stringify(_chunk76ES7BCOcjs.toBakedMarkdownSourcePath.call(void 0, config.root, route.markdownSourcePath))},
|
|
8750
8775
|
},` : ""}
|
|
8751
8776
|
}`);
|
|
8752
8777
|
});
|
|
@@ -8770,7 +8795,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8770
8795
|
pattern: ${JSON.stringify(layout.pattern)},
|
|
8771
8796
|
module: ${varName},
|
|
8772
8797
|
shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},
|
|
8773
|
-
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${treeLayoutPatterns.has(layout.pattern) ? "\n serverTree: true," : ""}${farmIslandsMode &&
|
|
8798
|
+
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${treeLayoutPatterns.has(layout.pattern) ? "\n serverTree: true," : ""}${farmIslandsMode && _chunk76ES7BCOcjs.canFarmSkipKeptLayoutRender.call(void 0, layout.modulePath, config.root) ? "\n skipKeptRender: true," : ""}${// A layout whose client components hydrate as islands of their own (islands mode,
|
|
8774
8799
|
// isolatedClientHydration, or an async layout): it wraps a docs page as an app page.
|
|
8775
8800
|
clientMetadata.hasIsolatedClientBoundaries ? "\n islands: true," : ""}
|
|
8776
8801
|
}`);
|
|
@@ -8798,7 +8823,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8798
8823
|
containerId: ${JSON.stringify(slot.containerId)},
|
|
8799
8824
|
interception: ${JSON.stringify(slot.interception)},
|
|
8800
8825
|
fallback: ${JSON.stringify(slot.fallback)},
|
|
8801
|
-
hydrates: ${!farmIslandsMode ||
|
|
8826
|
+
hydrates: ${!farmIslandsMode || _chunkBY5VQ57Wcjs.getClientModuleMetadata.call(void 0, slot.modulePath, config.root).isClientComponent},
|
|
8802
8827
|
module: ${varName},
|
|
8803
8828
|
}`);
|
|
8804
8829
|
});
|
|
@@ -8844,7 +8869,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8844
8869
|
metadataImageImports.push(
|
|
8845
8870
|
`import * as ${varName} from ${toVirtualEntryImportSpecifier(image.modulePath)};`
|
|
8846
8871
|
);
|
|
8847
|
-
const component = !_chunkLEZJZX4Ccjs.isReactRenderer.call(void 0, config.renderer) &&
|
|
8872
|
+
const component = !_chunkLEZJZX4Ccjs.isReactRenderer.call(void 0, config.renderer) && _chunk76ES7BCOcjs.isRendererCompiledComponent.call(void 0, image.modulePath, _nullishCoalesce(_optionalChain([config, 'access', _194 => _194.renderer, 'optionalAccess', _195 => _195.componentExtensions]), () => ( [])));
|
|
8848
8873
|
metadataImageRegistrations.push(`
|
|
8849
8874
|
{
|
|
8850
8875
|
pattern: ${JSON.stringify(image.pattern)},
|
|
@@ -8920,7 +8945,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8920
8945
|
createDefaultErrorMarkup,
|
|
8921
8946
|
createFarmInstrumentationLifecycle,
|
|
8922
8947
|
createFarmLayoutSelector,
|
|
8923
|
-
createFarmLayoutBoundary,${_optionalChain([config, 'access',
|
|
8948
|
+
createFarmLayoutBoundary,${_optionalChain([config, 'access', _196 => _196.docs, 'optionalAccess', _197 => _197.enabled]) ? "\n createFarmDocsLayoutTree,\n farmDocsLayoutsWrapPage,\n placeFarmDocsLayoutRoot," : ""}
|
|
8924
8949
|
isInFarmRouteGroupScope,
|
|
8925
8950
|
routeBoundaryCoversDirectory,
|
|
8926
8951
|
createFarmCacheKey,
|
|
@@ -9004,7 +9029,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
9004
9029
|
createFarmDeploymentMismatchResponse,
|
|
9005
9030
|
FARM_DEPLOYMENT_ID_HEADER,
|
|
9006
9031
|
getFarmDeploymentMismatch,
|
|
9007
|
-
withoutFarmDeploymentCookie,${config.mobileClient ? "\n createFarmNativeTreeResponse," : ""}${config.trailingSlash && (_optionalChain([config, 'access',
|
|
9032
|
+
withoutFarmDeploymentCookie,${config.mobileClient ? "\n createFarmNativeTreeResponse," : ""}${config.trailingSlash && (_optionalChain([config, 'access', _198 => _198.md, 'optionalAccess', _199 => _199.enabled]) || hasMarkdownPages) ? "\n toFarmTrailingSlashPageRequest," : ""}${hasInfraAnalyticsRuntime ? "\n resolveFarmDocsEngineRouteLabel,\n resolveFarmDocsRouteLabel,\n resolveFarmMarkdownRouteLabel,\n resolveFarmMCPRouteLabel,\n setFarmRouteLabel," : ""}${hasFarmServerStorageConfig(config.storage) ? "\n _registerFarmStorageModules,\n disposeFarmStorage,\n initFarmStorage," : ""}${searchPreserveRoutesSource ? "\n _setFarmSearchPreserveRoutes," : ""}
|
|
9008
9033
|
} from "@farm.js/core/internal/production-runtime";${farmMobileClient ? `
|
|
9009
9034
|
import { _applyFarmMobileShellClient } from "@farm.js/core/internal/production-runtime";
|
|
9010
9035
|
// The mobile client documents load when a mobile shell asks for them (RFC 0004, 7.2), filled in
|
|
@@ -9076,25 +9101,25 @@ function farmFormStateScript() { return ""; }`}`;
|
|
|
9076
9101
|
const infraAnalyticsImport = hasInfraAnalyticsRuntime ? `import { ${hasPluginRuntime ? "createFarmInfraAnalyticsPlugin" : "createFarmInfraAnalyticsRecorder"} } from "@farm.js/core/internal/infra-analytics-runtime";` : "";
|
|
9077
9102
|
const compressionRuntimeImport = hasCompressionRuntime ? `import { compressFarmResponse${hasPluginRuntime ? ", createCompressionPlugin" : ""} } from "@farm.js/core/internal/compression-runtime";` : "";
|
|
9078
9103
|
const i18nServerImport = config.i18n.enabled ? `import { _runWithFarmI18nRequest, _setDefaultFarmI18nRuntime, createFarmI18nRuntime, getFarmI18nClientSnapshot } from "@farm.js/core/i18n/server";` : "";
|
|
9079
|
-
const docsHandlerImport = _optionalChain([config, 'access',
|
|
9104
|
+
const docsHandlerImport = _optionalChain([config, 'access', _200 => _200.docs, 'optionalAccess', _201 => _201.enabled]) ? hasPrecompiledDocs ? `import { createFarmDocsPrecompiledRuntime } from "@farm.js/core/internal/docs-precompiled-runtime";
|
|
9080
9105
|
const isFarmDocsAPIRequest = (requestOrPathname) => {
|
|
9081
9106
|
const pathname = typeof requestOrPathname === "string"
|
|
9082
9107
|
? requestOrPathname
|
|
9083
9108
|
: new URL(requestOrPathname.url).pathname;
|
|
9084
|
-
const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess',
|
|
9109
|
+
const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _202 => _202.apiPath]) || "/api/docs")};
|
|
9085
9110
|
return pathname === apiPath || pathname.startsWith(apiPath + "/");
|
|
9086
9111
|
};` : adapterOwnsDocsRuntime ? `import { ${docsConfigModulePath ? "getFarmDocsConfigModuleRoot, " : ""}isFarmDocsAPIRequest } from "@farm.js/core/docs";
|
|
9087
|
-
import { ${_optionalChain([config, 'access',
|
|
9112
|
+
import { ${_optionalChain([config, 'access', _203 => _203.docs, 'access', _204 => _204.roots, 'optionalAccess', _205 => _205.length]) ? "createFarmDocsMultiRuntimeHandler as createFarmDocsAdapterMultiRuntimeHandler" : "createFarmDocsRuntimeHandler as createFarmDocsAdapterRuntimeHandler"} } from ${JSON.stringify(config.docs.adapter.server)};
|
|
9088
9113
|
import * as FarmDocsAdapterUI from ${JSON.stringify(_chunkVZ2P6GRCcjs.getFarmDocsAdapterUIModule.call(void 0, config.docs.adapter))};${docsConfigModulePath ? `
|
|
9089
9114
|
import * as farmDocsConfigModule from ${toVirtualEntryImportSpecifier(docsConfigModulePath)};` : ""}` : `import { createFarmDocsAPIHandler, createFarmDocsHandler, isFarmDocsAPIRequest } from "@farm.js/core/docs";` : "";
|
|
9090
|
-
const docsFontImport = _optionalChain([config, 'access',
|
|
9091
|
-
const docsRuntimeImport = _optionalChain([config, 'access',
|
|
9115
|
+
const docsFontImport = _optionalChain([config, 'access', _206 => _206.docs, 'optionalAccess', _207 => _207.enabled]) && !hasPrecompiledDocs ? `import { resolveFarmLayoutFonts } from "@farm.js/core/font";` : "";
|
|
9116
|
+
const docsRuntimeImport = _optionalChain([config, 'access', _208 => _208.docs, 'optionalAccess', _209 => _209.enabled]) && !hasPrecompiledDocs ? `import { existsSync as farmDocsExistsSync } from "node:fs";
|
|
9092
9117
|
import { dirname as farmDocsDirname, join as farmDocsJoin } from "node:path";
|
|
9093
9118
|
import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
|
|
9094
|
-
const markdownHandlerImport = _optionalChain([config, 'access',
|
|
9119
|
+
const markdownHandlerImport = _optionalChain([config, 'access', _210 => _210.md, 'optionalAccess', _211 => _211.enabled]) ? `import { applyMarkdownNegotiationHeaders, createMarkdownMirrorResponse, getFarmMarkdownAlternatePath } from "@farm.js/core/markdown";` : "";
|
|
9095
9120
|
const appMarkdownImport = hasMarkdownPages ? `import { FARM_MARKDOWN_ANONYMOUS_CLIENT_ADDRESS, createFarmMarkdownRouteModule, createFarmMarkdownSourceResponse, isFarmMarkdownPublicSourceResponse } from "@farm.js/core/internal/app-markdown-runtime";` : "const createFarmMarkdownSourceResponse = null;\nconst isFarmMarkdownPublicSourceResponse = null;";
|
|
9096
9121
|
const markdownErrorImport = `import { FARM_MARKDOWN_CONTENT_TYPE, FARM_MARKDOWN_PAGE_CHECK_HEADER, _isFarmMarkdownPageCheck, createFarmMarkdownErrorBody, farmRequestWantsMarkdown } from "@farm.js/core/markdown";`;
|
|
9097
|
-
const mdxComponentsPath = typeof _optionalChain([config, 'access',
|
|
9122
|
+
const mdxComponentsPath = typeof _optionalChain([config, 'access', _212 => _212.mdx, 'optionalAccess', _213 => _213.components]) === "string" ? _path2.default.isAbsolute(config.mdx.components) ? config.mdx.components : _path2.default.join(config.root, config.mdx.components) : null;
|
|
9098
9123
|
const mdxComponentsImport = mdxComponentsPath ? `import * as FarmMdxComponentsModule from ${toVirtualEntryImportSpecifier(mdxComponentsPath)};` : "";
|
|
9099
9124
|
const layerConfigPaths = (config.layers || []).map((layer) => layer.configFile).filter((configFile) => Boolean(configFile)).filter((configFile) => configFile !== configModulePath);
|
|
9100
9125
|
const layerConfigImports = layerConfigPaths.map(
|
|
@@ -9114,14 +9139,14 @@ import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
|
|
|
9114
9139
|
const nativeAuth = generateNativeAuthIntegrationSource(config.auth);
|
|
9115
9140
|
const nativeMCP = _chunkVNWKJOJFcjs.generateNativeMCPPluginSource.call(void 0, config.mcp);
|
|
9116
9141
|
const mobileSession = (config.plugins || []).some(
|
|
9117
|
-
(plugin) => _optionalChain([plugin, 'optionalAccess',
|
|
9142
|
+
(plugin) => _optionalChain([plugin, 'optionalAccess', _214 => _214.name]) === _chunk6AUPJYHFcjs.FARM_MOBILE_SESSION_PLUGIN
|
|
9118
9143
|
);
|
|
9119
9144
|
const nativeServerFns = (config.plugins || []).some(
|
|
9120
|
-
(plugin) => _optionalChain([plugin, 'optionalAccess',
|
|
9121
|
-
) ?
|
|
9145
|
+
(plugin) => _optionalChain([plugin, 'optionalAccess', _215 => _215.name]) === _chunk323JTLXRcjs.FARM_NATIVE_SERVER_FN_PLUGIN
|
|
9146
|
+
) ? _chunkY7FLPQSLcjs.collectFarmNativeServerFns.call(void 0, {
|
|
9122
9147
|
root: config.root,
|
|
9123
9148
|
srcDir: config.srcDir,
|
|
9124
|
-
entries:
|
|
9149
|
+
entries: _chunkY7FLPQSLcjs.findFarmNativeScreenFiles.call(void 0, _chunkPFVNPOKNcjs.getFarmAppDirectories.call(void 0, config))
|
|
9125
9150
|
}) : void 0;
|
|
9126
9151
|
const integrationImports = `
|
|
9127
9152
|
${configModulePath ? `import * as FarmUserConfigModule from ${toVirtualEntryImportSpecifier(configModulePath)};` : ""}
|
|
@@ -9136,7 +9161,7 @@ ${nativeServerFns ? `const __farmNativeServerFnRegistry = Object.assign(Object.c
|
|
|
9136
9161
|
${nativeServerFns.flatMap((module, index) => module.exports.map((entry) => ` ${JSON.stringify(entry.id)}: __farmNativeServerFns${index}[${JSON.stringify(entry.name)}],`)).join("\n")}
|
|
9137
9162
|
});` : ""}
|
|
9138
9163
|
`;
|
|
9139
|
-
const imageRuntime =
|
|
9164
|
+
const imageRuntime = _chunk76ES7BCOcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
|
|
9140
9165
|
const imageRuntimeImport = imageRuntime === "none" ? "" : `import { _withFarmImageSourceClientAddress, createCloudflareImageTransformer, createFarmImageHandler } from "@farm.js/core/image/server";`;
|
|
9141
9166
|
const imageNodeRuntimeImport = imageRuntime === "node" ? `import { createNodeImageFetcher, createNodeImageUrlValidator, createSharpImageTransformer } from "@farm.js/core/image/sharp";` : "";
|
|
9142
9167
|
const apiHandlerCode = apiRoutes.length > 0 ? `
|
|
@@ -9318,7 +9343,7 @@ const farmResolvedRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs);
|
|
|
9318
9343
|
|
|
9319
9344
|
function renderFarmDefault404Page() {
|
|
9320
9345
|
return React.createElement(React.Fragment, null,
|
|
9321
|
-
React.createElement("style", null, ${JSON.stringify(
|
|
9346
|
+
React.createElement("style", null, ${JSON.stringify(_chunk76ES7BCOcjs.DEFAULT_NOT_FOUND_STYLES)}),
|
|
9322
9347
|
React.createElement("main", {
|
|
9323
9348
|
className: "farm-default-not-found",
|
|
9324
9349
|
"aria-labelledby": "farm-default-not-found-title",
|
|
@@ -9359,7 +9384,7 @@ function createFarmNotFoundElement(pathname) {
|
|
|
9359
9384
|
function isFarmStaticNotFoundPrerender(pathname) {
|
|
9360
9385
|
return (
|
|
9361
9386
|
typeof process !== "undefined" &&
|
|
9362
|
-
process.env?.${
|
|
9387
|
+
process.env?.${_chunkT2VXOAC3cjs.FARM_PRERENDER_ENV} === "1" &&
|
|
9363
9388
|
pathname === ${JSON.stringify(_chunkTFCBJFP7cjs.applyFarmBasePath.call(void 0, FARM_STATIC_NOT_FOUND_PATH, config.basePath))}
|
|
9364
9389
|
);
|
|
9365
9390
|
}
|
|
@@ -9369,7 +9394,12 @@ function createFarmStaticNotFoundRefusal(reason) {
|
|
|
9369
9394
|
status: 404,
|
|
9370
9395
|
headers: { "Content-Type": ${JSON.stringify(FARM_STATIC_NOT_FOUND_REFUSAL_TYPE)} },
|
|
9371
9396
|
});
|
|
9372
|
-
}` : ""}
|
|
9397
|
+
}` : ""}${farmStaticPagesBuild ? `
|
|
9398
|
+
|
|
9399
|
+
// experimental.staticPages: set while the build prerenders, never for a visitor. Read once: Nitro's
|
|
9400
|
+
// prerender worker sets the variable before it loads the server.
|
|
9401
|
+
const farmStaticPagesPrerendering =
|
|
9402
|
+
typeof process !== "undefined" && process.env?.${_chunkT2VXOAC3cjs.FARM_PRERENDER_ENV} === "1";` : ""}
|
|
9373
9403
|
${nativeMCP.registerSource}
|
|
9374
9404
|
// Config middleware from layers is appended in layer order ahead of the
|
|
9375
9405
|
// project's, the same merge development applies (mergeFarmLayerConfig).
|
|
@@ -9491,24 +9521,24 @@ const farmImageHandler = ${imageRuntime === "none" ? "null" : imageRuntime === "
|
|
|
9491
9521
|
validateRemoteUrl: createNodeImageUrlValidator(${JSON.stringify(config.images)}),
|
|
9492
9522
|
onError(error) { console.error("[Farm Image]", error); },
|
|
9493
9523
|
})`};
|
|
9494
|
-
const farmMarkdownConfig = ${JSON.stringify(config.md)};${_optionalChain([config, 'access',
|
|
9524
|
+
const farmMarkdownConfig = ${JSON.stringify(config.md)};${_optionalChain([config, 'access', _216 => _216.md, 'optionalAccess', _217 => _217.enabled]) || hasMarkdownPages ? config.trailingSlash ? `
|
|
9495
9525
|
// A Markdown mirror, and a page.md source's page check, read the page at the URL it answers at
|
|
9496
9526
|
// ('/about/'), so the trailing-slash 308 never answers in its place.
|
|
9497
9527
|
const toFarmMarkdownPageRequest = (request) => toFarmTrailingSlashPageRequest(request, true);` : `
|
|
9498
9528
|
const toFarmMarkdownPageRequest = (request) => request;` : ""}
|
|
9499
|
-
const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access',
|
|
9500
|
-
${_optionalChain([config, 'access',
|
|
9529
|
+
const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _218 => _218.agent, 'optionalAccess', _219 => _219.llmsTxt]), () => ( { enabled: false, include: [], exclude: [] })))};
|
|
9530
|
+
${_optionalChain([config, 'access', _220 => _220.agent, 'optionalAccess', _221 => _221.llmsTxt, 'optionalAccess', _222 => _222.enabled]) ? "const farmLlmsFullRenderer = createFarmLlmsFullRenderer({ revalidate: farmLlmsTxtConfig.revalidate });\n" : ""}${servesAgentRobotsTxt ? `const farmAgentCrawlers = ${JSON.stringify(config.agent.crawlers)};` : ""}
|
|
9501
9531
|
const farmMdxConfig = ${JSON.stringify({
|
|
9502
9532
|
...config.mdx,
|
|
9503
|
-
components: typeof _optionalChain([config, 'access',
|
|
9533
|
+
components: typeof _optionalChain([config, 'access', _223 => _223.mdx, 'optionalAccess', _224 => _224.components]) === "string" ? config.mdx.components : void 0
|
|
9504
9534
|
})};
|
|
9505
9535
|
const configuredFarmMdxComponents = farmUserConfig?.mdx?.components;
|
|
9506
|
-
${_optionalChain([config, 'access',
|
|
9536
|
+
${_optionalChain([config, 'access', _225 => _225.agent, 'optionalAccess', _226 => _226.noindexPreviews]) ? `// agent.noindexPreviews: the runtime environment decides, falling back to the
|
|
9507
9537
|
// environment this was built in, since Netlify exposes its deploy context only
|
|
9508
9538
|
// to the build.
|
|
9509
9539
|
const farmNoindexPreview = resolveFarmPreviewDeployment(
|
|
9510
9540
|
globalThis.process?.env,
|
|
9511
|
-
${JSON.stringify(
|
|
9541
|
+
${JSON.stringify(_chunk6UBGXEIHcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env))},
|
|
9512
9542
|
);` : ""}
|
|
9513
9543
|
const farmMdxComponents = ${mdxComponentsPath ? `(FarmMdxComponentsModule.components || Reflect.get(FarmMdxComponentsModule, "default") || {})` : `(configuredFarmMdxComponents && typeof configuredFarmMdxComponents === "object" ? configuredFarmMdxComponents : {})`};
|
|
9514
9544
|
const farmObservabilityConfig = farmUserConfig?.observability ?? ${JSON.stringify(
|
|
@@ -9554,7 +9584,7 @@ export const farmProductionLifecycle = createFarmProductionLifecycle({
|
|
|
9554
9584
|
});
|
|
9555
9585
|
const farmI18nRuntime = ${config.i18n.enabled ? `createFarmI18nRuntime(farmI18nConfig, ${JSON.stringify(i18nCatalogs)})` : "null"};
|
|
9556
9586
|
${config.i18n.enabled ? "_setDefaultFarmI18nRuntime(farmI18nRuntime);" : ""}
|
|
9557
|
-
const farmDocsBundledContentDir = ${_optionalChain([config, 'access',
|
|
9587
|
+
const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _227 => _227.docs, 'optionalAccess', _228 => _228.enabled]) && !hasPrecompiledDocs ? `(() => {
|
|
9558
9588
|
try {
|
|
9559
9589
|
const currentDir = farmDocsDirname(farmDocsFileURLToPath(import.meta.url));
|
|
9560
9590
|
const candidates = [
|
|
@@ -9566,7 +9596,7 @@ const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _222 => _2
|
|
|
9566
9596
|
} catch {
|
|
9567
9597
|
return null;
|
|
9568
9598
|
}
|
|
9569
|
-
})()` : "null"};${_optionalChain([config, 'access',
|
|
9599
|
+
})()` : "null"};${_optionalChain([config, 'access', _229 => _229.docs, 'optionalAccess', _230 => _230.enabled]) && !hasPrecompiledDocs && _optionalChain([config, 'access', _231 => _231.docs, 'access', _232 => _232.roots, 'optionalAccess', _233 => _233.length]) ? `
|
|
9570
9600
|
const farmDocsBundledRootsDir = (() => {
|
|
9571
9601
|
try {
|
|
9572
9602
|
const currentDir = farmDocsDirname(farmDocsFileURLToPath(import.meta.url));
|
|
@@ -9583,7 +9613,7 @@ const farmDocsBundledRootsDir = (() => {
|
|
|
9583
9613
|
const farmDocsResolvedConfig = ${generateFarmDocsRuntimeConfigExpression(
|
|
9584
9614
|
config.docs,
|
|
9585
9615
|
hasPrecompiledDocs,
|
|
9586
|
-
_optionalChain([config, 'access',
|
|
9616
|
+
_optionalChain([config, 'access', _234 => _234.docs, 'optionalAccess', _235 => _235.enabled]) && _optionalChain([config, 'access', _236 => _236.docs, 'access', _237 => _237.roots, 'optionalAccess', _238 => _238.length]) ? getFarmDocsBundledRootPaths(config.docs, config.root, config.srcDir) : []
|
|
9587
9617
|
)};
|
|
9588
9618
|
const farmDocsRuntimeRoot = ${hasPrecompiledDocs ? '"."' : `farmDocsBundledContentDir || ${JSON.stringify(config.root)}`};
|
|
9589
9619
|
// Docs pages a path-specific guard covers, decided at build time. The docs API and the
|
|
@@ -9624,7 +9654,7 @@ const farmDocsModulePreloadPaths = farmDocsModulePreloads
|
|
|
9624
9654
|
: undefined;
|
|
9625
9655
|
${adapterOwnsDocsRuntime && !hasPrecompiledDocs ? `// The renderer contract's server exports, for a docs UI that builds its pages with them.
|
|
9626
9656
|
const farmDocsAppRenderer = ${_chunkLEZJZX4Ccjs.isReactRenderer.call(void 0, config.renderer) ? '{ name: "react", createElement: React.createElement, Fragment: React.Fragment, renderToString: ReactDOMServer.renderToString }' : "__farmRendererServer"};
|
|
9627
|
-
` : ""}const farmDocsHandler = ${_optionalChain([config, 'access',
|
|
9657
|
+
` : ""}const farmDocsHandler = ${_optionalChain([config, 'access', _239 => _239.docs, 'optionalAccess', _240 => _240.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleDocsRequest" : adapterOwnsDocsRuntime ? `${adapterHandler.factory}(${adapterHandler.config}, {${_optionalChain([config, 'access', _241 => _241.docs, 'access', _242 => _242.roots, 'optionalAccess', _243 => _243.length]) ? "" : `
|
|
9628
9658
|
rootDir: farmDocsRuntimeRoot,`}
|
|
9629
9659
|
// A production build's content cannot change, so the adapter reads its
|
|
9630
9660
|
// navigation once instead of scanning the content directory per request.
|
|
@@ -9648,7 +9678,7 @@ const farmDocsAppRenderer = ${_chunkLEZJZX4Ccjs.isReactRenderer.call(void 0, con
|
|
|
9648
9678
|
registerMCPServer: registerFarmMCPServer,
|
|
9649
9679
|
// A page built with this keeps its HTML string, so the preload budget and the response
|
|
9650
9680
|
// writer use it instead of reading and re-encoding the body. Older adapters ignore it.
|
|
9651
|
-
createHtmlResponse: farmOwnedHtmlResponse,${
|
|
9681
|
+
createHtmlResponse: farmOwnedHtmlResponse,${_chunkJEJXSTYRcjs.farmDocsAdapterServesGuardedPages.call(void 0, config.docs) ? `
|
|
9652
9682
|
// The adapter keeps pages a path guard covers off search, llms.txt, the sitemap and MCP. It
|
|
9653
9683
|
// asks about any path its own content lists, so the guards decide here, not a page list.
|
|
9654
9684
|
isPathGuarded: (pathname) =>
|
|
@@ -9674,7 +9704,7 @@ const farmDocsAppRenderer = ${_chunkLEZJZX4Ccjs.isReactRenderer.call(void 0, con
|
|
|
9674
9704
|
isPathGuarded: isFarmDocsPathGuarded,
|
|
9675
9705
|
basePath: ${JSON.stringify(config.basePath)},
|
|
9676
9706
|
})` : "null"};
|
|
9677
|
-
const farmDocsAPIHandler = ${_optionalChain([config, 'access',
|
|
9707
|
+
const farmDocsAPIHandler = ${_optionalChain([config, 'access', _244 => _244.docs, 'optionalAccess', _245 => _245.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleAPIRequest" : adapterOwnsDocsRuntime ? "null" : `createFarmDocsAPIHandler({ rootDir: farmDocsRuntimeRoot, srcDir: ${JSON.stringify(config.srcDir)}, docs: farmDocsResolvedConfig, isPathGuarded: isFarmDocsPathGuarded, basePath: ${JSON.stringify(config.basePath)} })` : "null"};
|
|
9678
9708
|
|
|
9679
9709
|
// A long-running server calls this before it listens, so a Polyroute route's first request
|
|
9680
9710
|
// doesn't wait for its WebAssembly to compile and its instance to start. Polyroute releases
|
|
@@ -9725,12 +9755,12 @@ const farmDeploymentCookiePath = ${JSON.stringify(config.basePath || "/")};
|
|
|
9725
9755
|
// runtime request.
|
|
9726
9756
|
const farmRuntimeErrorSlot = Symbol("farm.runtime.error.slot");
|
|
9727
9757
|
const farmOpenAPIReference = ${JSON.stringify(openAPIReference)};
|
|
9728
|
-
${_optionalChain([config, 'access',
|
|
9729
|
-
` : ""}${_optionalChain([config, 'access',
|
|
9730
|
-
|
|
9758
|
+
${_optionalChain([config, 'access', _246 => _246.agent, 'optionalAccess', _247 => _247.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunkPVR63WHWcjs.resolveFarmApiCatalogInput.call(void 0, config))};
|
|
9759
|
+
` : ""}${_optionalChain([config, 'access', _248 => _248.agent, 'optionalAccess', _249 => _249.manifest]) !== false ? `const farmAppManifestInput = ${JSON.stringify(
|
|
9760
|
+
_chunkPVR63WHWcjs.resolveFarmAppManifestInput.call(void 0, config, {
|
|
9731
9761
|
build: config.deploymentId,
|
|
9732
|
-
packages:
|
|
9733
|
-
webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ?
|
|
9762
|
+
packages: _chunk76ES7BCOcjs.resolveFarmAppPackages.call(void 0, config.root),
|
|
9763
|
+
webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunk76ES7BCOcjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
|
|
9734
9764
|
})
|
|
9735
9765
|
)};
|
|
9736
9766
|
${servesDefaultMCP ? "farmAppManifestInput.defaultMCP = getFarmDefaultMCPServer;\n" : ""}// A guard written for an MCP server's path keeps its tools out of the public view.
|
|
@@ -9743,7 +9773,7 @@ farmAppManifestInput.guardCoversPath = (path) =>
|
|
|
9743
9773
|
path,
|
|
9744
9774
|
farmLocalAPIBasePath,
|
|
9745
9775
|
);
|
|
9746
|
-
${_optionalChain([config, 'access',
|
|
9776
|
+
${_optionalChain([config, 'access', _250 => _250.docs, 'optionalAccess', _251 => _251.enabled]) ? `// A docs runtime's MCP server lists its tools when asked over MCP, in process. A build
|
|
9747
9777
|
// can't change them, so they are read once.
|
|
9748
9778
|
if (farmDocsHandler) {
|
|
9749
9779
|
farmAppManifestInput.registeredMCP = (request) =>
|
|
@@ -11242,7 +11272,7 @@ ${servesDefaultMCP ? `// agent.mcp: the default read-only MCP server at /mcp, as
|
|
|
11242
11272
|
// aside for a page route that answers /mcp and for any MCP server published or
|
|
11243
11273
|
// registered at runtime, such as the docs engine's.
|
|
11244
11274
|
const farmDefaultMCPServer = ${JSON.stringify(
|
|
11245
|
-
_chunkR6GOH5CHcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root),
|
|
11275
|
+
_chunkR6GOH5CHcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunkEZRB5N6Scjs.FARM_VERSION)
|
|
11246
11276
|
)};
|
|
11247
11277
|
let farmDefaultMCPRouteFree;
|
|
11248
11278
|
function getFarmDefaultMCPServer() {
|
|
@@ -11436,7 +11466,7 @@ ${edgeMiddlewareFilePaths.length > 0 ? `
|
|
|
11436
11466
|
// middleware guards is never prerendered. Read once: Nitro's prerender worker sets the variable.
|
|
11437
11467
|
const farmEdgeMiddlewareFiles = new Set(${JSON.stringify(edgeMiddlewareFilePaths)});
|
|
11438
11468
|
const farmPrerendering =
|
|
11439
|
-
typeof process !== "undefined" && process.env?.${
|
|
11469
|
+
typeof process !== "undefined" && process.env?.${_chunkT2VXOAC3cjs.FARM_PRERENDER_ENV} === "1";
|
|
11440
11470
|
` : ""}
|
|
11441
11471
|
const farmMiddlewareRunner = ${hasMiddlewareRuntime ? `createProductionMiddlewareRunner({
|
|
11442
11472
|
config: farmMiddlewareConfig,
|
|
@@ -11500,18 +11530,23 @@ function matchRouteSlots(pathname, interceptFrom) {
|
|
|
11500
11530
|
}
|
|
11501
11531
|
return matched;
|
|
11502
11532
|
}` : ""}
|
|
11533
|
+
const normalizedFrom =
|
|
11534
|
+
typeof interceptFrom === "string" && interceptFrom.startsWith("/")
|
|
11535
|
+
? new URL(interceptFrom, "http://farm.local").pathname
|
|
11536
|
+
: null;
|
|
11503
11537
|
for (const slot of routeSlots) {
|
|
11504
|
-
if (
|
|
11538
|
+
if (
|
|
11539
|
+
!${sharedSlotOwners.size > 0 ? "matchesSlotOwner(slot.ownerPattern)" : "matchesRoutePrefix(pathname, slot.ownerPattern)"} &&
|
|
11540
|
+
!(slot.interception && normalizedFrom && matchesRoutePrefix(normalizedFrom, slot.ownerPattern))
|
|
11541
|
+
) {
|
|
11542
|
+
continue;
|
|
11543
|
+
}
|
|
11505
11544
|
const key = slot.ownerPattern + ":" + slot.name;
|
|
11506
11545
|
const entries = groups.get(key) || [];
|
|
11507
11546
|
entries.push(slot);
|
|
11508
11547
|
groups.set(key, entries);
|
|
11509
11548
|
}
|
|
11510
11549
|
|
|
11511
|
-
const normalizedFrom =
|
|
11512
|
-
typeof interceptFrom === "string" && interceptFrom.startsWith("/")
|
|
11513
|
-
? new URL(interceptFrom, "http://farm.local").pathname
|
|
11514
|
-
: null;
|
|
11515
11550
|
const matches = [];
|
|
11516
11551
|
// Leave empty, fallback-only and ineligible requests unparsed.
|
|
11517
11552
|
let pathnameSegments;
|
|
@@ -11580,7 +11615,7 @@ function hasLocalRequestRoute(request, routePathname) {
|
|
|
11580
11615
|
if (${imageRuntime === "none" ? "false" : `pathname === ${JSON.stringify(config.images.path)}`}) {
|
|
11581
11616
|
return true;
|
|
11582
11617
|
}
|
|
11583
|
-
${_optionalChain([config, 'access',
|
|
11618
|
+
${_optionalChain([config, 'access', _252 => _252.docs, 'optionalAccess', _253 => _253.enabled]) ? `const docsPath = normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs");
|
|
11584
11619
|
// The docs answer below the basePath; their API stays at /api/docs, as API routes do.
|
|
11585
11620
|
const docsRoutePathname = stripFarmBasePath(pathname);
|
|
11586
11621
|
if (
|
|
@@ -11608,7 +11643,7 @@ function getFarmPluginRequestOptions(request) {
|
|
|
11608
11643
|
route: { ...route, pattern: normalizeRuntimePath(farmOpenAPIReference.route) },
|
|
11609
11644
|
};
|
|
11610
11645
|
}
|
|
11611
|
-
const isDocsAPIRequest = ${_optionalChain([config, 'access',
|
|
11646
|
+
const isDocsAPIRequest = ${_optionalChain([config, 'access', _254 => _254.docs, 'optionalAccess', _255 => _255.enabled]) ? "isFarmDocsAPIRequest(pathname)" : "false"};
|
|
11612
11647
|
const integrationMatch = ${hasServerRuntimeIntegrations ? `matchIntegrationRoute(serverRuntimeIntegrations, {
|
|
11613
11648
|
pathname,
|
|
11614
11649
|
method: request.method,
|
|
@@ -11692,7 +11727,7 @@ ${hasInfraAnalyticsRuntime ? `
|
|
|
11692
11727
|
// endpoints, Markdown mirrors, and docs pages have no app route pattern, so they are
|
|
11693
11728
|
// labeled here; route.pattern keeps meaning the matched app route for plugins.
|
|
11694
11729
|
const farmBuiltInRoutePaths = new Set(${JSON.stringify(
|
|
11695
|
-
|
|
11730
|
+
_chunkPVR63WHWcjs.listFarmBuiltInRoutePaths.call(void 0, {
|
|
11696
11731
|
agent: {
|
|
11697
11732
|
...config.agent,
|
|
11698
11733
|
aiCatalog: servesAiCatalog,
|
|
@@ -11703,9 +11738,9 @@ const farmBuiltInRoutePaths = new Set(${JSON.stringify(
|
|
|
11703
11738
|
openapi: openAPIReference
|
|
11704
11739
|
})
|
|
11705
11740
|
)});
|
|
11706
|
-
${_optionalChain([config, 'access',
|
|
11741
|
+
${_optionalChain([config, 'access', _256 => _256.docs, 'optionalAccess', _257 => _257.enabled]) ? `const farmDocsRouteLabelInput = {
|
|
11707
11742
|
path: normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs"),
|
|
11708
|
-
apiPath: ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess',
|
|
11743
|
+
apiPath: ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _258 => _258.apiPath]) || "/api/docs")},${_optionalChain([config, 'access', _259 => _259.docs, 'access', _260 => _260.roots, 'optionalAccess', _261 => _261.length]) ? "\n roots: farmDocsResolvedConfig.roots.map((farmDocsRoot) => farmDocsRoot.entry)," : ""}${farmDocsAnalyticsPages.length ? `
|
|
11709
11744
|
pages: new Set(${JSON.stringify(farmDocsAnalyticsPages)}),` : ""}
|
|
11710
11745
|
};
|
|
11711
11746
|
` : ""}// The request's route payload, for a handler that learns what answered while it handles.
|
|
@@ -11721,11 +11756,11 @@ function labelFarmRequestOptions(options) {
|
|
|
11721
11756
|
setFarmRouteLabel(options.route, mcpLabel);
|
|
11722
11757
|
return options;
|
|
11723
11758
|
}
|
|
11724
|
-
${_optionalChain([config, 'access',
|
|
11759
|
+
${_optionalChain([config, 'access', _262 => _262.docs, 'optionalAccess', _263 => _263.enabled]) ? `if (options.kind === "docs") {
|
|
11725
11760
|
setFarmRouteLabel(options.route, resolveFarmDocsRouteLabel(routePathname, farmDocsRouteLabelInput));
|
|
11726
11761
|
return options;
|
|
11727
11762
|
}` : ""}
|
|
11728
|
-
${_optionalChain([config, 'access',
|
|
11763
|
+
${_optionalChain([config, 'access', _264 => _264.md, 'optionalAccess', _265 => _265.enabled]) || hasMarkdownPages ? `const markdownLabel = resolveFarmMarkdownRouteLabel(
|
|
11729
11764
|
routePathname,
|
|
11730
11765
|
(page) => matchPageRoute(page)?.route.pattern,
|
|
11731
11766
|
);
|
|
@@ -11760,7 +11795,7 @@ function getApplicableLayouts(pathname, directory) {
|
|
|
11760
11795
|
return applicable;
|
|
11761
11796
|
}
|
|
11762
11797
|
|
|
11763
|
-
${_optionalChain([config, 'access',
|
|
11798
|
+
${_optionalChain([config, 'access', _266 => _266.docs, 'optionalAccess', _267 => _267.enabled]) ? `async function wrapFarmDocsResponseWithLayouts(request, response) {
|
|
11764
11799
|
if (request.method === "HEAD") return response;
|
|
11765
11800
|
if (response.headers.get("x-farm-docs-adapter")) return response;
|
|
11766
11801
|
|
|
@@ -11866,7 +11901,7 @@ ${_optionalChain([config, 'access', _261 => _261.docs, 'optionalAccess', _262 =>
|
|
|
11866
11901
|
|
|
11867
11902
|
// Shells keep their own LRU so query-string variants never evict app cache entries.
|
|
11868
11903
|
const pprShellCache = getFarmDataCache().pprShellCache;
|
|
11869
|
-
const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access',
|
|
11904
|
+
const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access', _268 => _268.experimental, 'optionalAccess', _269 => _269.ppr]) === true)};
|
|
11870
11905
|
|
|
11871
11906
|
function resolveRouteRenderingView(route) {
|
|
11872
11907
|
// The same merge development uses: baked directive config under the
|
|
@@ -11986,7 +12021,7 @@ async function handleFarmRequest(request, adapterContext) {
|
|
|
11986
12021
|
},
|
|
11987
12022
|
{ redirect: !isFarmLocalAPIPathname(requestUrl.pathname) }
|
|
11988
12023
|
)` : "handleFarmRequestInContext(request, null, false, Date.now(), adapterContext, requestUrl)"};
|
|
11989
|
-
${_optionalChain([config, 'access',
|
|
12024
|
+
${_optionalChain([config, 'access', _270 => _270.md, 'optionalAccess', _271 => _271.enabled]) ? `const pathname = getFarmRoutePathname(requestUrl.pathname);
|
|
11990
12025
|
if (matchPageRoute(pathname)) {
|
|
11991
12026
|
// The Link header advertises the public .md URL, like the head alternate.
|
|
11992
12027
|
return applyMarkdownNegotiationHeaders(response, {
|
|
@@ -12203,7 +12238,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12203
12238
|
return renderFarmErrorJSONResponse();` : `
|
|
12204
12239
|
if (isFarmLocalAPIPathname(pathname)) return renderFarmErrorJSONResponse();
|
|
12205
12240
|
// No page was selected, so only the root error boundary and layouts apply.
|
|
12206
|
-
const errorResponse = await renderFarmErrorResponse(middlewareResult.error, "/", {}, null);${_optionalChain([config, 'access',
|
|
12241
|
+
const errorResponse = await renderFarmErrorResponse(middlewareResult.error, "/", {}, null);${_optionalChain([config, 'access', _272 => _272.md, 'optionalAccess', _273 => _273.enabled]) ? `
|
|
12207
12242
|
// An agent asking for Markdown reads the error document as Markdown, as it
|
|
12208
12243
|
// does when a page throws. The helper answers null when Markdown is off.
|
|
12209
12244
|
const markdownErrorResponse = await createMarkdownMirrorResponse({
|
|
@@ -12245,7 +12280,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12245
12280
|
}
|
|
12246
12281
|
` : ""}
|
|
12247
12282
|
|
|
12248
|
-
${_optionalChain([config, 'access',
|
|
12283
|
+
${_optionalChain([config, 'access', _274 => _274.docs, 'optionalAccess', _275 => _275.enabled]) ? `
|
|
12249
12284
|
// Docs responses are served after app middleware so route guards and
|
|
12250
12285
|
// middleware headers apply to the docs engine like any other page content.
|
|
12251
12286
|
// An app's own llms.txt, llms-full.txt, sitemap.xml, and robots.txt take
|
|
@@ -12365,7 +12400,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12365
12400
|
}
|
|
12366
12401
|
` : ""}
|
|
12367
12402
|
|
|
12368
|
-
${_optionalChain([config, 'access',
|
|
12403
|
+
${_optionalChain([config, 'access', _276 => _276.md, 'optionalAccess', _277 => _277.enabled]) ? `
|
|
12369
12404
|
if (farmMarkdownConfig?.enabled) {
|
|
12370
12405
|
const markdownResponse = await createMarkdownMirrorResponse({
|
|
12371
12406
|
// The mirror helper only reads metadata and creates its own GET request.
|
|
@@ -12469,11 +12504,11 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12469
12504
|
return applyProductionMiddlewareHeaders(applicationMetadataResponse, middlewareHeaders);
|
|
12470
12505
|
}
|
|
12471
12506
|
` : ""}
|
|
12472
|
-
${_optionalChain([config, 'access',
|
|
12507
|
+
${_optionalChain([config, 'access', _278 => _278.agent, 'optionalAccess', _279 => _279.manifest]) !== false ? `
|
|
12473
12508
|
// agent.manifest: /.well-known/farmjs.json (and 0.1.34's /.well-known/farmjs), the app's
|
|
12474
12509
|
// public manifest, the same document for every request.
|
|
12475
12510
|
if (
|
|
12476
|
-
[${JSON.stringify(
|
|
12511
|
+
[${JSON.stringify(_chunkPVR63WHWcjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunkPVR63WHWcjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
|
|
12477
12512
|
normalizeRuntimePath(routePathname),
|
|
12478
12513
|
)
|
|
12479
12514
|
) {
|
|
@@ -12483,9 +12518,9 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12483
12518
|
);
|
|
12484
12519
|
}
|
|
12485
12520
|
` : ""}
|
|
12486
|
-
${_optionalChain([config, 'access',
|
|
12521
|
+
${_optionalChain([config, 'access', _280 => _280.agent, 'optionalAccess', _281 => _281.apiCatalog]) ? `
|
|
12487
12522
|
// agent.apiCatalog: list the OpenAPI and MCP surfaces at the RFC 9727 path.
|
|
12488
|
-
if (normalizeRuntimePath(routePathname) === ${JSON.stringify(
|
|
12523
|
+
if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkPVR63WHWcjs.FARM_API_CATALOG_PATH)}) {
|
|
12489
12524
|
return applyProductionMiddlewareHeaders(
|
|
12490
12525
|
createFarmApiCatalogResponse(request.method, farmApiCatalogInput, request),
|
|
12491
12526
|
middlewareHeaders,
|
|
@@ -12510,11 +12545,11 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12510
12545
|
);
|
|
12511
12546
|
}
|
|
12512
12547
|
` : ""}
|
|
12513
|
-
${_optionalChain([config, 'access',
|
|
12548
|
+
${_optionalChain([config, 'access', _282 => _282.agent, 'optionalAccess', _283 => _283.llmsTxt, 'optionalAccess', _284 => _284.enabled]) ? `
|
|
12514
12549
|
// agent.llmsTxt with no llms.ts or llms-full.ts: serve the generated files.
|
|
12515
12550
|
const farmGeneratedLlmsKind = normalizeRuntimePath(routePathname) === "/llms.txt"
|
|
12516
12551
|
? "llms"
|
|
12517
|
-
: ${_optionalChain([config, 'access',
|
|
12552
|
+
: ${_optionalChain([config, 'access', _285 => _285.agent, 'optionalAccess', _286 => _286.llmsTxt, 'optionalAccess', _287 => _287.full]) ? `normalizeRuntimePath(routePathname) === "/llms-full.txt" ? "llms-full" : ` : ""}null;
|
|
12518
12553
|
if (farmGeneratedLlmsKind) {
|
|
12519
12554
|
const llmsContext = createFarmLlmsTxtContext(request, farmGeneratedLlmsKind === "llms-full");
|
|
12520
12555
|
// Renders are shared per origin the request reached, which is where pages are read.
|
|
@@ -12550,7 +12585,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12550
12585
|
}
|
|
12551
12586
|
` : ""}
|
|
12552
12587
|
|
|
12553
|
-
${_optionalChain([config, 'access',
|
|
12588
|
+
${_optionalChain([config, 'access', _288 => _288.docs, 'optionalAccess', _289 => _289.enabled]) ? `if (farmDocsAPIHandler && isFarmDocsAPIRequest(pathname)) {
|
|
12554
12589
|
const docsAPIResponse = await farmDocsAPIHandler(cloneFarmRequestWithContext(request));
|
|
12555
12590
|
if (docsAPIResponse) {
|
|
12556
12591
|
return applyProductionMiddlewareHeaders(
|
|
@@ -13190,7 +13225,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
13190
13225
|
);
|
|
13191
13226
|
}
|
|
13192
13227
|
}
|
|
13193
|
-
${_optionalChain([config, 'access',
|
|
13228
|
+
${_optionalChain([config, 'access', _290 => _290.md, 'optionalAccess', _291 => _291.enabled]) ? `
|
|
13194
13229
|
// Advertise the Markdown mirror in the head as well as the Link header,
|
|
13195
13230
|
// using the public path the .md request will be resolved against.
|
|
13196
13231
|
mergedMetadata = addMetadataMarkdownAlternate(
|
|
@@ -13219,7 +13254,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
13219
13254
|
emitFarmEvent({ type: "cache.bypass", route: pathname, reason: "cookie" });
|
|
13220
13255
|
}
|
|
13221
13256
|
|
|
13222
|
-
const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access',
|
|
13257
|
+
const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _292 => _292.agent, 'optionalAccess', _293 => _293.jsonLd]), () => ( false)))} });
|
|
13223
13258
|
const title = renderedMetadata.title;
|
|
13224
13259
|
const metaTags = renderedMetadata.tags;
|
|
13225
13260
|
const hasFavicon = renderedMetadata.hasFavicon;
|
|
@@ -13237,7 +13272,28 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
13237
13272
|
hasConfiguredRouteContext ||
|
|
13238
13273
|
middlewareData?.size ||
|
|
13239
13274
|
middlewareContext?.size
|
|
13240
|
-
)
|
|
13275
|
+
);${farmStaticPagesBuild ? `
|
|
13276
|
+
// experimental.staticPages: the build prerenders a page that sets no rendering mode (any
|
|
13277
|
+
// prerendered page without static config is one) and writes it only if this render read
|
|
13278
|
+
// nothing of the request. Otherwise it answers why, in a type only the build reads.
|
|
13279
|
+
if (farmStaticPagesPrerendering && !resolveRouteRenderingView(route).ssg) {
|
|
13280
|
+
const farmStaticPageRefusal = pageStatus >= 400
|
|
13281
|
+
? "it answered " + pageStatus
|
|
13282
|
+
: renderReadRequest
|
|
13283
|
+
? "the render read the request's headers or cookies"
|
|
13284
|
+
: renderReadCookies()
|
|
13285
|
+
? "the render read cookies through a helper, such as an auth or api client"
|
|
13286
|
+
: middlewareData?.size || middlewareContext?.size
|
|
13287
|
+
? "middleware passed it data"
|
|
13288
|
+
: hasConfiguredRouteContext
|
|
13289
|
+
? "the app defines a route context"
|
|
13290
|
+
: "";
|
|
13291
|
+
if (farmStaticPageRefusal) {
|
|
13292
|
+
return new Response(farmStaticPageRefusal, {
|
|
13293
|
+
headers: { "Content-Type": ${JSON.stringify(FARM_STATIC_PAGE_REFUSAL_TYPE)} },
|
|
13294
|
+
});
|
|
13295
|
+
}
|
|
13296
|
+
}` : ""}
|
|
13241
13297
|
if (farmRouteRuleCached && (renderedPage.stream || hasRequestScopedRender)) {
|
|
13242
13298
|
// The route rule's cache refuses a private page: say why it renders on every request.
|
|
13243
13299
|
emitFarmEvent({
|
|
@@ -14077,11 +14133,11 @@ function createFarmRuntimeHookErrorResponse(request, error) {
|
|
|
14077
14133
|
export async function fetch(request, context) {${imageRuntime === "none" ? "" : `
|
|
14078
14134
|
// The image optimizer's fetch of a local source is not a loopback visitor.
|
|
14079
14135
|
context = _withFarmImageSourceClientAddress(request, context);`}
|
|
14080
|
-
${_optionalChain([config, 'access',
|
|
14136
|
+
${_optionalChain([config, 'access', _294 => _294.agent, 'optionalAccess', _295 => _295.noindexPreviews]) ? "const response = await" : "return"} _runWithAPIRequestRuntime({
|
|
14081
14137
|
basePath: farmLocalAPIBasePath,
|
|
14082
14138
|
dispatch: async (localRequest) =>
|
|
14083
14139
|
(await handleAPIRequest(localRequest)) ?? Response.json({ error: "Not Found" }, { status: 404 }),
|
|
14084
|
-
}, () => handleFarmFetch(request, context));${_optionalChain([config, 'access',
|
|
14140
|
+
}, () => handleFarmFetch(request, context));${_optionalChain([config, 'access', _296 => _296.agent, 'optionalAccess', _297 => _297.noindexPreviews]) ? `
|
|
14085
14141
|
// Keep every response of a preview deployment out of search indexes.
|
|
14086
14142
|
return farmNoindexPreview ? applyFarmPreviewRobotsTag(response) : response;` : ""}
|
|
14087
14143
|
}
|
|
@@ -14291,7 +14347,7 @@ function getManifestPageEntry(manifest, pathname) {
|
|
|
14291
14347
|
})).sort((left, right) => _chunkT4YCWRCJcjs.compareRouteSpecificity.call(void 0, left.specificity, right.specificity)).map(({ entry, matches }) => ({ entry, matches }));
|
|
14292
14348
|
manifestPageMatchers.set(manifest.routes, pages);
|
|
14293
14349
|
}
|
|
14294
|
-
return _optionalChain([pages, 'access',
|
|
14350
|
+
return _optionalChain([pages, 'access', _298 => _298.find, 'call', _299 => _299((page) => page.matches(pathname)), 'optionalAccess', _300 => _300.entry]);
|
|
14295
14351
|
}
|
|
14296
14352
|
function withFarmEdgeGuardedPrerenderHeaders(headers, edgeGuarded) {
|
|
14297
14353
|
if (!edgeGuarded) return headers;
|
|
@@ -14311,6 +14367,34 @@ function prerenderWouldChangePageUrl(pathname) {
|
|
|
14311
14367
|
return true;
|
|
14312
14368
|
}
|
|
14313
14369
|
}
|
|
14370
|
+
var comparePathnames = (a, b) => a < b ? -1 : a > b ? 1 : 0;
|
|
14371
|
+
function reportFarmStaticPages(mode, candidates, verdicts, bypasses) {
|
|
14372
|
+
const written = candidates.filter((pathname) => verdicts.get(pathname) === null);
|
|
14373
|
+
if (mode === "enabled") {
|
|
14374
|
+
if (written.length > 0) {
|
|
14375
|
+
_chunk7ZDLE77Pcjs.logger.info(
|
|
14376
|
+
`\u{1F4C4} Prerendered ${written.length} page(s) that read no request state (experimental.staticPages)`
|
|
14377
|
+
);
|
|
14378
|
+
}
|
|
14379
|
+
return;
|
|
14380
|
+
}
|
|
14381
|
+
const kept = [
|
|
14382
|
+
...bypasses,
|
|
14383
|
+
...candidates.flatMap((pathname) => {
|
|
14384
|
+
const reason = verdicts.get(pathname);
|
|
14385
|
+
return reason ? [{ pathname, reason }] : [];
|
|
14386
|
+
})
|
|
14387
|
+
].sort((a, b) => comparePathnames(a.pathname, b.pathname));
|
|
14388
|
+
written.sort(comparePathnames);
|
|
14389
|
+
const lines = [
|
|
14390
|
+
`experimental.staticPages ("analyze") wrote no files. With "enabled":`,
|
|
14391
|
+
` ${written.length} page(s) would be written as files${written.length ? ":" : ""}`,
|
|
14392
|
+
...written.map((pathname) => ` ${pathname}`),
|
|
14393
|
+
` ${kept.length} page(s) would stay server-handled${kept.length ? ":" : ""}`,
|
|
14394
|
+
...kept.map(({ pathname, reason }) => ` ${pathname} (${reason})`)
|
|
14395
|
+
];
|
|
14396
|
+
_chunk7ZDLE77Pcjs.logger.info(lines.join("\n"));
|
|
14397
|
+
}
|
|
14314
14398
|
function getPhysicalPrerenderBypassReason(options) {
|
|
14315
14399
|
const {
|
|
14316
14400
|
config,
|
|
@@ -14318,7 +14402,8 @@ function getPhysicalPrerenderBypassReason(options) {
|
|
|
14318
14402
|
routeRuntimeManifest,
|
|
14319
14403
|
redirectSources,
|
|
14320
14404
|
rewriteSources,
|
|
14321
|
-
pathname
|
|
14405
|
+
pathname,
|
|
14406
|
+
renderingDecidedByBuild
|
|
14322
14407
|
} = options;
|
|
14323
14408
|
if (prerenderWouldChangePageUrl(pathname)) return "an escaped character in its URL";
|
|
14324
14409
|
if (config.i18n.enabled) return "request-sensitive i18n";
|
|
@@ -14330,11 +14415,13 @@ function getPhysicalPrerenderBypassReason(options) {
|
|
|
14330
14415
|
}
|
|
14331
14416
|
if (_chunkIGBQSUT5cjs.appMiddlewareMayHandlePath.call(void 0, middlewareRoutes, pathname)) return "app middleware";
|
|
14332
14417
|
if (_chunkIGBQSUT5cjs.configMiddlewareMayHandlePath.call(void 0, config.middleware, pathname)) return "configured middleware";
|
|
14333
|
-
if (
|
|
14418
|
+
if (_chunkGDKJGL7Dcjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
|
|
14334
14419
|
if (farmServerRuntimePluginsMayHandlePath(config, pathname)) return "server runtime plugin";
|
|
14335
14420
|
const manifestEntry = getManifestPageEntry(routeRuntimeManifest, pathname);
|
|
14336
|
-
if (_optionalChain([manifestEntry, 'optionalAccess',
|
|
14337
|
-
|
|
14421
|
+
if (_optionalChain([manifestEntry, 'optionalAccess', _301 => _301.rendering]) === "dynamic" && !renderingDecidedByBuild) {
|
|
14422
|
+
return "dynamic runtime manifest";
|
|
14423
|
+
}
|
|
14424
|
+
if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access', _302 => _302.regions, 'optionalAccess', _303 => _303.length])) || manifestEntry.maxDuration !== void 0)) {
|
|
14338
14425
|
return "route runtime controls";
|
|
14339
14426
|
}
|
|
14340
14427
|
const routeRule = getEffectiveRouteRule(config, pathname);
|
|
@@ -14353,7 +14440,7 @@ function normalizeStaticNotFoundPath(pathname) {
|
|
|
14353
14440
|
var FARM_STATIC_NOT_FOUND_PROBE = "/__farm-static-not-found-probe__/0";
|
|
14354
14441
|
async function resolveFarmStaticNotFoundPlan(options) {
|
|
14355
14442
|
const { config, routeManager } = options;
|
|
14356
|
-
if (_optionalChain([config, 'access',
|
|
14443
|
+
if (_optionalChain([config, 'access', _304 => _304.experimental, 'optionalAccess', _305 => _305.staticNotFound]) !== true) return null;
|
|
14357
14444
|
if (options.preset !== "vercel") {
|
|
14358
14445
|
return { reason: `it applies to the vercel target, not "${options.preset}"` };
|
|
14359
14446
|
}
|
|
@@ -14424,7 +14511,7 @@ async function resolveFarmStaticNotFoundPlan(options) {
|
|
|
14424
14511
|
if (_chunkUOFTT6S4cjs.farmPluginMayAffectRuntimePath.call(void 0, plugin, FARM_STATIC_NOT_FOUND_PROBE)) {
|
|
14425
14512
|
return { reason: `the server plugin "${plugin.name}" may answer any path` };
|
|
14426
14513
|
}
|
|
14427
|
-
for (const endpoint of _nullishCoalesce(_optionalChain([plugin, 'access',
|
|
14514
|
+
for (const endpoint of _nullishCoalesce(_optionalChain([plugin, 'access', _306 => _306.runtime, 'optionalAccess', _307 => _307.endpoints]), () => ( []))) {
|
|
14428
14515
|
paths.add(
|
|
14429
14516
|
_chunkUOFTT6S4cjs.normalizeFarmPluginRuntimeEndpointPath.call(void 0,
|
|
14430
14517
|
endpoint.path,
|
|
@@ -14473,14 +14560,14 @@ async function resolveFarmStaticNotFoundPlan(options) {
|
|
|
14473
14560
|
const refusal = addMatcherSource(source, "the rewrite source");
|
|
14474
14561
|
if (refusal) return { reason: refusal };
|
|
14475
14562
|
}
|
|
14476
|
-
if (_optionalChain([config, 'access',
|
|
14563
|
+
if (_optionalChain([config, 'access', _308 => _308.docs, 'optionalAccess', _309 => _309.enabled])) {
|
|
14477
14564
|
for (const docsRoot of _chunk4A6WSOZHcjs.getFarmDocsRoots.call(void 0, config.docs)) {
|
|
14478
14565
|
const entry = normalizeStaticNotFoundPath(docsRoot.entry);
|
|
14479
14566
|
if (entry === "/") return { reason: "the docs entry is `/`, so docs answer every path" };
|
|
14480
14567
|
prefixPatterns.add(entry);
|
|
14481
14568
|
}
|
|
14482
14569
|
if (_chunkVZ2P6GRCcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
|
|
14483
|
-
const adapterRoutes = await
|
|
14570
|
+
const adapterRoutes = await _chunkJEJXSTYRcjs.listFarmDocsAdapterRoutes.call(void 0, config.docs, {
|
|
14484
14571
|
root: options.root,
|
|
14485
14572
|
srcDir: config.srcDir
|
|
14486
14573
|
});
|
|
@@ -14509,7 +14596,7 @@ async function resolveFarmStaticNotFoundPlan(options) {
|
|
|
14509
14596
|
if (config.openapi.specRoute) paths.add(config.openapi.specRoute);
|
|
14510
14597
|
}
|
|
14511
14598
|
if (config.workflows.route) prefixPatterns.add(config.workflows.route);
|
|
14512
|
-
const notFoundPath =
|
|
14599
|
+
const notFoundPath = _chunk76ES7BCOcjs.resolveFarmNotFoundComponentPath.call(void 0,
|
|
14513
14600
|
config,
|
|
14514
14601
|
_chunkPFVNPOKNcjs.getFarmAppDirectories.call(void 0, config),
|
|
14515
14602
|
routeManager.getRendererNotFoundPath()
|
|
@@ -14530,7 +14617,7 @@ async function resolveFarmStaticNotFoundPlan(options) {
|
|
|
14530
14617
|
};
|
|
14531
14618
|
}
|
|
14532
14619
|
async function getFarmDocsPrerenderPages(config, root, preset) {
|
|
14533
|
-
if (!_optionalChain([config, 'access',
|
|
14620
|
+
if (!_optionalChain([config, 'access', _310 => _310.docs, 'optionalAccess', _311 => _311.enabled]) || !config.docs.prerender) return [];
|
|
14534
14621
|
if (_chunkVIDUNAQEcjs.getFarmPresetRuntime.call(void 0, preset) === "edge") {
|
|
14535
14622
|
_chunk7ZDLE77Pcjs.logger.info(
|
|
14536
14623
|
`\u21AA Keeping docs pages in the edge docs snapshot: docs.prerender writes static files on Node and serverless targets, not "${preset}".`
|
|
@@ -14549,7 +14636,7 @@ async function getFarmDocsPrerenderPages(config, root, preset) {
|
|
|
14549
14636
|
}
|
|
14550
14637
|
return pages2;
|
|
14551
14638
|
}
|
|
14552
|
-
const pages = await
|
|
14639
|
+
const pages = await _chunkJEJXSTYRcjs.listFarmDocsAdapterPages.call(void 0, config.docs, { root, srcDir: config.srcDir });
|
|
14553
14640
|
if (!pages) {
|
|
14554
14641
|
_chunk7ZDLE77Pcjs.logger.warn(
|
|
14555
14642
|
`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.`
|
|
@@ -14559,11 +14646,11 @@ async function getFarmDocsPrerenderPages(config, root, preset) {
|
|
|
14559
14646
|
return pages;
|
|
14560
14647
|
}
|
|
14561
14648
|
async function listFarmDocsAnalyticsPages(config, root, preset) {
|
|
14562
|
-
if (!_optionalChain([config, 'access',
|
|
14649
|
+
if (!_optionalChain([config, 'access', _312 => _312.docs, 'optionalAccess', _313 => _313.enabled]) || config.analytics === false || _chunkRLC7NNTAcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) !== "nodejs") {
|
|
14563
14650
|
return [];
|
|
14564
14651
|
}
|
|
14565
14652
|
try {
|
|
14566
|
-
return await
|
|
14653
|
+
return await _chunkJEJXSTYRcjs.listFarmDocsPagePaths.call(void 0, config.docs, {
|
|
14567
14654
|
root,
|
|
14568
14655
|
srcDir: config.srcDir,
|
|
14569
14656
|
adapter: _chunkVZ2P6GRCcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)
|
|
@@ -14577,16 +14664,16 @@ async function listFarmDocsAnalyticsPages(config, root, preset) {
|
|
|
14577
14664
|
}
|
|
14578
14665
|
function hasFarmNitroCacheRouteRule(routeRules) {
|
|
14579
14666
|
return Object.values(routeRules || {}).some((rule) => {
|
|
14580
|
-
const swr = _optionalChain([rule, 'optionalAccess',
|
|
14581
|
-
const cache = _optionalChain([rule, 'optionalAccess',
|
|
14582
|
-
const headers = _optionalChain([rule, 'optionalAccess',
|
|
14667
|
+
const swr = _optionalChain([rule, 'optionalAccess', _314 => _314.swr]);
|
|
14668
|
+
const cache = _optionalChain([rule, 'optionalAccess', _315 => _315.cache]);
|
|
14669
|
+
const headers = _optionalChain([rule, 'optionalAccess', _316 => _316.headers]);
|
|
14583
14670
|
return swr !== void 0 && swr !== false || cache !== void 0 && cache !== false || !!headers && typeof headers === "object" && Object.keys(headers).length > 0;
|
|
14584
14671
|
});
|
|
14585
14672
|
}
|
|
14586
14673
|
function getFarmRouteRuleHeaderNames(routeRules) {
|
|
14587
14674
|
const names = /* @__PURE__ */ new Set();
|
|
14588
14675
|
for (const rule of Object.values(routeRules || {})) {
|
|
14589
|
-
const headers = _optionalChain([rule, 'optionalAccess',
|
|
14676
|
+
const headers = _optionalChain([rule, 'optionalAccess', _317 => _317.headers]);
|
|
14590
14677
|
if (!headers || typeof headers !== "object") continue;
|
|
14591
14678
|
for (const name of Object.keys(headers)) names.add(name.toLowerCase());
|
|
14592
14679
|
}
|
|
@@ -14601,10 +14688,10 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
14601
14688
|
const nitroBuilder = nitroBuilderResult.value;
|
|
14602
14689
|
const isVercel = preset === "vercel";
|
|
14603
14690
|
const isCloudflareWorker = preset === "cloudflare-module";
|
|
14604
|
-
const outputDir =
|
|
14691
|
+
const outputDir = _chunkGDKJGL7Dcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
14605
14692
|
const runtimeServerOutputDir = isVercel ? _path2.default.join(outputDir, "functions", "__nitro.func") : _path2.default.join(outputDir, "server");
|
|
14606
14693
|
const ssrOutputDir = _path2.default.join(root, distDir, "ssr");
|
|
14607
|
-
const imageRuntime =
|
|
14694
|
+
const imageRuntime = _chunk76ES7BCOcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
|
|
14608
14695
|
const hasGeneratedMetadataImages = Array.from(routeManager.getMetadataImages().values()).some(
|
|
14609
14696
|
(image) => image.sourceType === "module"
|
|
14610
14697
|
);
|
|
@@ -14625,14 +14712,17 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
14625
14712
|
_chunk7ZDLE77Pcjs.logger.info(`\u{1F4E6} Nitro output directory: ${outputDir}`);
|
|
14626
14713
|
_chunk7ZDLE77Pcjs.logger.info(`\u{1F4E6} SSR entry file: ${ssrEntryFile}`);
|
|
14627
14714
|
_chunk7ZDLE77Pcjs.logger.info(`\u{1F4E6} Preset: ${preset}`);
|
|
14628
|
-
const
|
|
14715
|
+
const staticPagesMode = _chunkLEZJZX4Ccjs.isFarmRendererDisabled.call(void 0, config.renderer) ? "off" : resolveFarmStaticPagesMode(_optionalChain([config, 'access', _318 => _318.experimental, 'optionalAccess', _319 => _319.staticPages]));
|
|
14716
|
+
const ssgCollectionPromise = routeManager.collectSSGPages(
|
|
14717
|
+
staticPagesMode === "off" ? {} : { staticCandidates: true }
|
|
14718
|
+
);
|
|
14629
14719
|
const middlewareRoutesPromise = discoverMiddlewareRoutes(_chunkPFVNPOKNcjs.getFarmAppDirectories.call(void 0, config));
|
|
14630
14720
|
const configuredResponseRoutesPromise = Promise.all([config.redirects(), config.rewrites()]);
|
|
14631
14721
|
const docsPrerenderPagesPromise = getFarmDocsPrerenderPages(config, root, preset);
|
|
14632
14722
|
const farmWorkflows = await _chunkXE3E4MERcjs.prepareFarmWorkflowsForNitro.call(void 0, config);
|
|
14633
14723
|
const farmCron = await _chunkXH4GQ7MTcjs.prepareFarmCronForNitro.call(void 0, config);
|
|
14634
14724
|
const [
|
|
14635
|
-
{ ssg: ssgPages },
|
|
14725
|
+
{ ssg: ssgPages, staticCandidates: staticPageCandidates = [] },
|
|
14636
14726
|
middlewareRoutes,
|
|
14637
14727
|
[configuredRedirects, configuredRewrites],
|
|
14638
14728
|
docsPrerenderPages
|
|
@@ -14649,7 +14739,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
14649
14739
|
const rewriteSources = configuredRewrites.map((route) => route.source);
|
|
14650
14740
|
const prerenderRoutes = [];
|
|
14651
14741
|
const skippedPrerenderRoutes = [];
|
|
14652
|
-
const middlewareRoutesWithConfig = ssgPages.length > 0 || docsPrerenderPages.length > 0 ? await Promise.all(
|
|
14742
|
+
const middlewareRoutesWithConfig = ssgPages.length > 0 || docsPrerenderPages.length > 0 || staticPageCandidates.length > 0 ? await Promise.all(
|
|
14653
14743
|
middlewareRoutes.map(async (route) => ({
|
|
14654
14744
|
...route,
|
|
14655
14745
|
config: await readMiddlewareFileConfig(route.filePath)
|
|
@@ -14704,6 +14794,31 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
14704
14794
|
for (const skipped of skippedPrerenderRoutes) {
|
|
14705
14795
|
_chunk7ZDLE77Pcjs.logger.info(`\u21AA Keeping SSG route ${skipped.pathname} server-handled (${skipped.reason})`);
|
|
14706
14796
|
}
|
|
14797
|
+
const staticPageCandidatePaths = [];
|
|
14798
|
+
const staticPageBypasses = [];
|
|
14799
|
+
for (const page of staticPageCandidates) {
|
|
14800
|
+
if (prerenderRoutes.includes(page.urlPath)) continue;
|
|
14801
|
+
const reason = getPhysicalPrerenderBypassReason({
|
|
14802
|
+
config,
|
|
14803
|
+
middlewareRoutes: middlewareRoutesWithConfig,
|
|
14804
|
+
routeRuntimeManifest,
|
|
14805
|
+
redirectSources,
|
|
14806
|
+
rewriteSources,
|
|
14807
|
+
pathname: page.urlPath,
|
|
14808
|
+
renderingDecidedByBuild: true
|
|
14809
|
+
});
|
|
14810
|
+
if (reason) {
|
|
14811
|
+
staticPageBypasses.push({ pathname: page.urlPath, reason });
|
|
14812
|
+
continue;
|
|
14813
|
+
}
|
|
14814
|
+
addPrerenderRoute(page.urlPath);
|
|
14815
|
+
staticPageCandidatePaths.push(page.urlPath);
|
|
14816
|
+
}
|
|
14817
|
+
if (staticPagesMode === "enabled") {
|
|
14818
|
+
for (const bypass of staticPageBypasses) {
|
|
14819
|
+
_chunk7ZDLE77Pcjs.logger.info(`\u21AA Keeping ${bypass.pathname} server-handled (${bypass.reason})`);
|
|
14820
|
+
}
|
|
14821
|
+
}
|
|
14707
14822
|
const staticNotFoundPlan = await resolveFarmStaticNotFoundPlan({
|
|
14708
14823
|
config,
|
|
14709
14824
|
root,
|
|
@@ -14771,7 +14886,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
14771
14886
|
webEntry: clientJsSrc,
|
|
14772
14887
|
webBoot: clientBootSrc,
|
|
14773
14888
|
stylesheet: clientCssHref,
|
|
14774
|
-
webFiles: _nullishCoalesce(_optionalChain([clientModulePreloads, 'optionalAccess',
|
|
14889
|
+
webFiles: _nullishCoalesce(_optionalChain([clientModulePreloads, 'optionalAccess', _320 => _320.files]), () => ( []))
|
|
14775
14890
|
})
|
|
14776
14891
|
) : null;
|
|
14777
14892
|
for (const output of Object.values(ssrBundle)) {
|
|
@@ -15310,22 +15425,22 @@ function toFarmNodeResponse(request, response) {
|
|
|
15310
15425
|
snapshotSSRRebundleOptions(nitroConfig)
|
|
15311
15426
|
);
|
|
15312
15427
|
const requestedBuilder = _nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER));
|
|
15313
|
-
const nitroBuildIsFarms = (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access',
|
|
15314
|
-
_optionalChain([nitroConfig, 'access',
|
|
15315
|
-
(handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess',
|
|
15428
|
+
const nitroBuildIsFarms = (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access', _321 => _321.rollupConfig, 'optionalAccess', _322 => _322.external]) === nitroRollupExternal && !hasRollupPlugins(_optionalChain([nitroConfig, 'access', _323 => _323.rollupConfig, 'optionalAccess', _324 => _324.plugins])) && customRollupKeys.length === 0 && Boolean(
|
|
15429
|
+
_optionalChain([nitroConfig, 'access', _325 => _325.handlers, 'optionalAccess', _326 => _326.some, 'call', _327 => _327(
|
|
15430
|
+
(handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess', _328 => _328.handler]) || "") === nitroEntryPath
|
|
15316
15431
|
)])
|
|
15317
15432
|
);
|
|
15318
|
-
const canReusePrebuiltSSR = isPrebuiltSSRCandidate && PREBUILT_SSR_PRESETS.has(_nullishCoalesce(nitroConfig.preset, () => ( ""))) && nitroBuildIsFarms && _path2.default.resolve(_optionalChain([nitroConfig, 'access',
|
|
15433
|
+
const canReusePrebuiltSSR = isPrebuiltSSRCandidate && PREBUILT_SSR_PRESETS.has(_nullishCoalesce(nitroConfig.preset, () => ( ""))) && nitroBuildIsFarms && _path2.default.resolve(_optionalChain([nitroConfig, 'access', _329 => _329.output, 'optionalAccess', _330 => _330.serverDir]) || "") === _path2.default.resolve(expectedServerDir);
|
|
15319
15434
|
const prerenderReusesPrebuiltSSR = (prerenderRoutes.length > 0 || staticNotFoundPrerenderPath !== null) && ssrExternalsArePackaged && nitroBuildIsFarms;
|
|
15320
15435
|
const selectRolldownBuilder = canReusePrebuiltSSR && requestedBuilder === void 0 && await canUseRolldownBuilder();
|
|
15321
15436
|
if (selectRolldownBuilder) nitroConfig.builder = "rolldown";
|
|
15322
15437
|
const useRolldownBuilder = canReusePrebuiltSSR && (_nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER))) === "rolldown";
|
|
15323
15438
|
const shouldMinify = nitroConfig.minify !== false;
|
|
15324
|
-
const keepServerNames = !(_optionalChain([config, 'access',
|
|
15439
|
+
const keepServerNames = !(_optionalChain([config, 'access', _331 => _331.docs, 'optionalAccess', _332 => _332.enabled]) && _optionalChain([config, 'access', _333 => _333.docs, 'access', _334 => _334.adapter, 'optionalAccess', _335 => _335.server]));
|
|
15325
15440
|
const useFarmServerMinifier = shouldMinify && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig;
|
|
15326
15441
|
const serverChunkMinifier = useFarmServerMinifier ? createServerChunkMinifyPlugin({ keepNames: keepServerNames, target: "esnext" }) : null;
|
|
15327
15442
|
const ssrRollupPlugin = canReusePrebuiltSSR ? prebuiltSSRPlugin : createServerReadSSRAssetsPlugin(ssrBundle, ssrOutputDir);
|
|
15328
|
-
const configuredRollupPlugins = _optionalChain([nitroConfig, 'access',
|
|
15443
|
+
const configuredRollupPlugins = _optionalChain([nitroConfig, 'access', _336 => _336.rollupConfig, 'optionalAccess', _337 => _337.plugins]);
|
|
15329
15444
|
nitroConfig.rollupConfig = {
|
|
15330
15445
|
...nitroConfig.rollupConfig,
|
|
15331
15446
|
plugins: [
|
|
@@ -15362,22 +15477,48 @@ function toFarmNodeResponse(request, response) {
|
|
|
15362
15477
|
});
|
|
15363
15478
|
const prerenderPagePaths = new Set(prerenderRoutes.map(toPrerenderPublicPath));
|
|
15364
15479
|
let skippedNonHtmlPrerenderRoute = false;
|
|
15365
|
-
|
|
15366
|
-
if (route.error || !prerenderPagePaths.has(route.route)) return;
|
|
15367
|
-
if (_optionalChain([route, 'access', _331 => _331.contentType, 'optionalAccess', _332 => _332.toLowerCase, 'call', _333 => _333(), 'access', _334 => _334.includes, 'call', _335 => _335("html")])) return;
|
|
15480
|
+
const keepPrerenderRouteServerHandled = (route) => {
|
|
15368
15481
|
route.skip = true;
|
|
15369
15482
|
skippedNonHtmlPrerenderRoute = true;
|
|
15370
15483
|
const configuredRule = configuredNitroRouteRules[route.route];
|
|
15371
15484
|
if (configuredRule) nitroInstance.options.routeRules[route.route] = configuredRule;
|
|
15372
15485
|
else delete nitroInstance.options.routeRules[route.route];
|
|
15486
|
+
};
|
|
15487
|
+
const staticPageCandidatePublicPaths = new Map(
|
|
15488
|
+
staticPageCandidatePaths.map((pathname) => [toPrerenderPublicPath(pathname), pathname])
|
|
15489
|
+
);
|
|
15490
|
+
const staticPageVerdicts = /* @__PURE__ */ new Map();
|
|
15491
|
+
if (staticPageCandidatePublicPaths.size > 0) {
|
|
15492
|
+
nitroInstance.hooks.hook("prerender:generate", (route) => {
|
|
15493
|
+
const pathname = staticPageCandidatePublicPaths.get(route.route);
|
|
15494
|
+
if (pathname === void 0) return;
|
|
15495
|
+
const refusal = getFarmStaticPageRefusal(route);
|
|
15496
|
+
staticPageVerdicts.set(pathname, refusal);
|
|
15497
|
+
if (route.error) {
|
|
15498
|
+
route.error = void 0;
|
|
15499
|
+
if (staticPagesMode === "enabled") {
|
|
15500
|
+
_chunk7ZDLE77Pcjs.logger.warn(
|
|
15501
|
+
`\u21AA Keeping ${pathname} server-handled: ${refusal}. Fix the page, or export \`dynamic = "force-dynamic"\` to render it on each request.`
|
|
15502
|
+
);
|
|
15503
|
+
}
|
|
15504
|
+
} else if (refusal && staticPagesMode === "enabled") {
|
|
15505
|
+
_chunk7ZDLE77Pcjs.logger.info(`\u21AA Keeping ${pathname} server-handled (${refusal})`);
|
|
15506
|
+
}
|
|
15507
|
+
if (refusal || staticPagesMode === "analyze") keepPrerenderRouteServerHandled(route);
|
|
15508
|
+
});
|
|
15509
|
+
}
|
|
15510
|
+
nitroInstance.hooks.hook("prerender:generate", (route) => {
|
|
15511
|
+
if (route.error || route.skip || !prerenderPagePaths.has(route.route)) return;
|
|
15512
|
+
if (_optionalChain([route, 'access', _338 => _338.contentType, 'optionalAccess', _339 => _339.toLowerCase, 'call', _340 => _340(), 'access', _341 => _341.includes, 'call', _342 => _342("html")])) return;
|
|
15513
|
+
keepPrerenderRouteServerHandled(route);
|
|
15373
15514
|
_chunk7ZDLE77Pcjs.logger.info(`\u21AA Keeping SSG route ${route.route} server-handled (it does not render HTML)`);
|
|
15374
15515
|
});
|
|
15375
15516
|
nitroInstance.hooks.hook("prerender:done", () => {
|
|
15376
15517
|
if (skippedNonHtmlPrerenderRoute) nitroInstance.routing.sync();
|
|
15377
15518
|
});
|
|
15378
|
-
if (_optionalChain([config, 'access',
|
|
15519
|
+
if (_optionalChain([config, 'access', _343 => _343.md, 'optionalAccess', _344 => _344.enabled])) {
|
|
15379
15520
|
nitroInstance.hooks.hook("prerender:generate", (route) => {
|
|
15380
|
-
if (!route.contents || !_optionalChain([route, 'access',
|
|
15521
|
+
if (!route.contents || !_optionalChain([route, 'access', _345 => _345.contentType, 'optionalAccess', _346 => _346.toLowerCase, 'call', _347 => _347(), 'access', _348 => _348.includes, 'call', _349 => _349("html")])) return;
|
|
15381
15522
|
const alternatePath = _chunkU2HFXURZcjs.getFarmMarkdownAlternatePath.call(void 0, config.md, route.route, {
|
|
15382
15523
|
routePathname: (pathname) => routeManager.toRoutePathname(pathname)
|
|
15383
15524
|
});
|
|
@@ -15400,7 +15541,7 @@ function toFarmNodeResponse(request, response) {
|
|
|
15400
15541
|
}
|
|
15401
15542
|
if (config.security.csp && config.security.csp.nonce) {
|
|
15402
15543
|
nitroInstance.hooks.hook("prerender:generate", async (route) => {
|
|
15403
|
-
if (!route.contents || !_optionalChain([route, 'access',
|
|
15544
|
+
if (!route.contents || !_optionalChain([route, 'access', _350 => _350.contentType, 'optionalAccess', _351 => _351.toLowerCase, 'call', _352 => _352(), 'access', _353 => _353.includes, 'call', _354 => _354("html")])) return;
|
|
15404
15545
|
const staticCsp = await _chunkIEZFFXSCcjs.applyFarmCspHashesToHtml.call(void 0, route.contents, config.security);
|
|
15405
15546
|
if (!staticCsp) return;
|
|
15406
15547
|
route.contents = staticCsp.html;
|
|
@@ -15421,8 +15562,8 @@ function toFarmNodeResponse(request, response) {
|
|
|
15421
15562
|
if (staticNotFoundPrerenderPath) {
|
|
15422
15563
|
nitroInstance.hooks.hook("prerender:generate", (route) => {
|
|
15423
15564
|
if (route.route !== staticNotFoundPrerenderPath) return;
|
|
15424
|
-
const status = _nullishCoalesce(_optionalChain([route, 'access',
|
|
15425
|
-
const contentType = _nullishCoalesce(_optionalChain([route, 'access',
|
|
15565
|
+
const status = _nullishCoalesce(_optionalChain([route, 'access', _355 => _355.error, 'optionalAccess', _356 => _356.status]), () => ( 200));
|
|
15566
|
+
const contentType = _nullishCoalesce(_optionalChain([route, 'access', _357 => _357.contentType, 'optionalAccess', _358 => _358.toLowerCase, 'call', _359 => _359()]), () => ( ""));
|
|
15426
15567
|
route.error = void 0;
|
|
15427
15568
|
if (status === 404 && contentType.includes("text/html")) {
|
|
15428
15569
|
staticNotFoundWritten = true;
|
|
@@ -15452,7 +15593,7 @@ function toFarmNodeResponse(request, response) {
|
|
|
15452
15593
|
await nitroBuilder.copyPublicAssets(nitroInstance);
|
|
15453
15594
|
if (prerenderReusesPrebuiltSSR && (!canReusePrebuiltSSR || preset !== "node-server")) {
|
|
15454
15595
|
nitroInstance.hooks.hook("prerender:config", (prerendererConfig) => {
|
|
15455
|
-
const configuredPlugins = _optionalChain([prerendererConfig, 'access',
|
|
15596
|
+
const configuredPlugins = _optionalChain([prerendererConfig, 'access', _360 => _360.rollupConfig, 'optionalAccess', _361 => _361.plugins]);
|
|
15456
15597
|
const plugins = Array.isArray(configuredPlugins) ? configuredPlugins : configuredPlugins ? [configuredPlugins] : [];
|
|
15457
15598
|
prerendererConfig.rollupConfig = {
|
|
15458
15599
|
...prerendererConfig.rollupConfig,
|
|
@@ -15517,18 +15658,32 @@ function toFarmNodeResponse(request, response) {
|
|
|
15517
15658
|
});
|
|
15518
15659
|
}
|
|
15519
15660
|
if (prerenderRoutes.length > 0 || staticNotFoundPrerenderPath) {
|
|
15520
|
-
|
|
15521
|
-
|
|
15661
|
+
const ssgPageCount = prerenderRoutes.length - staticPageCandidatePaths.length;
|
|
15662
|
+
if (ssgPageCount > 0) {
|
|
15663
|
+
_chunk7ZDLE77Pcjs.logger.info(`\u{1F4C4} Pre-rendering ${ssgPageCount} SSG page(s)`);
|
|
15664
|
+
}
|
|
15665
|
+
if (staticPageCandidatePaths.length > 0) {
|
|
15666
|
+
_chunk7ZDLE77Pcjs.logger.info(
|
|
15667
|
+
`\u{1F4C4} Rendering ${staticPageCandidatePaths.length} page(s) that set no rendering mode (experimental.staticPages: "${staticPagesMode}")`
|
|
15668
|
+
);
|
|
15522
15669
|
}
|
|
15523
|
-
const previousPrerender = process.env[
|
|
15524
|
-
process.env[
|
|
15670
|
+
const previousPrerender = process.env[_chunkT2VXOAC3cjs.FARM_PRERENDER_ENV];
|
|
15671
|
+
process.env[_chunkT2VXOAC3cjs.FARM_PRERENDER_ENV] = "1";
|
|
15525
15672
|
try {
|
|
15526
15673
|
await nitroBuilder.prerender(nitroInstance);
|
|
15527
15674
|
} finally {
|
|
15528
|
-
if (previousPrerender === void 0) delete process.env[
|
|
15529
|
-
else process.env[
|
|
15675
|
+
if (previousPrerender === void 0) delete process.env[_chunkT2VXOAC3cjs.FARM_PRERENDER_ENV];
|
|
15676
|
+
else process.env[_chunkT2VXOAC3cjs.FARM_PRERENDER_ENV] = previousPrerender;
|
|
15530
15677
|
}
|
|
15531
15678
|
}
|
|
15679
|
+
if (staticPagesMode !== "off") {
|
|
15680
|
+
reportFarmStaticPages(
|
|
15681
|
+
staticPagesMode,
|
|
15682
|
+
staticPageCandidatePaths,
|
|
15683
|
+
staticPageVerdicts,
|
|
15684
|
+
staticPageBypasses
|
|
15685
|
+
);
|
|
15686
|
+
}
|
|
15532
15687
|
const sharpRuntimeStagePromise = imageRuntime === "node" ? stageSharpRuntime(config, root, distDir, fs5, preset) : Promise.resolve(null);
|
|
15533
15688
|
const prebuiltSSRFilesPromise = canReusePrebuiltSSR ? prepareSSRBundleFiles(
|
|
15534
15689
|
ssrBundle,
|
|
@@ -15617,7 +15772,7 @@ function toFarmNodeResponse(request, response) {
|
|
|
15617
15772
|
...staticNotFoundPlan.input,
|
|
15618
15773
|
matcherSources: [...staticNotFoundPlan.input.matcherSources, ...handlerSources]
|
|
15619
15774
|
});
|
|
15620
|
-
const fileHeaders = _optionalChain([nitroInstance, 'access',
|
|
15775
|
+
const fileHeaders = _optionalChain([nitroInstance, 'access', _362 => _362.options, 'access', _363 => _363.routeRules, 'access', _364 => _364[staticNotFoundPrerenderPath], 'optionalAccess', _365 => _365.headers]);
|
|
15621
15776
|
const cspHeaders = Object.fromEntries(
|
|
15622
15777
|
Object.entries(fileHeaders || {}).filter(
|
|
15623
15778
|
([name]) => name.toLowerCase().startsWith("content-security-policy")
|
|
@@ -15647,7 +15802,10 @@ function toFarmNodeResponse(request, response) {
|
|
|
15647
15802
|
middlewareRoutes: edgeMiddlewareRoutes,
|
|
15648
15803
|
guardedPages: edgeGuardedPrerenderRoutes
|
|
15649
15804
|
},
|
|
15650
|
-
|
|
15805
|
+
// A candidate page the build kept on the server has no file to redirect to or negotiate.
|
|
15806
|
+
prerenderRoutes.filter(
|
|
15807
|
+
(pathname) => !staticPageVerdicts.has(pathname) || staticPagesMode === "enabled" && staticPageVerdicts.get(pathname) === null
|
|
15808
|
+
).map(toPrerenderPublicPath),
|
|
15651
15809
|
staticNotFoundRoutes
|
|
15652
15810
|
);
|
|
15653
15811
|
}
|
|
@@ -15743,7 +15901,7 @@ async function moveVercelOutputPath(src, dest, fs5) {
|
|
|
15743
15901
|
await fs5.rename(src, dest);
|
|
15744
15902
|
return;
|
|
15745
15903
|
} catch (error) {
|
|
15746
|
-
const code = _optionalChain([error, 'optionalAccess',
|
|
15904
|
+
const code = _optionalChain([error, 'optionalAccess', _366 => _366.code]);
|
|
15747
15905
|
if (code !== "EPERM" && code !== "EACCES" && code !== "EXDEV" && code !== "ENOTEMPTY" && code !== "EEXIST") {
|
|
15748
15906
|
throw error;
|
|
15749
15907
|
}
|
|
@@ -15769,7 +15927,7 @@ async function postProcessVercelOutput(root, outputDir, fs5, config, farmWorkflo
|
|
|
15769
15927
|
try {
|
|
15770
15928
|
await moveVercelOutputPath(publicDir, staticDir, fs5);
|
|
15771
15929
|
} catch (error) {
|
|
15772
|
-
if (_optionalChain([error, 'optionalAccess',
|
|
15930
|
+
if (_optionalChain([error, 'optionalAccess', _367 => _367.code]) !== "ENOENT") throw error;
|
|
15773
15931
|
}
|
|
15774
15932
|
await copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs5);
|
|
15775
15933
|
await copyPrismaClientForVercel(root, nitroFuncDir, fs5);
|
|
@@ -15813,7 +15971,7 @@ async function postProcessVercelOutput(root, outputDir, fs5, config, farmWorkflo
|
|
|
15813
15971
|
_chunk7ZDLE77Pcjs.logger.info("\u2705 Post-processed Vercel output for Build Output API v3");
|
|
15814
15972
|
}
|
|
15815
15973
|
async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs5, options = {}) {
|
|
15816
|
-
if (!_optionalChain([config, 'access',
|
|
15974
|
+
if (!_optionalChain([config, 'access', _368 => _368.docs, 'optionalAccess', _369 => _369.enabled])) return;
|
|
15817
15975
|
const [mainRoot, ...extraRoots] = _chunk4A6WSOZHcjs.getFarmDocsRoots.call(void 0, config.docs);
|
|
15818
15976
|
await copyFarmDocsRootContent(
|
|
15819
15977
|
mainRoot,
|
|
@@ -15843,7 +16001,7 @@ async function copyFarmDocsRootContent(docs, root, srcDir, bundledContentDir, fs
|
|
|
15843
16001
|
const lastModifiedManifest = _chunk4A6WSOZHcjs.createFarmDocsLastModifiedManifest.call(void 0, docsContentDir, {
|
|
15844
16002
|
fallback: "now"
|
|
15845
16003
|
});
|
|
15846
|
-
const undatedPages = _nullishCoalesce(_optionalChain([lastModifiedManifest, 'access',
|
|
16004
|
+
const undatedPages = _nullishCoalesce(_optionalChain([lastModifiedManifest, 'access', _370 => _370.unknown, 'optionalAccess', _371 => _371.length]), () => ( 0));
|
|
15847
16005
|
if (log && undatedPages > 0) {
|
|
15848
16006
|
_chunk7ZDLE77Pcjs.logger.warn(
|
|
15849
16007
|
`${undatedPages} docs page(s) were last changed before this shallow clone's Git history, so they show no "Last updated" date. Build from a full clone (git fetch --unshallow) or set lastModified in the page's frontmatter.`
|
|
@@ -15930,7 +16088,7 @@ async function stageSharpRuntime(config, root, distDir, fs5, preset) {
|
|
|
15930
16088
|
try {
|
|
15931
16089
|
await copyPackage("sharp", sharpRequire);
|
|
15932
16090
|
if (!copiedPackages.has("sharp")) {
|
|
15933
|
-
throw new Error(`Farm image optimization requires sharp. ${
|
|
16091
|
+
throw new Error(`Farm image optimization requires sharp. ${_chunk76ES7BCOcjs.SHARP_INSTALL_HINT}`);
|
|
15934
16092
|
}
|
|
15935
16093
|
} catch (error) {
|
|
15936
16094
|
await fs5.rm(stageDir, { recursive: true, force: true });
|
|
@@ -16164,7 +16322,7 @@ async function createFarmProjectModuleSsrEnvironment() {
|
|
|
16164
16322
|
// src/build/index.ts
|
|
16165
16323
|
async function build(config, options = {}) {
|
|
16166
16324
|
return _chunkJYQMGMKTcjs.withProductionNodeEnv.call(void 0,
|
|
16167
|
-
() =>
|
|
16325
|
+
() => _chunkBY5VQ57Wcjs.withPackageClientBoundaryCache.call(void 0, () => buildWithProductionNodeEnv(config, options))
|
|
16168
16326
|
);
|
|
16169
16327
|
}
|
|
16170
16328
|
function createBuildTargetBaseline(config) {
|
|
@@ -16175,7 +16333,7 @@ function createBuildTargetBaseline(config) {
|
|
|
16175
16333
|
preset,
|
|
16176
16334
|
distDir,
|
|
16177
16335
|
outputDir,
|
|
16178
|
-
outputWasDerived: outputDir ===
|
|
16336
|
+
outputWasDerived: outputDir === _chunkGDKJGL7Dcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
|
|
16179
16337
|
};
|
|
16180
16338
|
}
|
|
16181
16339
|
function resolveBuildTargets(config, options, baseline) {
|
|
@@ -16184,8 +16342,8 @@ function resolveBuildTargets(config, options, baseline) {
|
|
|
16184
16342
|
const distDir = config.distDir || ".farm";
|
|
16185
16343
|
const outputWasReplaced = config.deploy.outputDir !== baseline.outputDir;
|
|
16186
16344
|
const shouldRefreshDerivedOutput = baseline.outputWasDerived && !outputWasReplaced && (preset !== baseline.preset || distDir !== baseline.distDir);
|
|
16187
|
-
const deployTarget = preset === config.deploy.preset ? config.deploy.target :
|
|
16188
|
-
const outputDir = shouldRefreshDerivedOutput ?
|
|
16345
|
+
const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkGDKJGL7Dcjs.getDeployTargetForPreset.call(void 0, preset);
|
|
16346
|
+
const outputDir = shouldRefreshDerivedOutput ? _chunkGDKJGL7Dcjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
|
|
16189
16347
|
return {
|
|
16190
16348
|
root,
|
|
16191
16349
|
preset,
|
|
@@ -16193,7 +16351,7 @@ function resolveBuildTargets(config, options, baseline) {
|
|
|
16193
16351
|
distDir,
|
|
16194
16352
|
deployTarget,
|
|
16195
16353
|
outputDir,
|
|
16196
|
-
deployOutputDir:
|
|
16354
|
+
deployOutputDir: _chunkGDKJGL7Dcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
|
|
16197
16355
|
};
|
|
16198
16356
|
}
|
|
16199
16357
|
async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
@@ -16230,15 +16388,15 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
16230
16388
|
};
|
|
16231
16389
|
config = {
|
|
16232
16390
|
...config,
|
|
16233
|
-
images:
|
|
16391
|
+
images: _chunk76ES7BCOcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
|
|
16234
16392
|
root: targets.root,
|
|
16235
16393
|
preset: targets.preset
|
|
16236
16394
|
})
|
|
16237
16395
|
};
|
|
16238
|
-
if (_optionalChain([config, 'access',
|
|
16396
|
+
if (_optionalChain([config, 'access', _372 => _372.docs, 'optionalAccess', _373 => _373.enabled])) await _chunkTDAH76RRcjs.loadFarmDocsEngine.call(void 0, );
|
|
16239
16397
|
pluginManager.updateContext({ config });
|
|
16240
16398
|
const { root, preset, srcDir, distDir, deployOutputDir } = targets;
|
|
16241
|
-
|
|
16399
|
+
_chunkBY5VQ57Wcjs.usePackageClientBoundaryCacheFile.call(void 0, _chunkBY5VQ57Wcjs.resolvePackageClientBoundaryCacheFile.call(void 0, root, distDir));
|
|
16242
16400
|
_chunk7ZDLE77Pcjs.logger.info(`\u{1F69C} Building Farm.js application with preset: ${preset}...`);
|
|
16243
16401
|
await pluginManager.setupPlugins();
|
|
16244
16402
|
await pluginManager.runHookParallel("beforeBundle", {
|
|
@@ -16250,8 +16408,8 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
16250
16408
|
});
|
|
16251
16409
|
_chunk7ZDLE77Pcjs.logger.info("\u{1F50D} Discovering routes and API endpoints...");
|
|
16252
16410
|
const productionViteResult = productionViteResultPromise ? (await productionViteResultPromise)[0] : void 0;
|
|
16253
|
-
if (_optionalChain([productionViteResult, 'optionalAccess',
|
|
16254
|
-
const productionVite = _optionalChain([productionViteResult, 'optionalAccess',
|
|
16411
|
+
if (_optionalChain([productionViteResult, 'optionalAccess', _374 => _374.status]) === "rejected") throw productionViteResult.reason;
|
|
16412
|
+
const productionVite = _optionalChain([productionViteResult, 'optionalAccess', _375 => _375.value]);
|
|
16255
16413
|
const createViteServer = productionVite ? productionVite.createServer : (await import("vite")).createServer;
|
|
16256
16414
|
projectModuleServer = await createProjectModuleServer(
|
|
16257
16415
|
createViteServer,
|
|
@@ -16259,19 +16417,19 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
16259
16417
|
root,
|
|
16260
16418
|
rendererBuild.signal
|
|
16261
16419
|
);
|
|
16262
|
-
const farmApp =
|
|
16420
|
+
const farmApp = _chunk76ES7BCOcjs.createFarmApp.call(void 0, config, projectModuleServer);
|
|
16263
16421
|
if (options.universal !== false) farmApp.getRouteManager().keepBuildSourceSnapshot();
|
|
16264
16422
|
await farmApp.initialize();
|
|
16265
16423
|
const routeManager = farmApp.getRouteManager();
|
|
16266
16424
|
const serverRenderer = farmApp.getServerRenderer();
|
|
16267
|
-
const typeArtifacts =
|
|
16425
|
+
const typeArtifacts = _chunk7Q6KUXH6cjs.generateFarmTypeArtifacts.call(void 0, {
|
|
16268
16426
|
root,
|
|
16269
16427
|
srcDir,
|
|
16270
16428
|
layers: config.layers,
|
|
16271
16429
|
storage: config.storage,
|
|
16272
16430
|
plugins: config.plugins,
|
|
16273
16431
|
extraRoutes: [
|
|
16274
|
-
..._optionalChain([config, 'access',
|
|
16432
|
+
..._optionalChain([config, 'access', _376 => _376.openapi, 'optionalAccess', _377 => _377.enabled]) && config.openapi.route ? [config.openapi.route] : [],
|
|
16275
16433
|
..._chunk4A6WSOZHcjs.getFarmDocsRouteTypeEntries.call(void 0, config.docs)
|
|
16276
16434
|
],
|
|
16277
16435
|
suppressLintOnLink: config.suppressLintOnLink,
|
|
@@ -16284,7 +16442,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
16284
16442
|
const message = error instanceof Error ? error.message : String(error);
|
|
16285
16443
|
_chunk7ZDLE77Pcjs.logger.warn(`Route type generation failed (farm.d.ts may be stale): ${message}`);
|
|
16286
16444
|
});
|
|
16287
|
-
const apiRouteManager = new (0,
|
|
16445
|
+
const apiRouteManager = new (0, _chunkY3MTKPLNcjs.APIRouteManager)(
|
|
16288
16446
|
_chunkPFVNPOKNcjs.getFarmAppDirectories.call(void 0, config),
|
|
16289
16447
|
projectModuleServer,
|
|
16290
16448
|
{
|
|
@@ -16359,7 +16517,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
16359
16517
|
throw error;
|
|
16360
16518
|
} finally {
|
|
16361
16519
|
try {
|
|
16362
|
-
await _optionalChain([projectModuleServer, 'optionalAccess',
|
|
16520
|
+
await _optionalChain([projectModuleServer, 'optionalAccess', _378 => _378.close, 'call', _379 => _379()]);
|
|
16363
16521
|
} finally {
|
|
16364
16522
|
rendererBuild.abort();
|
|
16365
16523
|
}
|
|
@@ -16371,7 +16529,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
16371
16529
|
ssr: true,
|
|
16372
16530
|
buildLifetime
|
|
16373
16531
|
});
|
|
16374
|
-
const viteConfig =
|
|
16532
|
+
const viteConfig = _chunk76ES7BCOcjs.mergeFarmViteConfig.call(void 0,
|
|
16375
16533
|
{
|
|
16376
16534
|
root,
|
|
16377
16535
|
appType: "custom",
|
|
@@ -16383,13 +16541,13 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
16383
16541
|
},
|
|
16384
16542
|
plugins: [
|
|
16385
16543
|
...rendererVitePlugins,
|
|
16386
|
-
|
|
16544
|
+
_chunk76ES7BCOcjs.farmFontImportsPlugin.call(void 0, {
|
|
16387
16545
|
root,
|
|
16388
16546
|
basePath: config.basePath,
|
|
16389
16547
|
publicDir: config.publicDir,
|
|
16390
|
-
isLayoutModule: (id) =>
|
|
16548
|
+
isLayoutModule: (id) => _chunk76ES7BCOcjs.isFarmLayoutModule.call(void 0, id, _chunkPFVNPOKNcjs.getFarmAppDirectories.call(void 0, config))
|
|
16391
16549
|
}),
|
|
16392
|
-
|
|
16550
|
+
_chunkBY5VQ57Wcjs.farmEnvironmentFunctionsPlugin.call(void 0, { renderer: config.renderer }),
|
|
16393
16551
|
// Route modules load here at build time (rendering config, prerendering): `server-only`
|
|
16394
16552
|
// resolves as it does in the server build. Module-entry packages load pre-bundled, as in
|
|
16395
16553
|
// `farm dev`: unbundled, lucide-react alone is ~1,750 modules through the module runner,
|
|
@@ -16405,7 +16563,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
16405
16563
|
hmr: false
|
|
16406
16564
|
},
|
|
16407
16565
|
resolve: {
|
|
16408
|
-
alias:
|
|
16566
|
+
alias: _chunk76ES7BCOcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
16409
16567
|
dedupe: [...config.renderer.dedupe || []]
|
|
16410
16568
|
},
|
|
16411
16569
|
optimizeDeps: {
|
|
@@ -16444,10 +16602,10 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
16444
16602
|
noDiscovery: true
|
|
16445
16603
|
},
|
|
16446
16604
|
// An app or plugin that brings its own SSR environment keeps it.
|
|
16447
|
-
environments: _optionalChain([viteConfig, 'access',
|
|
16605
|
+
environments: _optionalChain([viteConfig, 'access', _380 => _380.environments, 'optionalAccess', _381 => _381.ssr, 'optionalAccess', _382 => _382.dev, 'optionalAccess', _383 => _383.createEnvironment]) ? viteConfig.environments : {
|
|
16448
16606
|
...viteConfig.environments,
|
|
16449
16607
|
ssr: {
|
|
16450
|
-
..._optionalChain([viteConfig, 'access',
|
|
16608
|
+
..._optionalChain([viteConfig, 'access', _384 => _384.environments, 'optionalAccess', _385 => _385.ssr]),
|
|
16451
16609
|
...await createFarmProjectModuleSsrEnvironment()
|
|
16452
16610
|
}
|
|
16453
16611
|
}
|
|
@@ -16483,7 +16641,7 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
|
|
|
16483
16641
|
farmNavigationPlugin(config.renderer),
|
|
16484
16642
|
farmIslandContainersPlugin(config),
|
|
16485
16643
|
farmPlugin(config, pluginManager),
|
|
16486
|
-
|
|
16644
|
+
_chunkBY5VQ57Wcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
|
|
16487
16645
|
],
|
|
16488
16646
|
mode: "production"
|
|
16489
16647
|
});
|
|
@@ -16511,13 +16669,13 @@ async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
|
|
|
16511
16669
|
define: {
|
|
16512
16670
|
__FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
|
|
16513
16671
|
__FARM_ENV__: JSON.stringify(_chunkTP7JAC3Tcjs.createBundledEnv.call(void 0, config.env)),
|
|
16514
|
-
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access',
|
|
16672
|
+
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _386 => _386.env, 'optionalAccess', _387 => _387.public]) || {})
|
|
16515
16673
|
},
|
|
16516
16674
|
plugins: [
|
|
16517
16675
|
farmI18nClientBridgePlugin(),
|
|
16518
16676
|
farmIslandContainersPlugin(config),
|
|
16519
16677
|
farmPlugin(config, pluginManager),
|
|
16520
|
-
|
|
16678
|
+
_chunkBY5VQ57Wcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
|
|
16521
16679
|
],
|
|
16522
16680
|
mode: "production"
|
|
16523
16681
|
});
|
|
@@ -16545,7 +16703,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
16545
16703
|
if (pluginManager) {
|
|
16546
16704
|
nitroConfig = await pluginManager.runHookSerial("beforeNitroBuild", nitroConfig);
|
|
16547
16705
|
}
|
|
16548
|
-
const outputDir =
|
|
16706
|
+
const outputDir = _chunkGDKJGL7Dcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
16549
16707
|
const serverOutputDir = _path2.default.join(outputDir, "server");
|
|
16550
16708
|
const publicOutputDir = _path2.default.join(outputDir, "public");
|
|
16551
16709
|
const { mkdir, cp } = await import("fs/promises");
|
|
@@ -16616,7 +16774,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
16616
16774
|
root,
|
|
16617
16775
|
preset,
|
|
16618
16776
|
distDir,
|
|
16619
|
-
outputDir:
|
|
16777
|
+
outputDir: _chunkGDKJGL7Dcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir),
|
|
16620
16778
|
serverDir: _path2.default.resolve(nitro.options.output.serverDir)
|
|
16621
16779
|
});
|
|
16622
16780
|
}
|