@farm.js/core 0.1.19 → 0.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-runtime.d.mts +2 -3
- package/dist/agent-runtime.d.ts +2 -3
- package/dist/api/route-manager.cjs +5 -5
- package/dist/api/route-manager.d.mts +2 -3
- package/dist/api/route-manager.d.ts +2 -3
- package/dist/api/route-manager.mjs +4 -4
- package/dist/api.cjs +6 -6
- package/dist/api.d.mts +3 -4
- package/dist/api.d.ts +3 -4
- package/dist/api.mjs +5 -5
- package/dist/{app-BHY_10Lm.d.ts → app-DAyPE-gr.d.ts} +11 -4
- package/dist/{app-BMk0do23.d.mts → app-D_6nTit-.d.mts} +11 -4
- package/dist/app-markdown.d.mts +3 -4
- package/dist/app-markdown.d.ts +3 -4
- package/dist/{chunk-FS7FLPOG.mjs → chunk-2J7W2WND.mjs} +3 -2
- package/dist/{chunk-YS3TRKCG.mjs → chunk-2M435BUE.mjs} +6 -1
- package/dist/{chunk-WJ3HK3LJ.cjs → chunk-2QLBIPFT.cjs} +4 -4
- package/dist/{chunk-FJSWYIR7.cjs → chunk-3IL5UC5I.cjs} +2 -2
- package/dist/chunk-43FMW62B.mjs +67 -0
- package/dist/{chunk-WZXN4R5Y.mjs → chunk-53G3OLTA.mjs} +106 -75
- package/dist/{chunk-FVZGEVTO.mjs → chunk-5L6NBNHI.mjs} +123 -41
- package/dist/{chunk-A7T6345N.mjs → chunk-5UX4C5QI.mjs} +10 -7
- package/dist/chunk-75WGQVQA.cjs +46 -0
- package/dist/{chunk-AFOD3LYZ.cjs → chunk-B3WK4DTX.cjs} +10 -9
- package/dist/{chunk-AORPIPNB.cjs → chunk-BHJUZ64B.cjs} +18 -14
- package/dist/chunk-BMWDEBXO.cjs +67 -0
- package/dist/{chunk-ATERBVHQ.mjs → chunk-CQHFU55R.mjs} +5 -4
- package/dist/{chunk-XSKZORAS.cjs → chunk-DX4VKYAJ.cjs} +5 -5
- package/dist/{chunk-7WPA7GBZ.mjs → chunk-GHFS7RUB.mjs} +1 -1
- package/dist/{chunk-NZ2JVBT2.mjs → chunk-GZ3ZPTQV.mjs} +2 -2
- package/dist/{chunk-RKQVJN2O.mjs → chunk-JIKGGIOL.mjs} +1 -1
- package/dist/{chunk-OXSIH4D6.cjs → chunk-KNPRCKXK.cjs} +6 -1
- package/dist/{chunk-XDGMADQM.cjs → chunk-L7ARWZYT.cjs} +384 -353
- package/dist/{chunk-2ANEVVF7.mjs → chunk-NRS46D4L.mjs} +1 -1
- package/dist/{chunk-A72YEUZ3.mjs → chunk-OCE65DDM.mjs} +1 -1
- package/dist/{chunk-2GNATDDE.mjs → chunk-PKO4FCTL.mjs} +1 -1
- package/dist/{chunk-UDBJCUPA.mjs → chunk-PUCUVI7K.mjs} +11 -7
- package/dist/{chunk-RFYO7QUD.cjs → chunk-Q2TUENW2.cjs} +1 -1
- package/dist/{chunk-GDSHDTJ4.cjs → chunk-Q5B3KJBP.cjs} +2 -2
- package/dist/{chunk-TSWW5BVH.mjs → chunk-QMV4QELL.mjs} +1 -1
- package/dist/{chunk-V4AICMQA.mjs → chunk-RMIJFZU3.mjs} +26 -2
- package/dist/{chunk-NSFC3LHB.cjs → chunk-RWXZKZXB.cjs} +255 -173
- package/dist/{chunk-MKB2EGIR.cjs → chunk-SOR334EB.cjs} +3 -2
- package/dist/{chunk-57J3Y7Y3.mjs → chunk-TIKNUAU7.mjs} +3 -2
- package/dist/chunk-VVBO3QH7.mjs +46 -0
- package/dist/{chunk-QBPKKQTD.mjs → chunk-W7MZXRXM.mjs} +19 -4
- package/dist/{chunk-Y53ZSFN6.cjs → chunk-WM6HL7E7.cjs} +4 -3
- package/dist/{chunk-GPVTX3HT.cjs → chunk-XFFQSD2F.cjs} +2 -2
- package/dist/{chunk-62YJ2IEB.cjs → chunk-XI3GWPUS.cjs} +23 -20
- package/dist/{chunk-KVFPGF2M.cjs → chunk-YJJLXIIS.cjs} +7 -7
- package/dist/{chunk-U5BMPGS3.cjs → chunk-YP5JZ4LF.cjs} +32 -8
- package/dist/{chunk-S27FMYAM.cjs → chunk-ZE6ONQ5R.cjs} +28 -13
- package/dist/{client-plugins-JXXmZliS.d.mts → client-plugins-CWrhb1ir.d.mts} +26 -3
- package/dist/{client-plugins-C089bQhN.d.ts → client-plugins-DPf0qZey.d.ts} +26 -3
- package/dist/client-plugins.d.mts +2 -3
- package/dist/client-plugins.d.ts +2 -3
- package/dist/client.cjs +4 -4
- package/dist/client.d.mts +9 -38
- package/dist/client.d.ts +9 -38
- package/dist/client.mjs +3 -3
- package/dist/config.d.mts +2 -3
- package/dist/config.d.ts +2 -3
- package/dist/{devtools-FY5R7TQ4.mjs → devtools-MTB5SA2B.mjs} +3 -3
- package/dist/{devtools-5KGPDVKL.cjs → devtools-R6MDDAZK.cjs} +7 -7
- package/dist/docs.cjs +6 -5
- package/dist/docs.d.mts +2 -2
- package/dist/docs.d.ts +2 -2
- package/dist/docs.mjs +5 -4
- package/dist/index.cjs +21 -20
- package/dist/index.d.mts +14 -14
- package/dist/index.d.ts +14 -14
- package/dist/index.mjs +20 -19
- package/dist/integrations.d.mts +2 -3
- package/dist/integrations.d.ts +2 -3
- package/dist/internal/app-markdown-runtime.d.mts +2 -3
- package/dist/internal/app-markdown-runtime.d.ts +2 -3
- package/dist/internal/build-runtime.cjs +15 -14
- package/dist/internal/build-runtime.d.mts +4 -5
- package/dist/internal/build-runtime.d.ts +4 -5
- package/dist/internal/build-runtime.mjs +14 -13
- package/dist/internal/cli-runtime.cjs +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/compression-runtime.d.mts +2 -3
- package/dist/internal/compression-runtime.d.ts +2 -3
- package/dist/internal/config-runtime.cjs +4 -4
- package/dist/internal/config-runtime.d.mts +3 -4
- package/dist/internal/config-runtime.d.ts +3 -4
- package/dist/internal/config-runtime.mjs +3 -3
- package/dist/internal/product-telemetry-runtime.cjs +2 -2
- package/dist/internal/product-telemetry-runtime.mjs +1 -1
- package/dist/internal/production-runtime.cjs +2 -2
- package/dist/internal/production-runtime.d.mts +8 -9
- package/dist/internal/production-runtime.d.ts +8 -9
- package/dist/internal/production-runtime.mjs +1 -1
- package/dist/{metadata-C1Z9vLbb.d.mts → metadata-CO9fRyyJ.d.mts} +1 -1
- package/dist/{metadata-BcNJP4fq.d.ts → metadata-zY9wltwH.d.ts} +1 -1
- package/dist/middleware.cjs +4 -4
- package/dist/middleware.d.mts +4 -11
- package/dist/middleware.d.ts +4 -11
- package/dist/middleware.mjs +3 -3
- package/dist/navigation.cjs +5 -5
- package/dist/navigation.d.mts +42 -3
- package/dist/navigation.d.ts +42 -3
- package/dist/navigation.mjs +4 -4
- package/dist/{nitro-CVZ36JM5.mjs → nitro-4LFVTT24.mjs} +2 -2
- package/dist/{nitro-4I2MYLY2.cjs → nitro-TSGDUJMN.cjs} +3 -3
- package/dist/plugin.cjs +17 -11
- package/dist/plugin.d.mts +3 -4
- package/dist/plugin.d.ts +3 -4
- package/dist/plugin.mjs +17 -11
- package/dist/{production-runtime-jcrTlRTb.d.mts → production-runtime-CywsHwnG.d.mts} +1 -1
- package/dist/{production-runtime-oKmC0WU-.d.ts → production-runtime-lkfwujwK.d.ts} +1 -1
- package/dist/query/client.cjs +6 -6
- package/dist/query/client.mjs +2 -2
- package/dist/{render-plan-DOB9cV-h.d.ts → render-plan-DHF0GeWo.d.ts} +1 -1
- package/dist/{render-plan-BLIfc4jt.d.mts → render-plan-LVy6sGQe.d.mts} +1 -1
- package/dist/renderer-client.cjs +5 -5
- package/dist/renderer-client.d.mts +4 -5
- package/dist/renderer-client.d.ts +4 -5
- package/dist/renderer-client.mjs +2 -2
- package/dist/renderer.d.mts +3 -0
- package/dist/renderer.d.ts +3 -0
- package/dist/{request-Cr53NRHr.d.mts → request-6AkmhEYE.d.mts} +1 -1
- package/dist/{request-Dt2gNuQD.d.ts → request-BYxlRqA9.d.ts} +1 -1
- package/dist/request.d.mts +3 -4
- package/dist/request.d.ts +3 -4
- package/dist/{route-rendering-CWYd8Mv1.d.ts → route-rendering-CWaKiUbS.d.ts} +1 -1
- package/dist/{route-rendering-CeFBEAoZ.d.mts → route-rendering-Dd8Jmml7.d.mts} +1 -1
- package/dist/router-B2m4fvve.d.ts +50 -0
- package/dist/router-xwEE112q.d.mts +50 -0
- package/dist/routes.cjs +3 -3
- package/dist/routes.d.mts +2 -3
- package/dist/routes.d.ts +2 -3
- package/dist/routes.mjs +2 -2
- package/dist/server-plugins.d.mts +3 -4
- package/dist/server-plugins.d.ts +3 -4
- package/dist/server.cjs +25 -24
- package/dist/server.d.mts +8 -9
- package/dist/server.d.ts +8 -9
- package/dist/server.mjs +12 -11
- package/dist/{spa-router-CQWiYGxS.d.mts → spa-router-DVEHQnWo.d.mts} +3 -3
- package/dist/{spa-router-Wjiw-8hB.d.ts → spa-router-Y8rrXTVK.d.ts} +3 -3
- package/dist/testing.cjs +6 -6
- package/dist/testing.d.mts +2 -3
- package/dist/testing.d.ts +2 -3
- package/dist/testing.mjs +5 -5
- package/dist/{types-D-1WTE72.d.mts → types-DFbjpjXX.d.mts} +8 -0
- package/dist/{types-D-1WTE72.d.ts → types-DFbjpjXX.d.ts} +8 -0
- package/dist/{utils-uUxF0K0P.d.mts → utils-DSPx34-A.d.mts} +1 -1
- package/dist/{utils-B0XJmG_b.d.ts → utils-Dvuny_08.d.ts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +12 -11
- package/dist/vite.d.mts +2 -3
- package/dist/vite.d.ts +2 -3
- package/dist/vite.mjs +11 -10
- package/package.json +3 -3
- package/dist/chunk-7GNWGLWB.mjs +0 -14
- package/dist/chunk-VQDBNVOO.cjs +0 -14
- package/dist/navigation-errors-Dvwpzaer.d.mts +0 -13
- package/dist/navigation-errors-Dvwpzaer.d.ts +0 -13
- /package/dist/{chunk-IAMRBF3Z.cjs → chunk-N4RLRSWW.cjs} +0 -0
- /package/dist/{chunk-BNGS6KJ6.mjs → chunk-YOYF2E4U.mjs} +0 -0
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkXFFQSD2Fcjs = require('./chunk-XFFQSD2F.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
@@ -51,6 +51,10 @@ var _chunkXWAWFQFScjs = require('./chunk-XWAWFQFS.cjs');
|
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
|
|
54
|
+
var _chunk75WGQVQAcjs = require('./chunk-75WGQVQA.cjs');
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
54
58
|
var _chunkHREOKQWTcjs = require('./chunk-HREOKQWT.cjs');
|
|
55
59
|
|
|
56
60
|
|
|
@@ -65,7 +69,7 @@ var _chunkQBPXNZGVcjs = require('./chunk-QBPXNZGV.cjs');
|
|
|
65
69
|
var _chunkYJRZR7VUcjs = require('./chunk-YJRZR7VU.cjs');
|
|
66
70
|
|
|
67
71
|
|
|
68
|
-
var
|
|
72
|
+
var _chunkQ5B3KJBPcjs = require('./chunk-Q5B3KJBP.cjs');
|
|
69
73
|
|
|
70
74
|
|
|
71
75
|
|
|
@@ -162,7 +166,7 @@ var _chunk6QQDAAAZcjs = require('./chunk-6QQDAAAZ.cjs');
|
|
|
162
166
|
var _chunkZ5HIWVDPcjs = require('./chunk-Z5HIWVDP.cjs');
|
|
163
167
|
|
|
164
168
|
|
|
165
|
-
var
|
|
169
|
+
var _chunkWM6HL7E7cjs = require('./chunk-WM6HL7E7.cjs');
|
|
166
170
|
|
|
167
171
|
|
|
168
172
|
|
|
@@ -177,11 +181,11 @@ var _chunk4PPEPOZZcjs = require('./chunk-4PPEPOZZ.cjs');
|
|
|
177
181
|
var _chunkMQ3H6LT5cjs = require('./chunk-MQ3H6LT5.cjs');
|
|
178
182
|
|
|
179
183
|
|
|
180
|
-
var
|
|
184
|
+
var _chunkB3WK4DTXcjs = require('./chunk-B3WK4DTX.cjs');
|
|
181
185
|
|
|
182
186
|
|
|
183
187
|
|
|
184
|
-
var
|
|
188
|
+
var _chunkN4RLRSWWcjs = require('./chunk-N4RLRSWW.cjs');
|
|
185
189
|
|
|
186
190
|
|
|
187
191
|
|
|
@@ -208,7 +212,7 @@ var _chunk6V4TDWECcjs = require('./chunk-6V4TDWEC.cjs');
|
|
|
208
212
|
|
|
209
213
|
|
|
210
214
|
|
|
211
|
-
var
|
|
215
|
+
var _chunkSOR334EBcjs = require('./chunk-SOR334EB.cjs');
|
|
212
216
|
|
|
213
217
|
|
|
214
218
|
|
|
@@ -228,7 +232,9 @@ var _chunkEM6SBQKMcjs = require('./chunk-EM6SBQKM.cjs');
|
|
|
228
232
|
var _chunkM2L4MYDQcjs = require('./chunk-M2L4MYDQ.cjs');
|
|
229
233
|
|
|
230
234
|
|
|
231
|
-
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
var _chunkBMWDEBXOcjs = require('./chunk-BMWDEBXO.cjs');
|
|
232
238
|
|
|
233
239
|
|
|
234
240
|
|
|
@@ -258,7 +264,7 @@ var _chunkQNPEUFHQcjs = require('./chunk-QNPEUFHQ.cjs');
|
|
|
258
264
|
var _chunkUQZ4AYTHcjs = require('./chunk-UQZ4AYTH.cjs');
|
|
259
265
|
|
|
260
266
|
|
|
261
|
-
var
|
|
267
|
+
var _chunkQ2TUENW2cjs = require('./chunk-Q2TUENW2.cjs');
|
|
262
268
|
|
|
263
269
|
|
|
264
270
|
|
|
@@ -277,7 +283,7 @@ var _chunk75BRBIFPcjs = require('./chunk-75BRBIFP.cjs');
|
|
|
277
283
|
|
|
278
284
|
|
|
279
285
|
|
|
280
|
-
var
|
|
286
|
+
var _chunkKNPRCKXKcjs = require('./chunk-KNPRCKXK.cjs');
|
|
281
287
|
|
|
282
288
|
|
|
283
289
|
|
|
@@ -1995,25 +2001,25 @@ var _RouteManager = class _RouteManager {
|
|
|
1995
2001
|
if (!routeEntry) {
|
|
1996
2002
|
throw new Error(`Cannot resolve runtime configuration for unknown route "${pattern}"`);
|
|
1997
2003
|
}
|
|
1998
|
-
const inherited =
|
|
2004
|
+
const inherited = _chunkSOR334EBcjs.resolveFarmRouteRuleRuntimeConfig.call(void 0, pattern, this.config.routeRules);
|
|
1999
2005
|
const layouts = this.findMatchingLayouts(pattern);
|
|
2000
2006
|
const layoutConfigs = [];
|
|
2001
2007
|
for (const layout of layouts) {
|
|
2002
2008
|
const layoutModule = await this.loadLayoutModule(layout.modulePath);
|
|
2003
2009
|
layoutConfigs.push(
|
|
2004
|
-
|
|
2005
|
-
|
|
2010
|
+
_chunkSOR334EBcjs.normalizeFarmRouteRuntimeConfig.call(void 0,
|
|
2011
|
+
_chunkSOR334EBcjs.getFarmRouteRuntimeConfig.call(void 0, layoutModule),
|
|
2006
2012
|
`Layout "${layout.pattern}"`
|
|
2007
2013
|
)
|
|
2008
2014
|
);
|
|
2009
2015
|
}
|
|
2010
2016
|
const routeModule = await this.loadRouteModule(routeEntry.modulePath);
|
|
2011
|
-
const routeConfig =
|
|
2012
|
-
|
|
2017
|
+
const routeConfig = _chunkSOR334EBcjs.normalizeFarmRouteRuntimeConfig.call(void 0,
|
|
2018
|
+
_chunkSOR334EBcjs.getFarmRouteRuntimeConfig.call(void 0, routeModule),
|
|
2013
2019
|
`Route "${pattern}"`
|
|
2014
2020
|
);
|
|
2015
|
-
return
|
|
2016
|
-
|
|
2021
|
+
return _chunkSOR334EBcjs.resolveFarmRouteRuntimeConfig.call(void 0,
|
|
2022
|
+
_chunkSOR334EBcjs.mergeFarmRouteRuntimeConfigs.call(void 0, inherited, ...layoutConfigs, routeConfig),
|
|
2017
2023
|
`Route "${pattern}"`
|
|
2018
2024
|
);
|
|
2019
2025
|
}
|
|
@@ -2388,7 +2394,7 @@ var _RouteManager = class _RouteManager {
|
|
|
2388
2394
|
const mdxConfig = _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, this.config.mdx);
|
|
2389
2395
|
const components = await _chunkI5YBCWQ6cjs.loadFarmMdxComponents.call(void 0, mdxConfig, {
|
|
2390
2396
|
root: this.config.root,
|
|
2391
|
-
loadModule: this.viteServer ? (componentModulePath) => this.viteServer
|
|
2397
|
+
loadModule: this.viteServer ? (componentModulePath) => _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, this.viteServer, componentModulePath) : void 0
|
|
2392
2398
|
});
|
|
2393
2399
|
return await _chunkI5YBCWQ6cjs.createFarmMarkdownRouteModuleFromFile.call(void 0, modulePath, {
|
|
2394
2400
|
components,
|
|
@@ -2396,7 +2402,7 @@ var _RouteManager = class _RouteManager {
|
|
|
2396
2402
|
});
|
|
2397
2403
|
}
|
|
2398
2404
|
if (this.viteServer) {
|
|
2399
|
-
const module = await this.viteServer
|
|
2405
|
+
const module = await _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, this.viteServer, modulePath);
|
|
2400
2406
|
return module;
|
|
2401
2407
|
} else {
|
|
2402
2408
|
const module = await import(
|
|
@@ -2421,7 +2427,7 @@ var _RouteManager = class _RouteManager {
|
|
|
2421
2427
|
return createLayoutModuleFromProgrammaticLayout(programmaticLayout);
|
|
2422
2428
|
}
|
|
2423
2429
|
if (this.viteServer) {
|
|
2424
|
-
const module = await this.viteServer
|
|
2430
|
+
const module = await _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, this.viteServer, modulePath);
|
|
2425
2431
|
return module;
|
|
2426
2432
|
} else {
|
|
2427
2433
|
const module = await import(
|
|
@@ -2483,7 +2489,7 @@ var _RouteManager = class _RouteManager {
|
|
|
2483
2489
|
appDir
|
|
2484
2490
|
);
|
|
2485
2491
|
const canonicalPageGroups = /* @__PURE__ */ new Map();
|
|
2486
|
-
for (const file of pageFiles.filter((candidate) =>
|
|
2492
|
+
for (const file of pageFiles.filter((candidate) => _chunkXFFQSD2Fcjs.parseRouteSlotFile.call(void 0, candidate) === null)) {
|
|
2487
2493
|
const route = _chunk5QIKR7RRcjs.parseRoutePath.call(void 0, file);
|
|
2488
2494
|
const pattern = this.createRoutePattern(route);
|
|
2489
2495
|
const group = canonicalPageGroups.get(pattern);
|
|
@@ -2556,7 +2562,7 @@ var _RouteManager = class _RouteManager {
|
|
|
2556
2562
|
}
|
|
2557
2563
|
}
|
|
2558
2564
|
for (const file of [...pageFiles, ...slotDefaultFiles]) {
|
|
2559
|
-
const slot =
|
|
2565
|
+
const slot = _chunkXFFQSD2Fcjs.parseRouteSlotFile.call(void 0, file);
|
|
2560
2566
|
if (!slot) continue;
|
|
2561
2567
|
const modulePath = path9.default.join(appDir, file);
|
|
2562
2568
|
const pattern = this.createRoutePattern(slot.route);
|
|
@@ -2578,7 +2584,7 @@ var _RouteManager = class _RouteManager {
|
|
|
2578
2584
|
ownerPattern,
|
|
2579
2585
|
interception: slot.interception,
|
|
2580
2586
|
fallback: slot.fallback,
|
|
2581
|
-
containerId:
|
|
2587
|
+
containerId: _chunkXFFQSD2Fcjs.createRouteSlotContainerId.call(void 0, slot.name, ownerPattern)
|
|
2582
2588
|
});
|
|
2583
2589
|
}
|
|
2584
2590
|
for (const file of metadataImageFiles) {
|
|
@@ -2635,7 +2641,7 @@ var _RouteManager = class _RouteManager {
|
|
|
2635
2641
|
}
|
|
2636
2642
|
}
|
|
2637
2643
|
async discoverProgrammaticRoutes(source) {
|
|
2638
|
-
const manifests = await
|
|
2644
|
+
const manifests = await _chunkN4RLRSWWcjs.loadProgrammaticRouteManifests.call(void 0, {
|
|
2639
2645
|
root: source.root,
|
|
2640
2646
|
srcDir: source.srcDir,
|
|
2641
2647
|
loadModule: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (filePath) => this.loadProgrammaticRoutesModule(filePath), "loadModule")
|
|
@@ -2695,11 +2701,11 @@ var _RouteManager = class _RouteManager {
|
|
|
2695
2701
|
async loadProgrammaticRoutesModule(filePath) {
|
|
2696
2702
|
if (this.viteServer) {
|
|
2697
2703
|
const viteRoot = _optionalChain([this, 'access', _134 => _134.viteServer, 'access', _135 => _135.config, 'optionalAccess', _136 => _136.root]) || this.config.root || process.cwd();
|
|
2698
|
-
return await this.viteServer
|
|
2704
|
+
return await _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, this.viteServer, _chunk5QIKR7RRcjs.toViteModuleId.call(void 0, filePath, viteRoot));
|
|
2699
2705
|
}
|
|
2700
2706
|
return await import(
|
|
2701
2707
|
/* @vite-ignore */
|
|
2702
|
-
|
|
2708
|
+
_chunkBMWDEBXOcjs.toFileModuleUrl.call(void 0, filePath)
|
|
2703
2709
|
);
|
|
2704
2710
|
}
|
|
2705
2711
|
/**
|
|
@@ -2816,7 +2822,7 @@ var _RouteManager = class _RouteManager {
|
|
|
2816
2822
|
pattern: entry.pattern
|
|
2817
2823
|
}));
|
|
2818
2824
|
const i18n = this.getI18nConfig();
|
|
2819
|
-
const result = await
|
|
2825
|
+
const result = await _chunkXFFQSD2Fcjs.collectSSGPages.call(void 0, routes, (filePath) => this.loadRouteModule(filePath), {
|
|
2820
2826
|
suggestStaticRendering: shouldSuggestStaticRenderingForI18n(i18n)
|
|
2821
2827
|
});
|
|
2822
2828
|
if (!i18n) {
|
|
@@ -2861,7 +2867,7 @@ var _RouteManager = class _RouteManager {
|
|
|
2861
2867
|
async isRouteSSG(modulePath) {
|
|
2862
2868
|
try {
|
|
2863
2869
|
const mod = await this.loadRouteModule(modulePath);
|
|
2864
|
-
const rendering = await
|
|
2870
|
+
const rendering = await _chunkXFFQSD2Fcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
|
|
2865
2871
|
return rendering.ssg;
|
|
2866
2872
|
} catch (e10) {
|
|
2867
2873
|
return false;
|
|
@@ -2873,7 +2879,7 @@ var _RouteManager = class _RouteManager {
|
|
|
2873
2879
|
async hasRouteISR(modulePath) {
|
|
2874
2880
|
try {
|
|
2875
2881
|
const mod = await this.loadRouteModule(modulePath);
|
|
2876
|
-
const rendering = await
|
|
2882
|
+
const rendering = await _chunkXFFQSD2Fcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
|
|
2877
2883
|
return rendering.ssg && typeof rendering.revalidate === "number" && rendering.revalidate > 0;
|
|
2878
2884
|
} catch (e11) {
|
|
2879
2885
|
return false;
|
|
@@ -2885,7 +2891,7 @@ var _RouteManager = class _RouteManager {
|
|
|
2885
2891
|
async getRouteRevalidateInterval(modulePath) {
|
|
2886
2892
|
try {
|
|
2887
2893
|
const mod = await this.loadRouteModule(modulePath);
|
|
2888
|
-
const rendering = await
|
|
2894
|
+
const rendering = await _chunkXFFQSD2Fcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
|
|
2889
2895
|
return rendering.revalidate;
|
|
2890
2896
|
} catch (e12) {
|
|
2891
2897
|
return void 0;
|
|
@@ -3012,18 +3018,29 @@ function collectDevStylesheetUrls(modules, alreadyLinked = ALREADY_LINKED) {
|
|
|
3012
3018
|
_chunkS3JO3N4Hcjs.__name.call(void 0, collectDevStylesheetUrls, "collectDevStylesheetUrls");
|
|
3013
3019
|
|
|
3014
3020
|
// src/server/full-document.ts
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3021
|
+
var CONTENTS_WRAPPER = /^<div\b[^>]*style="display\s*:\s*contents"[^>]*>/i;
|
|
3022
|
+
var HOISTED_HEAD_ELEMENT = /^(?:<(?:meta|link|base)\b[^>]*>|<title\b[^>]*>[\s\S]*?<\/title>)/i;
|
|
3023
|
+
function peelDocumentPrefix(markup) {
|
|
3024
|
+
let inner = markup.replace(/^\s+/, "");
|
|
3025
|
+
let hoisted = "";
|
|
3018
3026
|
let match;
|
|
3019
|
-
while (match =
|
|
3020
|
-
|
|
3027
|
+
while (match = _nullishCoalesce(CONTENTS_WRAPPER.exec(inner), () => ( HOISTED_HEAD_ELEMENT.exec(inner)))) {
|
|
3028
|
+
if (!/^<div/i.test(match[0])) hoisted += match[0];
|
|
3029
|
+
inner = inner.slice(match[0].length).replace(/^\s+/, "");
|
|
3030
|
+
}
|
|
3031
|
+
return { inner, hoisted };
|
|
3032
|
+
}
|
|
3033
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, peelDocumentPrefix, "peelDocumentPrefix");
|
|
3034
|
+
function restoreHoistedHead(document, hoisted) {
|
|
3035
|
+
if (!hoisted) return document;
|
|
3036
|
+
if (/<head[\s>]/i.test(document)) {
|
|
3037
|
+
return document.replace(/<head\b[^>]*>/i, (open) => open + hoisted);
|
|
3021
3038
|
}
|
|
3022
|
-
return
|
|
3039
|
+
return document.replace(/<html\b[^>]*>/i, (open) => `${open}<head>${hoisted}</head>`);
|
|
3023
3040
|
}
|
|
3024
|
-
_chunkS3JO3N4Hcjs.__name.call(void 0,
|
|
3041
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, restoreHoistedHead, "restoreHoistedHead");
|
|
3025
3042
|
function extractFarmFullDocument(markup) {
|
|
3026
|
-
const inner =
|
|
3043
|
+
const { inner, hoisted } = peelDocumentPrefix(markup);
|
|
3027
3044
|
if (!/^<!doctype/i.test(inner) && !/^<html[\s>]/i.test(inner)) return null;
|
|
3028
3045
|
const start = markup.search(/<!doctype|<html[\s>]/i);
|
|
3029
3046
|
const lower = markup.toLowerCase();
|
|
@@ -3041,14 +3058,15 @@ function extractFarmFullDocument(markup) {
|
|
|
3041
3058
|
if (streamedTail) {
|
|
3042
3059
|
document = document.replace(/<\/body>/i, () => `${streamedTail}</body>`);
|
|
3043
3060
|
}
|
|
3044
|
-
return document;
|
|
3061
|
+
return restoreHoistedHead(document, hoisted);
|
|
3045
3062
|
}
|
|
3046
3063
|
_chunkS3JO3N4Hcjs.__name.call(void 0, extractFarmFullDocument, "extractFarmFullDocument");
|
|
3047
|
-
function
|
|
3048
|
-
const inner =
|
|
3049
|
-
|
|
3064
|
+
function classifyFarmDocumentPrefix(markup) {
|
|
3065
|
+
const { inner } = peelDocumentPrefix(markup);
|
|
3066
|
+
if (/^<!doctype/i.test(inner) || /^<html[\s>]/i.test(inner)) return "document";
|
|
3067
|
+
return inner === "" ? "pending" : "fragment";
|
|
3050
3068
|
}
|
|
3051
|
-
_chunkS3JO3N4Hcjs.__name.call(void 0,
|
|
3069
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, classifyFarmDocumentPrefix, "classifyFarmDocumentPrefix");
|
|
3052
3070
|
function ensureFarmDocumentHead(markup) {
|
|
3053
3071
|
if (/<head[\s>]/i.test(markup)) return markup;
|
|
3054
3072
|
return markup.replace(/<html([^>]*)>/i, (_match, attributes) => {
|
|
@@ -4601,6 +4619,7 @@ function warnSuppressedAsyncHydrationOnce(modulePath, reason) {
|
|
|
4601
4619
|
}
|
|
4602
4620
|
_chunkS3JO3N4Hcjs.__name.call(void 0, warnSuppressedAsyncHydrationOnce, "warnSuppressedAsyncHydrationOnce");
|
|
4603
4621
|
var fullDocumentRoutes = /* @__PURE__ */ new Set();
|
|
4622
|
+
var documentLayouts = /* @__PURE__ */ new WeakMap();
|
|
4604
4623
|
function hasRequestHeader(req, name) {
|
|
4605
4624
|
const value = req.headers[name.toLowerCase()];
|
|
4606
4625
|
return Array.isArray(value) ? value.length > 0 : Boolean(value);
|
|
@@ -4791,7 +4810,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
4791
4810
|
if (_optionalChain([this, 'access', _148 => _148.config, 'access', _149 => _149.notFound, 'optionalAccess', _150 => _150.component, 'optionalAccess', _151 => _151.trim, 'call', _152 => _152()])) {
|
|
4792
4811
|
resolveFarmNotFoundComponentPath(this.config, _chunkY4YMF2NQcjs.getFarmAppDirectories.call(void 0, this.config));
|
|
4793
4812
|
}
|
|
4794
|
-
const loaded = _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, this.config.renderer) ? await import("./renderer/react/server.cjs") : this.viteServer ? await
|
|
4813
|
+
const loaded = _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, this.config.renderer) ? await import("./renderer/react/server.cjs") : this.viteServer ? await _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, this.viteServer, this.config.renderer.server) : await import(_url.pathToFileURL.call(void 0,
|
|
4795
4814
|
_chunkTFAXUHWXcjs.resolveFarmRendererModule.call(void 0,
|
|
4796
4815
|
this.config.root || process.cwd(),
|
|
4797
4816
|
this.config.renderer.server
|
|
@@ -5024,7 +5043,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
5024
5043
|
* Check if a path should be served from SSG cache
|
|
5025
5044
|
*/
|
|
5026
5045
|
async shouldServeSSG(pathname) {
|
|
5027
|
-
const ssgPage =
|
|
5046
|
+
const ssgPage = _chunkXFFQSD2Fcjs.matchSSGPage.call(void 0, pathname, this.ssgManifest);
|
|
5028
5047
|
if (!ssgPage) return null;
|
|
5029
5048
|
const cached = await this.getCachedSSGPage(pathname);
|
|
5030
5049
|
if (cached && await this.dataCache.isStaleAsync(cached)) {
|
|
@@ -5190,7 +5209,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
5190
5209
|
pageProps,
|
|
5191
5210
|
pathname: page.urlPath
|
|
5192
5211
|
});
|
|
5193
|
-
const { title, tags, hasFavicon } =
|
|
5212
|
+
const { title, tags, hasFavicon } = _chunkKNPRCKXKcjs.renderMetadataHead.call(void 0, mergedMetadata);
|
|
5194
5213
|
const metadataHead = `${hasFavicon ? "" : '<link rel="icon" href="data:,">\n '}<title>${title}</title>${tags}`;
|
|
5195
5214
|
const fullDocument = this.createFullHTML(
|
|
5196
5215
|
html,
|
|
@@ -5439,7 +5458,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
5439
5458
|
throw error;
|
|
5440
5459
|
}
|
|
5441
5460
|
}
|
|
5442
|
-
const renderingConfig = await
|
|
5461
|
+
const renderingConfig = await _chunkXFFQSD2Fcjs.resolveRouteRenderingConfigFromFile.call(void 0,
|
|
5443
5462
|
routeModule,
|
|
5444
5463
|
route.modulePath,
|
|
5445
5464
|
{ experimentalPPR: _optionalChain([this, 'access', _176 => _176.config, 'access', _177 => _177.experimental, 'optionalAccess', _178 => _178.ppr]) === true }
|
|
@@ -5903,7 +5922,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
5903
5922
|
path9.resolve(this.config.root, provider.component.module),
|
|
5904
5923
|
this.config.root
|
|
5905
5924
|
) : provider.component.module;
|
|
5906
|
-
const providerModule = this.viteServer ? await this.viteServer
|
|
5925
|
+
const providerModule = this.viteServer ? await _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, this.viteServer, providerModuleId) : await importRuntimeModule(
|
|
5907
5926
|
provider.component.module.startsWith(".") ? _url.pathToFileURL.call(void 0, path9.resolve(this.config.root, provider.component.module)).href : provider.component.module
|
|
5908
5927
|
);
|
|
5909
5928
|
ProviderComponent = providerModule[provider.component.export || "default"];
|
|
@@ -5942,9 +5961,9 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
5942
5961
|
async resolveRouteMetadata(options) {
|
|
5943
5962
|
let metadata = {};
|
|
5944
5963
|
for (const layoutModule of options.layoutModules) {
|
|
5945
|
-
metadata =
|
|
5964
|
+
metadata = _chunkKNPRCKXKcjs.mergeMetadata.call(void 0, metadata, layoutModule.metadata);
|
|
5946
5965
|
if (typeof layoutModule.generateMetadata === "function") {
|
|
5947
|
-
metadata =
|
|
5966
|
+
metadata = _chunkKNPRCKXKcjs.mergeMetadata.call(void 0,
|
|
5948
5967
|
metadata,
|
|
5949
5968
|
await layoutModule.generateMetadata({
|
|
5950
5969
|
params: options.pageProps.params
|
|
@@ -5952,9 +5971,9 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
5952
5971
|
);
|
|
5953
5972
|
}
|
|
5954
5973
|
}
|
|
5955
|
-
metadata =
|
|
5974
|
+
metadata = _chunkKNPRCKXKcjs.mergeMetadata.call(void 0, metadata, options.routeModule.metadata);
|
|
5956
5975
|
if (typeof options.routeModule.generateMetadata === "function") {
|
|
5957
|
-
metadata =
|
|
5976
|
+
metadata = _chunkKNPRCKXKcjs.mergeMetadata.call(void 0,
|
|
5958
5977
|
metadata,
|
|
5959
5978
|
await options.routeModule.generateMetadata(options.pageProps)
|
|
5960
5979
|
);
|
|
@@ -5977,7 +5996,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
5977
5996
|
for (const kind of ["opengraph", "twitter"]) {
|
|
5978
5997
|
const reference = await this.resolveMetadataImageReference(kind, options.pathname);
|
|
5979
5998
|
if (reference) {
|
|
5980
|
-
metadata =
|
|
5999
|
+
metadata = _chunkKNPRCKXKcjs.addMetadataImageReference.call(void 0, metadata, reference);
|
|
5981
6000
|
}
|
|
5982
6001
|
}
|
|
5983
6002
|
const snapshot = _chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
@@ -5985,7 +6004,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
5985
6004
|
snapshot ? _chunkBIDYX3SLcjs.localizeFarmHref.call(void 0, options.pathname, snapshot.locale, snapshot) : options.pathname,
|
|
5986
6005
|
this.config.basePath
|
|
5987
6006
|
);
|
|
5988
|
-
metadata =
|
|
6007
|
+
metadata = _chunkKNPRCKXKcjs.addMetadataMarkdownAlternate.call(void 0,
|
|
5989
6008
|
metadata,
|
|
5990
6009
|
_chunkBBVSJVBZcjs.getFarmMarkdownAlternatePath.call(void 0, _chunkBBVSJVBZcjs.resolveMarkdownConfig.call(void 0, this.config.md), publicPathname)
|
|
5991
6010
|
);
|
|
@@ -6438,7 +6457,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6438
6457
|
tags: metaTags,
|
|
6439
6458
|
hasFavicon,
|
|
6440
6459
|
hasExplicitTitle
|
|
6441
|
-
} =
|
|
6460
|
+
} = _chunkKNPRCKXKcjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
|
|
6442
6461
|
pathname: getFarmMetadataPathname(req),
|
|
6443
6462
|
jsonLd: _optionalChain([this, 'access', _232 => _232.config, 'access', _233 => _233.agent, 'optionalAccess', _234 => _234.jsonLd])
|
|
6444
6463
|
});
|
|
@@ -6530,10 +6549,43 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6530
6549
|
_optionalChain([clearMiddlewareData, 'optionalCall', _238 => _238()]);
|
|
6531
6550
|
}
|
|
6532
6551
|
}
|
|
6552
|
+
/**
|
|
6553
|
+
* Whether the root layout returns its own `<html>` document, checked as the client's layout
|
|
6554
|
+
* boundary checks it: call a plain synchronous layout and look at what it returns. Knowing
|
|
6555
|
+
* this up front keeps a route's first request on the buffered path too; a layout this cannot
|
|
6556
|
+
* call (async, a class, or one using hooks) falls back to detection from the stream.
|
|
6557
|
+
*/
|
|
6558
|
+
async rootLayoutRendersDocument() {
|
|
6559
|
+
if (typeof this.routeManager.getLayouts !== "function") return false;
|
|
6560
|
+
const rootLayout = this.routeManager.getLayouts().get("/");
|
|
6561
|
+
if (!rootLayout) return false;
|
|
6562
|
+
try {
|
|
6563
|
+
const Layout = (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).default;
|
|
6564
|
+
if (typeof Layout !== "function" || _optionalChain([Layout, 'access', _239 => _239.prototype, 'optionalAccess', _240 => _240.isReactComponent]) || _optionalChain([Layout, 'access', _241 => _241.constructor, 'optionalAccess', _242 => _242.name]) === "AsyncFunction") {
|
|
6565
|
+
return false;
|
|
6566
|
+
}
|
|
6567
|
+
const cached = documentLayouts.get(Layout);
|
|
6568
|
+
if (cached !== void 0) return cached;
|
|
6569
|
+
let rendersDocument = false;
|
|
6570
|
+
try {
|
|
6571
|
+
const rendered = Layout({
|
|
6572
|
+
children: null,
|
|
6573
|
+
params: {}
|
|
6574
|
+
});
|
|
6575
|
+
rendersDocument = this.rendererRuntime.isValidElement(rendered) && rendered.type === "html";
|
|
6576
|
+
} catch (e18) {
|
|
6577
|
+
rendersDocument = false;
|
|
6578
|
+
}
|
|
6579
|
+
documentLayouts.set(Layout, rendersDocument);
|
|
6580
|
+
return rendersDocument;
|
|
6581
|
+
} catch (e19) {
|
|
6582
|
+
return false;
|
|
6583
|
+
}
|
|
6584
|
+
}
|
|
6533
6585
|
async renderWithSSR(element, req, res, clearMiddlewareData, options = {}) {
|
|
6534
6586
|
const renderToPipeableStream = this.rendererRuntime.renderToPipeableStream;
|
|
6535
6587
|
const fullDocumentRouteKey = options.observabilityRoute || req.__FARM_ROUTE__ || req.url || "/";
|
|
6536
|
-
if (!renderToPipeableStream || fullDocumentRoutes.has(fullDocumentRouteKey)) {
|
|
6588
|
+
if (!renderToPipeableStream || fullDocumentRoutes.has(fullDocumentRouteKey) || await this.rootLayoutRendersDocument()) {
|
|
6537
6589
|
return this.renderBufferedSSR(element, req, res, clearMiddlewareData, options);
|
|
6538
6590
|
}
|
|
6539
6591
|
return new Promise((resolve5, reject) => {
|
|
@@ -6643,9 +6695,9 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6643
6695
|
title,
|
|
6644
6696
|
tags: metaTags,
|
|
6645
6697
|
hasFavicon
|
|
6646
|
-
} =
|
|
6698
|
+
} = _chunkKNPRCKXKcjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
|
|
6647
6699
|
pathname: getFarmMetadataPathname(req),
|
|
6648
|
-
jsonLd: _optionalChain([this, 'access',
|
|
6700
|
+
jsonLd: _optionalChain([this, 'access', _243 => _243.config, 'access', _244 => _244.agent, 'optionalAccess', _245 => _245.jsonLd])
|
|
6649
6701
|
});
|
|
6650
6702
|
const i18nSnapshot = _chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
6651
6703
|
const i18nAlternateTags = i18nSnapshot ? renderI18nAlternateLinks(
|
|
@@ -6669,7 +6721,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6669
6721
|
nonce: cspNonce,
|
|
6670
6722
|
onShellReady() {
|
|
6671
6723
|
if (pendingNavigationError) {
|
|
6672
|
-
_optionalChain([abort, 'optionalCall',
|
|
6724
|
+
_optionalChain([abort, 'optionalCall', _246 => _246(pendingNavigationError)]);
|
|
6673
6725
|
if (clearMiddlewareData) {
|
|
6674
6726
|
clearMiddlewareData();
|
|
6675
6727
|
}
|
|
@@ -6687,7 +6739,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6687
6739
|
console.log(`[FARM STREAM] onShellReady at ${shellReadyMs}ms`);
|
|
6688
6740
|
}
|
|
6689
6741
|
const shell = `<!DOCTYPE html>
|
|
6690
|
-
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
6742
|
+
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _247 => _247.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
|
|
6691
6743
|
<head>
|
|
6692
6744
|
${themeDocument.head}
|
|
6693
6745
|
<meta charset="utf-8">
|
|
@@ -6706,17 +6758,21 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6706
6758
|
<div id="root">`;
|
|
6707
6759
|
const securedShell = secureDocumentHTML(shell);
|
|
6708
6760
|
htmlParts.push(securedShell);
|
|
6709
|
-
_optionalChain([staticShellParts, 'optionalAccess',
|
|
6761
|
+
_optionalChain([staticShellParts, 'optionalAccess', _248 => _248.push, 'call', _249 => _249(securedShell)]);
|
|
6710
6762
|
let firstChunk = true;
|
|
6711
6763
|
let checkedFullDocument = false;
|
|
6764
|
+
let documentPrefix = "";
|
|
6712
6765
|
const cspNonceRewriter = cspNonce ? _chunkISTFC3MZcjs.createFarmCspNonceRewriter.call(void 0, cspNonce) : void 0;
|
|
6713
6766
|
const cspStreamDecoder = cspNonceRewriter ? new TextDecoder() : void 0;
|
|
6714
6767
|
const recordRenderedChunk = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (chunkText) => {
|
|
6715
6768
|
if (!chunkText) return;
|
|
6716
6769
|
if (!checkedFullDocument) {
|
|
6717
|
-
|
|
6718
|
-
|
|
6719
|
-
|
|
6770
|
+
documentPrefix += chunkText;
|
|
6771
|
+
const prefix = classifyFarmDocumentPrefix(documentPrefix);
|
|
6772
|
+
if (prefix !== "pending") {
|
|
6773
|
+
checkedFullDocument = true;
|
|
6774
|
+
documentPrefix = "";
|
|
6775
|
+
if (prefix === "document") fullDocumentRoutes.add(fullDocumentRouteKey);
|
|
6720
6776
|
}
|
|
6721
6777
|
}
|
|
6722
6778
|
htmlParts.push(chunkText);
|
|
@@ -6729,7 +6785,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6729
6785
|
staticShellClosed = true;
|
|
6730
6786
|
if (!suspenseHoleEmitted) {
|
|
6731
6787
|
suspenseHoleEmitted = true;
|
|
6732
|
-
_optionalChain([options, 'access',
|
|
6788
|
+
_optionalChain([options, 'access', _250 => _250.onSuspenseHoleDetected, 'optionalCall', _251 => _251()]);
|
|
6733
6789
|
}
|
|
6734
6790
|
} else {
|
|
6735
6791
|
staticShellParts.push(chunkText);
|
|
@@ -6886,12 +6942,12 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6886
6942
|
return await this.routeManager.loadRouteModule(notFoundPath);
|
|
6887
6943
|
}
|
|
6888
6944
|
async loadNotFoundComponent() {
|
|
6889
|
-
return await _asyncNullishCoalesce(await _asyncOptionalChain([(await this.loadNotFoundModule()), 'optionalAccess', async
|
|
6945
|
+
return await _asyncNullishCoalesce(await _asyncOptionalChain([(await this.loadNotFoundModule()), 'optionalAccess', async _252 => _252.default]), async () => ( null));
|
|
6890
6946
|
}
|
|
6891
6947
|
/** The not-found document's head: layout and not-found metadata, as production renders it. */
|
|
6892
6948
|
async notFoundMetadataHead(layoutModule, notFoundModule) {
|
|
6893
|
-
const metadata = await
|
|
6894
|
-
const { title, tags, hasFavicon } =
|
|
6949
|
+
const metadata = await _chunkKNPRCKXKcjs.resolveFarmNotFoundMetadata.call(void 0, [layoutModule], notFoundModule);
|
|
6950
|
+
const { title, tags, hasFavicon } = _chunkKNPRCKXKcjs.renderMetadataHead.call(void 0, metadata);
|
|
6895
6951
|
return {
|
|
6896
6952
|
head: `${hasFavicon ? "" : '<link rel="icon" href="data:,">\n '}<title>${title}</title>${tags}`,
|
|
6897
6953
|
metadata
|
|
@@ -6912,7 +6968,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6912
6968
|
return _chunkOYDRPBBVcjs.createLateRedirectRecovery.call(void 0, this.localizeRedirectUrl(_chunkOX6O6WVAcjs.getFarmRedirectError.call(void 0, error).url));
|
|
6913
6969
|
}
|
|
6914
6970
|
const pathname = _chunk5ZSWG4UXcjs.resolveFarmRequestURL.call(void 0, req, {
|
|
6915
|
-
trustProxy: _optionalChain([this, 'access',
|
|
6971
|
+
trustProxy: _optionalChain([this, 'access', _253 => _253.config, 'access', _254 => _254.server, 'optionalAccess', _255 => _255.trustProxy])
|
|
6916
6972
|
}).pathname;
|
|
6917
6973
|
let content = this.defaultNotFoundContent();
|
|
6918
6974
|
const NotFoundComponent = await this.loadNotFoundComponent();
|
|
@@ -6932,7 +6988,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6932
6988
|
async render404(req, res) {
|
|
6933
6989
|
res.statusCode = 404;
|
|
6934
6990
|
const pathname = _chunk5ZSWG4UXcjs.resolveFarmRequestURL.call(void 0, req, {
|
|
6935
|
-
trustProxy: _optionalChain([this, 'access',
|
|
6991
|
+
trustProxy: _optionalChain([this, 'access', _256 => _256.config, 'access', _257 => _257.server, 'optionalAccess', _258 => _258.trustProxy])
|
|
6936
6992
|
}).pathname;
|
|
6937
6993
|
const acceptHeader = req.headers.accept;
|
|
6938
6994
|
const accept = Array.isArray(acceptHeader) ? acceptHeader.join(",") : acceptHeader;
|
|
@@ -6960,9 +7016,9 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6960
7016
|
);
|
|
6961
7017
|
if (notFoundPath) {
|
|
6962
7018
|
const notFoundModule = await this.loadNotFoundModule();
|
|
6963
|
-
const NotFoundComponent = _nullishCoalesce(_optionalChain([notFoundModule, 'optionalAccess',
|
|
7019
|
+
const NotFoundComponent = _nullishCoalesce(_optionalChain([notFoundModule, 'optionalAccess', _259 => _259.default]), () => ( null));
|
|
6964
7020
|
if (NotFoundComponent) {
|
|
6965
|
-
const LayoutComponent = _nullishCoalesce(_optionalChain([layoutModule, 'optionalAccess',
|
|
7021
|
+
const LayoutComponent = _nullishCoalesce(_optionalChain([layoutModule, 'optionalAccess', _260 => _260.default]), () => ( null));
|
|
6966
7022
|
let element = this.rendererRuntime.createElement(NotFoundComponent, { pathname });
|
|
6967
7023
|
if (LayoutComponent) {
|
|
6968
7024
|
element = this.rendererRuntime.createElement(LayoutComponent, {
|
|
@@ -6999,7 +7055,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6999
7055
|
res.statusCode = statusCode;
|
|
7000
7056
|
const isDev = process.env.NODE_ENV === "development";
|
|
7001
7057
|
const requestUrl = _chunk5ZSWG4UXcjs.resolveFarmRequestURL.call(void 0, req, {
|
|
7002
|
-
trustProxy: _optionalChain([this, 'access',
|
|
7058
|
+
trustProxy: _optionalChain([this, 'access', _261 => _261.config, 'access', _262 => _262.server, 'optionalAccess', _263 => _263.trustProxy])
|
|
7003
7059
|
});
|
|
7004
7060
|
const diagnostics = isDev ? createDefaultErrorDiagnostics(error, this.config.root || process.cwd()) : void 0;
|
|
7005
7061
|
const statusText = _chunkOYDRPBBVcjs.getDefaultErrorStatusText.call(void 0, statusCode);
|
|
@@ -7008,12 +7064,12 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7008
7064
|
statusText,
|
|
7009
7065
|
requestPath: requestUrl.pathname,
|
|
7010
7066
|
method: req.method || "GET",
|
|
7011
|
-
message: _optionalChain([diagnostics, 'optionalAccess',
|
|
7012
|
-
errorName: _optionalChain([diagnostics, 'optionalAccess',
|
|
7013
|
-
stack: _optionalChain([diagnostics, 'optionalAccess',
|
|
7014
|
-
sourceFrame: _optionalChain([diagnostics, 'optionalAccess',
|
|
7067
|
+
message: _optionalChain([diagnostics, 'optionalAccess', _264 => _264.message]),
|
|
7068
|
+
errorName: _optionalChain([diagnostics, 'optionalAccess', _265 => _265.name]),
|
|
7069
|
+
stack: _optionalChain([diagnostics, 'optionalAccess', _266 => _266.stack]),
|
|
7070
|
+
sourceFrame: _optionalChain([diagnostics, 'optionalAccess', _267 => _267.sourceFrame]),
|
|
7015
7071
|
development: isDev,
|
|
7016
|
-
farmVersion:
|
|
7072
|
+
farmVersion: _chunkQ2TUENW2cjs.FARM_VERSION,
|
|
7017
7073
|
nodeVersion: process.version,
|
|
7018
7074
|
mode: isDev ? "development" : "production"
|
|
7019
7075
|
});
|
|
@@ -7038,8 +7094,8 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7038
7094
|
*/
|
|
7039
7095
|
getI18nAlternateOptions(req, metadata) {
|
|
7040
7096
|
return {
|
|
7041
|
-
metadataBase: _optionalChain([metadata, 'optionalAccess',
|
|
7042
|
-
origin: req ? _chunk5ZSWG4UXcjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access',
|
|
7097
|
+
metadataBase: _optionalChain([metadata, 'optionalAccess', _268 => _268.metadataBase]),
|
|
7098
|
+
origin: req ? _chunk5ZSWG4UXcjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _269 => _269.config, 'access', _270 => _270.server, 'optionalAccess', _271 => _271.trustProxy]) }).origin : void 0
|
|
7043
7099
|
};
|
|
7044
7100
|
}
|
|
7045
7101
|
createFullHTML(content, isClientComponent = false, requestPath = "/", metadataHead, alternates = {}) {
|
|
@@ -7061,7 +7117,7 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
|
|
|
7061
7117
|
this.config.basePath,
|
|
7062
7118
|
_chunkXWAWFQFScjs.getTheme.call(void 0, )
|
|
7063
7119
|
);
|
|
7064
|
-
const rendererHydrationScript = _optionalChain([this, 'access',
|
|
7120
|
+
const rendererHydrationScript = _optionalChain([this, 'access', _272 => _272.rendererRuntime, 'access', _273 => _273.generateHydrationScript, 'optionalCall', _274 => _274()]) || "";
|
|
7065
7121
|
const fullDocument = extractFarmFullDocument(content);
|
|
7066
7122
|
if (fullDocument) {
|
|
7067
7123
|
return composeFarmFullDocument(
|
|
@@ -7090,7 +7146,7 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
|
|
|
7090
7146
|
);
|
|
7091
7147
|
}
|
|
7092
7148
|
return `<!DOCTYPE html>
|
|
7093
|
-
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
7149
|
+
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _275 => _275.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
|
|
7094
7150
|
<head>
|
|
7095
7151
|
${themeDocument.head}
|
|
7096
7152
|
<meta charset="utf-8">
|
|
@@ -7123,7 +7179,7 @@ ${clientScript}
|
|
|
7123
7179
|
res.setHeader(_chunkC5GUTBZKcjs.FARM_DEPLOYMENT_ID_HEADER, deploymentId);
|
|
7124
7180
|
if ((req.method || "GET").toUpperCase() !== "GET") return;
|
|
7125
7181
|
const forwardedProto = req.headers["x-forwarded-proto"];
|
|
7126
|
-
const isSecure = _optionalChain([(Array.isArray(forwardedProto) ? forwardedProto[0] : forwardedProto), 'optionalAccess',
|
|
7182
|
+
const isSecure = _optionalChain([(Array.isArray(forwardedProto) ? forwardedProto[0] : forwardedProto), 'optionalAccess', _276 => _276.split, 'call', _277 => _277(","), 'access', _278 => _278[0], 'optionalAccess', _279 => _279.trim, 'call', _280 => _280()]) === "https" || Boolean(_optionalChain([req, 'access', _281 => _281.socket, 'optionalAccess', _282 => _282.encrypted]));
|
|
7127
7183
|
const cookie = _chunkC5GUTBZKcjs.createFarmDeploymentCookie.call(void 0, deploymentId, this.config.basePath || "/", isSecure);
|
|
7128
7184
|
const existing = res.getHeader("Set-Cookie");
|
|
7129
7185
|
if (Array.isArray(existing)) {
|
|
@@ -7220,7 +7276,7 @@ var _FarmApp = class _FarmApp {
|
|
|
7220
7276
|
workflows: _chunkK6FNHVDRcjs.resolveWorkflowsConfig.call(void 0, config.workflows),
|
|
7221
7277
|
api: normalizeFarmAppAPIConfig(config.api),
|
|
7222
7278
|
middleware: config.middleware || {},
|
|
7223
|
-
routeRules:
|
|
7279
|
+
routeRules: _chunkQ5B3KJBPcjs.normalizeRouteRules.call(void 0, config.routeRules),
|
|
7224
7280
|
context: config.context || (() => void 0),
|
|
7225
7281
|
server: _chunkEM6SBQKMcjs.resolveFarmServerConfig.call(void 0, config.server),
|
|
7226
7282
|
serverActions: _chunkT5CERMEHcjs.resolveServerActionsConfig.call(void 0, config.serverActions),
|
|
@@ -7254,10 +7310,10 @@ var _FarmApp = class _FarmApp {
|
|
|
7254
7310
|
env: config.env || { server: {}, public: {} },
|
|
7255
7311
|
suppressLintOnLink: _nullishCoalesce(config.suppressLintOnLink, () => ( false)),
|
|
7256
7312
|
experimental: {
|
|
7257
|
-
serverComponents: _nullishCoalesce(_optionalChain([config, 'access',
|
|
7258
|
-
serverActions: _nullishCoalesce(_optionalChain([config, 'access',
|
|
7259
|
-
isolatedClientHydration: _nullishCoalesce(_optionalChain([config, 'access',
|
|
7260
|
-
ppr: _nullishCoalesce(_optionalChain([config, 'access',
|
|
7313
|
+
serverComponents: _nullishCoalesce(_optionalChain([config, 'access', _283 => _283.experimental, 'optionalAccess', _284 => _284.serverComponents]), () => ( false)),
|
|
7314
|
+
serverActions: _nullishCoalesce(_optionalChain([config, 'access', _285 => _285.experimental, 'optionalAccess', _286 => _286.serverActions]), () => ( false)),
|
|
7315
|
+
isolatedClientHydration: _nullishCoalesce(_optionalChain([config, 'access', _287 => _287.experimental, 'optionalAccess', _288 => _288.isolatedClientHydration]), () => ( "off")),
|
|
7316
|
+
ppr: _nullishCoalesce(_optionalChain([config, 'access', _289 => _289.experimental, 'optionalAccess', _290 => _290.ppr]), () => ( false)),
|
|
7261
7317
|
...config.experimental
|
|
7262
7318
|
},
|
|
7263
7319
|
agent: _nullishCoalesce(config.agent, () => ( {})),
|
|
@@ -7271,7 +7327,7 @@ var _FarmApp = class _FarmApp {
|
|
|
7271
7327
|
);
|
|
7272
7328
|
if (!hasAppDirectory) {
|
|
7273
7329
|
const routeFiles = _chunkY4YMF2NQcjs.getFarmSourceRoots.call(void 0, this.config).flatMap(
|
|
7274
|
-
(source) =>
|
|
7330
|
+
(source) => _chunkN4RLRSWWcjs.findProgrammaticRouteFiles.call(void 0, source.root, source.srcDir)
|
|
7275
7331
|
);
|
|
7276
7332
|
if (routeFiles.length > 0) {
|
|
7277
7333
|
return;
|
|
@@ -7308,7 +7364,7 @@ function isResolvedAuthConfig(value) {
|
|
|
7308
7364
|
}
|
|
7309
7365
|
_chunkS3JO3N4Hcjs.__name.call(void 0, isResolvedAuthConfig, "isResolvedAuthConfig");
|
|
7310
7366
|
function normalizeFarmAppAPIConfig(config) {
|
|
7311
|
-
if (typeof _optionalChain([config, 'optionalAccess',
|
|
7367
|
+
if (typeof _optionalChain([config, 'optionalAccess', _291 => _291.baseURL]) === "function" || typeof _optionalChain([config, 'optionalAccess', _292 => _292.basePath]) === "function") {
|
|
7312
7368
|
throw new Error(
|
|
7313
7369
|
"Farm API config resolver functions must be processed with resolveConfig() before creating a FarmApp."
|
|
7314
7370
|
);
|
|
@@ -7330,7 +7386,7 @@ function validateSchemaSteps(owner, schema, steps) {
|
|
|
7330
7386
|
const models = _chunkJSROZYYOcjs.resolveSchemaModels.call(void 0, owner, schema);
|
|
7331
7387
|
const ids = /* @__PURE__ */ new Set();
|
|
7332
7388
|
for (const step of steps) {
|
|
7333
|
-
const where = `${owner} migration "${_optionalChain([step, 'optionalAccess',
|
|
7389
|
+
const where = `${owner} migration "${_optionalChain([step, 'optionalAccess', _293 => _293.id])}"`;
|
|
7334
7390
|
if (!step || typeof step.id !== "string" || step.id.trim() === "") {
|
|
7335
7391
|
throw new TypeError(`${owner}: every migration step needs a non-empty \`id\`.`);
|
|
7336
7392
|
}
|
|
@@ -7419,7 +7475,7 @@ ${lines.join("\n")}`);
|
|
|
7419
7475
|
_chunkS3JO3N4Hcjs.__name.call(void 0, _FarmPluginOptionsError, "FarmPluginOptionsError");
|
|
7420
7476
|
var FarmPluginOptionsError = _FarmPluginOptionsError;
|
|
7421
7477
|
function formatIssuePath(path17) {
|
|
7422
|
-
if (!_optionalChain([path17, 'optionalAccess',
|
|
7478
|
+
if (!_optionalChain([path17, 'optionalAccess', _294 => _294.length])) return "";
|
|
7423
7479
|
return path17.map((segment) => {
|
|
7424
7480
|
const key = typeof segment === "object" && segment !== null ? segment.key : segment;
|
|
7425
7481
|
return typeof key === "symbol" ? key.toString() : String(key);
|
|
@@ -7433,11 +7489,11 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, isPromiseLike, "isPromiseLike");
|
|
|
7433
7489
|
function isPluginOptionsSchema(value) {
|
|
7434
7490
|
if (typeof value !== "object" && typeof value !== "function" || value === null) return false;
|
|
7435
7491
|
const standard = value["~standard"];
|
|
7436
|
-
return typeof _optionalChain([standard, 'optionalAccess',
|
|
7492
|
+
return typeof _optionalChain([standard, 'optionalAccess', _295 => _295.validate]) === "function";
|
|
7437
7493
|
}
|
|
7438
7494
|
_chunkS3JO3N4Hcjs.__name.call(void 0, isPluginOptionsSchema, "isPluginOptionsSchema");
|
|
7439
7495
|
function parsePluginOptions(schema, options) {
|
|
7440
|
-
const standard = _optionalChain([schema, 'optionalAccess',
|
|
7496
|
+
const standard = _optionalChain([schema, 'optionalAccess', _296 => _296["~standard"]]);
|
|
7441
7497
|
if (!standard || typeof standard.validate !== "function") {
|
|
7442
7498
|
throw new TypeError(
|
|
7443
7499
|
"A plugin's `options` needs a Standard Schema, such as a Zod, Valibot, or ArkType schema."
|
|
@@ -7472,7 +7528,7 @@ function normalizeFarmPluginRuntimeEndpointPath(pathname, label = "Farm plugin r
|
|
|
7472
7528
|
let decoded = segment;
|
|
7473
7529
|
try {
|
|
7474
7530
|
decoded = decodeURIComponent(segment);
|
|
7475
|
-
} catch (
|
|
7531
|
+
} catch (e20) {
|
|
7476
7532
|
throw new TypeError(`${label} path contains a malformed percent escape`);
|
|
7477
7533
|
}
|
|
7478
7534
|
if (decoded.includes("/") || decoded.includes("\\")) {
|
|
@@ -7497,9 +7553,9 @@ function normalizeRuntimeEndpointRequestPath(pathname) {
|
|
|
7497
7553
|
_chunkS3JO3N4Hcjs.__name.call(void 0, normalizeRuntimeEndpointRequestPath, "normalizeRuntimeEndpointRequestPath");
|
|
7498
7554
|
function farmPluginMayAffectRuntimePath(plugin, pathname) {
|
|
7499
7555
|
const runtime = plugin.runtime;
|
|
7500
|
-
const endpoints = _optionalChain([runtime, 'optionalAccess',
|
|
7556
|
+
const endpoints = _optionalChain([runtime, 'optionalAccess', _297 => _297.endpoints]);
|
|
7501
7557
|
const hasUnscopedRequestHooks = Boolean(
|
|
7502
|
-
plugin.init || plugin.ready || plugin.shutdown || _optionalChain([runtime, 'optionalAccess',
|
|
7558
|
+
plugin.init || plugin.ready || plugin.shutdown || _optionalChain([runtime, 'optionalAccess', _298 => _298.context]) || _optionalChain([runtime, 'optionalAccess', _299 => _299.before]) || _optionalChain([runtime, 'optionalAccess', _300 => _300.after]) || _optionalChain([runtime, 'optionalAccess', _301 => _301.error]) || plugin.router || plugin.render || plugin.beforeRouteMatch || plugin.afterRouteMatch || plugin.beforeRender || plugin.afterRender || plugin.onError || plugin.transformHTML || plugin.beforeRequest || plugin.afterResponse
|
|
7503
7559
|
);
|
|
7504
7560
|
if (hasUnscopedRequestHooks) return true;
|
|
7505
7561
|
if (Array.isArray(endpoints) && endpoints.length > 0) {
|
|
@@ -7511,7 +7567,7 @@ function farmPluginMayAffectRuntimePath(plugin, pathname) {
|
|
|
7511
7567
|
) === normalizedPathname
|
|
7512
7568
|
);
|
|
7513
7569
|
}
|
|
7514
|
-
return Boolean(plugin.setup || _optionalChain([runtime, 'optionalAccess',
|
|
7570
|
+
return Boolean(plugin.setup || _optionalChain([runtime, 'optionalAccess', _302 => _302.start]) || _optionalChain([runtime, 'optionalAccess', _303 => _303.close]));
|
|
7515
7571
|
}
|
|
7516
7572
|
_chunkS3JO3N4Hcjs.__name.call(void 0, farmPluginMayAffectRuntimePath, "farmPluginMayAffectRuntimePath");
|
|
7517
7573
|
|
|
@@ -7645,7 +7701,7 @@ var _PluginManager = class _PluginManager {
|
|
|
7645
7701
|
const endpoints = [];
|
|
7646
7702
|
const owners = /* @__PURE__ */ new Map();
|
|
7647
7703
|
for (const plugin of this.getSortedPlugins()) {
|
|
7648
|
-
const configured = _optionalChain([plugin, 'access',
|
|
7704
|
+
const configured = _optionalChain([plugin, 'access', _304 => _304.runtime, 'optionalAccess', _305 => _305.endpoints]);
|
|
7649
7705
|
if (configured === void 0) continue;
|
|
7650
7706
|
if (!Array.isArray(configured)) {
|
|
7651
7707
|
throw new TypeError(`Farm plugin "${plugin.name}" runtime.endpoints must be an array`);
|
|
@@ -7716,7 +7772,7 @@ var _PluginManager = class _PluginManager {
|
|
|
7716
7772
|
const values = {};
|
|
7717
7773
|
const owners = /* @__PURE__ */ new Map();
|
|
7718
7774
|
for (const plugin of this.getSortedPlugins()) {
|
|
7719
|
-
const createContext = _optionalChain([plugin, 'access',
|
|
7775
|
+
const createContext = _optionalChain([plugin, 'access', _306 => _306.runtime, 'optionalAccess', _307 => _307.context]);
|
|
7720
7776
|
if (!createContext) continue;
|
|
7721
7777
|
const result = await createContext(
|
|
7722
7778
|
this.createRuntimeBaseEvent(plugin, request2, options, waitUntil)
|
|
@@ -7742,7 +7798,7 @@ var _PluginManager = class _PluginManager {
|
|
|
7742
7798
|
}
|
|
7743
7799
|
async runRuntimeErrorHooks(request2, error, ctx, durationMs, options, waitUntil) {
|
|
7744
7800
|
for (const plugin of this.getSortedPlugins()) {
|
|
7745
|
-
const onError = _optionalChain([plugin, 'access',
|
|
7801
|
+
const onError = _optionalChain([plugin, 'access', _308 => _308.runtime, 'optionalAccess', _309 => _309.error]);
|
|
7746
7802
|
if (!onError) continue;
|
|
7747
7803
|
try {
|
|
7748
7804
|
await onError({
|
|
@@ -7786,19 +7842,19 @@ var _PluginManager = class _PluginManager {
|
|
|
7786
7842
|
case "config":
|
|
7787
7843
|
if (plugin.configure) {
|
|
7788
7844
|
hooks.push(
|
|
7789
|
-
(config, context) => _optionalChain([plugin, 'access',
|
|
7845
|
+
(config, context) => _optionalChain([plugin, 'access', _310 => _310.configure, 'optionalCall', _311 => _311(config, context)])
|
|
7790
7846
|
);
|
|
7791
7847
|
}
|
|
7792
7848
|
break;
|
|
7793
7849
|
case "ready":
|
|
7794
|
-
if (_optionalChain([plugin, 'access',
|
|
7795
|
-
hooks.push((context) => _optionalChain([plugin, 'access',
|
|
7850
|
+
if (_optionalChain([plugin, 'access', _312 => _312.runtime, 'optionalAccess', _313 => _313.start])) {
|
|
7851
|
+
hooks.push((context) => _optionalChain([plugin, 'access', _314 => _314.runtime, 'optionalAccess', _315 => _315.start, 'optionalCall', _316 => _316(withState(context))]));
|
|
7796
7852
|
}
|
|
7797
7853
|
break;
|
|
7798
7854
|
case "shutdown":
|
|
7799
|
-
if (_optionalChain([plugin, 'access',
|
|
7855
|
+
if (_optionalChain([plugin, 'access', _317 => _317.runtime, 'optionalAccess', _318 => _318.close])) {
|
|
7800
7856
|
hooks.push(
|
|
7801
|
-
(payload, context) => _optionalChain([plugin, 'access',
|
|
7857
|
+
(payload, context) => _optionalChain([plugin, 'access', _319 => _319.runtime, 'optionalAccess', _320 => _320.close, 'optionalCall', _321 => _321({
|
|
7802
7858
|
...withState(context),
|
|
7803
7859
|
reason: payload.reason
|
|
7804
7860
|
})])
|
|
@@ -7806,93 +7862,93 @@ var _PluginManager = class _PluginManager {
|
|
|
7806
7862
|
}
|
|
7807
7863
|
break;
|
|
7808
7864
|
case "routeDiscovered":
|
|
7809
|
-
if (_optionalChain([plugin, 'access',
|
|
7865
|
+
if (_optionalChain([plugin, 'access', _322 => _322.router, 'optionalAccess', _323 => _323.discovered])) {
|
|
7810
7866
|
hooks.push(
|
|
7811
|
-
(route, context) => _optionalChain([plugin, 'access',
|
|
7867
|
+
(route, context) => _optionalChain([plugin, 'access', _324 => _324.router, 'optionalAccess', _325 => _325.discovered, 'optionalCall', _326 => _326(route, withState(context))])
|
|
7812
7868
|
);
|
|
7813
7869
|
}
|
|
7814
7870
|
break;
|
|
7815
7871
|
case "middlewareDiscovered":
|
|
7816
|
-
if (_optionalChain([plugin, 'access',
|
|
7872
|
+
if (_optionalChain([plugin, 'access', _327 => _327.router, 'optionalAccess', _328 => _328.discovered])) {
|
|
7817
7873
|
hooks.push(
|
|
7818
|
-
(route, context) => _optionalChain([plugin, 'access',
|
|
7874
|
+
(route, context) => _optionalChain([plugin, 'access', _329 => _329.router, 'optionalAccess', _330 => _330.discovered, 'optionalCall', _331 => _331({ kind: "middleware", ...route }, withState(context))])
|
|
7819
7875
|
);
|
|
7820
7876
|
}
|
|
7821
7877
|
break;
|
|
7822
7878
|
case "apiRouteDiscovered":
|
|
7823
|
-
if (_optionalChain([plugin, 'access',
|
|
7879
|
+
if (_optionalChain([plugin, 'access', _332 => _332.router, 'optionalAccess', _333 => _333.discovered])) {
|
|
7824
7880
|
hooks.push(
|
|
7825
|
-
(route, context) => _optionalChain([plugin, 'access',
|
|
7881
|
+
(route, context) => _optionalChain([plugin, 'access', _334 => _334.router, 'optionalAccess', _335 => _335.discovered, 'optionalCall', _336 => _336({ kind: "api", ...route }, withState(context))])
|
|
7826
7882
|
);
|
|
7827
7883
|
}
|
|
7828
7884
|
break;
|
|
7829
7885
|
case "routesGenerated":
|
|
7830
|
-
if (_optionalChain([plugin, 'access',
|
|
7886
|
+
if (_optionalChain([plugin, 'access', _337 => _337.router, 'optionalAccess', _338 => _338.generated])) {
|
|
7831
7887
|
hooks.push(
|
|
7832
|
-
(routes, context) => _optionalChain([plugin, 'access',
|
|
7888
|
+
(routes, context) => _optionalChain([plugin, 'access', _339 => _339.router, 'optionalAccess', _340 => _340.generated, 'optionalCall', _341 => _341(routes, withState(context))])
|
|
7833
7889
|
);
|
|
7834
7890
|
}
|
|
7835
7891
|
break;
|
|
7836
7892
|
case "beforeRouteMatch":
|
|
7837
|
-
if (_optionalChain([plugin, 'access',
|
|
7893
|
+
if (_optionalChain([plugin, 'access', _342 => _342.router, 'optionalAccess', _343 => _343.before])) {
|
|
7838
7894
|
hooks.push(
|
|
7839
|
-
(route, context) => _optionalChain([plugin, 'access',
|
|
7895
|
+
(route, context) => _optionalChain([plugin, 'access', _344 => _344.router, 'optionalAccess', _345 => _345.before, 'optionalCall', _346 => _346(route, withState(context))])
|
|
7840
7896
|
);
|
|
7841
7897
|
}
|
|
7842
7898
|
break;
|
|
7843
7899
|
case "afterRouteMatch":
|
|
7844
|
-
if (_optionalChain([plugin, 'access',
|
|
7900
|
+
if (_optionalChain([plugin, 'access', _347 => _347.router, 'optionalAccess', _348 => _348.after])) {
|
|
7845
7901
|
hooks.push(
|
|
7846
|
-
(result, context) => _optionalChain([plugin, 'access',
|
|
7902
|
+
(result, context) => _optionalChain([plugin, 'access', _349 => _349.router, 'optionalAccess', _350 => _350.after, 'optionalCall', _351 => _351(result, withState(context))])
|
|
7847
7903
|
);
|
|
7848
7904
|
}
|
|
7849
7905
|
break;
|
|
7850
7906
|
case "beforeRender":
|
|
7851
|
-
if (_optionalChain([plugin, 'access',
|
|
7907
|
+
if (_optionalChain([plugin, 'access', _352 => _352.render, 'optionalAccess', _353 => _353.before])) {
|
|
7852
7908
|
hooks.push(
|
|
7853
|
-
(render, context) => _optionalChain([plugin, 'access',
|
|
7909
|
+
(render, context) => _optionalChain([plugin, 'access', _354 => _354.render, 'optionalAccess', _355 => _355.before, 'optionalCall', _356 => _356(render, withState(context))])
|
|
7854
7910
|
);
|
|
7855
7911
|
}
|
|
7856
7912
|
break;
|
|
7857
7913
|
case "afterRender":
|
|
7858
|
-
if (_optionalChain([plugin, 'access',
|
|
7914
|
+
if (_optionalChain([plugin, 'access', _357 => _357.render, 'optionalAccess', _358 => _358.html])) {
|
|
7859
7915
|
hooks.push(
|
|
7860
|
-
(html, render, context) => _optionalChain([plugin, 'access',
|
|
7916
|
+
(html, render, context) => _optionalChain([plugin, 'access', _359 => _359.render, 'optionalAccess', _360 => _360.html, 'optionalCall', _361 => _361(html, render, withState(context))])
|
|
7861
7917
|
);
|
|
7862
7918
|
}
|
|
7863
7919
|
break;
|
|
7864
7920
|
case "beforeBundle":
|
|
7865
|
-
if (_optionalChain([plugin, 'access',
|
|
7921
|
+
if (_optionalChain([plugin, 'access', _362 => _362.build, 'optionalAccess', _363 => _363.before])) {
|
|
7866
7922
|
hooks.push(
|
|
7867
|
-
(bundle, context) => _optionalChain([plugin, 'access',
|
|
7923
|
+
(bundle, context) => _optionalChain([plugin, 'access', _364 => _364.build, 'optionalAccess', _365 => _365.before, 'optionalCall', _366 => _366(bundle, withState(context))])
|
|
7868
7924
|
);
|
|
7869
7925
|
}
|
|
7870
7926
|
break;
|
|
7871
7927
|
case "beforeNitroBuild":
|
|
7872
|
-
if (_optionalChain([plugin, 'access',
|
|
7928
|
+
if (_optionalChain([plugin, 'access', _367 => _367.build, 'optionalAccess', _368 => _368.configure])) {
|
|
7873
7929
|
hooks.push(
|
|
7874
|
-
(buildConfig, context) => _optionalChain([plugin, 'access',
|
|
7930
|
+
(buildConfig, context) => _optionalChain([plugin, 'access', _369 => _369.build, 'optionalAccess', _370 => _370.configure, 'optionalCall', _371 => _371(buildConfig, withState(context))])
|
|
7875
7931
|
);
|
|
7876
7932
|
}
|
|
7877
7933
|
break;
|
|
7878
7934
|
case "afterBundle":
|
|
7879
|
-
if (_optionalChain([plugin, 'access',
|
|
7935
|
+
if (_optionalChain([plugin, 'access', _372 => _372.build, 'optionalAccess', _373 => _373.after])) {
|
|
7880
7936
|
hooks.push(
|
|
7881
|
-
(result, context) => _optionalChain([plugin, 'access',
|
|
7937
|
+
(result, context) => _optionalChain([plugin, 'access', _374 => _374.build, 'optionalAccess', _375 => _375.after, 'optionalCall', _376 => _376(result, withState(context))])
|
|
7882
7938
|
);
|
|
7883
7939
|
}
|
|
7884
7940
|
break;
|
|
7885
7941
|
case "devServerCreated":
|
|
7886
|
-
if (_optionalChain([plugin, 'access',
|
|
7942
|
+
if (_optionalChain([plugin, 'access', _377 => _377.dev, 'optionalAccess', _378 => _378.server])) {
|
|
7887
7943
|
hooks.push(
|
|
7888
|
-
(server, context) => _optionalChain([plugin, 'access',
|
|
7944
|
+
(server, context) => _optionalChain([plugin, 'access', _379 => _379.dev, 'optionalAccess', _380 => _380.server, 'optionalCall', _381 => _381(server, withState(context))])
|
|
7889
7945
|
);
|
|
7890
7946
|
}
|
|
7891
7947
|
break;
|
|
7892
7948
|
case "hmrUpdate":
|
|
7893
|
-
if (_optionalChain([plugin, 'access',
|
|
7949
|
+
if (_optionalChain([plugin, 'access', _382 => _382.dev, 'optionalAccess', _383 => _383.update])) {
|
|
7894
7950
|
hooks.push(
|
|
7895
|
-
(update, context) => _optionalChain([plugin, 'access',
|
|
7951
|
+
(update, context) => _optionalChain([plugin, 'access', _384 => _384.dev, 'optionalAccess', _385 => _385.update, 'optionalCall', _386 => _386(update, withState(context))])
|
|
7896
7952
|
);
|
|
7897
7953
|
}
|
|
7898
7954
|
break;
|
|
@@ -7938,7 +7994,7 @@ var _PluginManager = class _PluginManager {
|
|
|
7938
7994
|
hasRuntimeHook(hookName) {
|
|
7939
7995
|
const cached = this.runtimeHookPresence.get(hookName);
|
|
7940
7996
|
if (cached !== void 0) return cached;
|
|
7941
|
-
const present = this.plugins.some((plugin) => typeof _optionalChain([plugin, 'access',
|
|
7997
|
+
const present = this.plugins.some((plugin) => typeof _optionalChain([plugin, 'access', _387 => _387.runtime, 'optionalAccess', _388 => _388[hookName]]) === "function");
|
|
7942
7998
|
this.runtimeHookPresence.set(hookName, present);
|
|
7943
7999
|
return present;
|
|
7944
8000
|
}
|
|
@@ -8017,7 +8073,7 @@ var _PluginManager = class _PluginManager {
|
|
|
8017
8073
|
async beginRuntimeRequest(request2, options = {}) {
|
|
8018
8074
|
await this.startRuntime();
|
|
8019
8075
|
const startedAt = Date.now();
|
|
8020
|
-
const waitUntil = options.waitUntil ? (promise) => _optionalChain([options, 'access',
|
|
8076
|
+
const waitUntil = options.waitUntil ? (promise) => _optionalChain([options, 'access', _389 => _389.waitUntil, 'optionalCall', _390 => _390(Promise.resolve(promise))]) : (promise) => {
|
|
8021
8077
|
void Promise.resolve(promise).catch(() => {
|
|
8022
8078
|
});
|
|
8023
8079
|
};
|
|
@@ -8050,7 +8106,7 @@ var _PluginManager = class _PluginManager {
|
|
|
8050
8106
|
);
|
|
8051
8107
|
let response;
|
|
8052
8108
|
for (const plugin of this.getSortedPlugins()) {
|
|
8053
|
-
const before = _optionalChain([plugin, 'access',
|
|
8109
|
+
const before = _optionalChain([plugin, 'access', _391 => _391.runtime, 'optionalAccess', _392 => _392.before]);
|
|
8054
8110
|
if (!before) continue;
|
|
8055
8111
|
const result = await before({
|
|
8056
8112
|
...this.createRuntimeBaseEvent(plugin, activeRequest, activeOptions, waitUntil),
|
|
@@ -8096,7 +8152,7 @@ var _PluginManager = class _PluginManager {
|
|
|
8096
8152
|
let response = initialResponse;
|
|
8097
8153
|
try {
|
|
8098
8154
|
for (const plugin of this.getSortedPlugins()) {
|
|
8099
|
-
const after = _optionalChain([plugin, 'access',
|
|
8155
|
+
const after = _optionalChain([plugin, 'access', _393 => _393.runtime, 'optionalAccess', _394 => _394.after]);
|
|
8100
8156
|
if (!after) continue;
|
|
8101
8157
|
const result = await after({
|
|
8102
8158
|
...this.createRuntimeBaseEvent(
|
|
@@ -8185,7 +8241,7 @@ var _PluginManager = class _PluginManager {
|
|
|
8185
8241
|
/** @internal Runs hooks for only the plugins selected by the runtime adapter. */
|
|
8186
8242
|
async runHookParallelFiltered(hookName, include, ...args) {
|
|
8187
8243
|
if (hookName === "shutdown" && !this.runtimeShutdownHooksRunning) {
|
|
8188
|
-
await this.closeRuntime(_optionalChain([args, 'access',
|
|
8244
|
+
await this.closeRuntime(_optionalChain([args, 'access', _395 => _395[0], 'optionalAccess', _396 => _396.reason]));
|
|
8189
8245
|
return false;
|
|
8190
8246
|
}
|
|
8191
8247
|
const plugins = this.getSortedPlugins().filter(include);
|
|
@@ -8271,7 +8327,7 @@ function createPluginFactory(definition) {
|
|
|
8271
8327
|
configure: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (config, context) => configure(config, { ...context, options }), "configure")
|
|
8272
8328
|
} : {},
|
|
8273
8329
|
setup(context) {
|
|
8274
|
-
const state = _optionalChain([setup, 'optionalCall',
|
|
8330
|
+
const state = _optionalChain([setup, 'optionalCall', _397 => _397({ ...context, options })]);
|
|
8275
8331
|
return state instanceof Promise ? state.then(resolveState) : resolveState(state);
|
|
8276
8332
|
}
|
|
8277
8333
|
});
|
|
@@ -8312,10 +8368,10 @@ function declarePluginSchema(plugin) {
|
|
|
8312
8368
|
models: Object.keys(models).filter((key) => !models[key].external),
|
|
8313
8369
|
...plugin.dependsOn ? { dependsOn: plugin.dependsOn.map(_chunkQBPXNZGVcjs.pluginShortName) } : {},
|
|
8314
8370
|
...plugin.version ? { version: plugin.version } : {},
|
|
8315
|
-
..._optionalChain([plugin, 'access',
|
|
8316
|
-
dialect: _optionalChain([database, 'optionalAccess',
|
|
8371
|
+
..._optionalChain([plugin, 'access', _398 => _398.migrations, 'optionalAccess', _399 => _399.length]) ? { migrations: plugin.migrations } : {},
|
|
8372
|
+
dialect: _optionalChain([database, 'optionalAccess', _400 => _400.dialect]),
|
|
8317
8373
|
resolveClient: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (config) => {
|
|
8318
|
-
if (_optionalChain([database, 'optionalAccess',
|
|
8374
|
+
if (_optionalChain([database, 'optionalAccess', _401 => _401.client]) !== void 0 && database.client !== null) {
|
|
8319
8375
|
const client2 = typeof database.client === "function" ? await database.client() : database.client;
|
|
8320
8376
|
if (client2 === void 0 || client2 === null) {
|
|
8321
8377
|
throw new Error(`The ${name} plugin's \`database.client\` returned no connection.`);
|
|
@@ -8369,7 +8425,7 @@ function resolveFarmAppClientEntry(root = process.cwd(), srcDir = "src") {
|
|
|
8369
8425
|
}
|
|
8370
8426
|
_chunkS3JO3N4Hcjs.__name.call(void 0, resolveFarmAppClientEntry, "resolveFarmAppClientEntry");
|
|
8371
8427
|
function resolveFarmClientPlugins(plugins, _root) {
|
|
8372
|
-
if (!_optionalChain([plugins, 'optionalAccess',
|
|
8428
|
+
if (!_optionalChain([plugins, 'optionalAccess', _402 => _402.length])) return [];
|
|
8373
8429
|
return plugins.flatMap((plugin) => {
|
|
8374
8430
|
if (!plugin.client) return [];
|
|
8375
8431
|
assertClientLifecycle(plugin.client, plugin.name);
|
|
@@ -8449,7 +8505,7 @@ function assertLifecycleObject(value, pluginName, location, allowedKeys) {
|
|
|
8449
8505
|
throw new TypeError(`Client plugin "${pluginName}" has an unknown ${location}.${key} option`);
|
|
8450
8506
|
}
|
|
8451
8507
|
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
8452
|
-
if (!_optionalChain([descriptor, 'optionalAccess',
|
|
8508
|
+
if (!_optionalChain([descriptor, 'optionalAccess', _403 => _403.enumerable])) {
|
|
8453
8509
|
throw new TypeError(`Client plugin "${pluginName}" ${location}.${key} must be enumerable`);
|
|
8454
8510
|
}
|
|
8455
8511
|
if (!("value" in descriptor)) {
|
|
@@ -8573,7 +8629,7 @@ function assertPublicData(value, pluginName) {
|
|
|
8573
8629
|
throwPublicDataError(pluginName, pathSegments, "cannot contain symbol keys");
|
|
8574
8630
|
}
|
|
8575
8631
|
const descriptor = Object.getOwnPropertyDescriptor(current, key);
|
|
8576
|
-
if (!_optionalChain([descriptor, 'optionalAccess',
|
|
8632
|
+
if (!_optionalChain([descriptor, 'optionalAccess', _404 => _404.enumerable])) {
|
|
8577
8633
|
throwPublicDataError(
|
|
8578
8634
|
pluginName,
|
|
8579
8635
|
[...pathSegments, key],
|
|
@@ -8619,8 +8675,8 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, isArrayIndex, "isArrayIndex");
|
|
|
8619
8675
|
|
|
8620
8676
|
var ADAPTER_EXTENSIONS = ["ts", "tsx", "js", "jsx", "mts", "mjs"];
|
|
8621
8677
|
function resolveFarmClientCacheAdapterEntry(root, cache) {
|
|
8622
|
-
const client = _optionalChain([cache, 'optionalAccess',
|
|
8623
|
-
const adapter = _optionalChain([client, 'optionalAccess',
|
|
8678
|
+
const client = _optionalChain([cache, 'optionalAccess', _405 => _405.client]);
|
|
8679
|
+
const adapter = _optionalChain([client, 'optionalAccess', _406 => _406.adapter]);
|
|
8624
8680
|
if (adapter === void 0) return void 0;
|
|
8625
8681
|
if (typeof adapter !== "string" || adapter.trim().length === 0) {
|
|
8626
8682
|
throw new Error(
|
|
@@ -8635,8 +8691,8 @@ function resolveFarmClientCacheAdapterEntry(root, cache) {
|
|
|
8635
8691
|
);
|
|
8636
8692
|
}
|
|
8637
8693
|
const options = {};
|
|
8638
|
-
if (_optionalChain([client, 'optionalAccess',
|
|
8639
|
-
if (_optionalChain([client, 'optionalAccess',
|
|
8694
|
+
if (_optionalChain([client, 'optionalAccess', _407 => _407.version]) !== void 0) options.version = client.version;
|
|
8695
|
+
if (_optionalChain([client, 'optionalAccess', _408 => _408.flushDelayMs]) !== void 0) options.flushDelayMs = client.flushDelayMs;
|
|
8640
8696
|
return { importPath: found.replace(/\\/g, "/"), options };
|
|
8641
8697
|
}
|
|
8642
8698
|
_chunkS3JO3N4Hcjs.__name.call(void 0, resolveFarmClientCacheAdapterEntry, "resolveFarmClientCacheAdapterEntry");
|
|
@@ -8738,7 +8794,7 @@ function createFarmLayoutElement(Component, pattern, children, params) {
|
|
|
8738
8794
|
function shouldBypassFarmRouterForDottedPath(pathname, routeManager, baseDirs, generatedPaths = []) {
|
|
8739
8795
|
if (!pathname.includes(".") || pathname.endsWith(".html")) return false;
|
|
8740
8796
|
const matchesAppRoute = Boolean(
|
|
8741
|
-
_optionalChain([routeManager, 'optionalAccess',
|
|
8797
|
+
_optionalChain([routeManager, 'optionalAccess', _409 => _409.matchRoute, 'call', _410 => _410(pathname), 'optionalAccess', _411 => _411.route]) || _optionalChain([routeManager, 'optionalAccess', _412 => _412.matchMetadataRoute, 'call', _413 => _413(pathname)]) || _optionalChain([routeManager, 'optionalAccess', _414 => _414.matchMetadataImage, 'call', _415 => _415(pathname)]) || generatedPaths.includes(pathname)
|
|
8742
8798
|
);
|
|
8743
8799
|
return !matchesAppRoute || devServableFileExists(pathname, baseDirs);
|
|
8744
8800
|
}
|
|
@@ -8767,14 +8823,14 @@ var DOCS_ENGINE_APP_OWNABLE_PATHS = /* @__PURE__ */ new Set([
|
|
|
8767
8823
|
]);
|
|
8768
8824
|
function farmAppOwnsDocsEnginePath(pathname, options) {
|
|
8769
8825
|
if (!DOCS_ENGINE_APP_OWNABLE_PATHS.has(pathname)) return false;
|
|
8770
|
-
return options.generatedPaths.includes(pathname) || Boolean(_optionalChain([options, 'access',
|
|
8826
|
+
return options.generatedPaths.includes(pathname) || Boolean(_optionalChain([options, 'access', _416 => _416.routeManager, 'optionalAccess', _417 => _417.matchMetadataRoute, 'call', _418 => _418(pathname)])) || devServableFileExists(pathname, [options.publicDir]);
|
|
8771
8827
|
}
|
|
8772
8828
|
_chunkS3JO3N4Hcjs.__name.call(void 0, farmAppOwnsDocsEnginePath, "farmAppOwnsDocsEnginePath");
|
|
8773
8829
|
function devServableFileExists(pathname, baseDirs) {
|
|
8774
8830
|
let decodedPathname;
|
|
8775
8831
|
try {
|
|
8776
8832
|
decodedPathname = decodeURIComponent(pathname);
|
|
8777
|
-
} catch (
|
|
8833
|
+
} catch (e21) {
|
|
8778
8834
|
return false;
|
|
8779
8835
|
}
|
|
8780
8836
|
const relativePathname = decodedPathname.replace(/^\/+/, "");
|
|
@@ -8788,7 +8844,7 @@ function devServableFileExists(pathname, baseDirs) {
|
|
|
8788
8844
|
if (fs8.existsSync(candidate) && fs8.statSync(candidate).isFile()) {
|
|
8789
8845
|
return true;
|
|
8790
8846
|
}
|
|
8791
|
-
} catch (
|
|
8847
|
+
} catch (e22) {
|
|
8792
8848
|
}
|
|
8793
8849
|
}
|
|
8794
8850
|
return false;
|
|
@@ -8874,14 +8930,14 @@ function analyzeClientBoundary(program, publicKeys) {
|
|
|
8874
8930
|
_chunkS3JO3N4Hcjs.__name.call(void 0, analyzeClientBoundary, "analyzeClientBoundary");
|
|
8875
8931
|
function readNodeBuiltinSource(node) {
|
|
8876
8932
|
if (node.type === "ImportDeclaration" || node.type === "ExportNamedDeclaration" || node.type === "ExportAllDeclaration" || node.type === "ImportExpression") {
|
|
8877
|
-
const value = _optionalChain([node, 'access',
|
|
8933
|
+
const value = _optionalChain([node, 'access', _419 => _419.source, 'optionalAccess', _420 => _420.value]);
|
|
8878
8934
|
return typeof value === "string" && value.startsWith("node:") ? value : void 0;
|
|
8879
8935
|
}
|
|
8880
8936
|
if (node.type === "CallExpression") {
|
|
8881
8937
|
const callee = node.callee;
|
|
8882
|
-
if (_optionalChain([callee, 'optionalAccess',
|
|
8883
|
-
const arg = _optionalChain([node, 'access',
|
|
8884
|
-
const value = _optionalChain([arg, 'optionalAccess',
|
|
8938
|
+
if (_optionalChain([callee, 'optionalAccess', _421 => _421.type]) === "Identifier" && callee.name === "require") {
|
|
8939
|
+
const arg = _optionalChain([node, 'access', _422 => _422.arguments, 'optionalAccess', _423 => _423[0]]);
|
|
8940
|
+
const value = _optionalChain([arg, 'optionalAccess', _424 => _424.type]) === "Literal" ? arg.value : void 0;
|
|
8885
8941
|
return typeof value === "string" && value.startsWith("node:") ? value : void 0;
|
|
8886
8942
|
}
|
|
8887
8943
|
}
|
|
@@ -8891,7 +8947,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, readNodeBuiltinSource, "readNodeBuiltinSou
|
|
|
8891
8947
|
function readProcessEnvKey(node) {
|
|
8892
8948
|
if (node.type !== "MemberExpression") return void 0;
|
|
8893
8949
|
const object = node.object;
|
|
8894
|
-
if (!object || object.type !== "MemberExpression" || _optionalChain([object, 'access',
|
|
8950
|
+
if (!object || object.type !== "MemberExpression" || _optionalChain([object, 'access', _425 => _425.object, 'optionalAccess', _426 => _426.type]) !== "Identifier" || object.object.name !== "process" || _optionalChain([object, 'access', _427 => _427.property, 'optionalAccess', _428 => _428.name]) !== "env") {
|
|
8895
8951
|
return void 0;
|
|
8896
8952
|
}
|
|
8897
8953
|
const property = node.property;
|
|
@@ -8956,7 +9012,7 @@ function farmImageImportsPlugin() {
|
|
|
8956
9012
|
async transform(code, id) {
|
|
8957
9013
|
const filePath = id.split("?", 1)[0];
|
|
8958
9014
|
if (id.includes("?") || !STATIC_IMAGE_RE.test(filePath)) return null;
|
|
8959
|
-
const defaultExport = _optionalChain([code, 'access',
|
|
9015
|
+
const defaultExport = _optionalChain([code, 'access', _429 => _429.match, 'call', _430 => _430(/^\s*export\s+default\s+(.+?);?\s*$/s), 'optionalAccess', _431 => _431[1]]);
|
|
8960
9016
|
if (!defaultExport) return null;
|
|
8961
9017
|
return createStaticImageModule(filePath, `const src = ${defaultExport};`);
|
|
8962
9018
|
}
|
|
@@ -8991,7 +9047,7 @@ async function createBlurDataURL(bytes) {
|
|
|
8991
9047
|
const { default: sharp } = await import("sharp");
|
|
8992
9048
|
const placeholder = await sharp(bytes).rotate().resize({ width: 8, height: 8, fit: "inside", withoutEnlargement: true }).webp({ quality: 35 }).toBuffer();
|
|
8993
9049
|
return `data:image/webp;base64,${placeholder.toString("base64")}`;
|
|
8994
|
-
} catch (
|
|
9050
|
+
} catch (e23) {
|
|
8995
9051
|
return void 0;
|
|
8996
9052
|
}
|
|
8997
9053
|
}
|
|
@@ -9017,7 +9073,7 @@ var FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE = [
|
|
|
9017
9073
|
];
|
|
9018
9074
|
function getFarmClientOptimizeDepsInclude(renderer) {
|
|
9019
9075
|
return Array.from(
|
|
9020
|
-
/* @__PURE__ */ new Set([...FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE, ..._optionalChain([renderer, 'optionalAccess',
|
|
9076
|
+
/* @__PURE__ */ new Set([...FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE, ..._optionalChain([renderer, 'optionalAccess', _432 => _432.optimizeDeps]) || []])
|
|
9021
9077
|
);
|
|
9022
9078
|
}
|
|
9023
9079
|
_chunkS3JO3N4Hcjs.__name.call(void 0, getFarmClientOptimizeDepsInclude, "getFarmClientOptimizeDepsInclude");
|
|
@@ -9042,7 +9098,7 @@ function createFarmClientOptimizeDepsConfig(entries, renderer) {
|
|
|
9042
9098
|
// Farm's HTML boots through a virtual module and imports route UI lazily.
|
|
9043
9099
|
// Explicit entries let Vite finish that crawl before a navigation can
|
|
9044
9100
|
// rotate the optimizer hash underneath a hydrated React runtime.
|
|
9045
|
-
..._optionalChain([entries, 'optionalAccess',
|
|
9101
|
+
..._optionalChain([entries, 'optionalAccess', _433 => _433.length]) ? { entries: [...entries] } : {}
|
|
9046
9102
|
};
|
|
9047
9103
|
}
|
|
9048
9104
|
_chunkS3JO3N4Hcjs.__name.call(void 0, createFarmClientOptimizeDepsConfig, "createFarmClientOptimizeDepsConfig");
|
|
@@ -9072,8 +9128,8 @@ function mergeAlias(farmValue, userValue) {
|
|
|
9072
9128
|
}
|
|
9073
9129
|
_chunkS3JO3N4Hcjs.__name.call(void 0, mergeAlias, "mergeAlias");
|
|
9074
9130
|
function mergeFarmViteConfig(farmConfig, userConfig = {}) {
|
|
9075
|
-
const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access',
|
|
9076
|
-
const holdUntilCrawlEnd = _nullishCoalesce(_optionalChain([userConfig, 'access',
|
|
9131
|
+
const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access', _434 => _434.optimizeDeps, 'optionalAccess', _435 => _435.noDiscovery]), () => ( _optionalChain([farmConfig, 'access', _436 => _436.optimizeDeps, 'optionalAccess', _437 => _437.noDiscovery])));
|
|
9132
|
+
const holdUntilCrawlEnd = _nullishCoalesce(_optionalChain([userConfig, 'access', _438 => _438.optimizeDeps, 'optionalAccess', _439 => _439.holdUntilCrawlEnd]), () => ( (_optionalChain([userConfig, 'access', _440 => _440.optimizeDeps, 'optionalAccess', _441 => _441.noDiscovery]) === true ? false : _optionalChain([farmConfig, 'access', _442 => _442.optimizeDeps, 'optionalAccess', _443 => _443.holdUntilCrawlEnd]))));
|
|
9077
9133
|
return {
|
|
9078
9134
|
...farmConfig,
|
|
9079
9135
|
...userConfig,
|
|
@@ -9085,9 +9141,9 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
|
|
|
9085
9141
|
resolve: {
|
|
9086
9142
|
...farmConfig.resolve,
|
|
9087
9143
|
...userConfig.resolve,
|
|
9088
|
-
alias: mergeAlias(_optionalChain([farmConfig, 'access',
|
|
9144
|
+
alias: mergeAlias(_optionalChain([farmConfig, 'access', _444 => _444.resolve, 'optionalAccess', _445 => _445.alias]), _optionalChain([userConfig, 'access', _446 => _446.resolve, 'optionalAccess', _447 => _447.alias])),
|
|
9089
9145
|
dedupe: Array.from(
|
|
9090
|
-
/* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access',
|
|
9146
|
+
/* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access', _448 => _448.resolve, 'optionalAccess', _449 => _449.dedupe]) || [], ..._optionalChain([userConfig, 'access', _450 => _450.resolve, 'optionalAccess', _451 => _451.dedupe]) || []])
|
|
9091
9147
|
)
|
|
9092
9148
|
},
|
|
9093
9149
|
optimizeDeps: {
|
|
@@ -9097,21 +9153,21 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
|
|
|
9097
9153
|
holdUntilCrawlEnd,
|
|
9098
9154
|
include: Array.from(
|
|
9099
9155
|
/* @__PURE__ */ new Set([
|
|
9100
|
-
..._optionalChain([farmConfig, 'access',
|
|
9101
|
-
..._optionalChain([userConfig, 'access',
|
|
9156
|
+
..._optionalChain([farmConfig, 'access', _452 => _452.optimizeDeps, 'optionalAccess', _453 => _453.include]) || [],
|
|
9157
|
+
..._optionalChain([userConfig, 'access', _454 => _454.optimizeDeps, 'optionalAccess', _455 => _455.include]) || []
|
|
9102
9158
|
])
|
|
9103
9159
|
),
|
|
9104
9160
|
exclude: Array.from(
|
|
9105
9161
|
/* @__PURE__ */ new Set([
|
|
9106
|
-
..._optionalChain([farmConfig, 'access',
|
|
9107
|
-
..._optionalChain([userConfig, 'access',
|
|
9162
|
+
..._optionalChain([farmConfig, 'access', _456 => _456.optimizeDeps, 'optionalAccess', _457 => _457.exclude]) || [],
|
|
9163
|
+
..._optionalChain([userConfig, 'access', _458 => _458.optimizeDeps, 'optionalAccess', _459 => _459.exclude]) || []
|
|
9108
9164
|
])
|
|
9109
9165
|
)
|
|
9110
9166
|
},
|
|
9111
9167
|
ssr: {
|
|
9112
9168
|
...farmConfig.ssr,
|
|
9113
9169
|
...userConfig.ssr,
|
|
9114
|
-
noExternal: mergeNoExternal(_optionalChain([farmConfig, 'access',
|
|
9170
|
+
noExternal: mergeNoExternal(_optionalChain([farmConfig, 'access', _460 => _460.ssr, 'optionalAccess', _461 => _461.noExternal]), _optionalChain([userConfig, 'access', _462 => _462.ssr, 'optionalAccess', _463 => _463.noExternal]))
|
|
9115
9171
|
}
|
|
9116
9172
|
};
|
|
9117
9173
|
}
|
|
@@ -9165,7 +9221,7 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}) {
|
|
|
9165
9221
|
...farmConfig.build,
|
|
9166
9222
|
rollupOptions: {
|
|
9167
9223
|
...userBundlerOptions,
|
|
9168
|
-
..._optionalChain([farmConfig, 'access',
|
|
9224
|
+
..._optionalChain([farmConfig, 'access', _464 => _464.build, 'optionalAccess', _465 => _465.rollupOptions])
|
|
9169
9225
|
}
|
|
9170
9226
|
},
|
|
9171
9227
|
css: farmConfig.css || userCss ? { ...farmConfig.css, ...userCss } : void 0,
|
|
@@ -9173,39 +9229,12 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}) {
|
|
|
9173
9229
|
esbuild: typeof userEsbuild === "object" && farmConfig.esbuild !== false ? { ...userEsbuild, ...farmConfig.esbuild } : _nullishCoalesce(farmConfig.esbuild, () => ( userEsbuild)),
|
|
9174
9230
|
ssr: {
|
|
9175
9231
|
...merged.ssr,
|
|
9176
|
-
external: mergeExternal(_optionalChain([farmConfig, 'access',
|
|
9232
|
+
external: mergeExternal(_optionalChain([farmConfig, 'access', _466 => _466.ssr, 'optionalAccess', _467 => _467.external]), _optionalChain([userConfig, 'access', _468 => _468.ssr, 'optionalAccess', _469 => _469.external]))
|
|
9177
9233
|
}
|
|
9178
9234
|
};
|
|
9179
9235
|
}
|
|
9180
9236
|
_chunkS3JO3N4Hcjs.__name.call(void 0, mergeFarmProductionViteConfig, "mergeFarmProductionViteConfig");
|
|
9181
9237
|
|
|
9182
|
-
// src/docs/adapter-client.ts
|
|
9183
|
-
function generateFarmDocsAdapterClientRuntime(reactModule) {
|
|
9184
|
-
if (!reactModule) {
|
|
9185
|
-
return `
|
|
9186
|
-
async function hydrateFarmDocsAdapterRuntime() {
|
|
9187
|
-
return false;
|
|
9188
|
-
}
|
|
9189
|
-
`;
|
|
9190
|
-
}
|
|
9191
|
-
return `
|
|
9192
|
-
async function hydrateFarmDocsAdapterRuntime() {
|
|
9193
|
-
const runtime = window.__FARM_DOCS_ADAPTER__;
|
|
9194
|
-
if (!runtime) return false;
|
|
9195
|
-
const FarmDocsAdapterReact = await import(${JSON.stringify(reactModule)});
|
|
9196
|
-
if (typeof FarmDocsAdapterReact.hydrateFarmDocs !== "function") {
|
|
9197
|
-
throw new Error("The configured Farm docs adapter does not export hydrateFarmDocs().");
|
|
9198
|
-
}
|
|
9199
|
-
FarmDocsAdapterReact.hydrateFarmDocs({
|
|
9200
|
-
config: runtime.config || {},
|
|
9201
|
-
data: runtime.data,
|
|
9202
|
-
});
|
|
9203
|
-
return true;
|
|
9204
|
-
}
|
|
9205
|
-
`;
|
|
9206
|
-
}
|
|
9207
|
-
_chunkS3JO3N4Hcjs.__name.call(void 0, generateFarmDocsAdapterClientRuntime, "generateFarmDocsAdapterClientRuntime");
|
|
9208
|
-
|
|
9209
9238
|
// src/theme/vite.ts
|
|
9210
9239
|
var FARM_DARK_VARIANT = '@custom-variant dark (&:where([data-theme="dark"], [data-theme="dark"] *));';
|
|
9211
9240
|
function createFarmThemeCssPlugin(input, basePath = "/") {
|
|
@@ -9272,13 +9301,13 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, reportOpenAPIDevGenerationResult, "reportO
|
|
|
9272
9301
|
|
|
9273
9302
|
// src/vite.ts
|
|
9274
9303
|
function farmLlmsTxtGeneratedPaths(config) {
|
|
9275
|
-
const llms = _chunkISTFC3MZcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([config, 'access',
|
|
9304
|
+
const llms = _chunkISTFC3MZcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([config, 'access', _470 => _470.agent, 'optionalAccess', _471 => _471.llmsTxt]));
|
|
9276
9305
|
if (!llms.enabled) return [];
|
|
9277
9306
|
return llms.full ? ["/llms.txt", "/llms-full.txt"] : ["/llms.txt"];
|
|
9278
9307
|
}
|
|
9279
9308
|
_chunkS3JO3N4Hcjs.__name.call(void 0, farmLlmsTxtGeneratedPaths, "farmLlmsTxtGeneratedPaths");
|
|
9280
9309
|
function farmAgentGeneratedPaths(config) {
|
|
9281
|
-
const crawlers = _chunkISTFC3MZcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([config, 'access',
|
|
9310
|
+
const crawlers = _chunkISTFC3MZcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([config, 'access', _472 => _472.agent, 'optionalAccess', _473 => _473.crawlers]));
|
|
9282
9311
|
return [...farmLlmsTxtGeneratedPaths(config), ...crawlers.enabled ? ["/robots.txt"] : []];
|
|
9283
9312
|
}
|
|
9284
9313
|
_chunkS3JO3N4Hcjs.__name.call(void 0, farmAgentGeneratedPaths, "farmAgentGeneratedPaths");
|
|
@@ -9324,7 +9353,7 @@ function loadFarmWorkflowsDevRuntime() {
|
|
|
9324
9353
|
}
|
|
9325
9354
|
_chunkS3JO3N4Hcjs.__name.call(void 0, loadFarmWorkflowsDevRuntime, "loadFarmWorkflowsDevRuntime");
|
|
9326
9355
|
function loadFarmDevtoolsSnapshotRuntime() {
|
|
9327
|
-
return import("./devtools-
|
|
9356
|
+
return import("./devtools-R6MDDAZK.cjs");
|
|
9328
9357
|
}
|
|
9329
9358
|
_chunkS3JO3N4Hcjs.__name.call(void 0, loadFarmDevtoolsSnapshotRuntime, "loadFarmDevtoolsSnapshotRuntime");
|
|
9330
9359
|
function loadFarmDevtoolsUIRuntime() {
|
|
@@ -9340,7 +9369,7 @@ function farmI18nClientBridgePlugin() {
|
|
|
9340
9369
|
name: "farm:i18n-client-bridge",
|
|
9341
9370
|
enforce: "pre",
|
|
9342
9371
|
resolveId(id, _importer, options) {
|
|
9343
|
-
if (id === "@farm.js/core/i18n/server" && !_optionalChain([options, 'optionalAccess',
|
|
9372
|
+
if (id === "@farm.js/core/i18n/server" && !_optionalChain([options, 'optionalAccess', _474 => _474.ssr])) {
|
|
9344
9373
|
return FARM_I18N_CLIENT_BRIDGE_ID;
|
|
9345
9374
|
}
|
|
9346
9375
|
return null;
|
|
@@ -9358,7 +9387,7 @@ function farmServerOnlyEntriesPlugin() {
|
|
|
9358
9387
|
name: "farm:server-only-entries",
|
|
9359
9388
|
enforce: "pre",
|
|
9360
9389
|
resolveId(id, importer, options) {
|
|
9361
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
9390
|
+
if (_optionalChain([options, 'optionalAccess', _475 => _475.ssr]) || !FARM_SERVER_ONLY_ENTRIES.has(id)) return null;
|
|
9362
9391
|
this.error(
|
|
9363
9392
|
`${id} is server-only and cannot be imported into client code${importer ? ` (imported by ${importer})` : ""}. Use it from an API route or another server module.`
|
|
9364
9393
|
);
|
|
@@ -9400,7 +9429,7 @@ function renderFarmI18nStaticHead(requestPath, snapshot) {
|
|
|
9400
9429
|
}
|
|
9401
9430
|
_chunkS3JO3N4Hcjs.__name.call(void 0, renderFarmI18nStaticHead, "renderFarmI18nStaticHead");
|
|
9402
9431
|
function getPublicEnvDefine(config) {
|
|
9403
|
-
const publicEnv = _optionalChain([config, 'access',
|
|
9432
|
+
const publicEnv = _optionalChain([config, 'access', _476 => _476.env, 'optionalAccess', _477 => _477.public]);
|
|
9404
9433
|
if (!isResolvedEnvScope(publicEnv)) {
|
|
9405
9434
|
return {};
|
|
9406
9435
|
}
|
|
@@ -9441,7 +9470,7 @@ function withFarmRequestTracing(handler, apiRuntime, resolveTraceUrl = (request2
|
|
|
9441
9470
|
return;
|
|
9442
9471
|
}
|
|
9443
9472
|
if (res.headersSent) {
|
|
9444
|
-
_optionalChain([res, 'access',
|
|
9473
|
+
_optionalChain([res, 'access', _478 => _478.destroy, 'optionalCall', _479 => _479(error instanceof Error ? error : new Error(String(error)))]);
|
|
9445
9474
|
return;
|
|
9446
9475
|
}
|
|
9447
9476
|
res.statusCode = 500;
|
|
@@ -9540,7 +9569,7 @@ function interceptFarmDevPageResponse(options) {
|
|
|
9540
9569
|
const originalWrite = res.write.bind(res);
|
|
9541
9570
|
const originalEnd = res.end.bind(res);
|
|
9542
9571
|
const originalWriteHead = res.writeHead.bind(res);
|
|
9543
|
-
const originalFlushHeaders = _optionalChain([res, 'access',
|
|
9572
|
+
const originalFlushHeaders = _optionalChain([res, 'access', _480 => _480.flushHeaders, 'optionalAccess', _481 => _481.bind, 'call', _482 => _482(res)]);
|
|
9544
9573
|
let afterResponseCalled = false;
|
|
9545
9574
|
let interceptedEnd = false;
|
|
9546
9575
|
const htmlChunks = [];
|
|
@@ -9580,7 +9609,7 @@ function interceptFarmDevPageResponse(options) {
|
|
|
9580
9609
|
const shouldBufferResponse = isHtmlResponse ? bufferPluginResponse : Boolean(runtimeSession && hasRuntimeAfterHook);
|
|
9581
9610
|
if (shouldBufferResponse) {
|
|
9582
9611
|
const callback = args.find((arg) => typeof arg === "function");
|
|
9583
|
-
_optionalChain([callback, 'optionalCall',
|
|
9612
|
+
_optionalChain([callback, 'optionalCall', _483 => _483()]);
|
|
9584
9613
|
return true;
|
|
9585
9614
|
}
|
|
9586
9615
|
const writeResult = originalWrite(chunk, ...args);
|
|
@@ -9695,14 +9724,14 @@ function getEnvDefines(config, configEnv) {
|
|
|
9695
9724
|
_chunkYFPGHF5Fcjs.getPublicFarmImageConfig.call(void 0, _chunkYFPGHF5Fcjs.resolveFarmImageConfig.call(void 0, config.images))
|
|
9696
9725
|
)
|
|
9697
9726
|
};
|
|
9698
|
-
if (_optionalChain([configEnv, 'optionalAccess',
|
|
9727
|
+
if (_optionalChain([configEnv, 'optionalAccess', _484 => _484.isSsrBuild])) {
|
|
9699
9728
|
defines.__FARM_ENV__ = JSON.stringify(_chunkVEKFLAQMcjs.createBundledEnv.call(void 0, getFullEnvDefine(config)));
|
|
9700
9729
|
}
|
|
9701
9730
|
return defines;
|
|
9702
9731
|
}
|
|
9703
9732
|
_chunkS3JO3N4Hcjs.__name.call(void 0, getEnvDefines, "getEnvDefines");
|
|
9704
9733
|
function getFarmAPIBaseURLDefine(config) {
|
|
9705
|
-
const baseURL = _optionalChain([config, 'access',
|
|
9734
|
+
const baseURL = _optionalChain([config, 'access', _485 => _485.api, 'optionalAccess', _486 => _486.baseURL]);
|
|
9706
9735
|
return typeof baseURL === "string" && baseURL ? baseURL : _chunkS3A45T7Fcjs.DEFAULT_FARM_API_BASE_PATH;
|
|
9707
9736
|
}
|
|
9708
9737
|
_chunkS3JO3N4Hcjs.__name.call(void 0, getFarmAPIBaseURLDefine, "getFarmAPIBaseURLDefine");
|
|
@@ -9725,7 +9754,7 @@ function fileContainsProgrammaticPageRoute(file) {
|
|
|
9725
9754
|
}
|
|
9726
9755
|
try {
|
|
9727
9756
|
return _chunk6V4TDWECcjs.scanProgrammaticPagePaths.call(void 0, fs9.readFileSync(file, "utf8")).length > 0;
|
|
9728
|
-
} catch (
|
|
9757
|
+
} catch (e24) {
|
|
9729
9758
|
return false;
|
|
9730
9759
|
}
|
|
9731
9760
|
}
|
|
@@ -9739,7 +9768,7 @@ function rewriteEarlySsrRelativeImports(options) {
|
|
|
9739
9768
|
let ast;
|
|
9740
9769
|
try {
|
|
9741
9770
|
ast = options.parse(options.code);
|
|
9742
|
-
} catch (
|
|
9771
|
+
} catch (e25) {
|
|
9743
9772
|
return null;
|
|
9744
9773
|
}
|
|
9745
9774
|
walkModuleAst(ast, (node) => {
|
|
@@ -9771,7 +9800,7 @@ function transformIsolatedClientBoundaryModule(options) {
|
|
|
9771
9800
|
let ast;
|
|
9772
9801
|
try {
|
|
9773
9802
|
ast = options.parse(options.code);
|
|
9774
|
-
} catch (
|
|
9803
|
+
} catch (e26) {
|
|
9775
9804
|
return null;
|
|
9776
9805
|
}
|
|
9777
9806
|
const body = Array.isArray(ast.body) ? ast.body : [];
|
|
@@ -9792,9 +9821,9 @@ function transformIsolatedClientBoundaryModule(options) {
|
|
|
9792
9821
|
transformedExports++;
|
|
9793
9822
|
}, "addWrapper");
|
|
9794
9823
|
for (const node of body) {
|
|
9795
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
9824
|
+
if (_optionalChain([node, 'optionalAccess', _487 => _487.type]) === "ExportDefaultDeclaration" && node.declaration) {
|
|
9796
9825
|
const declaration2 = node.declaration;
|
|
9797
|
-
if ((declaration2.type === "FunctionDeclaration" || declaration2.type === "ClassDeclaration") && _optionalChain([declaration2, 'access',
|
|
9826
|
+
if ((declaration2.type === "FunctionDeclaration" || declaration2.type === "ClassDeclaration") && _optionalChain([declaration2, 'access', _488 => _488.id, 'optionalAccess', _489 => _489.name])) {
|
|
9798
9827
|
replacements.push({
|
|
9799
9828
|
start: node.start,
|
|
9800
9829
|
end: node.end,
|
|
@@ -9812,14 +9841,14 @@ function transformIsolatedClientBoundaryModule(options) {
|
|
|
9812
9841
|
}
|
|
9813
9842
|
continue;
|
|
9814
9843
|
}
|
|
9815
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
9844
|
+
if (_optionalChain([node, 'optionalAccess', _490 => _490.type]) !== "ExportNamedDeclaration" || !node.declaration) continue;
|
|
9816
9845
|
const declaration = node.declaration;
|
|
9817
9846
|
const declaredNames = [];
|
|
9818
|
-
if ((declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") && _optionalChain([declaration, 'access',
|
|
9847
|
+
if ((declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") && _optionalChain([declaration, 'access', _491 => _491.id, 'optionalAccess', _492 => _492.name])) {
|
|
9819
9848
|
declaredNames.push(declaration.id.name);
|
|
9820
9849
|
} else if (declaration.type === "VariableDeclaration") {
|
|
9821
9850
|
for (const declarator of declaration.declarations || []) {
|
|
9822
|
-
if (_optionalChain([declarator, 'access',
|
|
9851
|
+
if (_optionalChain([declarator, 'access', _493 => _493.id, 'optionalAccess', _494 => _494.type]) === "Identifier") declaredNames.push(declarator.id.name);
|
|
9823
9852
|
}
|
|
9824
9853
|
}
|
|
9825
9854
|
const componentNames = declaredNames.filter((name) => /^[A-Z]/.test(name));
|
|
@@ -9880,10 +9909,10 @@ function warnClientBoundaryOnce(context, id, code, config) {
|
|
|
9880
9909
|
let program;
|
|
9881
9910
|
try {
|
|
9882
9911
|
program = context.parse(code);
|
|
9883
|
-
} catch (
|
|
9912
|
+
} catch (e27) {
|
|
9884
9913
|
return;
|
|
9885
9914
|
}
|
|
9886
|
-
const publicKeys = new Set(Object.keys(_nullishCoalesce(_optionalChain([config, 'access',
|
|
9915
|
+
const publicKeys = new Set(Object.keys(_nullishCoalesce(_optionalChain([config, 'access', _495 => _495.env, 'optionalAccess', _496 => _496.public]), () => ( {}))));
|
|
9887
9916
|
const findings = analyzeClientBoundary(program, publicKeys);
|
|
9888
9917
|
if (findings.envKeys.length === 0 && findings.publicEnvKeys.length === 0 && findings.builtinImports.length === 0) {
|
|
9889
9918
|
return;
|
|
@@ -9934,13 +9963,16 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
9934
9963
|
config(userConfig, configEnv) {
|
|
9935
9964
|
isBuild = configEnv.command === "build";
|
|
9936
9965
|
const layerAliases = _chunkY4YMF2NQcjs.getFarmLayerAliases.call(void 0, options.layers);
|
|
9937
|
-
const sourceAlias = hasViteAlias(_optionalChain([userConfig, 'access',
|
|
9966
|
+
const sourceAlias = hasViteAlias(_optionalChain([userConfig, 'access', _497 => _497.resolve, 'optionalAccess', _498 => _498.alias]), "@") ? {} : createFarmSourceAlias(options.root || process.cwd(), options.srcDir);
|
|
9938
9967
|
const layerRoots = (_nullishCoalesce(options.layers, () => ( []))).map((layer) => layer.root);
|
|
9939
9968
|
return {
|
|
9940
9969
|
// Honor Farm's publicDir so the dev server serves the same static
|
|
9941
9970
|
// directory the production client build emits.
|
|
9942
9971
|
...options.publicDir ? { publicDir: options.publicDir } : {},
|
|
9943
9972
|
define: getEnvDefines(options, configEnv),
|
|
9973
|
+
// Keep development module ownership explicit; the RSC plugin adds its
|
|
9974
|
+
// environment only when enabled. Production environment setup is unchanged.
|
|
9975
|
+
...!isBuild ? { environments: { client: {}, ssr: {} } } : {},
|
|
9944
9976
|
resolve: {
|
|
9945
9977
|
alias: { ...layerAliases, ...sourceAlias }
|
|
9946
9978
|
},
|
|
@@ -9968,7 +10000,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
9968
10000
|
if (!pm) return;
|
|
9969
10001
|
try {
|
|
9970
10002
|
await pm.runHookParallel("onError", { phase, error, meta });
|
|
9971
|
-
} catch (
|
|
10003
|
+
} catch (e28) {
|
|
9972
10004
|
}
|
|
9973
10005
|
}, "emitPluginError");
|
|
9974
10006
|
farmApp = new FarmApp(
|
|
@@ -9980,7 +10012,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
9980
10012
|
);
|
|
9981
10013
|
await farmApp.initialize();
|
|
9982
10014
|
const farmConfig = farmApp.getConfig();
|
|
9983
|
-
if (_optionalChain([farmConfig, 'access',
|
|
10015
|
+
if (_optionalChain([farmConfig, 'access', _499 => _499.agent, 'optionalAccess', _500 => _500.noindexPreviews])) {
|
|
9984
10016
|
server.middlewares.use((_req, res, next) => {
|
|
9985
10017
|
if (_chunkCXP5U3RWcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env)) {
|
|
9986
10018
|
res.setHeader("X-Robots-Tag", _chunkISTFC3MZcjs.FARM_PREVIEW_ROBOTS_TAG);
|
|
@@ -9999,7 +10031,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
9999
10031
|
validateRemoteUrl: createNodeImageUrlValidator(farmConfig.images),
|
|
10000
10032
|
// Vite owns this address. Unlike request.url, it cannot be replaced by
|
|
10001
10033
|
// a caller-controlled Host header.
|
|
10002
|
-
trustedLocalOrigin: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => _optionalChain([server, 'access',
|
|
10034
|
+
trustedLocalOrigin: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => _optionalChain([server, 'access', _501 => _501.resolvedUrls, 'optionalAccess', _502 => _502.local, 'access', _503 => _503[0]]), "trustedLocalOrigin"),
|
|
10003
10035
|
onError(error) {
|
|
10004
10036
|
_chunk5QIKR7RRcjs.logger.error(
|
|
10005
10037
|
`Image optimization failed: ${error instanceof Error ? error.message : String(error)}`
|
|
@@ -10019,15 +10051,15 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
10019
10051
|
const workflowConfig = farmConfig.workflows;
|
|
10020
10052
|
const farmDocsDevRuntime = farmConfig.docs.enabled ? await loadFarmDocsDevRuntime() : null;
|
|
10021
10053
|
const getExtraRouteTypes = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => [
|
|
10022
|
-
..._optionalChain([options, 'access',
|
|
10023
|
-
..._nullishCoalesce(_optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
10054
|
+
..._optionalChain([options, 'access', _504 => _504.openapi, 'optionalAccess', _505 => _505.enabled]) && options.openapi.route ? [options.openapi.route] : [],
|
|
10055
|
+
..._nullishCoalesce(_optionalChain([farmDocsDevRuntime, 'optionalAccess', _506 => _506.getFarmDocsRouteTypeEntries, 'call', _507 => _507(farmConfig.docs)]), () => ( []))
|
|
10024
10056
|
], "getExtraRouteTypes");
|
|
10025
10057
|
const appDirSlugs = sourceRoots.map(
|
|
10026
10058
|
(source) => path16.join(source.root, source.srcDir, "app").replace(/\\/g, "/")
|
|
10027
10059
|
);
|
|
10028
10060
|
const generateTypeArtifacts = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (reason, selection = ALL_TYPE_ARTIFACTS, log = false) => {
|
|
10029
10061
|
try {
|
|
10030
|
-
const result = await
|
|
10062
|
+
const result = await _chunkXFFQSD2Fcjs.generateFarmTypeArtifacts.call(void 0, {
|
|
10031
10063
|
root: farmConfig.root,
|
|
10032
10064
|
srcDir: farmConfig.srcDir,
|
|
10033
10065
|
layers: farmConfig.layers,
|
|
@@ -10067,7 +10099,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
10067
10099
|
(source) => path16.join(source.root, source.srcDir).replace(/\\/g, "/")
|
|
10068
10100
|
);
|
|
10069
10101
|
const layerConfigFiles = new Set(
|
|
10070
|
-
farmConfig.layers.map((layer) => _optionalChain([layer, 'access',
|
|
10102
|
+
farmConfig.layers.map((layer) => _optionalChain([layer, 'access', _508 => _508.configFile, 'optionalAccess', _509 => _509.replace, 'call', _510 => _510(/\\/g, "/")])).filter((file) => Boolean(file))
|
|
10071
10103
|
);
|
|
10072
10104
|
const routeModuleExtensions = /* @__PURE__ */ new Set([
|
|
10073
10105
|
..._chunkTFAXUHWXcjs.resolveFarmComponentExtensions.call(void 0, farmConfig.renderer.componentExtensions),
|
|
@@ -10130,9 +10162,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
10130
10162
|
["add", "change", "unlink"].forEach((ev) => {
|
|
10131
10163
|
server.watcher.on(ev, (file) => {
|
|
10132
10164
|
if (ev === "add") {
|
|
10133
|
-
|
|
10134
|
-
if (mod.ssrError) server.moduleGraph.invalidateModule(mod);
|
|
10135
|
-
}
|
|
10165
|
+
_chunkBMWDEBXOcjs.invalidateFailedFarmDevModules.call(void 0, server);
|
|
10136
10166
|
}
|
|
10137
10167
|
const normalizedFile = file.replace(/\\/g, "/");
|
|
10138
10168
|
const configChanged = isFarmConfigFile(file, farmConfig.root) || layerConfigFiles.has(normalizedFile);
|
|
@@ -10148,7 +10178,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
10148
10178
|
scheduleTypeArtifactGen(file, ev, typeArtifacts);
|
|
10149
10179
|
}
|
|
10150
10180
|
if (isI18nCatalogFile(file)) {
|
|
10151
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
10181
|
+
_optionalChain([farmApp, 'optionalAccess', _511 => _511.getI18nRuntime, 'call', _512 => _512(), 'access', _513 => _513.reload, 'call', _514 => _514(), 'access', _515 => _515.then, 'call', _516 => _516(() => server.ws.send({ type: "full-reload", path: "*" })), 'access', _517 => _517.catch, 'call', _518 => _518((error) => _chunk5QIKR7RRcjs.logger.warn(`i18n catalog reload failed: ${error.message}`))]);
|
|
10152
10182
|
}
|
|
10153
10183
|
const isRouteRefreshEvent = (ev !== "change" || isStaticMetadataImageFile2(file)) && (isAppRuntimeFile(file) || isProgrammaticRouteFile(file) || isProgrammaticRouteSourceFile(file) && (ev === "unlink" || fileContainsProgrammaticPageRoute(file)));
|
|
10154
10184
|
if (isRouteRefreshEvent) {
|
|
@@ -10161,8 +10191,8 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
10161
10191
|
const reloadsMiddleware = pendingRouteRefreshIncludesMiddleware;
|
|
10162
10192
|
pendingRouteRefreshIncludesMiddleware = false;
|
|
10163
10193
|
Promise.all([
|
|
10164
|
-
_optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
10165
|
-
reloadsMiddleware ? _optionalChain([middlewareManager, 'optionalAccess',
|
|
10194
|
+
_optionalChain([refreshRouteDiscovery, 'optionalCall', _519 => _519(`${ev} ${file}`)]),
|
|
10195
|
+
reloadsMiddleware ? _optionalChain([middlewareManager, 'optionalAccess', _520 => _520.reload, 'call', _521 => _521()]) : void 0
|
|
10166
10196
|
]).then(() => server.ws.send({ type: "full-reload", path: "*" })).catch((error) => _chunk5QIKR7RRcjs.logger.warn(`Route refresh failed: ${error.message}`));
|
|
10167
10197
|
}, 50);
|
|
10168
10198
|
}
|
|
@@ -10196,7 +10226,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
10196
10226
|
layoutCount: discoveredRoutes.filter((r) => r.kind === "layout").length
|
|
10197
10227
|
});
|
|
10198
10228
|
}
|
|
10199
|
-
apiRouteManager = new (0,
|
|
10229
|
+
apiRouteManager = new (0, _chunkB3WK4DTXcjs.APIRouteManager)(appDirs, server, {
|
|
10200
10230
|
plugins: farmConfig.plugins,
|
|
10201
10231
|
i18n: farmApp.getI18nRuntime(),
|
|
10202
10232
|
bodySizeLimit: serverConfig.bodySizeLimit,
|
|
@@ -10212,14 +10242,14 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
10212
10242
|
discoveredWorkflows = await discoverFarmWorkflows(
|
|
10213
10243
|
{ ...farmConfig, workflows: workflowConfig },
|
|
10214
10244
|
{
|
|
10215
|
-
loadModule: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (filePath) =>
|
|
10245
|
+
loadModule: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (filePath) => _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, server, filePath), "loadModule")
|
|
10216
10246
|
}
|
|
10217
10247
|
);
|
|
10218
10248
|
if (discoveredWorkflows.length > 0) {
|
|
10219
10249
|
workflowHandler = createFarmWorkflowRequestHandler({
|
|
10220
10250
|
workflows: discoveredWorkflows,
|
|
10221
10251
|
config: workflowConfig,
|
|
10222
|
-
loadModule: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (workflow) =>
|
|
10252
|
+
loadModule: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (workflow) => _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, server, workflow.filePath), "loadModule"),
|
|
10223
10253
|
server: farmConfig.server
|
|
10224
10254
|
});
|
|
10225
10255
|
_chunk5QIKR7RRcjs.logger.success(`\u2705 Discovered ${discoveredWorkflows.length} Farm workflow task(s)`);
|
|
@@ -10234,7 +10264,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
10234
10264
|
});
|
|
10235
10265
|
}
|
|
10236
10266
|
}
|
|
10237
|
-
middlewareManager = new (0,
|
|
10267
|
+
middlewareManager = new (0, _chunkWM6HL7E7cjs.MiddlewareManager)(
|
|
10238
10268
|
appDirs,
|
|
10239
10269
|
server,
|
|
10240
10270
|
farmConfig.middleware,
|
|
@@ -10251,11 +10281,11 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
10251
10281
|
});
|
|
10252
10282
|
}
|
|
10253
10283
|
}
|
|
10254
|
-
if (_optionalChain([options, 'access',
|
|
10284
|
+
if (_optionalChain([options, 'access', _522 => _522.openapi, 'optionalAccess', _523 => _523.enabled])) {
|
|
10255
10285
|
const { OpenAPIManager } = await loadFarmOpenAPIDevRuntime();
|
|
10256
10286
|
openAPIManager = new OpenAPIManager(appDirs, options.openapi, {
|
|
10257
10287
|
mode: "development",
|
|
10258
|
-
apiBaseURL: typeof _optionalChain([options, 'access',
|
|
10288
|
+
apiBaseURL: typeof _optionalChain([options, 'access', _524 => _524.api, 'optionalAccess', _525 => _525.baseURL]) === "string" ? options.api.baseURL : void 0
|
|
10259
10289
|
});
|
|
10260
10290
|
const spec = await openAPIManager.generateSpec();
|
|
10261
10291
|
reportOpenAPIDevGenerationResult(spec);
|
|
@@ -10293,16 +10323,14 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
10293
10323
|
farmConfig.srcDir
|
|
10294
10324
|
),
|
|
10295
10325
|
loadModule: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (specifier) => {
|
|
10296
|
-
const resolved = await server.pluginContainer.resolveId(specifier
|
|
10297
|
-
|
|
10298
|
-
});
|
|
10299
|
-
if (specifier === _optionalChain([farmConfig, 'access', _522 => _522.docs, 'access', _523 => _523.adapter, 'optionalAccess', _524 => _524.server]) && _optionalChain([resolved, 'optionalAccess', _525 => _525.id])) {
|
|
10326
|
+
const resolved = await server.environments.ssr.pluginContainer.resolveId(specifier);
|
|
10327
|
+
if (specifier === _optionalChain([farmConfig, 'access', _526 => _526.docs, 'access', _527 => _527.adapter, 'optionalAccess', _528 => _528.server]) && _optionalChain([resolved, 'optionalAccess', _529 => _529.id])) {
|
|
10300
10328
|
return import(
|
|
10301
10329
|
/* @vite-ignore */
|
|
10302
10330
|
_url.pathToFileURL.call(void 0, resolved.id).href
|
|
10303
10331
|
);
|
|
10304
10332
|
}
|
|
10305
|
-
return
|
|
10333
|
+
return _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, server, _nullishCoalesce(_optionalChain([resolved, 'optionalAccess', _530 => _530.id]), () => ( specifier)));
|
|
10306
10334
|
}, "loadModule")
|
|
10307
10335
|
}) : farmDocsDevRuntime.createFarmDocsHandler(farmConfig.docs, {
|
|
10308
10336
|
root: farmConfig.root,
|
|
@@ -10317,7 +10345,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
10317
10345
|
)
|
|
10318
10346
|
}) : null;
|
|
10319
10347
|
const wrapFarmDocsResponseWithLayouts = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (request2, response) => {
|
|
10320
|
-
if (request2.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access',
|
|
10348
|
+
if (request2.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access', _531 => _531.headers, 'access', _532 => _532.get, 'call', _533 => _533("content-type"), 'optionalAccess', _534 => _534.toLowerCase, 'call', _535 => _535(), 'access', _536 => _536.includes, 'call', _537 => _537("text/html")])) {
|
|
10321
10349
|
return response;
|
|
10322
10350
|
}
|
|
10323
10351
|
const pathname = new URL(request2.url).pathname;
|
|
@@ -10338,9 +10366,9 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
10338
10366
|
headers: response.headers
|
|
10339
10367
|
});
|
|
10340
10368
|
}
|
|
10341
|
-
const docsRenderer = _chunkTFAXUHWXcjs.resolveFarmRenderer.call(void 0, (_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
10369
|
+
const docsRenderer = _chunkTFAXUHWXcjs.resolveFarmRenderer.call(void 0, (_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _538 => _538.getConfig, 'call', _539 => _539()]), () => ( options))).renderer);
|
|
10342
10370
|
const [rendererRuntime, layoutModules] = await Promise.all([
|
|
10343
|
-
_chunkTFAXUHWXcjs.isReactRenderer.call(void 0, docsRenderer) ? import("./renderer/react/server.cjs") :
|
|
10371
|
+
_chunkTFAXUHWXcjs.isReactRenderer.call(void 0, docsRenderer) ? import("./renderer/react/server.cjs") : _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, server, docsRenderer.server),
|
|
10344
10372
|
Promise.all(
|
|
10345
10373
|
layoutEntries.map((layout) => routeManager.loadLayoutModule(layout.modulePath))
|
|
10346
10374
|
)
|
|
@@ -10367,7 +10395,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
10367
10395
|
])
|
|
10368
10396
|
);
|
|
10369
10397
|
const inlineValue = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (value) => JSON.stringify(value).replace(/</g, "\\u003c").replace(/>/g, "\\u003e"), "inlineValue");
|
|
10370
|
-
const pageModulePath = _optionalChain([matchedRoute, 'access',
|
|
10398
|
+
const pageModulePath = _optionalChain([matchedRoute, 'access', _540 => _540.route, 'optionalAccess', _541 => _541.modulePath]) ? toUrlPath(matchedRoute.route.modulePath) : "";
|
|
10371
10399
|
const bootstrapScript = `<script>
|
|
10372
10400
|
window.__FARM_PROPS__ = ${inlineValue({ params })};
|
|
10373
10401
|
window.__FARM_ROUTE_SLOTS__ = [];
|
|
@@ -10461,7 +10489,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10461
10489
|
}, "dispatch")
|
|
10462
10490
|
},
|
|
10463
10491
|
(request2) => {
|
|
10464
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
10492
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _542 => _542.getConfig, 'call', _543 => _543()]), () => ( options));
|
|
10465
10493
|
const currentServerConfig = _chunkEM6SBQKMcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
|
|
10466
10494
|
return _chunk5ZSWG4UXcjs.resolveFarmRequestURL.call(void 0, request2, {
|
|
10467
10495
|
trustProxy: currentServerConfig.trustProxy
|
|
@@ -10472,7 +10500,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10472
10500
|
withAPIRequestTracing(async (req, res, next) => {
|
|
10473
10501
|
const requestUrl = req.url || "/";
|
|
10474
10502
|
const requestMethod = req.method || "GET";
|
|
10475
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
10503
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _544 => _544.getConfig, 'call', _545 => _545()]), () => ( options));
|
|
10476
10504
|
const currentServerConfig = _chunkEM6SBQKMcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
|
|
10477
10505
|
const parsedRequestUrl = _chunk5ZSWG4UXcjs.resolveFarmRequestURL.call(void 0, req, {
|
|
10478
10506
|
trustProxy: currentServerConfig.trustProxy
|
|
@@ -10514,7 +10542,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10514
10542
|
if (referrerUrl.origin === parsedRequestUrl.origin && !referrerUrl.pathname.startsWith(_chunkYJRZR7VUcjs.FARM_DEVTOOLS_PATH)) {
|
|
10515
10543
|
launchUrl = referrerUrl;
|
|
10516
10544
|
}
|
|
10517
|
-
} catch (
|
|
10545
|
+
} catch (e29) {
|
|
10518
10546
|
}
|
|
10519
10547
|
}
|
|
10520
10548
|
launchUrl.searchParams.set(_chunkYJRZR7VUcjs.FARM_DEVTOOLS_LAUNCH_PARAM, "1");
|
|
@@ -10562,7 +10590,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10562
10590
|
return;
|
|
10563
10591
|
}
|
|
10564
10592
|
const runAppMiddlewareForContentRoute = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => {
|
|
10565
|
-
if (!_optionalChain([middlewareManager, 'optionalAccess',
|
|
10593
|
+
if (!_optionalChain([middlewareManager, 'optionalAccess', _546 => _546.hasMiddleware, 'call', _547 => _547()])) return false;
|
|
10566
10594
|
const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
|
|
10567
10595
|
return runFarmMiddlewareWithNavigation(
|
|
10568
10596
|
farmApp.getServerRenderer(),
|
|
@@ -10573,7 +10601,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10573
10601
|
);
|
|
10574
10602
|
}, "runAppMiddlewareForContentRoute");
|
|
10575
10603
|
const openAPIRequestPathname = openAPIManager ? _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) : requestPathname;
|
|
10576
|
-
if (openAPIManager && _optionalChain([options, 'access',
|
|
10604
|
+
if (openAPIManager && _optionalChain([options, 'access', _548 => _548.openapi, 'optionalAccess', _549 => _549.specRoute]) && openAPIRequestPathname === options.openapi.specRoute) {
|
|
10577
10605
|
if (await runAppMiddlewareForContentRoute()) return;
|
|
10578
10606
|
if (requestMethod !== "GET" && requestMethod !== "HEAD") {
|
|
10579
10607
|
res.statusCode = 405;
|
|
@@ -10590,7 +10618,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10590
10618
|
res.end(requestMethod === "HEAD" ? void 0 : body);
|
|
10591
10619
|
return;
|
|
10592
10620
|
}
|
|
10593
|
-
if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access',
|
|
10621
|
+
if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access', _550 => _550.openapi, 'optionalAccess', _551 => _551.route])) {
|
|
10594
10622
|
if (await runAppMiddlewareForContentRoute()) return;
|
|
10595
10623
|
const docsHandler = openAPIManager.getDocsRouteHandler(parsedRequestUrl.origin);
|
|
10596
10624
|
return docsHandler(req, res);
|
|
@@ -10630,7 +10658,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10630
10658
|
config: farmApp.getConfig().mdx,
|
|
10631
10659
|
resolveSource: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (pathname2) => {
|
|
10632
10660
|
const match = farmApp.getRouteManager().matchRoute(pathname2);
|
|
10633
|
-
const sourcePath = _optionalChain([match, 'access',
|
|
10661
|
+
const sourcePath = _optionalChain([match, 'access', _552 => _552.route, 'optionalAccess', _553 => _553.markdownSourcePath]) || (match.route && _chunkAH7HOAQ3cjs.isFarmMarkdownPageFile.call(void 0, match.route.modulePath) ? match.route.modulePath : null);
|
|
10634
10662
|
if (!sourcePath) {
|
|
10635
10663
|
return null;
|
|
10636
10664
|
}
|
|
@@ -10738,7 +10766,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10738
10766
|
"beforeRequest",
|
|
10739
10767
|
(plugin) => {
|
|
10740
10768
|
const owner = _chunkZ5HIWVDPcjs.getFarmIntegrationPluginOwner.call(void 0, plugin);
|
|
10741
|
-
return plugin.name !== _chunkYZTASLPQcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME && (_optionalChain([owner, 'optionalAccess',
|
|
10769
|
+
return plugin.name !== _chunkYZTASLPQcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME && (_optionalChain([owner, 'optionalAccess', _554 => _554.source]) !== "lifecycle" || owner.key !== matchedRoute.key);
|
|
10742
10770
|
},
|
|
10743
10771
|
req,
|
|
10744
10772
|
res
|
|
@@ -10868,7 +10896,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10868
10896
|
const apiHandler = apiRouteManager.getHandler({ throwOnError: true });
|
|
10869
10897
|
const hasExplicitAPIRoute = hasMatchedApiRoute || Boolean(apiRouteManager.matchRoute(pathname2));
|
|
10870
10898
|
if (apiHandler && hasExplicitAPIRoute) {
|
|
10871
|
-
const apiRoutePattern = _optionalChain([matchedApiRoute, 'optionalAccess',
|
|
10899
|
+
const apiRoutePattern = _optionalChain([matchedApiRoute, 'optionalAccess', _555 => _555.route, 'access', _556 => _556.path]) || _optionalChain([apiRouteManager, 'access', _557 => _557.matchRoute, 'call', _558 => _558(pathname2), 'optionalAccess', _559 => _559.route, 'access', _560 => _560.path]) || urlPath2;
|
|
10872
10900
|
_chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, {
|
|
10873
10901
|
type: "route.matched",
|
|
10874
10902
|
pathname: pathname2,
|
|
@@ -10958,7 +10986,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10958
10986
|
return;
|
|
10959
10987
|
}
|
|
10960
10988
|
}
|
|
10961
|
-
if (farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
10989
|
+
if (farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _561 => _561.isFarmDocsAPIRequest, 'call', _562 => _562(pathname2)])) {
|
|
10962
10990
|
try {
|
|
10963
10991
|
const url = `http://${req.headers.host || "localhost:3000"}${req.url}`;
|
|
10964
10992
|
const headers = new Headers();
|
|
@@ -11031,18 +11059,18 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11031
11059
|
res.end(JSON.stringify({ error: "API route not found", pathname: pathname2 }));
|
|
11032
11060
|
return;
|
|
11033
11061
|
}
|
|
11034
|
-
if (_optionalChain([req, 'access',
|
|
11062
|
+
if (_optionalChain([req, 'access', _563 => _563.url, 'optionalAccess', _564 => _564.startsWith, 'call', _565 => _565("/@")]) || _optionalChain([req, 'access', _566 => _566.url, 'optionalAccess', _567 => _567.startsWith, 'call', _568 => _568("/node_modules")])) {
|
|
11035
11063
|
return next();
|
|
11036
11064
|
}
|
|
11037
11065
|
if (shouldBypassFarmRouterForDottedPath(
|
|
11038
11066
|
requestPathname,
|
|
11039
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
11067
|
+
_optionalChain([farmApp, 'optionalAccess', _569 => _569.getRouteManager, 'call', _570 => _570()]),
|
|
11040
11068
|
[server.config.publicDir, server.config.root],
|
|
11041
11069
|
farmAgentGeneratedPaths(farmConfig)
|
|
11042
11070
|
)) {
|
|
11043
11071
|
return next();
|
|
11044
11072
|
}
|
|
11045
|
-
if (_optionalChain([req, 'access',
|
|
11073
|
+
if (_optionalChain([req, 'access', _571 => _571.url, 'optionalAccess', _572 => _572.startsWith, 'call', _573 => _573("/__farm/page-data")])) {
|
|
11046
11074
|
const urlObj = parsedRequestUrl;
|
|
11047
11075
|
const targetPath = urlObj.searchParams.get("path") || "/";
|
|
11048
11076
|
try {
|
|
@@ -11070,7 +11098,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11070
11098
|
});
|
|
11071
11099
|
let middlewareMap = /* @__PURE__ */ new Map();
|
|
11072
11100
|
let middlewareContext = /* @__PURE__ */ new Map();
|
|
11073
|
-
if (_optionalChain([middlewareManager, 'optionalAccess',
|
|
11101
|
+
if (_optionalChain([middlewareManager, 'optionalAccess', _574 => _574.hasMiddleware, 'call', _575 => _575()])) {
|
|
11074
11102
|
const targetNodeRequest = createPageDataMiddlewareRequest(req, targetRequestUrl);
|
|
11075
11103
|
const handled = await runFarmMiddlewareWithNavigation(
|
|
11076
11104
|
farmApp.getServerRenderer(),
|
|
@@ -11098,10 +11126,10 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11098
11126
|
if (pm) {
|
|
11099
11127
|
await pm.runHookParallel("afterRouteMatch", {
|
|
11100
11128
|
pathname: targetPath,
|
|
11101
|
-
matched: !!_optionalChain([match, 'optionalAccess',
|
|
11102
|
-
routePattern: _optionalChain([match, 'optionalAccess',
|
|
11103
|
-
params: _optionalChain([match, 'optionalAccess',
|
|
11104
|
-
layoutPatterns: (_optionalChain([match, 'optionalAccess',
|
|
11129
|
+
matched: !!_optionalChain([match, 'optionalAccess', _576 => _576.route]),
|
|
11130
|
+
routePattern: _optionalChain([match, 'optionalAccess', _577 => _577.route, 'optionalAccess', _578 => _578.pattern]) || null,
|
|
11131
|
+
params: _optionalChain([match, 'optionalAccess', _579 => _579.params]) || {},
|
|
11132
|
+
layoutPatterns: (_optionalChain([match, 'optionalAccess', _580 => _580.layouts]) || []).map((l) => l.pattern)
|
|
11105
11133
|
});
|
|
11106
11134
|
}
|
|
11107
11135
|
if (!match) {
|
|
@@ -11165,22 +11193,22 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11165
11193
|
routePath: route.pattern
|
|
11166
11194
|
});
|
|
11167
11195
|
for (const layoutModule of layoutModules) {
|
|
11168
|
-
mergedMetadata =
|
|
11196
|
+
mergedMetadata = _chunkKNPRCKXKcjs.mergeMetadata.call(void 0, mergedMetadata, layoutModule.metadata);
|
|
11169
11197
|
if (typeof layoutModule.generateMetadata === "function") {
|
|
11170
|
-
mergedMetadata =
|
|
11198
|
+
mergedMetadata = _chunkKNPRCKXKcjs.mergeMetadata.call(void 0,
|
|
11171
11199
|
mergedMetadata,
|
|
11172
11200
|
await layoutModule.generateMetadata({ params: routeProps.params })
|
|
11173
11201
|
);
|
|
11174
11202
|
}
|
|
11175
11203
|
}
|
|
11176
|
-
mergedMetadata =
|
|
11204
|
+
mergedMetadata = _chunkKNPRCKXKcjs.mergeMetadata.call(void 0, mergedMetadata, routeModule.metadata);
|
|
11177
11205
|
if (typeof routeModule.generateMetadata === "function") {
|
|
11178
|
-
mergedMetadata =
|
|
11206
|
+
mergedMetadata = _chunkKNPRCKXKcjs.mergeMetadata.call(void 0,
|
|
11179
11207
|
mergedMetadata,
|
|
11180
11208
|
await routeModule.generateMetadata(routeProps)
|
|
11181
11209
|
);
|
|
11182
11210
|
}
|
|
11183
|
-
mergedMetadata =
|
|
11211
|
+
mergedMetadata = _chunkKNPRCKXKcjs.addMetadataMarkdownAlternate.call(void 0,
|
|
11184
11212
|
mergedMetadata,
|
|
11185
11213
|
_chunkBBVSJVBZcjs.getFarmMarkdownAlternatePath.call(void 0, farmApp.getConfig().md, targetRequestUrl.pathname)
|
|
11186
11214
|
);
|
|
@@ -11238,7 +11266,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11238
11266
|
pageShouldHydrate: shouldHydrate,
|
|
11239
11267
|
layoutShouldHydrate: shouldHydrateLayout,
|
|
11240
11268
|
islandStrategy: hydrationIslandStrategy,
|
|
11241
|
-
rendering:
|
|
11269
|
+
rendering: _chunkXFFQSD2Fcjs.resolveRouteRenderingConfig.call(void 0, routeModule)
|
|
11242
11270
|
});
|
|
11243
11271
|
const destinationLayoutPatterns = layouts.map((layout) => layout.pattern);
|
|
11244
11272
|
const layoutStartIndex = getSharedLayoutPrefixLength(
|
|
@@ -11252,7 +11280,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11252
11280
|
middlewareContext,
|
|
11253
11281
|
() => renderer.renderNavigationFragment({
|
|
11254
11282
|
PageComponent: routeModule.default,
|
|
11255
|
-
LoadingComponent: _optionalChain([loadingModule, 'optionalAccess',
|
|
11283
|
+
LoadingComponent: _optionalChain([loadingModule, 'optionalAccess', _581 => _581.default]),
|
|
11256
11284
|
pageProps: routeProps,
|
|
11257
11285
|
params,
|
|
11258
11286
|
layouts: layouts.map((layout, index) => ({
|
|
@@ -11358,14 +11386,14 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11358
11386
|
trustProxy: currentServerConfig.trustProxy
|
|
11359
11387
|
}).pathname;
|
|
11360
11388
|
const routeManager2 = farmApp.getRouteManager();
|
|
11361
|
-
const hasBeforeRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
11362
|
-
const hasAfterRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
11363
|
-
const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
11364
|
-
const hasBeforeRenderHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
11365
|
-
const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
11366
|
-
const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
11367
|
-
const hasRuntimeRequestHooks = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
11368
|
-
const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
11389
|
+
const hasBeforeRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _582 => _582.hasHook, 'call', _583 => _583("beforeRouteMatch")]), () => ( false));
|
|
11390
|
+
const hasAfterRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _584 => _584.hasHook, 'call', _585 => _585("afterRouteMatch")]), () => ( false));
|
|
11391
|
+
const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _586 => _586.hasHook, 'call', _587 => _587("beforeRequest")]), () => ( false));
|
|
11392
|
+
const hasBeforeRenderHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _588 => _588.hasHook, 'call', _589 => _589("beforeRender")]), () => ( false));
|
|
11393
|
+
const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _590 => _590.hasHook, 'call', _591 => _591("afterResponse")]), () => ( false));
|
|
11394
|
+
const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _592 => _592.hasHook, 'call', _593 => _593("transformHTML")]), () => ( false))) || (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _594 => _594.hasHook, 'call', _595 => _595("afterRender")]), () => ( false)));
|
|
11395
|
+
const hasRuntimeRequestHooks = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _596 => _596.hasRuntimeRequestHooks, 'call', _597 => _597()]), () => ( false));
|
|
11396
|
+
const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _598 => _598.hasRuntimeHook, 'call', _599 => _599("after")]), () => ( false));
|
|
11369
11397
|
const requestedMatch = routeManager2.matchRoute(requestedPathname);
|
|
11370
11398
|
let runtimeSession;
|
|
11371
11399
|
if (pm && hasRuntimeRequestHooks) {
|
|
@@ -11376,8 +11404,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11376
11404
|
kind: "page",
|
|
11377
11405
|
route: {
|
|
11378
11406
|
pathname: requestedPathname,
|
|
11379
|
-
pattern: _optionalChain([requestedMatch, 'optionalAccess',
|
|
11380
|
-
params: _optionalChain([requestedMatch, 'optionalAccess',
|
|
11407
|
+
pattern: _optionalChain([requestedMatch, 'optionalAccess', _600 => _600.route, 'optionalAccess', _601 => _601.pattern]) || null,
|
|
11408
|
+
params: _optionalChain([requestedMatch, 'optionalAccess', _602 => _602.params]) || {}
|
|
11381
11409
|
}
|
|
11382
11410
|
}
|
|
11383
11411
|
);
|
|
@@ -11410,17 +11438,17 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11410
11438
|
if (pm && hasAfterRouteMatchHook) {
|
|
11411
11439
|
await pm.runHookParallel("afterRouteMatch", {
|
|
11412
11440
|
pathname,
|
|
11413
|
-
matched: !!_optionalChain([routeMatch, 'optionalAccess',
|
|
11414
|
-
routePattern: _optionalChain([routeMatch, 'optionalAccess',
|
|
11415
|
-
params: _optionalChain([routeMatch, 'optionalAccess',
|
|
11416
|
-
layoutPatterns: (_optionalChain([routeMatch, 'optionalAccess',
|
|
11441
|
+
matched: !!_optionalChain([routeMatch, 'optionalAccess', _603 => _603.route]),
|
|
11442
|
+
routePattern: _optionalChain([routeMatch, 'optionalAccess', _604 => _604.route, 'optionalAccess', _605 => _605.pattern]) || null,
|
|
11443
|
+
params: _optionalChain([routeMatch, 'optionalAccess', _606 => _606.params]) || {},
|
|
11444
|
+
layoutPatterns: (_optionalChain([routeMatch, 'optionalAccess', _607 => _607.layouts]) || []).map((l) => l.pattern)
|
|
11417
11445
|
});
|
|
11418
11446
|
}
|
|
11419
11447
|
const renderPayload = {
|
|
11420
11448
|
pathname,
|
|
11421
11449
|
method,
|
|
11422
|
-
routePattern: _optionalChain([routeMatch, 'optionalAccess',
|
|
11423
|
-
params: _optionalChain([routeMatch, 'optionalAccess',
|
|
11450
|
+
routePattern: _optionalChain([routeMatch, 'optionalAccess', _608 => _608.route, 'optionalAccess', _609 => _609.pattern]) || null,
|
|
11451
|
+
params: _optionalChain([routeMatch, 'optionalAccess', _610 => _610.params]) || {}
|
|
11424
11452
|
};
|
|
11425
11453
|
const shouldInterceptResponse = Boolean(
|
|
11426
11454
|
pm && (hasAfterResponseHook || hasHTMLTransformHook || runtimeSession && hasRuntimeAfterHook)
|
|
@@ -11442,7 +11470,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11442
11470
|
emitError: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (error) => emitPluginError("response-end", error, { pathname }), "emitError")
|
|
11443
11471
|
}) : void 0;
|
|
11444
11472
|
try {
|
|
11445
|
-
if (_optionalChain([middlewareManager, 'optionalAccess',
|
|
11473
|
+
if (_optionalChain([middlewareManager, 'optionalAccess', _611 => _611.hasMiddleware, 'call', _612 => _612()])) {
|
|
11446
11474
|
const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
|
|
11447
11475
|
const handled = await runFarmMiddlewareWithNavigation(
|
|
11448
11476
|
farmApp.getServerRenderer(),
|
|
@@ -11452,7 +11480,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11452
11480
|
() => middlewareManager.execute(req, res)
|
|
11453
11481
|
);
|
|
11454
11482
|
if (handled) {
|
|
11455
|
-
if (!_optionalChain([responseInterceptor, 'optionalAccess',
|
|
11483
|
+
if (!_optionalChain([responseInterceptor, 'optionalAccess', _613 => _613.isEnded, 'call', _614 => _614()])) {
|
|
11456
11484
|
const duration = Date.now() - startTime;
|
|
11457
11485
|
logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
|
|
11458
11486
|
}
|
|
@@ -11464,7 +11492,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11464
11492
|
req.url || "/",
|
|
11465
11493
|
`http://${req.headers.host || "localhost:3000"}`
|
|
11466
11494
|
).pathname;
|
|
11467
|
-
const hasLocalPageRoute = Boolean(_optionalChain([routeManager2, 'access',
|
|
11495
|
+
const hasLocalPageRoute = Boolean(_optionalChain([routeManager2, 'access', _615 => _615.matchRoute, 'call', _616 => _616(currentPathname), 'optionalAccess', _617 => _617.route]));
|
|
11468
11496
|
await pm.runHookParallelFiltered(
|
|
11469
11497
|
"beforeRequest",
|
|
11470
11498
|
(plugin) => !hasLocalPageRoute || plugin.name !== _chunkYZTASLPQcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME,
|
|
@@ -11472,8 +11500,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11472
11500
|
res
|
|
11473
11501
|
);
|
|
11474
11502
|
}
|
|
11475
|
-
if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess',
|
|
11476
|
-
if (!_optionalChain([responseInterceptor, 'optionalAccess',
|
|
11503
|
+
if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess', _618 => _618.isEnded, 'call', _619 => _619()])) {
|
|
11504
|
+
if (!_optionalChain([responseInterceptor, 'optionalAccess', _620 => _620.isEnded, 'call', _621 => _621()])) {
|
|
11477
11505
|
const duration = Date.now() - startTime;
|
|
11478
11506
|
logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
|
|
11479
11507
|
}
|
|
@@ -11531,25 +11559,25 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11531
11559
|
if (imageModule) return imageModule;
|
|
11532
11560
|
}
|
|
11533
11561
|
if (_chunk6V4TDWECcjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
|
|
11534
|
-
const renderer = _optionalChain([farmApp, 'optionalAccess',
|
|
11535
|
-
return generateProgrammaticRouteModule(id, _optionalChain([server, 'optionalAccess',
|
|
11562
|
+
const renderer = _optionalChain([farmApp, 'optionalAccess', _622 => _622.getConfig, 'call', _623 => _623(), 'access', _624 => _624.renderer]) || _chunkTFAXUHWXcjs.resolveFarmRenderer.call(void 0, options.renderer);
|
|
11563
|
+
return generateProgrammaticRouteModule(id, _optionalChain([server, 'optionalAccess', _625 => _625.config, 'access', _626 => _626.root]) || options.root, renderer);
|
|
11536
11564
|
}
|
|
11537
11565
|
if (isFarmClientVirtualId(id)) {
|
|
11538
|
-
const resolvedConfig = _optionalChain([farmApp, 'optionalAccess',
|
|
11539
|
-
const renderer = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
11540
|
-
const integrations = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
11541
|
-
const root = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
11542
|
-
const docs = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
11566
|
+
const resolvedConfig = _optionalChain([farmApp, 'optionalAccess', _627 => _627.getConfig, 'call', _628 => _628()]);
|
|
11567
|
+
const renderer = _optionalChain([resolvedConfig, 'optionalAccess', _629 => _629.renderer]) || _chunkTFAXUHWXcjs.resolveFarmRenderer.call(void 0, options.renderer);
|
|
11568
|
+
const integrations = _optionalChain([resolvedConfig, 'optionalAccess', _630 => _630.integrations]) || options.integrations;
|
|
11569
|
+
const root = _optionalChain([resolvedConfig, 'optionalAccess', _631 => _631.root]) || _optionalChain([server, 'optionalAccess', _632 => _632.config, 'access', _633 => _633.root]) || process.cwd();
|
|
11570
|
+
const docs = _optionalChain([resolvedConfig, 'optionalAccess', _634 => _634.docs]);
|
|
11543
11571
|
const adapterOwnsDocsRuntime = Boolean(
|
|
11544
|
-
_chunkTFAXUHWXcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess',
|
|
11572
|
+
_chunkTFAXUHWXcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess', _635 => _635.adapter, 'optionalAccess', _636 => _636.server]) && docs.adapter.react
|
|
11545
11573
|
);
|
|
11546
|
-
const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
11574
|
+
const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _637 => _637.devtools]), () => ( _chunkYJRZR7VUcjs.resolveFarmDevtoolsConfig.call(void 0, false, "production")));
|
|
11547
11575
|
const [docsRuntime, docsSearchRuntime, devtoolsClientRuntime] = await Promise.all([
|
|
11548
|
-
_optionalChain([docs, 'optionalAccess',
|
|
11549
|
-
_optionalChain([docs, 'optionalAccess',
|
|
11576
|
+
_optionalChain([docs, 'optionalAccess', _638 => _638.enabled]) ? loadFarmDocsDevRuntime() : null,
|
|
11577
|
+
_optionalChain([docs, 'optionalAccess', _639 => _639.enabled]) && !adapterOwnsDocsRuntime ? loadFarmDocsSearchDevRuntime() : null,
|
|
11550
11578
|
devtools.enabled ? loadFarmDevtoolsClientRuntime() : null
|
|
11551
11579
|
]);
|
|
11552
|
-
const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess',
|
|
11580
|
+
const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess', _640 => _640.isFarmDocsSearchEnabled, 'call', _641 => _641(docs)]), () => ( false));
|
|
11553
11581
|
const generatedDocsSearchRuntime = docsSearchRuntime ? docsSearchRuntime.generateFarmDocsSearchClientRuntime(
|
|
11554
11582
|
docsSearchEnabled,
|
|
11555
11583
|
docsSearchEnabled ? docsSearchRuntime.resolveFarmDocsSearchClientModule(root) : void 0
|
|
@@ -11558,9 +11586,9 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11558
11586
|
const generatedDevIndicatorsClientRuntime = farmApp ? _chunkQBPXNZGVcjs.generateFarmDevIndicatorsClientRuntime.call(void 0, farmApp.getConfig().devIndicators) : "";
|
|
11559
11587
|
const integrationProviders = _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, renderer) ? _chunkZ5HIWVDPcjs.getIntegrationProviders.call(void 0, integrations) : [];
|
|
11560
11588
|
const isolatedHydrationMode = resolveFarmIsolatedClientHydrationMode(
|
|
11561
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
11589
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _642 => _642.experimental, 'optionalAccess', _643 => _643.isolatedClientHydration]),
|
|
11562
11590
|
{
|
|
11563
|
-
serverComponents: _optionalChain([resolvedConfig, 'optionalAccess',
|
|
11591
|
+
serverComponents: _optionalChain([resolvedConfig, 'optionalAccess', _644 => _644.experimental, 'optionalAccess', _645 => _645.serverComponents]) === true,
|
|
11564
11592
|
hasUnsupportedIntegrationProvider: integrationProviders.filter((provider) => provider.component || provider.type === "clerk").some((provider) => provider.supportsIsolatedHydration !== true)
|
|
11565
11593
|
}
|
|
11566
11594
|
);
|
|
@@ -11568,30 +11596,31 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11568
11596
|
integrationProviders,
|
|
11569
11597
|
[
|
|
11570
11598
|
..._chunkZ5HIWVDPcjs.getIntegrationDocumentNavigationMatchers.call(void 0, integrations),
|
|
11571
|
-
..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess',
|
|
11599
|
+
..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess', _646 => _646.getFarmDocsDocumentNavigationMatchers, 'call', _647 => _647(docs)]), () => ( []))
|
|
11572
11600
|
],
|
|
11573
11601
|
generatedDocsSearchRuntime,
|
|
11574
11602
|
`${generatedDevtoolsClientRuntime}
|
|
11575
11603
|
${generatedDevIndicatorsClientRuntime}`,
|
|
11576
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
11604
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _648 => _648.plugins]) || [],
|
|
11577
11605
|
root,
|
|
11578
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
11579
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
11580
|
-
_chunkTFAXUHWXcjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess',
|
|
11606
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _649 => _649.srcDir]) || options.srcDir || "src",
|
|
11607
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _650 => _650.publicRuntimeConfig]) || options.publicRuntimeConfig,
|
|
11608
|
+
_chunkTFAXUHWXcjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess', _651 => _651.adapter, 'optionalAccess', _652 => _652.react]) : void 0,
|
|
11581
11609
|
renderer,
|
|
11582
|
-
isolatedHydrationMode === "enabled" || _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
11583
|
-
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
11584
|
-
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
11610
|
+
isolatedHydrationMode === "enabled" || _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _653 => _653.getRouteManager, 'call', _654 => _654(), 'access', _655 => _655.getIsolatedClientBoundaryModules, 'call', _656 => _656(root)])))), 'optionalAccess', _657 => _657.size]) > 0,
|
|
11611
|
+
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _658 => _658.trailingSlash]), () => ( false)),
|
|
11612
|
+
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _659 => _659.basePath]), () => ( "/")),
|
|
11585
11613
|
generateClientCachePersistenceCode(
|
|
11586
|
-
resolveFarmClientCacheAdapterEntry(root, _optionalChain([resolvedConfig, 'optionalAccess',
|
|
11587
|
-
)
|
|
11614
|
+
resolveFarmClientCacheAdapterEntry(root, _optionalChain([resolvedConfig, 'optionalAccess', _660 => _660.cache]))
|
|
11615
|
+
),
|
|
11616
|
+
_chunkTFAXUHWXcjs.isReactRenderer.call(void 0, renderer) ? _chunk75WGQVQAcjs.getFarmDocsAdapterConfigModule.call(void 0, docs) : void 0
|
|
11588
11617
|
);
|
|
11589
11618
|
}
|
|
11590
11619
|
if (id === "/@farm/server") {
|
|
11591
11620
|
return generateServerCode();
|
|
11592
11621
|
}
|
|
11593
11622
|
if (id === "/@farm/manifest") {
|
|
11594
|
-
const routeManager = _optionalChain([farmApp, 'optionalAccess',
|
|
11623
|
+
const routeManager = _optionalChain([farmApp, 'optionalAccess', _661 => _661.getRouteManager, 'call', _662 => _662()]);
|
|
11595
11624
|
if (!routeManager) {
|
|
11596
11625
|
return `
|
|
11597
11626
|
export const getManifest = () => ({
|
|
@@ -11606,7 +11635,7 @@ export const getManifest = () => ({
|
|
|
11606
11635
|
const manifest = routeManager.generateClientManifest(server.config.root);
|
|
11607
11636
|
const globalStylesheetHref = resolveDevGlobalStylesheetHref(
|
|
11608
11637
|
server.config.root,
|
|
11609
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
11638
|
+
_optionalChain([farmApp, 'optionalAccess', _663 => _663.getConfig, 'call', _664 => _664(), 'access', _665 => _665.srcDir])
|
|
11610
11639
|
);
|
|
11611
11640
|
const fullManifest = {
|
|
11612
11641
|
clientEntry: "/@farm/client.js",
|
|
@@ -11657,17 +11686,17 @@ export const manifest = getManifest();
|
|
|
11657
11686
|
}
|
|
11658
11687
|
},
|
|
11659
11688
|
async transform(code, id, transformOptions) {
|
|
11660
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
11661
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
11662
|
-
if (_optionalChain([currentConfig, 'access',
|
|
11689
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _666 => _666.ssr])) {
|
|
11690
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _667 => _667.getConfig, 'call', _668 => _668()]), () => ( options));
|
|
11691
|
+
if (_optionalChain([currentConfig, 'access', _669 => _669.experimental, 'optionalAccess', _670 => _670.serverActions]) !== true) {
|
|
11663
11692
|
const violation = findClientServerFnViolation(code, id);
|
|
11664
11693
|
if (violation) {
|
|
11665
11694
|
this.error(formatServerFnBoundaryError(violation, id));
|
|
11666
11695
|
}
|
|
11667
11696
|
}
|
|
11668
11697
|
}
|
|
11669
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
11670
|
-
warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
11698
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _671 => _671.ssr]) && shouldInspectClientBoundary(id, code)) {
|
|
11699
|
+
warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _672 => _672.getConfig, 'call', _673 => _673()]), () => ( options)));
|
|
11671
11700
|
}
|
|
11672
11701
|
if (typeof imageImports.transform === "function") {
|
|
11673
11702
|
const imageModule = await imageImports.transform.call(this, code, id, transformOptions);
|
|
@@ -11682,13 +11711,13 @@ export const manifest = getManifest();
|
|
|
11682
11711
|
id,
|
|
11683
11712
|
transformOptions
|
|
11684
11713
|
);
|
|
11685
|
-
const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess',
|
|
11714
|
+
const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess', _674 => _674.code, 'optionalAccess', _675 => _675.toString, 'call', _676 => _676()]);
|
|
11686
11715
|
if (fontCode) {
|
|
11687
11716
|
transformedCode = fontCode;
|
|
11688
11717
|
transformed = true;
|
|
11689
11718
|
}
|
|
11690
11719
|
}
|
|
11691
|
-
if (_optionalChain([transformOptions, 'optionalAccess',
|
|
11720
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _677 => _677.ssr]) && server) {
|
|
11692
11721
|
const rewrittenImports = rewriteEarlySsrRelativeImports({
|
|
11693
11722
|
code: transformedCode,
|
|
11694
11723
|
id,
|
|
@@ -11708,12 +11737,12 @@ export const manifest = getManifest();
|
|
|
11708
11737
|
}
|
|
11709
11738
|
transformedCode = stripUseClientDirective(transformedCode);
|
|
11710
11739
|
transformed = true;
|
|
11711
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
11740
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _678 => _678.getConfig, 'call', _679 => _679()]), () => ( options));
|
|
11712
11741
|
let isolatedModuleReference = null;
|
|
11713
|
-
const root = currentConfig.root || _optionalChain([server, 'optionalAccess',
|
|
11742
|
+
const root = currentConfig.root || _optionalChain([server, 'optionalAccess', _680 => _680.config, 'access', _681 => _681.root]) || process.cwd();
|
|
11714
11743
|
const cleanId = id.split("?", 1)[0];
|
|
11715
|
-
const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
11716
|
-
const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess',
|
|
11744
|
+
const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _682 => _682.getRouteManager, 'call', _683 => _683(), 'access', _684 => _684.getIsolatedClientBoundaryModules, 'call', _685 => _685(root)])));
|
|
11745
|
+
const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess', _686 => _686.has, 'call', _687 => _687(path16.resolve(cleanId))]) === true;
|
|
11717
11746
|
if (_chunkTFAXUHWXcjs.isReactRenderer.call(void 0, _chunkTFAXUHWXcjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration && isIsolatableClientBoundarySource(clientBoundarySource)) {
|
|
11718
11747
|
isolatedModuleReference = _chunk5QIKR7RRcjs.toViteModuleId.call(void 0, cleanId, root);
|
|
11719
11748
|
const transformedBoundary = transformIsolatedClientBoundaryModule({
|
|
@@ -11750,7 +11779,7 @@ export const manifest = getManifest();
|
|
|
11750
11779
|
);
|
|
11751
11780
|
return;
|
|
11752
11781
|
}` : "";
|
|
11753
|
-
const hmrCode = !shouldEmitFarmClientRootHmr(currentConfig.renderer) ? "" : `
|
|
11782
|
+
const hmrCode = _optionalChain([transformOptions, 'optionalAccess', _688 => _688.ssr]) || !shouldEmitFarmClientRootHmr(currentConfig.renderer) ? "" : `
|
|
11754
11783
|
if (import.meta.hot) {
|
|
11755
11784
|
import.meta.hot.accept((newModule) => {
|
|
11756
11785
|
${isolatedHmrUpdate}
|
|
@@ -11804,14 +11833,14 @@ if (import.meta.hot) {
|
|
|
11804
11833
|
}
|
|
11805
11834
|
_chunk5QIKR7RRcjs.logger.info(`Found ${ssgPages.length} SSG pages, ${ssrRoutes.length} SSR routes`);
|
|
11806
11835
|
_chunk5QIKR7RRcjs.logger.info("Pre-rendering SSG pages...");
|
|
11807
|
-
const outDir = path16.join(_optionalChain([server, 'optionalAccess',
|
|
11836
|
+
const outDir = path16.join(_optionalChain([server, 'optionalAccess', _689 => _689.config, 'access', _690 => _690.root]) || process.cwd(), options.outDir || "dist");
|
|
11808
11837
|
const clientDir = path16.join(outDir, "client");
|
|
11809
11838
|
for (const page of ssgPages) {
|
|
11810
11839
|
try {
|
|
11811
11840
|
const staticRequest = new Request(new URL(page.urlPath, "http://farm.static"));
|
|
11812
11841
|
await farmApp.getServerRenderer().runWithRequestContext(staticRequest, async () => {
|
|
11813
11842
|
const mod = await routeManager.loadRouteModule(page.filePath);
|
|
11814
|
-
if (!_optionalChain([mod, 'optionalAccess',
|
|
11843
|
+
if (!_optionalChain([mod, 'optionalAccess', _691 => _691.default])) return;
|
|
11815
11844
|
const { layouts } = routeManager.matchRoute(page.urlPath);
|
|
11816
11845
|
const layoutModules = await Promise.all(
|
|
11817
11846
|
layouts.map((l) => routeManager.loadLayoutModule(l.modulePath))
|
|
@@ -11843,7 +11872,7 @@ if (import.meta.hot) {
|
|
|
11843
11872
|
const i18nSnapshot = _chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
11844
11873
|
const i18nHead = renderFarmI18nStaticHead(page.urlPath, i18nSnapshot);
|
|
11845
11874
|
const fullHtml = `<!DOCTYPE html>
|
|
11846
|
-
<html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
11875
|
+
<html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess', _692 => _692.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}>
|
|
11847
11876
|
<head>
|
|
11848
11877
|
<meta charset="utf-8">
|
|
11849
11878
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
@@ -11901,13 +11930,13 @@ if (import.meta.hot) {
|
|
|
11901
11930
|
});
|
|
11902
11931
|
}
|
|
11903
11932
|
}
|
|
11904
|
-
const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess',
|
|
11933
|
+
const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess', _693 => _693.getConfig, 'call', _694 => _694()]);
|
|
11905
11934
|
const normalizedFile = file.replace(/\\/g, "/");
|
|
11906
11935
|
if (currentFarmConfig && /\/route\.(?:ts|tsx|js|jsx)$/.test(normalizedFile) && _chunkY4YMF2NQcjs.getFarmAppDirectories.call(void 0, currentFarmConfig).some(
|
|
11907
11936
|
(appDir) => normalizedFile.startsWith(`${_chunk5QIKR7RRcjs.toPosixPath.call(void 0, appDir)}/api/`)
|
|
11908
11937
|
)) {
|
|
11909
11938
|
for (const mod of modules) server2.moduleGraph.invalidateModule(mod);
|
|
11910
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
11939
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _695 => _695(`updated ${file}`)]);
|
|
11911
11940
|
server2.ws.send({ type: "full-reload", path: "*" });
|
|
11912
11941
|
return [];
|
|
11913
11942
|
}
|
|
@@ -11917,7 +11946,7 @@ if (import.meta.hot) {
|
|
|
11917
11946
|
for (const mod of modules) {
|
|
11918
11947
|
server2.moduleGraph.invalidateModule(mod);
|
|
11919
11948
|
}
|
|
11920
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
11949
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _696 => _696(`updated ${file}`)]);
|
|
11921
11950
|
server2.ws.send({
|
|
11922
11951
|
type: "full-reload",
|
|
11923
11952
|
path: "*"
|
|
@@ -11930,17 +11959,17 @@ if (import.meta.hot) {
|
|
|
11930
11959
|
for (const mod of modules) {
|
|
11931
11960
|
server2.moduleGraph.invalidateModule(mod);
|
|
11932
11961
|
}
|
|
11933
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
11962
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _697 => _697(`updated ${file}`)]);
|
|
11934
11963
|
server2.ws.send({
|
|
11935
11964
|
type: "full-reload",
|
|
11936
11965
|
path: "*"
|
|
11937
11966
|
});
|
|
11938
11967
|
return [];
|
|
11939
11968
|
}
|
|
11940
|
-
const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess',
|
|
11941
|
-
const planRouteManager = _optionalChain([farmApp, 'optionalAccess',
|
|
11969
|
+
const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess', _698 => _698.experimental, 'optionalAccess', _699 => _699.isolatedClientHydration]);
|
|
11970
|
+
const planRouteManager = _optionalChain([farmApp, 'optionalAccess', _700 => _700.getRouteManager, 'call', _701 => _701()]);
|
|
11942
11971
|
const isHydrationPlanSource = currentSrcRoot !== null && normalizedFile.startsWith(`${currentSrcRoot}/`) && /\.[cm]?[jt]sx?$/.test(normalizedFile);
|
|
11943
|
-
const tracksAsyncOwnerIslands = _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess',
|
|
11972
|
+
const tracksAsyncOwnerIslands = _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _702 => _702.renderer])) && planRouteManager !== void 0;
|
|
11944
11973
|
if (isHydrationPlanSource && (isolatedHydrationMode === "enabled" || isolatedHydrationMode === "analyze" || tracksAsyncOwnerIslands)) {
|
|
11945
11974
|
const routeManager = planRouteManager;
|
|
11946
11975
|
if (routeManager) {
|
|
@@ -12000,7 +12029,7 @@ if (import.meta.hot) {
|
|
|
12000
12029
|
}
|
|
12001
12030
|
return [];
|
|
12002
12031
|
}
|
|
12003
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
12032
|
+
_optionalChain([farmApp, 'optionalAccess', _703 => _703.getRouteManager, 'call', _704 => _704(), 'access', _705 => _705.invalidateClientManifest, 'call', _706 => _706()]);
|
|
12004
12033
|
const manifestModule = server2.moduleGraph.getModuleById("/@farm/manifest");
|
|
12005
12034
|
if (manifestModule) {
|
|
12006
12035
|
server2.moduleGraph.invalidateModule(manifestModule);
|
|
@@ -12049,7 +12078,7 @@ function resolveDevelopmentRoot(farmRoot, viteRoot) {
|
|
|
12049
12078
|
if (fs9.realpathSync(farmRoot) === fs9.realpathSync(viteRoot)) {
|
|
12050
12079
|
return path16.resolve(viteRoot);
|
|
12051
12080
|
}
|
|
12052
|
-
} catch (
|
|
12081
|
+
} catch (e30) {
|
|
12053
12082
|
}
|
|
12054
12083
|
return farmRoot;
|
|
12055
12084
|
}
|
|
@@ -12369,12 +12398,12 @@ async function parseRouteModuleProps2(routeModule, input) {
|
|
|
12369
12398
|
}
|
|
12370
12399
|
const schemas = routeModule.__farmRouteSchemas;
|
|
12371
12400
|
const params = parseRouteModuleSchema2(
|
|
12372
|
-
_optionalChain([schemas, 'optionalAccess',
|
|
12401
|
+
_optionalChain([schemas, 'optionalAccess', _707 => _707.params]),
|
|
12373
12402
|
input.props.params,
|
|
12374
12403
|
"params",
|
|
12375
12404
|
input.routePath
|
|
12376
12405
|
);
|
|
12377
|
-
const search = parseRouteModuleSchema2(_optionalChain([schemas, 'optionalAccess',
|
|
12406
|
+
const search = parseRouteModuleSchema2(_optionalChain([schemas, 'optionalAccess', _708 => _708.search]), input.search, "search", input.routePath);
|
|
12378
12407
|
return {
|
|
12379
12408
|
...input.props,
|
|
12380
12409
|
params,
|
|
@@ -12395,7 +12424,7 @@ function parseRouteModuleSchema2(schema, value, label, routePath) {
|
|
|
12395
12424
|
}
|
|
12396
12425
|
}
|
|
12397
12426
|
_chunkS3JO3N4Hcjs.__name.call(void 0, parseRouteModuleSchema2, "parseRouteModuleSchema");
|
|
12398
|
-
function generateClientCode(integrationProviders = [], documentNavigationMatchers = [], docsSearchClientRuntime = EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME, devtoolsClientRuntime = "", plugins = [], root = process.cwd(), srcDir = "src", publicRuntimeConfig = void 0, docsAdapterReact, renderer = _chunkTFAXUHWXcjs.REACT_RENDERER, isolatedHydrationEnabled = false, trailingSlash = false, basePath = "/", clientCachePersistence = { imports: "", init: "" }) {
|
|
12427
|
+
function generateClientCode(integrationProviders = [], documentNavigationMatchers = [], docsSearchClientRuntime = EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME, devtoolsClientRuntime = "", plugins = [], root = process.cwd(), srcDir = "src", publicRuntimeConfig = void 0, docsAdapterReact, renderer = _chunkTFAXUHWXcjs.REACT_RENDERER, isolatedHydrationEnabled = false, trailingSlash = false, basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule) {
|
|
12399
12428
|
const providerClientCode = generateFarmIntegrationProviderClientCode(
|
|
12400
12429
|
integrationProviders,
|
|
12401
12430
|
root,
|
|
@@ -12410,7 +12439,10 @@ function generateClientCode(integrationProviders = [], documentNavigationMatcher
|
|
|
12410
12439
|
const rendererClientImports = _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, renderer) ? `import React from 'react'
|
|
12411
12440
|
import { hydrateRoot, createRoot } from 'react-dom/client'` : `import React, { hydrateRoot, createRoot } from ${JSON.stringify(renderer.client)}`;
|
|
12412
12441
|
const isolatedHydrationImport = isolatedHydrationEnabled ? `import { createFarmIsolatedHydrationRuntime, createFarmServerPageBoundary, wrapFarmIsolatedClientGraph } from '@farm.js/core/internal/isolated-boundary'` : "";
|
|
12413
|
-
const docsAdapterImportBlock = generateFarmDocsAdapterClientRuntime(
|
|
12442
|
+
const docsAdapterImportBlock = _chunk75WGQVQAcjs.generateFarmDocsAdapterClientRuntime.call(void 0,
|
|
12443
|
+
docsAdapterReact,
|
|
12444
|
+
docsConfigModule
|
|
12445
|
+
);
|
|
12414
12446
|
const isolatedHydrationRuntime = isolatedHydrationEnabled ? `const farmIsolatedHydrationRuntime = createFarmIsolatedHydrationRuntime({
|
|
12415
12447
|
ReactRuntime: React,
|
|
12416
12448
|
hydrateRoot,
|
|
@@ -13964,7 +13996,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, generateClientManifest, "generateClientMan
|
|
|
13964
13996
|
async function defineConfig(config = {}) {
|
|
13965
13997
|
const tailwindcss = (await import("@tailwindcss/vite")).default;
|
|
13966
13998
|
const appRoot = path16.resolve(config.root || process.cwd());
|
|
13967
|
-
if (_optionalChain([config, 'access',
|
|
13999
|
+
if (_optionalChain([config, 'access', _709 => _709.extends, 'optionalAccess', _710 => _710.length])) {
|
|
13968
14000
|
const { config: layeredConfig } = await import("./layers-E4WPJNY5.cjs").then(
|
|
13969
14001
|
({ resolveFarmLayers }) => resolveFarmLayers(config, {
|
|
13970
14002
|
root: appRoot,
|
|
@@ -14064,13 +14096,13 @@ async function defineConfig(config = {}) {
|
|
|
14064
14096
|
if (!serverStarted) {
|
|
14065
14097
|
serverStarted = true;
|
|
14066
14098
|
const elapsed = Date.now() - startTime;
|
|
14067
|
-
const address = _optionalChain([server, 'access',
|
|
14099
|
+
const address = _optionalChain([server, 'access', _711 => _711.httpServer, 'optionalAccess', _712 => _712.address, 'call', _713 => _713()]);
|
|
14068
14100
|
const resolvedPort = typeof address === "object" && address ? address.port : server.config.server.port || port || 3e3;
|
|
14069
14101
|
const hostConfig = server.config.server.host;
|
|
14070
14102
|
const isExposed = hostConfig === true || hostConfig === "0.0.0.0";
|
|
14071
14103
|
console.log("");
|
|
14072
14104
|
console.log(
|
|
14073
|
-
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${
|
|
14105
|
+
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${_chunkQ2TUENW2cjs.FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
|
|
14074
14106
|
);
|
|
14075
14107
|
console.log("");
|
|
14076
14108
|
console.log(
|
|
@@ -14221,5 +14253,4 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, defineConfig, "defineConfig");
|
|
|
14221
14253
|
|
|
14222
14254
|
|
|
14223
14255
|
|
|
14224
|
-
|
|
14225
|
-
exports.getFarmClientHydrationPlanOptions = getFarmClientHydrationPlanOptions; exports.describeSuppressedAsyncHydration = describeSuppressedAsyncHydration; exports.resolveFarmIsolatedClientHydrationMode = resolveFarmIsolatedClientHydrationMode; exports.getClientModuleMetadata = getClientModuleMetadata; exports.getClientModuleHydrationPlan = getClientModuleHydrationPlan; exports.createMarkdownPageHydrationPlanner = createMarkdownPageHydrationPlanner; exports.enforceFarmIsolatedHydrationRouteBudget = enforceFarmIsolatedHydrationRouteBudget; exports.RouteManager = RouteManager; exports.resolveFarmNotFoundComponentPath = resolveFarmNotFoundComponentPath; exports.farmFontImportsPlugin = farmFontImportsPlugin; exports.mergeFarmFontCss = mergeFarmFontCss; exports.DEFAULT_NOT_FOUND_STYLES = DEFAULT_NOT_FOUND_STYLES; exports.generateFarmIntegrationProviderClientCode = generateFarmIntegrationProviderClientCode; exports.generateFarmIntegrationProviderServerModules = generateFarmIntegrationProviderServerModules; exports.ServerRenderer = ServerRenderer; exports.FarmApp = FarmApp; exports.createFarmApp = createFarmApp; exports.FarmPluginOptionsError = FarmPluginOptionsError; exports.farmPluginMayAffectRuntimePath = farmPluginMayAffectRuntimePath; exports.generateFarmClientPluginEntryCode = generateFarmClientPluginEntryCode; exports.resolveFarmClientCacheAdapterEntry = resolveFarmClientCacheAdapterEntry; exports.generateClientCachePersistenceCode = generateClientCachePersistenceCode; exports.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE = FARM_LAYOUT_ELEMENT_CLIENT_SOURCE; exports.createFarmClientOptimizeDepsEntries = createFarmClientOptimizeDepsEntries; exports.createFarmClientOptimizeDepsConfig = createFarmClientOptimizeDepsConfig; exports.createFarmSourceAlias = createFarmSourceAlias; exports.mergeFarmViteConfig = mergeFarmViteConfig; exports.mergeFarmProductionViteConfig = mergeFarmProductionViteConfig; exports.generateFarmDocsAdapterClientRuntime = generateFarmDocsAdapterClientRuntime; exports.createFarmThemeCssPlugin = createFarmThemeCssPlugin; exports.farmI18nClientBridgePlugin = farmI18nClientBridgePlugin; exports.farmServerOnlyEntriesPlugin = farmServerOnlyEntriesPlugin; exports.withFarmRequestTracing = withFarmRequestTracing; exports.rewriteEarlySsrRelativeImports = rewriteEarlySsrRelativeImports; exports.transformIsolatedClientBoundaryModule = transformIsolatedClientBoundaryModule; exports.shouldEmitFarmClientRootHmr = shouldEmitFarmClientRootHmr; exports.farmPlugin = farmPlugin; exports.defineConfig = defineConfig; exports.FARM_NODE_RESPONSE_END_PENDING = FARM_NODE_RESPONSE_END_PENDING; exports.FarmRuntimeShutdownError = FarmRuntimeShutdownError; exports.PluginManager = PluginManager; exports.definePlugin = definePlugin;
|
|
14256
|
+
exports.getFarmClientHydrationPlanOptions = getFarmClientHydrationPlanOptions; exports.describeSuppressedAsyncHydration = describeSuppressedAsyncHydration; exports.resolveFarmIsolatedClientHydrationMode = resolveFarmIsolatedClientHydrationMode; exports.getClientModuleMetadata = getClientModuleMetadata; exports.getClientModuleHydrationPlan = getClientModuleHydrationPlan; exports.createMarkdownPageHydrationPlanner = createMarkdownPageHydrationPlanner; exports.enforceFarmIsolatedHydrationRouteBudget = enforceFarmIsolatedHydrationRouteBudget; exports.RouteManager = RouteManager; exports.resolveFarmNotFoundComponentPath = resolveFarmNotFoundComponentPath; exports.farmFontImportsPlugin = farmFontImportsPlugin; exports.mergeFarmFontCss = mergeFarmFontCss; exports.DEFAULT_NOT_FOUND_STYLES = DEFAULT_NOT_FOUND_STYLES; exports.generateFarmIntegrationProviderClientCode = generateFarmIntegrationProviderClientCode; exports.generateFarmIntegrationProviderServerModules = generateFarmIntegrationProviderServerModules; exports.ServerRenderer = ServerRenderer; exports.FarmApp = FarmApp; exports.createFarmApp = createFarmApp; exports.FarmPluginOptionsError = FarmPluginOptionsError; exports.farmPluginMayAffectRuntimePath = farmPluginMayAffectRuntimePath; exports.generateFarmClientPluginEntryCode = generateFarmClientPluginEntryCode; exports.resolveFarmClientCacheAdapterEntry = resolveFarmClientCacheAdapterEntry; exports.generateClientCachePersistenceCode = generateClientCachePersistenceCode; exports.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE = FARM_LAYOUT_ELEMENT_CLIENT_SOURCE; exports.createFarmClientOptimizeDepsEntries = createFarmClientOptimizeDepsEntries; exports.createFarmClientOptimizeDepsConfig = createFarmClientOptimizeDepsConfig; exports.createFarmSourceAlias = createFarmSourceAlias; exports.mergeFarmViteConfig = mergeFarmViteConfig; exports.mergeFarmProductionViteConfig = mergeFarmProductionViteConfig; exports.createFarmThemeCssPlugin = createFarmThemeCssPlugin; exports.farmI18nClientBridgePlugin = farmI18nClientBridgePlugin; exports.farmServerOnlyEntriesPlugin = farmServerOnlyEntriesPlugin; exports.withFarmRequestTracing = withFarmRequestTracing; exports.rewriteEarlySsrRelativeImports = rewriteEarlySsrRelativeImports; exports.transformIsolatedClientBoundaryModule = transformIsolatedClientBoundaryModule; exports.shouldEmitFarmClientRootHmr = shouldEmitFarmClientRootHmr; exports.farmPlugin = farmPlugin; exports.defineConfig = defineConfig; exports.FARM_NODE_RESPONSE_END_PENDING = FARM_NODE_RESPONSE_END_PENDING; exports.FarmRuntimeShutdownError = FarmRuntimeShutdownError; exports.PluginManager = PluginManager; exports.definePlugin = definePlugin;
|