@farm.js/core 0.1.23 → 0.1.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/api/route-manager.cjs +4 -4
- package/dist/api/route-manager.d.mts +1 -1
- package/dist/api/route-manager.d.ts +1 -1
- package/dist/api/route-manager.mjs +3 -3
- package/dist/api/runtime.cjs +3 -3
- package/dist/api/runtime.mjs +2 -2
- package/dist/api.cjs +7 -7
- package/dist/api.d.mts +2 -2
- package/dist/api.d.ts +2 -2
- package/dist/api.mjs +6 -6
- package/dist/{app-BV-7wV5q.d.ts → app-BF-ctoxh.d.ts} +3 -3
- package/dist/{app-BZDWwwFa.d.mts → app-ZuWrAMc_.d.mts} +3 -3
- package/dist/app-markdown.cjs +4 -4
- package/dist/app-markdown.d.mts +2 -2
- package/dist/app-markdown.d.ts +2 -2
- package/dist/app-markdown.mjs +3 -3
- package/dist/{chunk-MVUREHPN.mjs → chunk-2BIJGZR3.mjs} +1 -1
- package/dist/chunk-2ITKVAIF.cjs +1077 -0
- package/dist/{chunk-47H7VENP.mjs → chunk-2KI3CL3N.mjs} +1 -1
- package/dist/{chunk-KNPRCKXK.cjs → chunk-3TQWUUNP.cjs} +9 -7
- package/dist/{chunk-GZ3ZPTQV.mjs → chunk-52SH7TKB.mjs} +2 -2
- package/dist/{chunk-BDJNP7AQ.mjs → chunk-5YYJ6Q2L.mjs} +10 -3
- package/dist/{chunk-OYDRPBBV.cjs → chunk-65P6OGYN.cjs} +73 -3
- package/dist/{chunk-JIKGGIOL.mjs → chunk-6D242YGO.mjs} +1 -1
- package/dist/{chunk-AH7HOAQ3.cjs → chunk-6K4SPQWL.cjs} +9 -4
- package/dist/{chunk-LYM7HY34.cjs → chunk-AXYTGLF3.cjs} +4 -4
- package/dist/{chunk-2QLBIPFT.cjs → chunk-B6ZCT36X.cjs} +4 -4
- package/dist/{chunk-IMBMOEWT.cjs → chunk-BD2U4ZL6.cjs} +8 -8
- package/dist/{chunk-2M435BUE.mjs → chunk-CEYUWDWA.mjs} +7 -5
- package/dist/{chunk-I5YBCWQ6.cjs → chunk-CFNOGDUS.cjs} +2 -2
- package/dist/{chunk-XI3GWPUS.cjs → chunk-CRQPYWLK.cjs} +14 -14
- package/dist/{chunk-ISTFC3MZ.cjs → chunk-E3RDL2DA.cjs} +48 -5
- package/dist/{chunk-QTBEAKCJ.cjs → chunk-H7CJRJ4L.cjs} +16 -16
- package/dist/{chunk-VPY755R2.mjs → chunk-N2Z4ZFDE.mjs} +25 -11
- package/dist/{chunk-DNLQMFER.cjs → chunk-O5DVPF3R.cjs} +26 -19
- package/dist/{chunk-WNUBR4CA.mjs → chunk-QGG336NI.mjs} +1 -1
- package/dist/{chunk-4DKZ6JR3.cjs → chunk-QYMRIVG6.cjs} +184 -130
- package/dist/{chunk-III667SJ.cjs → chunk-R7LCG3BT.cjs} +189 -175
- package/dist/{chunk-7BC6GAL7.mjs → chunk-RR6UGYUT.mjs} +44 -1
- package/dist/{chunk-LQIRVSBY.cjs → chunk-RYDW7GPR.cjs} +13 -13
- package/dist/{chunk-PGQBL5DN.mjs → chunk-T2OPSH6S.mjs} +72 -2
- package/dist/{chunk-5UX4C5QI.mjs → chunk-TKDY6AJP.mjs} +1 -1
- package/dist/{chunk-VXCA7RZP.cjs → chunk-TTVHACQV.cjs} +1 -1
- package/dist/{chunk-OFEY6KHO.mjs → chunk-U4MP7XTD.mjs} +504 -27
- package/dist/{chunk-YJJLXIIS.cjs → chunk-U74A3P2P.cjs} +7 -7
- package/dist/{chunk-72VJRKJD.mjs → chunk-VZWO3XVL.mjs} +2 -2
- package/dist/{chunk-7LU4IOXQ.mjs → chunk-WJYCI56T.mjs} +87 -33
- package/dist/{chunk-EHUZ2MKO.mjs → chunk-WOI2HOGA.mjs} +1 -1
- package/dist/{chunk-N255VYFP.mjs → chunk-XM4ZDVD7.mjs} +8 -3
- package/dist/{chunk-YGMK6ESJ.mjs → chunk-XME4TCLB.mjs} +2 -2
- package/dist/{client-plugins-B_XzCegf.d.mts → client-plugins-DPG0NeZN.d.mts} +41 -3
- package/dist/{client-plugins-CKsXQfXY.d.ts → client-plugins-Fgni-_25.d.ts} +41 -3
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client.cjs +4 -4
- package/dist/client.d.mts +5 -5
- package/dist/client.d.ts +5 -5
- package/dist/client.mjs +3 -3
- package/dist/config.d.mts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/{devtools-UHRSZ7VA.cjs → devtools-6OA7FEF6.cjs} +4 -4
- package/dist/{devtools-OY4SNU3P.mjs → devtools-I7TBFOKD.mjs} +3 -3
- package/dist/docs.cjs +6 -6
- package/dist/docs.mjs +5 -5
- package/dist/index.cjs +24 -22
- package/dist/index.d.mts +13 -13
- package/dist/index.d.ts +13 -13
- package/dist/index.mjs +23 -21
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/internal/app-markdown-runtime.cjs +3 -3
- package/dist/internal/app-markdown-runtime.d.mts +1 -1
- package/dist/internal/app-markdown-runtime.d.ts +1 -1
- package/dist/internal/app-markdown-runtime.mjs +2 -2
- package/dist/internal/build-runtime.cjs +16 -16
- package/dist/internal/build-runtime.d.mts +3 -3
- package/dist/internal/build-runtime.d.ts +3 -3
- package/dist/internal/build-runtime.mjs +15 -15
- package/dist/internal/cli-runtime.cjs +5 -5
- package/dist/internal/cli-runtime.mjs +4 -4
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/compression-runtime.d.mts +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/config-runtime.cjs +4 -4
- package/dist/internal/config-runtime.d.mts +2 -2
- package/dist/internal/config-runtime.d.ts +2 -2
- package/dist/internal/config-runtime.mjs +3 -3
- package/dist/internal/product-telemetry-runtime.cjs +2 -2
- package/dist/internal/product-telemetry-runtime.mjs +1 -1
- package/dist/internal/production-runtime.cjs +11 -5
- package/dist/internal/production-runtime.d.mts +30 -8
- package/dist/internal/production-runtime.d.ts +30 -8
- package/dist/internal/production-runtime.mjs +10 -4
- package/dist/markdown.cjs +4 -2
- package/dist/markdown.d.mts +63 -1
- package/dist/markdown.d.ts +63 -1
- package/dist/markdown.mjs +3 -1
- package/dist/{metadata-IQEblkZp.d.ts → metadata-CDnRHKVq.d.ts} +1 -1
- package/dist/{metadata-B08w4EYV.d.mts → metadata-D0EF7esB.d.mts} +1 -1
- package/dist/middleware.d.mts +3 -3
- package/dist/middleware.d.ts +3 -3
- package/dist/navigation.cjs +5 -5
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/navigation.mjs +4 -4
- package/dist/plugin.cjs +12 -12
- package/dist/plugin.d.mts +1 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.mjs +11 -11
- package/dist/{production-runtime-DRSOkc-d.d.ts → production-runtime-DpCt0opU.d.ts} +1 -1
- package/dist/{production-runtime-C3bGFEaM.d.mts → production-runtime-x3W4wVqx.d.mts} +1 -1
- package/dist/query/client.cjs +6 -6
- package/dist/query/client.mjs +2 -2
- package/dist/{render-plan-CCFuMLNS.d.ts → render-plan-D5oFRVBV.d.ts} +1 -1
- package/dist/{render-plan-B6CKNl4e.d.mts → render-plan-tazUJalK.d.mts} +1 -1
- package/dist/renderer-client.cjs +5 -5
- package/dist/renderer-client.d.mts +3 -3
- package/dist/renderer-client.d.ts +3 -3
- package/dist/renderer-client.mjs +2 -2
- package/dist/{request-DgD1XsTx.d.mts → request-CXmQy5ks.d.mts} +1 -1
- package/dist/{request-Dn6VURbE.d.ts → request-CzZX0Aew.d.ts} +1 -1
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/{route-rendering-76A5I_kE.d.mts → route-rendering-B-qpe32B.d.mts} +1 -1
- package/dist/{route-rendering-LAmQEdyG.d.ts → route-rendering-Dw3C362T.d.ts} +1 -1
- package/dist/{router-BSOOGya2.d.ts → router-CLl3xHwl.d.ts} +1 -1
- package/dist/{router-CnrRSa9d.d.mts → router-CafM2jlw.d.mts} +1 -1
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/server-plugins.d.mts +2 -2
- package/dist/server-plugins.d.ts +2 -2
- package/dist/server.cjs +27 -27
- package/dist/server.d.mts +7 -7
- package/dist/server.d.ts +7 -7
- package/dist/server.mjs +12 -12
- package/dist/{spa-router-DnYhWCvI.d.mts → spa-router-6sJfsMlQ.d.mts} +2 -2
- package/dist/{spa-router-BMrSsG5b.d.ts → spa-router-DePr2aZ6.d.ts} +2 -2
- package/dist/testing.cjs +4 -4
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.mjs +3 -3
- package/dist/{utils-C3GguS-Q.d.ts → utils-BBKC3cf3.d.ts} +1 -1
- package/dist/{utils-ABkktwku.d.mts → utils-BPHr-1mP.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +12 -12
- package/dist/vite.d.mts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.mjs +11 -11
- package/package.json +1 -1
- package/dist/chunk-BBVSJVBZ.cjs +0 -600
- package/dist/{chunk-XP777LRD.mjs → chunk-GDUYXFIS.mjs} +3 -3
- package/dist/{chunk-4PNUXIVU.cjs → chunk-YAOX43YI.cjs} +3 -3
|
@@ -24,7 +24,10 @@ var _chunkJSROZYYOcjs = require('./chunk-JSROZYYO.cjs');
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
var _chunk65P6OGYNcjs = require('./chunk-65P6OGYN.cjs');
|
|
28
31
|
|
|
29
32
|
|
|
30
33
|
var _chunkCXP5U3RWcjs = require('./chunk-CXP5U3RW.cjs');
|
|
@@ -104,7 +107,7 @@ var _chunkPSV6XKPOcjs = require('./chunk-PSV6XKPO.cjs');
|
|
|
104
107
|
|
|
105
108
|
|
|
106
109
|
|
|
107
|
-
var
|
|
110
|
+
var _chunkE3RDL2DAcjs = require('./chunk-E3RDL2DA.cjs');
|
|
108
111
|
|
|
109
112
|
|
|
110
113
|
|
|
@@ -122,12 +125,12 @@ var _chunkVEKFLAQMcjs = require('./chunk-VEKFLAQM.cjs');
|
|
|
122
125
|
|
|
123
126
|
|
|
124
127
|
|
|
125
|
-
var
|
|
128
|
+
var _chunkCFNOGDUScjs = require('./chunk-CFNOGDUS.cjs');
|
|
126
129
|
|
|
127
130
|
|
|
128
131
|
|
|
129
132
|
|
|
130
|
-
var
|
|
133
|
+
var _chunk6K4SPQWLcjs = require('./chunk-6K4SPQWL.cjs');
|
|
131
134
|
|
|
132
135
|
|
|
133
136
|
|
|
@@ -141,7 +144,7 @@ var _chunkOHY2ZWUGcjs = require('./chunk-OHY2ZWUG.cjs');
|
|
|
141
144
|
|
|
142
145
|
|
|
143
146
|
|
|
144
|
-
var
|
|
147
|
+
var _chunk2ITKVAIFcjs = require('./chunk-2ITKVAIF.cjs');
|
|
145
148
|
|
|
146
149
|
|
|
147
150
|
var _chunkMPEYMSCFcjs = require('./chunk-MPEYMSCF.cjs');
|
|
@@ -182,7 +185,7 @@ var _chunk4PPEPOZZcjs = require('./chunk-4PPEPOZZ.cjs');
|
|
|
182
185
|
var _chunkMQ3H6LT5cjs = require('./chunk-MQ3H6LT5.cjs');
|
|
183
186
|
|
|
184
187
|
|
|
185
|
-
var
|
|
188
|
+
var _chunkBD2U4ZL6cjs = require('./chunk-BD2U4ZL6.cjs');
|
|
186
189
|
|
|
187
190
|
|
|
188
191
|
|
|
@@ -201,7 +204,7 @@ var _chunkUJ2C4ICScjs = require('./chunk-UJ2C4ICS.cjs');
|
|
|
201
204
|
var _chunkLYLEZIG3cjs = require('./chunk-LYLEZIG3.cjs');
|
|
202
205
|
|
|
203
206
|
|
|
204
|
-
var
|
|
207
|
+
var _chunkYAOX43YIcjs = require('./chunk-YAOX43YI.cjs');
|
|
205
208
|
|
|
206
209
|
|
|
207
210
|
var _chunkWPYFSQKKcjs = require('./chunk-WPYFSQKK.cjs');
|
|
@@ -271,7 +274,7 @@ var _chunkQNPEUFHQcjs = require('./chunk-QNPEUFHQ.cjs');
|
|
|
271
274
|
var _chunkUQZ4AYTHcjs = require('./chunk-UQZ4AYTH.cjs');
|
|
272
275
|
|
|
273
276
|
|
|
274
|
-
var
|
|
277
|
+
var _chunkTTVHACQVcjs = require('./chunk-TTVHACQV.cjs');
|
|
275
278
|
|
|
276
279
|
|
|
277
280
|
|
|
@@ -290,7 +293,7 @@ var _chunk75BRBIFPcjs = require('./chunk-75BRBIFP.cjs');
|
|
|
290
293
|
|
|
291
294
|
|
|
292
295
|
|
|
293
|
-
var
|
|
296
|
+
var _chunk3TQWUUNPcjs = require('./chunk-3TQWUUNP.cjs');
|
|
294
297
|
|
|
295
298
|
|
|
296
299
|
|
|
@@ -2234,7 +2237,7 @@ var _RouteManager = class _RouteManager {
|
|
|
2234
2237
|
);
|
|
2235
2238
|
const routeEntries = Array.from(this.routes.values()).map((entry) => ({
|
|
2236
2239
|
entry,
|
|
2237
|
-
metadata:
|
|
2240
|
+
metadata: _chunk6K4SPQWLcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? markdownPagePlan() : getClientModuleHydrationPlan(
|
|
2238
2241
|
entry.modulePath,
|
|
2239
2242
|
normalizedProjectRoot,
|
|
2240
2243
|
isolatedMode,
|
|
@@ -2242,7 +2245,7 @@ var _RouteManager = class _RouteManager {
|
|
|
2242
2245
|
)
|
|
2243
2246
|
}));
|
|
2244
2247
|
const markdownFallback = routeEntries.find(
|
|
2245
|
-
({ entry, metadata }) =>
|
|
2248
|
+
({ entry, metadata }) => _chunk6K4SPQWLcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.fallbackReason
|
|
2246
2249
|
);
|
|
2247
2250
|
if (markdownFallback) {
|
|
2248
2251
|
_chunk5QIKR7RRcjs.logger.warn(
|
|
@@ -2250,7 +2253,7 @@ var _RouteManager = class _RouteManager {
|
|
|
2250
2253
|
);
|
|
2251
2254
|
}
|
|
2252
2255
|
const markdownStaticPackages = _optionalChain([routeEntries, 'access', _120 => _120.find, 'call', _121 => _121(
|
|
2253
|
-
({ entry, metadata }) =>
|
|
2256
|
+
({ entry, metadata }) => _chunk6K4SPQWLcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.staticPackageBoundaries
|
|
2254
2257
|
), 'optionalAccess', _122 => _122.metadata, 'access', _123 => _123.staticPackageBoundaries]);
|
|
2255
2258
|
if (markdownStaticPackages) {
|
|
2256
2259
|
_chunk5QIKR7RRcjs.logger.info(
|
|
@@ -2258,7 +2261,7 @@ var _RouteManager = class _RouteManager {
|
|
|
2258
2261
|
);
|
|
2259
2262
|
}
|
|
2260
2263
|
for (const { entry, metadata } of [...layoutEntries, ...routeEntries]) {
|
|
2261
|
-
if (
|
|
2264
|
+
if (_chunk6K4SPQWLcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) || !metadata.staticPackageBoundaries) continue;
|
|
2262
2265
|
_chunk5QIKR7RRcjs.logger.info(
|
|
2263
2266
|
`[Farm.js] ${entry.pattern} is async, so it renders client components from ${metadata.staticPackageBoundaries.join(", ")} as static HTML: package client components cannot be isolated yet.`
|
|
2264
2267
|
);
|
|
@@ -2410,13 +2413,13 @@ var _RouteManager = class _RouteManager {
|
|
|
2410
2413
|
const { createRouteModuleFromProgrammaticPage } = await import("./routes.cjs");
|
|
2411
2414
|
return createRouteModuleFromProgrammaticPage(programmaticPage, this.rendererRuntime);
|
|
2412
2415
|
}
|
|
2413
|
-
if (
|
|
2416
|
+
if (_chunk6K4SPQWLcjs.isFarmMarkdownPageFile.call(void 0, modulePath)) {
|
|
2414
2417
|
const mdxConfig = _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, this.config.mdx);
|
|
2415
|
-
const components = await
|
|
2418
|
+
const components = await _chunkCFNOGDUScjs.loadFarmMdxComponents.call(void 0, mdxConfig, {
|
|
2416
2419
|
root: this.config.root,
|
|
2417
2420
|
loadModule: this.viteServer ? (componentModulePath) => _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, this.viteServer, componentModulePath) : void 0
|
|
2418
2421
|
});
|
|
2419
|
-
return await
|
|
2422
|
+
return await _chunkCFNOGDUScjs.createFarmMarkdownRouteModuleFromFile.call(void 0, modulePath, {
|
|
2420
2423
|
components,
|
|
2421
2424
|
config: mdxConfig
|
|
2422
2425
|
});
|
|
@@ -2523,8 +2526,8 @@ var _RouteManager = class _RouteManager {
|
|
|
2523
2526
|
}
|
|
2524
2527
|
}
|
|
2525
2528
|
for (const [pattern, group] of canonicalPageGroups) {
|
|
2526
|
-
const componentFiles = group.files.filter((file) => !
|
|
2527
|
-
const markdownFiles = group.files.filter(
|
|
2529
|
+
const componentFiles = group.files.filter((file) => !_chunk6K4SPQWLcjs.isFarmMarkdownPageFile.call(void 0, file));
|
|
2530
|
+
const markdownFiles = group.files.filter(_chunk6K4SPQWLcjs.isFarmMarkdownPageFile);
|
|
2528
2531
|
if (componentFiles.length > 1) {
|
|
2529
2532
|
throw new Error(
|
|
2530
2533
|
`Duplicate page route "${pattern}". Found ${componentFiles.map((file) => path9.default.join(appDir, file)).join(" and ")}.`
|
|
@@ -4683,7 +4686,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, appendResponseVary, "appendResponseVary");
|
|
|
4683
4686
|
function renderI18nAlternateLinks(requestPath, snapshot, options) {
|
|
4684
4687
|
if (snapshot.routing === "none") return "";
|
|
4685
4688
|
const url = new URL(requestPath, "http://farm.local");
|
|
4686
|
-
return
|
|
4689
|
+
return _chunk65P6OGYNcjs.renderFarmLocaleAlternateLinks.call(void 0, url.pathname, snapshot, options);
|
|
4687
4690
|
}
|
|
4688
4691
|
_chunkS3JO3N4Hcjs.__name.call(void 0, renderI18nAlternateLinks, "renderI18nAlternateLinks");
|
|
4689
4692
|
var PPR_REFRESH_MAX_ATTEMPTS = 3;
|
|
@@ -4822,7 +4825,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
4822
4825
|
this.routeManager = routeManager;
|
|
4823
4826
|
this.i18nRuntime = i18nRuntime;
|
|
4824
4827
|
this.viteServer = viteServer;
|
|
4825
|
-
this.security =
|
|
4828
|
+
this.security = _chunkE3RDL2DAcjs.resolveFarmSecurityConfig.call(void 0, config.security);
|
|
4826
4829
|
this.loadSSGManifest();
|
|
4827
4830
|
}
|
|
4828
4831
|
async initialize() {
|
|
@@ -5253,7 +5256,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
5253
5256
|
pageProps,
|
|
5254
5257
|
pathname: page.urlPath
|
|
5255
5258
|
});
|
|
5256
|
-
const { title, tags, hasFavicon } =
|
|
5259
|
+
const { title, tags, hasFavicon } = _chunk3TQWUUNPcjs.renderMetadataHead.call(void 0, mergedMetadata);
|
|
5257
5260
|
const metadataHead = `${hasFavicon ? "" : '<link rel="icon" href="data:,">\n '}<title>${title}</title>${tags}`;
|
|
5258
5261
|
const fullDocument = this.createFullHTML(
|
|
5259
5262
|
html,
|
|
@@ -5321,10 +5324,10 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
5321
5324
|
if (this.viteServer) await this.applyRendererAppSetup();
|
|
5322
5325
|
_chunkI57LW5VZcjs.setFarmBasePath.call(void 0, this.config.basePath);
|
|
5323
5326
|
_chunkOYEUREB6cjs.setFarmTrailingSlashPreference.call(void 0, this.config.trailingSlash);
|
|
5324
|
-
const cspNonce =
|
|
5327
|
+
const cspNonce = _chunkE3RDL2DAcjs.createFarmCspNonce.call(void 0, this.security);
|
|
5325
5328
|
if (cspNonce) {
|
|
5326
5329
|
req.__FARM_CSP_NONCE__ = cspNonce;
|
|
5327
|
-
const header =
|
|
5330
|
+
const header = _chunkE3RDL2DAcjs.getFarmSecurityHeader.call(void 0, this.security, cspNonce);
|
|
5328
5331
|
res.setHeader(header.key, header.value);
|
|
5329
5332
|
}
|
|
5330
5333
|
const request2 = _chunk5ZSWG4UXcjs.createWebRequestFromFarmRequest.call(void 0, req, {
|
|
@@ -5907,7 +5910,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
5907
5910
|
}
|
|
5908
5911
|
}
|
|
5909
5912
|
_chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, { type: "render.error", route: pathname, error });
|
|
5910
|
-
const errorStatus =
|
|
5913
|
+
const errorStatus = _chunk65P6OGYNcjs.resolveDefaultErrorStatus.call(void 0, error);
|
|
5911
5914
|
if (pprRefreshRoute) {
|
|
5912
5915
|
_chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, {
|
|
5913
5916
|
type: "ppr.refresh.error",
|
|
@@ -6006,9 +6009,9 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6006
6009
|
async resolveRouteMetadata(options) {
|
|
6007
6010
|
let metadata = {};
|
|
6008
6011
|
for (const layoutModule of options.layoutModules) {
|
|
6009
|
-
metadata =
|
|
6012
|
+
metadata = _chunk3TQWUUNPcjs.mergeMetadata.call(void 0, metadata, layoutModule.metadata);
|
|
6010
6013
|
if (typeof layoutModule.generateMetadata === "function") {
|
|
6011
|
-
metadata =
|
|
6014
|
+
metadata = _chunk3TQWUUNPcjs.mergeMetadata.call(void 0,
|
|
6012
6015
|
metadata,
|
|
6013
6016
|
await layoutModule.generateMetadata({
|
|
6014
6017
|
params: options.pageProps.params
|
|
@@ -6016,9 +6019,9 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6016
6019
|
);
|
|
6017
6020
|
}
|
|
6018
6021
|
}
|
|
6019
|
-
metadata =
|
|
6022
|
+
metadata = _chunk3TQWUUNPcjs.mergeMetadata.call(void 0, metadata, options.routeModule.metadata);
|
|
6020
6023
|
if (typeof options.routeModule.generateMetadata === "function") {
|
|
6021
|
-
metadata =
|
|
6024
|
+
metadata = _chunk3TQWUUNPcjs.mergeMetadata.call(void 0,
|
|
6022
6025
|
metadata,
|
|
6023
6026
|
await options.routeModule.generateMetadata(options.pageProps)
|
|
6024
6027
|
);
|
|
@@ -6041,7 +6044,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6041
6044
|
for (const kind of ["opengraph", "twitter"]) {
|
|
6042
6045
|
const reference = await this.resolveMetadataImageReference(kind, options.pathname);
|
|
6043
6046
|
if (reference) {
|
|
6044
|
-
metadata =
|
|
6047
|
+
metadata = _chunk3TQWUUNPcjs.addMetadataImageReference.call(void 0, metadata, reference);
|
|
6045
6048
|
}
|
|
6046
6049
|
}
|
|
6047
6050
|
const snapshot = _chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
@@ -6049,9 +6052,9 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6049
6052
|
snapshot ? _chunkBIDYX3SLcjs.localizeFarmHref.call(void 0, options.pathname, snapshot.locale, snapshot) : options.pathname,
|
|
6050
6053
|
this.config.basePath
|
|
6051
6054
|
);
|
|
6052
|
-
metadata =
|
|
6055
|
+
metadata = _chunk3TQWUUNPcjs.addMetadataMarkdownAlternate.call(void 0,
|
|
6053
6056
|
metadata,
|
|
6054
|
-
|
|
6057
|
+
_chunk2ITKVAIFcjs.getFarmMarkdownAlternatePath.call(void 0, _chunk2ITKVAIFcjs.resolveMarkdownConfig.call(void 0, this.config.md), publicPathname)
|
|
6055
6058
|
);
|
|
6056
6059
|
return metadata;
|
|
6057
6060
|
}
|
|
@@ -6123,11 +6126,11 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6123
6126
|
path: match.routePath,
|
|
6124
6127
|
...llmsContext
|
|
6125
6128
|
}) : routeModule.default;
|
|
6126
|
-
const body = match.metadata.kind === "llms-full" && !(value instanceof Response) ? await
|
|
6129
|
+
const body = match.metadata.kind === "llms-full" && !(value instanceof Response) ? await _chunkE3RDL2DAcjs.renderFarmLlmsFullTxt.call(void 0, value, {
|
|
6127
6130
|
origin: url.origin,
|
|
6128
6131
|
readMarkdown: llmsContext.markdown
|
|
6129
6132
|
}) : value;
|
|
6130
|
-
const response =
|
|
6133
|
+
const response = _chunk65P6OGYNcjs.createFarmMetadataRouteResponse.call(void 0, match.metadata.kind, body, routeModule, {
|
|
6131
6134
|
method
|
|
6132
6135
|
});
|
|
6133
6136
|
await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0, res, response);
|
|
@@ -6144,7 +6147,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6144
6147
|
}
|
|
6145
6148
|
/** `/llms.txt` and `/llms-full.txt` from `agent.llmsTxt` when no file route owns them. */
|
|
6146
6149
|
getGeneratedLlmsKind(pathname) {
|
|
6147
|
-
const config =
|
|
6150
|
+
const config = _chunkE3RDL2DAcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _200 => _200.config, 'access', _201 => _201.agent, 'optionalAccess', _202 => _202.llmsTxt]));
|
|
6148
6151
|
if (!config.enabled) return null;
|
|
6149
6152
|
if (pathname === "/llms.txt") return "llms";
|
|
6150
6153
|
return pathname === "/llms-full.txt" && config.full ? "llms-full" : null;
|
|
@@ -6154,15 +6157,15 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6154
6157
|
const request2 = _chunk5ZSWG4UXcjs.createWebRequestFromFarmRequest.call(void 0, req, {
|
|
6155
6158
|
trustProxy: _optionalChain([this, 'access', _203 => _203.config, 'access', _204 => _204.server, 'optionalAccess', _205 => _205.trustProxy])
|
|
6156
6159
|
});
|
|
6157
|
-
const config =
|
|
6160
|
+
const config = _chunkE3RDL2DAcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _206 => _206.config, 'access', _207 => _207.agent, 'optionalAccess', _208 => _208.llmsTxt]));
|
|
6158
6161
|
const context = await this.createLlmsTxtContext(request2, { full: kind === "llms-full", req });
|
|
6159
|
-
const body = kind === "llms-full" ? await
|
|
6162
|
+
const body = kind === "llms-full" ? await _chunkE3RDL2DAcjs.renderFarmLlmsFullTxt.call(void 0, context.defaults, {
|
|
6160
6163
|
origin: new URL(request2.url).origin,
|
|
6161
6164
|
readMarkdown: context.markdown
|
|
6162
6165
|
}) : context.defaults;
|
|
6163
6166
|
await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0,
|
|
6164
6167
|
res,
|
|
6165
|
-
|
|
6168
|
+
_chunk65P6OGYNcjs.createFarmMetadataRouteResponse.call(void 0,
|
|
6166
6169
|
kind,
|
|
6167
6170
|
body,
|
|
6168
6171
|
{ revalidate: config.revalidate },
|
|
@@ -6181,7 +6184,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6181
6184
|
}
|
|
6182
6185
|
}
|
|
6183
6186
|
getAgentCrawlers() {
|
|
6184
|
-
return
|
|
6187
|
+
return _chunkE3RDL2DAcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([this, 'access', _209 => _209.config, 'access', _210 => _210.agent, 'optionalAccess', _211 => _211.crawlers]));
|
|
6185
6188
|
}
|
|
6186
6189
|
/** `/robots.txt` from `agent.crawlers` when no robots.ts owns it. */
|
|
6187
6190
|
async renderGeneratedRobotsTxt(req, res) {
|
|
@@ -6189,7 +6192,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6189
6192
|
const sitemapPath = _optionalChain([this, 'access', _212 => _212.routeManager, 'access', _213 => _213.matchMetadataRoute, 'call', _214 => _214("/sitemap.xml"), 'optionalAccess', _215 => _215.metadata, 'access', _216 => _216.kind]) === "sitemap" ? "/sitemap.xml" : void 0;
|
|
6190
6193
|
const rootLayout = this.routeManager.getLayouts().get("/");
|
|
6191
6194
|
const rootMetadata = sitemapPath && rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
|
|
6192
|
-
const robots =
|
|
6195
|
+
const robots = _chunkE3RDL2DAcjs.createFarmAgentRobots.call(void 0, {
|
|
6193
6196
|
crawlers: this.getAgentCrawlers(),
|
|
6194
6197
|
sitemapPath,
|
|
6195
6198
|
metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _217 => _217.metadataBase]),
|
|
@@ -6197,7 +6200,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6197
6200
|
});
|
|
6198
6201
|
await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0,
|
|
6199
6202
|
res,
|
|
6200
|
-
|
|
6203
|
+
_chunk65P6OGYNcjs.createFarmMetadataRouteResponse.call(void 0, "robots", robots, {}, { method: req.method })
|
|
6201
6204
|
);
|
|
6202
6205
|
} catch (error) {
|
|
6203
6206
|
_chunk5QIKR7RRcjs.logger.error(`Generated robots.txt failed: ${error}`);
|
|
@@ -6212,7 +6215,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6212
6215
|
}
|
|
6213
6216
|
/** Same inputs the production server gives llms.txt: static pages and root metadata. */
|
|
6214
6217
|
async createLlmsTxtContext(request2, options = {}) {
|
|
6215
|
-
const config =
|
|
6218
|
+
const config = _chunkE3RDL2DAcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _218 => _218.config, 'access', _219 => _219.agent, 'optionalAccess', _220 => _220.llmsTxt]));
|
|
6216
6219
|
const origin = new URL(request2.url).origin;
|
|
6217
6220
|
const staticRoutes = [...this.routeManager.getRoutes()].filter(
|
|
6218
6221
|
([pattern]) => !pattern.includes("[")
|
|
@@ -6230,16 +6233,16 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6230
6233
|
);
|
|
6231
6234
|
const rootLayout = this.routeManager.getLayouts().get("/");
|
|
6232
6235
|
const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
|
|
6233
|
-
const pages =
|
|
6236
|
+
const pages = _chunkE3RDL2DAcjs.collectFarmLlmsTxtPages.call(void 0, sources, {
|
|
6234
6237
|
origin,
|
|
6235
6238
|
basePath: this.config.basePath,
|
|
6236
|
-
markdown:
|
|
6239
|
+
markdown: _chunk2ITKVAIFcjs.resolveMarkdownConfig.call(void 0, this.config.md),
|
|
6237
6240
|
include: config.include,
|
|
6238
6241
|
exclude: config.exclude
|
|
6239
6242
|
});
|
|
6240
6243
|
return {
|
|
6241
6244
|
pages,
|
|
6242
|
-
defaults:
|
|
6245
|
+
defaults: _chunkE3RDL2DAcjs.createFarmDefaultLlmsTxt.call(void 0, { origin, pages, config, rootMetadata }),
|
|
6243
6246
|
...options.full ? { markdown: this.createDevMarkdownReader(options.req) } : {}
|
|
6244
6247
|
};
|
|
6245
6248
|
}
|
|
@@ -6259,11 +6262,11 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6259
6262
|
}
|
|
6260
6263
|
if (socket.encrypted) {
|
|
6261
6264
|
const address = { host: socket.localAddress, port: socket.localPort };
|
|
6262
|
-
return
|
|
6265
|
+
return _chunkE3RDL2DAcjs.createFarmLlmsMarkdownReader.call(void 0, (page) => requestOwnHttpsServer(page, address));
|
|
6263
6266
|
}
|
|
6264
6267
|
const host = socket.localAddress.includes(":") ? `[${socket.localAddress}]` : socket.localAddress;
|
|
6265
6268
|
const localOrigin = `http://${host}:${socket.localPort}`;
|
|
6266
|
-
const read =
|
|
6269
|
+
const read = _chunkE3RDL2DAcjs.createFarmLlmsMarkdownReader.call(void 0, (page) => fetch(page));
|
|
6267
6270
|
return (url) => {
|
|
6268
6271
|
const target = new URL(url);
|
|
6269
6272
|
return read(`${localOrigin}${target.pathname}${target.search}`);
|
|
@@ -6502,7 +6505,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6502
6505
|
tags: metaTags,
|
|
6503
6506
|
hasFavicon,
|
|
6504
6507
|
hasExplicitTitle
|
|
6505
|
-
} =
|
|
6508
|
+
} = _chunk3TQWUUNPcjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
|
|
6506
6509
|
pathname: getFarmMetadataPathname(req),
|
|
6507
6510
|
jsonLd: _optionalChain([this, 'access', _232 => _232.config, 'access', _233 => _233.agent, 'optionalAccess', _234 => _234.jsonLd])
|
|
6508
6511
|
});
|
|
@@ -6514,7 +6517,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6514
6517
|
i18nSnapshot,
|
|
6515
6518
|
this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
|
|
6516
6519
|
) : "";
|
|
6517
|
-
const themeDocument =
|
|
6520
|
+
const themeDocument = _chunk65P6OGYNcjs.createFarmThemeDocumentParts.call(void 0,
|
|
6518
6521
|
this.config.theme,
|
|
6519
6522
|
this.config.basePath,
|
|
6520
6523
|
_chunkXWAWFQFScjs.getTheme.call(void 0, )
|
|
@@ -6740,7 +6743,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6740
6743
|
title,
|
|
6741
6744
|
tags: metaTags,
|
|
6742
6745
|
hasFavicon
|
|
6743
|
-
} =
|
|
6746
|
+
} = _chunk3TQWUUNPcjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
|
|
6744
6747
|
pathname: getFarmMetadataPathname(req),
|
|
6745
6748
|
jsonLd: _optionalChain([this, 'access', _243 => _243.config, 'access', _244 => _244.agent, 'optionalAccess', _245 => _245.jsonLd])
|
|
6746
6749
|
});
|
|
@@ -6751,7 +6754,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6751
6754
|
this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
|
|
6752
6755
|
) : "";
|
|
6753
6756
|
const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
|
|
6754
|
-
const themeDocument =
|
|
6757
|
+
const themeDocument = _chunk65P6OGYNcjs.createFarmThemeDocumentParts.call(void 0,
|
|
6755
6758
|
this.config.theme,
|
|
6756
6759
|
this.config.basePath,
|
|
6757
6760
|
_chunkXWAWFQFScjs.getTheme.call(void 0, )
|
|
@@ -6760,7 +6763,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6760
6763
|
const devStyleLinks = this.collectDevStyleLinks();
|
|
6761
6764
|
const globalStylesheetLink = this.devGlobalStylesheetLink(true);
|
|
6762
6765
|
const cspNonce = this.getCspNonce(req);
|
|
6763
|
-
const secureDocumentHTML = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (html) => cspNonce ?
|
|
6766
|
+
const secureDocumentHTML = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (html) => cspNonce ? _chunkE3RDL2DAcjs.addFarmCspNonceToScriptTags.call(void 0, html, cspNonce) : html, "secureDocumentHTML");
|
|
6764
6767
|
const createLateNavigationRecovery = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (navigationError) => this.createLateNavigationRecoveryHTML(req, navigationError), "createLateNavigationRecovery");
|
|
6765
6768
|
const { pipe, abort } = renderToPipeableStream(streamRoot, {
|
|
6766
6769
|
nonce: cspNonce,
|
|
@@ -6807,7 +6810,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6807
6810
|
let firstChunk = true;
|
|
6808
6811
|
let checkedFullDocument = false;
|
|
6809
6812
|
let documentPrefix = "";
|
|
6810
|
-
const cspNonceRewriter = cspNonce ?
|
|
6813
|
+
const cspNonceRewriter = cspNonce ? _chunkE3RDL2DAcjs.createFarmCspNonceRewriter.call(void 0, cspNonce) : void 0;
|
|
6811
6814
|
const cspStreamDecoder = cspNonceRewriter ? new TextDecoder() : void 0;
|
|
6812
6815
|
const recordRenderedChunk = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (chunkText) => {
|
|
6813
6816
|
if (!chunkText) return;
|
|
@@ -6991,8 +6994,8 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6991
6994
|
}
|
|
6992
6995
|
/** The not-found document's head: layout and not-found metadata, as production renders it. */
|
|
6993
6996
|
async notFoundMetadataHead(layoutModule, notFoundModule) {
|
|
6994
|
-
const metadata = await
|
|
6995
|
-
const { title, tags, hasFavicon } =
|
|
6997
|
+
const metadata = await _chunk3TQWUUNPcjs.resolveFarmNotFoundMetadata.call(void 0, [layoutModule], notFoundModule);
|
|
6998
|
+
const { title, tags, hasFavicon } = _chunk3TQWUUNPcjs.renderMetadataHead.call(void 0, metadata);
|
|
6996
6999
|
return {
|
|
6997
7000
|
head: `${hasFavicon ? "" : '<link rel="icon" href="data:,">\n '}<title>${title}</title>${tags}`,
|
|
6998
7001
|
metadata
|
|
@@ -7010,7 +7013,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7010
7013
|
*/
|
|
7011
7014
|
async createLateNavigationRecoveryHTML(req, error) {
|
|
7012
7015
|
if (_chunkOX6O6WVAcjs.isFarmRedirectError.call(void 0, error)) {
|
|
7013
|
-
return
|
|
7016
|
+
return _chunk65P6OGYNcjs.createLateRedirectRecovery.call(void 0, this.localizeRedirectUrl(_chunkOX6O6WVAcjs.getFarmRedirectError.call(void 0, error).url));
|
|
7014
7017
|
}
|
|
7015
7018
|
const pathname = _chunk5ZSWG4UXcjs.resolveFarmRequestURL.call(void 0, req, {
|
|
7016
7019
|
trustProxy: _optionalChain([this, 'access', _253 => _253.config, 'access', _254 => _254.server, 'optionalAccess', _255 => _255.trustProxy])
|
|
@@ -7028,7 +7031,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7028
7031
|
_chunk5QIKR7RRcjs.logger.warn(`not-found page could not render outside its layout, using Farm's: ${error2}`);
|
|
7029
7032
|
}
|
|
7030
7033
|
}
|
|
7031
|
-
return
|
|
7034
|
+
return _chunk65P6OGYNcjs.createLateNotFoundRecovery.call(void 0, content);
|
|
7032
7035
|
}
|
|
7033
7036
|
async render404(req, res) {
|
|
7034
7037
|
res.statusCode = 404;
|
|
@@ -7037,11 +7040,11 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7037
7040
|
}).pathname;
|
|
7038
7041
|
const acceptHeader = req.headers.accept;
|
|
7039
7042
|
const accept = Array.isArray(acceptHeader) ? acceptHeader.join(",") : acceptHeader;
|
|
7040
|
-
if (
|
|
7041
|
-
res.setHeader("Content-Type",
|
|
7043
|
+
if (_chunk2ITKVAIFcjs.farmRequestWantsMarkdown.call(void 0, pathname, accept)) {
|
|
7044
|
+
res.setHeader("Content-Type", _chunk2ITKVAIFcjs.FARM_MARKDOWN_CONTENT_TYPE);
|
|
7042
7045
|
res.setHeader("X-Farm-Markdown-Error", "404");
|
|
7043
7046
|
res.setHeader("Cache-Control", "no-store");
|
|
7044
|
-
res.end(
|
|
7047
|
+
res.end(_chunk2ITKVAIFcjs.createFarmMarkdownErrorBody.call(void 0, 404, pathname, this.config.basePath || "/"));
|
|
7045
7048
|
return;
|
|
7046
7049
|
}
|
|
7047
7050
|
const appDir = path9.join(this.config.root, this.config.srcDir, "app");
|
|
@@ -7103,8 +7106,8 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7103
7106
|
trustProxy: _optionalChain([this, 'access', _261 => _261.config, 'access', _262 => _262.server, 'optionalAccess', _263 => _263.trustProxy])
|
|
7104
7107
|
});
|
|
7105
7108
|
const diagnostics = isDev ? createDefaultErrorDiagnostics(error, this.config.root || process.cwd()) : void 0;
|
|
7106
|
-
const statusText =
|
|
7107
|
-
const content =
|
|
7109
|
+
const statusText = _chunk65P6OGYNcjs.getDefaultErrorStatusText.call(void 0, statusCode);
|
|
7110
|
+
const content = _chunk65P6OGYNcjs.createDefaultErrorMarkup.call(void 0, {
|
|
7108
7111
|
statusCode,
|
|
7109
7112
|
statusText,
|
|
7110
7113
|
requestPath: requestUrl.pathname,
|
|
@@ -7114,7 +7117,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7114
7117
|
stack: _optionalChain([diagnostics, 'optionalAccess', _266 => _266.stack]),
|
|
7115
7118
|
sourceFrame: _optionalChain([diagnostics, 'optionalAccess', _267 => _267.sourceFrame]),
|
|
7116
7119
|
development: isDev,
|
|
7117
|
-
farmVersion:
|
|
7120
|
+
farmVersion: _chunkTTVHACQVcjs.FARM_VERSION,
|
|
7118
7121
|
nodeVersion: process.version,
|
|
7119
7122
|
mode: isDev ? "development" : "production"
|
|
7120
7123
|
});
|
|
@@ -7157,7 +7160,7 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
|
|
|
7157
7160
|
this.getI18nAlternateOptions(alternates.req, alternates.metadata)
|
|
7158
7161
|
) : "";
|
|
7159
7162
|
const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
|
|
7160
|
-
const themeDocument =
|
|
7163
|
+
const themeDocument = _chunk65P6OGYNcjs.createFarmThemeDocumentParts.call(void 0,
|
|
7161
7164
|
this.config.theme,
|
|
7162
7165
|
this.config.basePath,
|
|
7163
7166
|
_chunkXWAWFQFScjs.getTheme.call(void 0, )
|
|
@@ -7217,7 +7220,7 @@ ${clientScript}
|
|
|
7217
7220
|
}
|
|
7218
7221
|
secureDocumentHTML(req, html) {
|
|
7219
7222
|
const nonce = this.getCspNonce(req);
|
|
7220
|
-
return nonce ?
|
|
7223
|
+
return nonce ? _chunkE3RDL2DAcjs.addFarmCspNonceToScriptTags.call(void 0, html, nonce) : html;
|
|
7221
7224
|
}
|
|
7222
7225
|
applyDeploymentHeaders(req, res) {
|
|
7223
7226
|
const deploymentId = this.getDeploymentId();
|
|
@@ -7325,9 +7328,9 @@ var _FarmApp = class _FarmApp {
|
|
|
7325
7328
|
context: config.context || (() => void 0),
|
|
7326
7329
|
server: _chunkEM6SBQKMcjs.resolveFarmServerConfig.call(void 0, config.server),
|
|
7327
7330
|
serverActions: _chunkT5CERMEHcjs.resolveServerActionsConfig.call(void 0, config.serverActions),
|
|
7328
|
-
security:
|
|
7331
|
+
security: _chunkE3RDL2DAcjs.resolveFarmSecurityConfig.call(void 0, config.security),
|
|
7329
7332
|
images: _chunkYFPGHF5Fcjs.resolveFarmImageConfig.call(void 0, config.images),
|
|
7330
|
-
performance:
|
|
7333
|
+
performance: _chunkE3RDL2DAcjs.resolveFarmPerformanceConfig.call(void 0, config.performance),
|
|
7331
7334
|
theme: _chunkOI6CMLWXcjs.resolveFarmThemeConfig.call(void 0, config.theme, basePath),
|
|
7332
7335
|
i18n: isResolvedI18nConfig(config.i18n) ? config.i18n : _chunkHBTUGXHScjs.resolveFarmI18nConfig.call(void 0, config.i18n, {
|
|
7333
7336
|
root,
|
|
@@ -7339,7 +7342,7 @@ var _FarmApp = class _FarmApp {
|
|
|
7339
7342
|
serverRuntimeConfig: config.serverRuntimeConfig || {},
|
|
7340
7343
|
publicRuntimeConfig: config.publicRuntimeConfig || {},
|
|
7341
7344
|
docs: isResolvedDocsConfig(config.docs) ? config.docs : defaultDocsConfig,
|
|
7342
|
-
md:
|
|
7345
|
+
md: _chunk2ITKVAIFcjs.resolveMarkdownConfig.call(void 0, config.md),
|
|
7343
7346
|
mdx: _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, config.mdx),
|
|
7344
7347
|
observability: _nullishCoalesce(config.observability, () => ( false)),
|
|
7345
7348
|
telemetry: config.telemetry !== false,
|
|
@@ -9462,13 +9465,13 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, reportOpenAPIDevGenerationResult, "reportO
|
|
|
9462
9465
|
// src/vite.ts
|
|
9463
9466
|
var SERVER_FN_TRANSFORM_PLUGIN = "@farm.js/plugin/rsc:server-fn-actions";
|
|
9464
9467
|
function farmLlmsTxtGeneratedPaths(config) {
|
|
9465
|
-
const llms =
|
|
9468
|
+
const llms = _chunkE3RDL2DAcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([config, 'access', _474 => _474.agent, 'optionalAccess', _475 => _475.llmsTxt]));
|
|
9466
9469
|
if (!llms.enabled) return [];
|
|
9467
9470
|
return llms.full ? ["/llms.txt", "/llms-full.txt"] : ["/llms.txt"];
|
|
9468
9471
|
}
|
|
9469
9472
|
_chunkS3JO3N4Hcjs.__name.call(void 0, farmLlmsTxtGeneratedPaths, "farmLlmsTxtGeneratedPaths");
|
|
9470
9473
|
function farmAgentGeneratedPaths(config) {
|
|
9471
|
-
const crawlers =
|
|
9474
|
+
const crawlers = _chunkE3RDL2DAcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([config, 'access', _476 => _476.agent, 'optionalAccess', _477 => _477.crawlers]));
|
|
9472
9475
|
return [...farmLlmsTxtGeneratedPaths(config), ...crawlers.enabled ? ["/robots.txt"] : []];
|
|
9473
9476
|
}
|
|
9474
9477
|
_chunkS3JO3N4Hcjs.__name.call(void 0, farmAgentGeneratedPaths, "farmAgentGeneratedPaths");
|
|
@@ -9514,7 +9517,7 @@ function loadFarmWorkflowsDevRuntime() {
|
|
|
9514
9517
|
}
|
|
9515
9518
|
_chunkS3JO3N4Hcjs.__name.call(void 0, loadFarmWorkflowsDevRuntime, "loadFarmWorkflowsDevRuntime");
|
|
9516
9519
|
function loadFarmDevtoolsSnapshotRuntime() {
|
|
9517
|
-
return import("./devtools-
|
|
9520
|
+
return import("./devtools-6OA7FEF6.cjs");
|
|
9518
9521
|
}
|
|
9519
9522
|
_chunkS3JO3N4Hcjs.__name.call(void 0, loadFarmDevtoolsSnapshotRuntime, "loadFarmDevtoolsSnapshotRuntime");
|
|
9520
9523
|
function loadFarmDevtoolsUIRuntime() {
|
|
@@ -9601,7 +9604,7 @@ function renderFarmI18nStaticHead(requestPath, snapshot) {
|
|
|
9601
9604
|
if (!snapshot) return "";
|
|
9602
9605
|
const runtime = `<script>window.__FARM_I18N__ = ${serializeFarmInlineValue(snapshot)};</script>`;
|
|
9603
9606
|
if (snapshot.routing === "none") return runtime;
|
|
9604
|
-
return `${
|
|
9607
|
+
return `${_chunk65P6OGYNcjs.renderFarmLocaleAlternateLinks.call(void 0, requestPath, snapshot)}${runtime}`;
|
|
9605
9608
|
}
|
|
9606
9609
|
_chunkS3JO3N4Hcjs.__name.call(void 0, renderFarmI18nStaticHead, "renderFarmI18nStaticHead");
|
|
9607
9610
|
function getPublicEnvDefine(config) {
|
|
@@ -10200,7 +10203,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
10200
10203
|
if (_optionalChain([farmConfig, 'access', _505 => _505.agent, 'optionalAccess', _506 => _506.noindexPreviews])) {
|
|
10201
10204
|
server.middlewares.use((_req, res, next) => {
|
|
10202
10205
|
if (_chunkCXP5U3RWcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env)) {
|
|
10203
|
-
res.setHeader("X-Robots-Tag",
|
|
10206
|
+
res.setHeader("X-Robots-Tag", _chunkE3RDL2DAcjs.FARM_PREVIEW_ROBOTS_TAG);
|
|
10204
10207
|
}
|
|
10205
10208
|
next();
|
|
10206
10209
|
});
|
|
@@ -10412,7 +10415,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
10412
10415
|
layoutCount: discoveredRoutes.filter((r) => r.kind === "layout").length
|
|
10413
10416
|
});
|
|
10414
10417
|
}
|
|
10415
|
-
apiRouteManager = new (0,
|
|
10418
|
+
apiRouteManager = new (0, _chunkBD2U4ZL6cjs.APIRouteManager)(appDirs, server, {
|
|
10416
10419
|
plugins: farmConfig.plugins,
|
|
10417
10420
|
i18n: farmApp.getI18nRuntime(),
|
|
10418
10421
|
bodySizeLimit: serverConfig.bodySizeLimit,
|
|
@@ -10809,6 +10812,17 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10809
10812
|
const docsHandler = openAPIManager.getDocsRouteHandler(parsedRequestUrl.origin);
|
|
10810
10813
|
return docsHandler(req, res);
|
|
10811
10814
|
}
|
|
10815
|
+
if (_optionalChain([options, 'access', _558 => _558.agent, 'optionalAccess', _559 => _559.apiCatalog]) && _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) === _chunk65P6OGYNcjs.FARM_API_CATALOG_PATH) {
|
|
10816
|
+
if (await runAppMiddlewareForContentRoute()) return;
|
|
10817
|
+
await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0,
|
|
10818
|
+
res,
|
|
10819
|
+
_chunk65P6OGYNcjs.createFarmApiCatalogResponse.call(void 0,
|
|
10820
|
+
requestMethod,
|
|
10821
|
+
_chunk65P6OGYNcjs.resolveFarmApiCatalogInput.call(void 0, { ...options, api: farmConfig.api })
|
|
10822
|
+
)
|
|
10823
|
+
);
|
|
10824
|
+
return;
|
|
10825
|
+
}
|
|
10812
10826
|
const docsHeaders = new Headers();
|
|
10813
10827
|
for (const [key, value] of Object.entries(req.headers)) {
|
|
10814
10828
|
if (value) {
|
|
@@ -10836,7 +10850,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10836
10850
|
return;
|
|
10837
10851
|
}
|
|
10838
10852
|
}
|
|
10839
|
-
const markdownSourceResponse = viteModuleRequest ? null : await
|
|
10853
|
+
const markdownSourceResponse = viteModuleRequest ? null : await _chunk6K4SPQWLcjs.createFarmMarkdownSourceResponse.call(void 0, {
|
|
10840
10854
|
request: new Request(fullUrl, {
|
|
10841
10855
|
method: requestMethod,
|
|
10842
10856
|
headers: docsHeaders
|
|
@@ -10844,7 +10858,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10844
10858
|
config: farmApp.getConfig().mdx,
|
|
10845
10859
|
resolveSource: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (pathname2) => {
|
|
10846
10860
|
const match = farmApp.getRouteManager().matchRoute(pathname2);
|
|
10847
|
-
const sourcePath = _optionalChain([match, 'access',
|
|
10861
|
+
const sourcePath = _optionalChain([match, 'access', _560 => _560.route, 'optionalAccess', _561 => _561.markdownSourcePath]) || (match.route && _chunk6K4SPQWLcjs.isFarmMarkdownPageFile.call(void 0, match.route.modulePath) ? match.route.modulePath : null);
|
|
10848
10862
|
if (!sourcePath) {
|
|
10849
10863
|
return null;
|
|
10850
10864
|
}
|
|
@@ -10859,7 +10873,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10859
10873
|
await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0, res, markdownSourceResponse);
|
|
10860
10874
|
return;
|
|
10861
10875
|
}
|
|
10862
|
-
const markdownResponse = viteModuleRequest ? null : await
|
|
10876
|
+
const markdownResponse = viteModuleRequest ? null : await _chunk2ITKVAIFcjs.createMarkdownMirrorResponse.call(void 0, {
|
|
10863
10877
|
request: new Request(fullUrl, {
|
|
10864
10878
|
method: requestMethod,
|
|
10865
10879
|
headers: docsHeaders
|
|
@@ -10873,21 +10887,21 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10873
10887
|
await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0, res, markdownResponse);
|
|
10874
10888
|
return;
|
|
10875
10889
|
}
|
|
10876
|
-
if (!viteModuleRequest &&
|
|
10877
|
-
const markdownRoute = farmApp.getRouteManager().matchRoute(
|
|
10890
|
+
if (!viteModuleRequest && _chunk2ITKVAIFcjs.farmRequestWantsMarkdown.call(void 0, requestPathname, req.headers.accept)) {
|
|
10891
|
+
const markdownRoute = farmApp.getRouteManager().matchRoute(_chunk6K4SPQWLcjs.normalizeFarmMarkdownRoutePath.call(void 0, requestPathname));
|
|
10878
10892
|
if (!markdownRoute.route) {
|
|
10879
10893
|
if (await runAppMiddlewareForContentRoute()) return;
|
|
10880
10894
|
res.statusCode = 404;
|
|
10881
|
-
res.setHeader("Content-Type",
|
|
10895
|
+
res.setHeader("Content-Type", _chunk2ITKVAIFcjs.FARM_MARKDOWN_CONTENT_TYPE);
|
|
10882
10896
|
res.setHeader("X-Farm-Markdown-Error", "404");
|
|
10883
10897
|
res.setHeader("Cache-Control", "no-store");
|
|
10884
10898
|
res.end(
|
|
10885
|
-
|
|
10899
|
+
_chunk2ITKVAIFcjs.createFarmMarkdownErrorBody.call(void 0, 404, requestPathname, farmConfig.basePath || "/")
|
|
10886
10900
|
);
|
|
10887
10901
|
return;
|
|
10888
10902
|
}
|
|
10889
10903
|
}
|
|
10890
|
-
const markdownPageTarget =
|
|
10904
|
+
const markdownPageTarget = _chunk2ITKVAIFcjs.resolveMarkdownMirrorTarget.call(void 0,
|
|
10891
10905
|
farmApp.getConfig().md,
|
|
10892
10906
|
requestPathname,
|
|
10893
10907
|
{
|
|
@@ -10900,7 +10914,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10900
10914
|
if (!varyValues.some((value) => value.toLowerCase() === "accept")) {
|
|
10901
10915
|
res.setHeader("Vary", [...varyValues, "Accept"].join(", "));
|
|
10902
10916
|
}
|
|
10903
|
-
const alternatePath =
|
|
10917
|
+
const alternatePath = _chunk2ITKVAIFcjs.getFarmMarkdownMirrorPath.call(void 0, markdownPageTarget.pathname);
|
|
10904
10918
|
const alternateLink = `<${alternatePath}>; rel="alternate"; type="text/markdown"`;
|
|
10905
10919
|
const currentLink = res.getHeader("Link");
|
|
10906
10920
|
res.setHeader(
|
|
@@ -10952,7 +10966,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10952
10966
|
"beforeRequest",
|
|
10953
10967
|
(plugin) => {
|
|
10954
10968
|
const owner = _chunkZ5HIWVDPcjs.getFarmIntegrationPluginOwner.call(void 0, plugin);
|
|
10955
|
-
return plugin.name !== _chunkYZTASLPQcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME && (_optionalChain([owner, 'optionalAccess',
|
|
10969
|
+
return plugin.name !== _chunkYZTASLPQcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME && (_optionalChain([owner, 'optionalAccess', _562 => _562.source]) !== "lifecycle" || owner.key !== matchedRoute.key);
|
|
10956
10970
|
},
|
|
10957
10971
|
req,
|
|
10958
10972
|
res
|
|
@@ -11043,7 +11057,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11043
11057
|
}
|
|
11044
11058
|
const matchedApiRoute = apiRouteManager.matchRoute(requestPathname);
|
|
11045
11059
|
const hasMatchedApiRoute = Boolean(matchedApiRoute);
|
|
11046
|
-
if (hasMatchedApiRoute ||
|
|
11060
|
+
if (hasMatchedApiRoute || _chunkYAOX43YIcjs.isFarmAPIPathname.call(void 0, requestPathname, apiServerBasePath)) {
|
|
11047
11061
|
const startTime2 = Date.now();
|
|
11048
11062
|
const method2 = req.method || "GET";
|
|
11049
11063
|
const urlPath2 = req.url || "/";
|
|
@@ -11082,7 +11096,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11082
11096
|
const apiHandler = apiRouteManager.getHandler({ throwOnError: true });
|
|
11083
11097
|
const hasExplicitAPIRoute = hasMatchedApiRoute || Boolean(apiRouteManager.matchRoute(pathname2));
|
|
11084
11098
|
if (apiHandler && hasExplicitAPIRoute) {
|
|
11085
|
-
const apiRoutePattern = _optionalChain([matchedApiRoute, 'optionalAccess',
|
|
11099
|
+
const apiRoutePattern = _optionalChain([matchedApiRoute, 'optionalAccess', _563 => _563.route, 'access', _564 => _564.path]) || _optionalChain([apiRouteManager, 'access', _565 => _565.matchRoute, 'call', _566 => _566(pathname2), 'optionalAccess', _567 => _567.route, 'access', _568 => _568.path]) || urlPath2;
|
|
11086
11100
|
_chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, {
|
|
11087
11101
|
type: "route.matched",
|
|
11088
11102
|
pathname: pathname2,
|
|
@@ -11172,7 +11186,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11172
11186
|
return;
|
|
11173
11187
|
}
|
|
11174
11188
|
}
|
|
11175
|
-
if (farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
11189
|
+
if (farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _569 => _569.isFarmDocsAPIRequest, 'call', _570 => _570(pathname2)])) {
|
|
11176
11190
|
try {
|
|
11177
11191
|
const url = `http://${req.headers.host || "localhost:3000"}${req.url}`;
|
|
11178
11192
|
const headers = new Headers();
|
|
@@ -11245,18 +11259,18 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11245
11259
|
res.end(JSON.stringify({ error: "API route not found", pathname: pathname2 }));
|
|
11246
11260
|
return;
|
|
11247
11261
|
}
|
|
11248
|
-
if (_optionalChain([req, 'access',
|
|
11262
|
+
if (_optionalChain([req, 'access', _571 => _571.url, 'optionalAccess', _572 => _572.startsWith, 'call', _573 => _573("/@")]) || _optionalChain([req, 'access', _574 => _574.url, 'optionalAccess', _575 => _575.startsWith, 'call', _576 => _576("/node_modules")])) {
|
|
11249
11263
|
return next();
|
|
11250
11264
|
}
|
|
11251
11265
|
if (shouldBypassFarmRouterForDottedPath(
|
|
11252
11266
|
requestPathname,
|
|
11253
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
11267
|
+
_optionalChain([farmApp, 'optionalAccess', _577 => _577.getRouteManager, 'call', _578 => _578()]),
|
|
11254
11268
|
[server.config.publicDir, server.config.root],
|
|
11255
11269
|
farmAgentGeneratedPaths(farmConfig)
|
|
11256
11270
|
)) {
|
|
11257
11271
|
return next();
|
|
11258
11272
|
}
|
|
11259
|
-
if (_optionalChain([req, 'access',
|
|
11273
|
+
if (_optionalChain([req, 'access', _579 => _579.url, 'optionalAccess', _580 => _580.startsWith, 'call', _581 => _581("/__farm/page-data")])) {
|
|
11260
11274
|
const urlObj = parsedRequestUrl;
|
|
11261
11275
|
const targetPath = urlObj.searchParams.get("path") || "/";
|
|
11262
11276
|
try {
|
|
@@ -11284,7 +11298,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11284
11298
|
});
|
|
11285
11299
|
let middlewareMap = /* @__PURE__ */ new Map();
|
|
11286
11300
|
let middlewareContext = /* @__PURE__ */ new Map();
|
|
11287
|
-
if (_optionalChain([middlewareManager, 'optionalAccess',
|
|
11301
|
+
if (_optionalChain([middlewareManager, 'optionalAccess', _582 => _582.hasMiddleware, 'call', _583 => _583()])) {
|
|
11288
11302
|
const targetNodeRequest = createPageDataMiddlewareRequest(req, targetRequestUrl);
|
|
11289
11303
|
const handled = await runFarmMiddlewareWithNavigation(
|
|
11290
11304
|
farmApp.getServerRenderer(),
|
|
@@ -11312,10 +11326,10 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11312
11326
|
if (pm) {
|
|
11313
11327
|
await pm.runHookParallel("afterRouteMatch", {
|
|
11314
11328
|
pathname: targetPath,
|
|
11315
|
-
matched: !!_optionalChain([match, 'optionalAccess',
|
|
11316
|
-
routePattern: _optionalChain([match, 'optionalAccess',
|
|
11317
|
-
params: _optionalChain([match, 'optionalAccess',
|
|
11318
|
-
layoutPatterns: (_optionalChain([match, 'optionalAccess',
|
|
11329
|
+
matched: !!_optionalChain([match, 'optionalAccess', _584 => _584.route]),
|
|
11330
|
+
routePattern: _optionalChain([match, 'optionalAccess', _585 => _585.route, 'optionalAccess', _586 => _586.pattern]) || null,
|
|
11331
|
+
params: _optionalChain([match, 'optionalAccess', _587 => _587.params]) || {},
|
|
11332
|
+
layoutPatterns: (_optionalChain([match, 'optionalAccess', _588 => _588.layouts]) || []).map((l) => l.pattern)
|
|
11319
11333
|
});
|
|
11320
11334
|
}
|
|
11321
11335
|
if (!match) {
|
|
@@ -11379,24 +11393,24 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11379
11393
|
routePath: route.pattern
|
|
11380
11394
|
});
|
|
11381
11395
|
for (const layoutModule of layoutModules) {
|
|
11382
|
-
mergedMetadata =
|
|
11396
|
+
mergedMetadata = _chunk3TQWUUNPcjs.mergeMetadata.call(void 0, mergedMetadata, layoutModule.metadata);
|
|
11383
11397
|
if (typeof layoutModule.generateMetadata === "function") {
|
|
11384
|
-
mergedMetadata =
|
|
11398
|
+
mergedMetadata = _chunk3TQWUUNPcjs.mergeMetadata.call(void 0,
|
|
11385
11399
|
mergedMetadata,
|
|
11386
11400
|
await layoutModule.generateMetadata({ params: routeProps.params })
|
|
11387
11401
|
);
|
|
11388
11402
|
}
|
|
11389
11403
|
}
|
|
11390
|
-
mergedMetadata =
|
|
11404
|
+
mergedMetadata = _chunk3TQWUUNPcjs.mergeMetadata.call(void 0, mergedMetadata, routeModule.metadata);
|
|
11391
11405
|
if (typeof routeModule.generateMetadata === "function") {
|
|
11392
|
-
mergedMetadata =
|
|
11406
|
+
mergedMetadata = _chunk3TQWUUNPcjs.mergeMetadata.call(void 0,
|
|
11393
11407
|
mergedMetadata,
|
|
11394
11408
|
await routeModule.generateMetadata(routeProps)
|
|
11395
11409
|
);
|
|
11396
11410
|
}
|
|
11397
|
-
mergedMetadata =
|
|
11411
|
+
mergedMetadata = _chunk3TQWUUNPcjs.addMetadataMarkdownAlternate.call(void 0,
|
|
11398
11412
|
mergedMetadata,
|
|
11399
|
-
|
|
11413
|
+
_chunk2ITKVAIFcjs.getFarmMarkdownAlternatePath.call(void 0, farmApp.getConfig().md, targetRequestUrl.pathname)
|
|
11400
11414
|
);
|
|
11401
11415
|
const routeSlots = await Promise.all(
|
|
11402
11416
|
slots.map(async (slot) => {
|
|
@@ -11466,7 +11480,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11466
11480
|
middlewareContext,
|
|
11467
11481
|
() => renderer.renderNavigationFragment({
|
|
11468
11482
|
PageComponent: routeModule.default,
|
|
11469
|
-
LoadingComponent: _optionalChain([loadingModule, 'optionalAccess',
|
|
11483
|
+
LoadingComponent: _optionalChain([loadingModule, 'optionalAccess', _589 => _589.default]),
|
|
11470
11484
|
pageProps: routeProps,
|
|
11471
11485
|
params,
|
|
11472
11486
|
layouts: layouts.map((layout, index) => ({
|
|
@@ -11572,14 +11586,14 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11572
11586
|
trustProxy: currentServerConfig.trustProxy
|
|
11573
11587
|
}).pathname;
|
|
11574
11588
|
const routeManager2 = farmApp.getRouteManager();
|
|
11575
|
-
const hasBeforeRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
11576
|
-
const hasAfterRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
11577
|
-
const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
11578
|
-
const hasBeforeRenderHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
11579
|
-
const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
11580
|
-
const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
11581
|
-
const hasRuntimeRequestHooks = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
11582
|
-
const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
11589
|
+
const hasBeforeRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _590 => _590.hasHook, 'call', _591 => _591("beforeRouteMatch")]), () => ( false));
|
|
11590
|
+
const hasAfterRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _592 => _592.hasHook, 'call', _593 => _593("afterRouteMatch")]), () => ( false));
|
|
11591
|
+
const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _594 => _594.hasHook, 'call', _595 => _595("beforeRequest")]), () => ( false));
|
|
11592
|
+
const hasBeforeRenderHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _596 => _596.hasHook, 'call', _597 => _597("beforeRender")]), () => ( false));
|
|
11593
|
+
const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _598 => _598.hasHook, 'call', _599 => _599("afterResponse")]), () => ( false));
|
|
11594
|
+
const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _600 => _600.hasHook, 'call', _601 => _601("transformHTML")]), () => ( false))) || (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _602 => _602.hasHook, 'call', _603 => _603("afterRender")]), () => ( false)));
|
|
11595
|
+
const hasRuntimeRequestHooks = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _604 => _604.hasRuntimeRequestHooks, 'call', _605 => _605()]), () => ( false));
|
|
11596
|
+
const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _606 => _606.hasRuntimeHook, 'call', _607 => _607("after")]), () => ( false));
|
|
11583
11597
|
const requestedMatch = routeManager2.matchRoute(requestedPathname);
|
|
11584
11598
|
let runtimeSession;
|
|
11585
11599
|
if (pm && hasRuntimeRequestHooks) {
|
|
@@ -11590,8 +11604,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11590
11604
|
kind: "page",
|
|
11591
11605
|
route: {
|
|
11592
11606
|
pathname: requestedPathname,
|
|
11593
|
-
pattern: _optionalChain([requestedMatch, 'optionalAccess',
|
|
11594
|
-
params: _optionalChain([requestedMatch, 'optionalAccess',
|
|
11607
|
+
pattern: _optionalChain([requestedMatch, 'optionalAccess', _608 => _608.route, 'optionalAccess', _609 => _609.pattern]) || null,
|
|
11608
|
+
params: _optionalChain([requestedMatch, 'optionalAccess', _610 => _610.params]) || {}
|
|
11595
11609
|
}
|
|
11596
11610
|
}
|
|
11597
11611
|
);
|
|
@@ -11624,17 +11638,17 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11624
11638
|
if (pm && hasAfterRouteMatchHook) {
|
|
11625
11639
|
await pm.runHookParallel("afterRouteMatch", {
|
|
11626
11640
|
pathname,
|
|
11627
|
-
matched: !!_optionalChain([routeMatch, 'optionalAccess',
|
|
11628
|
-
routePattern: _optionalChain([routeMatch, 'optionalAccess',
|
|
11629
|
-
params: _optionalChain([routeMatch, 'optionalAccess',
|
|
11630
|
-
layoutPatterns: (_optionalChain([routeMatch, 'optionalAccess',
|
|
11641
|
+
matched: !!_optionalChain([routeMatch, 'optionalAccess', _611 => _611.route]),
|
|
11642
|
+
routePattern: _optionalChain([routeMatch, 'optionalAccess', _612 => _612.route, 'optionalAccess', _613 => _613.pattern]) || null,
|
|
11643
|
+
params: _optionalChain([routeMatch, 'optionalAccess', _614 => _614.params]) || {},
|
|
11644
|
+
layoutPatterns: (_optionalChain([routeMatch, 'optionalAccess', _615 => _615.layouts]) || []).map((l) => l.pattern)
|
|
11631
11645
|
});
|
|
11632
11646
|
}
|
|
11633
11647
|
const renderPayload = {
|
|
11634
11648
|
pathname,
|
|
11635
11649
|
method,
|
|
11636
|
-
routePattern: _optionalChain([routeMatch, 'optionalAccess',
|
|
11637
|
-
params: _optionalChain([routeMatch, 'optionalAccess',
|
|
11650
|
+
routePattern: _optionalChain([routeMatch, 'optionalAccess', _616 => _616.route, 'optionalAccess', _617 => _617.pattern]) || null,
|
|
11651
|
+
params: _optionalChain([routeMatch, 'optionalAccess', _618 => _618.params]) || {}
|
|
11638
11652
|
};
|
|
11639
11653
|
const shouldInterceptResponse = Boolean(
|
|
11640
11654
|
pm && (hasAfterResponseHook || hasHTMLTransformHook || runtimeSession && hasRuntimeAfterHook)
|
|
@@ -11656,7 +11670,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11656
11670
|
emitError: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (error) => emitPluginError("response-end", error, { pathname }), "emitError")
|
|
11657
11671
|
}) : void 0;
|
|
11658
11672
|
try {
|
|
11659
|
-
if (_optionalChain([middlewareManager, 'optionalAccess',
|
|
11673
|
+
if (_optionalChain([middlewareManager, 'optionalAccess', _619 => _619.hasMiddleware, 'call', _620 => _620()])) {
|
|
11660
11674
|
const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
|
|
11661
11675
|
const handled = await runFarmMiddlewareWithNavigation(
|
|
11662
11676
|
farmApp.getServerRenderer(),
|
|
@@ -11666,7 +11680,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11666
11680
|
() => middlewareManager.execute(req, res)
|
|
11667
11681
|
);
|
|
11668
11682
|
if (handled) {
|
|
11669
|
-
if (!_optionalChain([responseInterceptor, 'optionalAccess',
|
|
11683
|
+
if (!_optionalChain([responseInterceptor, 'optionalAccess', _621 => _621.isEnded, 'call', _622 => _622()])) {
|
|
11670
11684
|
const duration = Date.now() - startTime;
|
|
11671
11685
|
logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
|
|
11672
11686
|
}
|
|
@@ -11678,7 +11692,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11678
11692
|
req.url || "/",
|
|
11679
11693
|
`http://${req.headers.host || "localhost:3000"}`
|
|
11680
11694
|
).pathname;
|
|
11681
|
-
const hasLocalPageRoute = Boolean(_optionalChain([routeManager2, 'access',
|
|
11695
|
+
const hasLocalPageRoute = Boolean(_optionalChain([routeManager2, 'access', _623 => _623.matchRoute, 'call', _624 => _624(currentPathname), 'optionalAccess', _625 => _625.route]));
|
|
11682
11696
|
await pm.runHookParallelFiltered(
|
|
11683
11697
|
"beforeRequest",
|
|
11684
11698
|
(plugin) => !hasLocalPageRoute || plugin.name !== _chunkYZTASLPQcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME,
|
|
@@ -11686,8 +11700,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11686
11700
|
res
|
|
11687
11701
|
);
|
|
11688
11702
|
}
|
|
11689
|
-
if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess',
|
|
11690
|
-
if (!_optionalChain([responseInterceptor, 'optionalAccess',
|
|
11703
|
+
if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess', _626 => _626.isEnded, 'call', _627 => _627()])) {
|
|
11704
|
+
if (!_optionalChain([responseInterceptor, 'optionalAccess', _628 => _628.isEnded, 'call', _629 => _629()])) {
|
|
11691
11705
|
const duration = Date.now() - startTime;
|
|
11692
11706
|
logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
|
|
11693
11707
|
}
|
|
@@ -11745,25 +11759,25 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11745
11759
|
if (imageModule) return imageModule;
|
|
11746
11760
|
}
|
|
11747
11761
|
if (_chunk6V4TDWECcjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
|
|
11748
|
-
const renderer = _optionalChain([farmApp, 'optionalAccess',
|
|
11749
|
-
return generateProgrammaticRouteModule(id, _optionalChain([server, 'optionalAccess',
|
|
11762
|
+
const renderer = _optionalChain([farmApp, 'optionalAccess', _630 => _630.getConfig, 'call', _631 => _631(), 'access', _632 => _632.renderer]) || _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, options.renderer);
|
|
11763
|
+
return generateProgrammaticRouteModule(id, _optionalChain([server, 'optionalAccess', _633 => _633.config, 'access', _634 => _634.root]) || options.root, renderer);
|
|
11750
11764
|
}
|
|
11751
11765
|
if (isFarmClientVirtualId(id)) {
|
|
11752
|
-
const resolvedConfig = _optionalChain([farmApp, 'optionalAccess',
|
|
11753
|
-
const renderer = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
11754
|
-
const integrations = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
11755
|
-
const root = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
11756
|
-
const docs = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
11766
|
+
const resolvedConfig = _optionalChain([farmApp, 'optionalAccess', _635 => _635.getConfig, 'call', _636 => _636()]);
|
|
11767
|
+
const renderer = _optionalChain([resolvedConfig, 'optionalAccess', _637 => _637.renderer]) || _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, options.renderer);
|
|
11768
|
+
const integrations = _optionalChain([resolvedConfig, 'optionalAccess', _638 => _638.integrations]) || options.integrations;
|
|
11769
|
+
const root = _optionalChain([resolvedConfig, 'optionalAccess', _639 => _639.root]) || _optionalChain([server, 'optionalAccess', _640 => _640.config, 'access', _641 => _641.root]) || process.cwd();
|
|
11770
|
+
const docs = _optionalChain([resolvedConfig, 'optionalAccess', _642 => _642.docs]);
|
|
11757
11771
|
const adapterOwnsDocsRuntime = Boolean(
|
|
11758
|
-
_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess',
|
|
11772
|
+
_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess', _643 => _643.adapter, 'optionalAccess', _644 => _644.server]) && docs.adapter.react
|
|
11759
11773
|
);
|
|
11760
|
-
const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
11774
|
+
const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _645 => _645.devtools]), () => ( _chunkYJRZR7VUcjs.resolveFarmDevtoolsConfig.call(void 0, false, "production")));
|
|
11761
11775
|
const [docsRuntime, docsSearchRuntime, devtoolsClientRuntime] = await Promise.all([
|
|
11762
|
-
_optionalChain([docs, 'optionalAccess',
|
|
11763
|
-
_optionalChain([docs, 'optionalAccess',
|
|
11776
|
+
_optionalChain([docs, 'optionalAccess', _646 => _646.enabled]) ? loadFarmDocsDevRuntime() : null,
|
|
11777
|
+
_optionalChain([docs, 'optionalAccess', _647 => _647.enabled]) && !adapterOwnsDocsRuntime ? loadFarmDocsSearchDevRuntime() : null,
|
|
11764
11778
|
devtools.enabled ? loadFarmDevtoolsClientRuntime() : null
|
|
11765
11779
|
]);
|
|
11766
|
-
const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess',
|
|
11780
|
+
const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess', _648 => _648.isFarmDocsSearchEnabled, 'call', _649 => _649(docs)]), () => ( false));
|
|
11767
11781
|
const generatedDocsSearchRuntime = docsSearchRuntime ? docsSearchRuntime.generateFarmDocsSearchClientRuntime(
|
|
11768
11782
|
docsSearchEnabled,
|
|
11769
11783
|
docsSearchEnabled ? docsSearchRuntime.resolveFarmDocsSearchClientModule(root) : void 0
|
|
@@ -11772,9 +11786,9 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11772
11786
|
const generatedDevIndicatorsClientRuntime = farmApp ? _chunkQBPXNZGVcjs.generateFarmDevIndicatorsClientRuntime.call(void 0, farmApp.getConfig().devIndicators) : "";
|
|
11773
11787
|
const integrationProviders = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _chunkZ5HIWVDPcjs.getIntegrationProviders.call(void 0, integrations) : [];
|
|
11774
11788
|
const isolatedHydrationMode = resolveFarmIsolatedClientHydrationMode(
|
|
11775
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
11789
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _650 => _650.experimental, 'optionalAccess', _651 => _651.isolatedClientHydration]),
|
|
11776
11790
|
{
|
|
11777
|
-
serverComponents: _optionalChain([resolvedConfig, 'optionalAccess',
|
|
11791
|
+
serverComponents: _optionalChain([resolvedConfig, 'optionalAccess', _652 => _652.experimental, 'optionalAccess', _653 => _653.serverComponents]) === true,
|
|
11778
11792
|
hasUnsupportedIntegrationProvider: integrationProviders.filter((provider) => provider.component || provider.type === "clerk").some((provider) => provider.supportsIsolatedHydration !== true)
|
|
11779
11793
|
}
|
|
11780
11794
|
);
|
|
@@ -11782,22 +11796,22 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11782
11796
|
integrationProviders,
|
|
11783
11797
|
[
|
|
11784
11798
|
..._chunkZ5HIWVDPcjs.getIntegrationDocumentNavigationMatchers.call(void 0, integrations),
|
|
11785
|
-
..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess',
|
|
11799
|
+
..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess', _654 => _654.getFarmDocsDocumentNavigationMatchers, 'call', _655 => _655(docs)]), () => ( []))
|
|
11786
11800
|
],
|
|
11787
11801
|
generatedDocsSearchRuntime,
|
|
11788
11802
|
`${generatedDevtoolsClientRuntime}
|
|
11789
11803
|
${generatedDevIndicatorsClientRuntime}`,
|
|
11790
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
11804
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _656 => _656.plugins]) || [],
|
|
11791
11805
|
root,
|
|
11792
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
11793
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
11794
|
-
_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess',
|
|
11806
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _657 => _657.srcDir]) || options.srcDir || "src",
|
|
11807
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _658 => _658.publicRuntimeConfig]) || options.publicRuntimeConfig,
|
|
11808
|
+
_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess', _659 => _659.adapter, 'optionalAccess', _660 => _660.react]) : void 0,
|
|
11795
11809
|
renderer,
|
|
11796
|
-
isolatedHydrationMode === "enabled" || _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
11797
|
-
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
11798
|
-
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
11810
|
+
isolatedHydrationMode === "enabled" || _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _661 => _661.getRouteManager, 'call', _662 => _662(), 'access', _663 => _663.getIsolatedClientBoundaryModules, 'call', _664 => _664(root)])))), 'optionalAccess', _665 => _665.size]) > 0,
|
|
11811
|
+
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _666 => _666.trailingSlash]), () => ( false)),
|
|
11812
|
+
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _667 => _667.basePath]), () => ( "/")),
|
|
11799
11813
|
generateClientCachePersistenceCode(
|
|
11800
|
-
resolveFarmClientCacheAdapterEntry(root, _optionalChain([resolvedConfig, 'optionalAccess',
|
|
11814
|
+
resolveFarmClientCacheAdapterEntry(root, _optionalChain([resolvedConfig, 'optionalAccess', _668 => _668.cache]))
|
|
11801
11815
|
),
|
|
11802
11816
|
_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _chunk75WGQVQAcjs.getFarmDocsAdapterConfigModule.call(void 0, docs) : void 0
|
|
11803
11817
|
);
|
|
@@ -11806,7 +11820,7 @@ ${generatedDevIndicatorsClientRuntime}`,
|
|
|
11806
11820
|
return generateServerCode();
|
|
11807
11821
|
}
|
|
11808
11822
|
if (id === "/@farm/manifest") {
|
|
11809
|
-
const routeManager = _optionalChain([farmApp, 'optionalAccess',
|
|
11823
|
+
const routeManager = _optionalChain([farmApp, 'optionalAccess', _669 => _669.getRouteManager, 'call', _670 => _670()]);
|
|
11810
11824
|
if (!routeManager) {
|
|
11811
11825
|
return `
|
|
11812
11826
|
export const getManifest = () => ({
|
|
@@ -11821,7 +11835,7 @@ export const getManifest = () => ({
|
|
|
11821
11835
|
const manifest = routeManager.generateClientManifest(server.config.root);
|
|
11822
11836
|
const globalStylesheetHref = resolveDevGlobalStylesheetHref(
|
|
11823
11837
|
server.config.root,
|
|
11824
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
11838
|
+
_optionalChain([farmApp, 'optionalAccess', _671 => _671.getConfig, 'call', _672 => _672(), 'access', _673 => _673.srcDir])
|
|
11825
11839
|
);
|
|
11826
11840
|
const fullManifest = {
|
|
11827
11841
|
clientEntry: "/@farm/client.js",
|
|
@@ -11872,17 +11886,17 @@ export const manifest = getManifest();
|
|
|
11872
11886
|
}
|
|
11873
11887
|
},
|
|
11874
11888
|
async transform(code, id, transformOptions) {
|
|
11875
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
11876
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
11877
|
-
if (_optionalChain([currentConfig, 'access',
|
|
11889
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _674 => _674.ssr])) {
|
|
11890
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _675 => _675.getConfig, 'call', _676 => _676()]), () => ( options));
|
|
11891
|
+
if (_optionalChain([currentConfig, 'access', _677 => _677.experimental, 'optionalAccess', _678 => _678.serverActions]) !== true || !serverFnTransformActive) {
|
|
11878
11892
|
const violation = findClientServerFnViolation(code, id);
|
|
11879
11893
|
if (violation) {
|
|
11880
11894
|
this.error(formatServerFnBoundaryError(violation, id));
|
|
11881
11895
|
}
|
|
11882
11896
|
}
|
|
11883
11897
|
}
|
|
11884
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
11885
|
-
warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
11898
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _679 => _679.ssr]) && shouldInspectClientBoundary(id, code)) {
|
|
11899
|
+
warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _680 => _680.getConfig, 'call', _681 => _681()]), () => ( options)));
|
|
11886
11900
|
}
|
|
11887
11901
|
if (typeof imageImports.transform === "function") {
|
|
11888
11902
|
const imageModule = await imageImports.transform.call(this, code, id, transformOptions);
|
|
@@ -11897,13 +11911,13 @@ export const manifest = getManifest();
|
|
|
11897
11911
|
id,
|
|
11898
11912
|
transformOptions
|
|
11899
11913
|
);
|
|
11900
|
-
const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess',
|
|
11914
|
+
const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess', _682 => _682.code, 'optionalAccess', _683 => _683.toString, 'call', _684 => _684()]);
|
|
11901
11915
|
if (fontCode) {
|
|
11902
11916
|
transformedCode = fontCode;
|
|
11903
11917
|
transformed = true;
|
|
11904
11918
|
}
|
|
11905
11919
|
}
|
|
11906
|
-
if (_optionalChain([transformOptions, 'optionalAccess',
|
|
11920
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _685 => _685.ssr]) && server) {
|
|
11907
11921
|
const rewrittenImports = rewriteEarlySsrRelativeImports({
|
|
11908
11922
|
code: transformedCode,
|
|
11909
11923
|
id,
|
|
@@ -11923,12 +11937,12 @@ export const manifest = getManifest();
|
|
|
11923
11937
|
}
|
|
11924
11938
|
transformedCode = stripUseClientDirective(transformedCode);
|
|
11925
11939
|
transformed = true;
|
|
11926
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
11940
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _686 => _686.getConfig, 'call', _687 => _687()]), () => ( options));
|
|
11927
11941
|
let isolatedModuleReference = null;
|
|
11928
|
-
const root = currentConfig.root || _optionalChain([server, 'optionalAccess',
|
|
11942
|
+
const root = currentConfig.root || _optionalChain([server, 'optionalAccess', _688 => _688.config, 'access', _689 => _689.root]) || process.cwd();
|
|
11929
11943
|
const cleanId = id.split("?", 1)[0];
|
|
11930
|
-
const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
11931
|
-
const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess',
|
|
11944
|
+
const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _690 => _690.getRouteManager, 'call', _691 => _691(), 'access', _692 => _692.getIsolatedClientBoundaryModules, 'call', _693 => _693(root)])));
|
|
11945
|
+
const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess', _694 => _694.has, 'call', _695 => _695(path17.resolve(cleanId))]) === true;
|
|
11932
11946
|
if (_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration && isIsolatableClientBoundarySource(clientBoundarySource)) {
|
|
11933
11947
|
isolatedModuleReference = _chunk5QIKR7RRcjs.toViteModuleId.call(void 0, cleanId, root);
|
|
11934
11948
|
const transformedBoundary = transformIsolatedClientBoundaryModule({
|
|
@@ -11965,7 +11979,7 @@ export const manifest = getManifest();
|
|
|
11965
11979
|
);
|
|
11966
11980
|
return;
|
|
11967
11981
|
}` : "";
|
|
11968
|
-
const hmrCode = _optionalChain([transformOptions, 'optionalAccess',
|
|
11982
|
+
const hmrCode = _optionalChain([transformOptions, 'optionalAccess', _696 => _696.ssr]) || !shouldEmitFarmClientRootHmr(currentConfig.renderer) ? "" : `
|
|
11969
11983
|
if (import.meta.hot) {
|
|
11970
11984
|
import.meta.hot.accept((newModule) => {
|
|
11971
11985
|
${isolatedHmrUpdate}
|
|
@@ -12019,14 +12033,14 @@ if (import.meta.hot) {
|
|
|
12019
12033
|
}
|
|
12020
12034
|
_chunk5QIKR7RRcjs.logger.info(`Found ${ssgPages.length} SSG pages, ${ssrRoutes.length} SSR routes`);
|
|
12021
12035
|
_chunk5QIKR7RRcjs.logger.info("Pre-rendering SSG pages...");
|
|
12022
|
-
const outDir = path17.join(_optionalChain([server, 'optionalAccess',
|
|
12036
|
+
const outDir = path17.join(_optionalChain([server, 'optionalAccess', _697 => _697.config, 'access', _698 => _698.root]) || process.cwd(), options.outDir || "dist");
|
|
12023
12037
|
const clientDir = path17.join(outDir, "client");
|
|
12024
12038
|
for (const page of ssgPages) {
|
|
12025
12039
|
try {
|
|
12026
12040
|
const staticRequest = new Request(new URL(page.urlPath, "http://farm.static"));
|
|
12027
12041
|
await farmApp.getServerRenderer().runWithRequestContext(staticRequest, async () => {
|
|
12028
12042
|
const mod = await routeManager.loadRouteModule(page.filePath);
|
|
12029
|
-
if (!_optionalChain([mod, 'optionalAccess',
|
|
12043
|
+
if (!_optionalChain([mod, 'optionalAccess', _699 => _699.default])) return;
|
|
12030
12044
|
const { layouts } = routeManager.matchRoute(page.urlPath);
|
|
12031
12045
|
const layoutModules = await Promise.all(
|
|
12032
12046
|
layouts.map((l) => routeManager.loadLayoutModule(l.modulePath))
|
|
@@ -12058,7 +12072,7 @@ if (import.meta.hot) {
|
|
|
12058
12072
|
const i18nSnapshot = _chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
12059
12073
|
const i18nHead = renderFarmI18nStaticHead(page.urlPath, i18nSnapshot);
|
|
12060
12074
|
const fullHtml = `<!DOCTYPE html>
|
|
12061
|
-
<html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
12075
|
+
<html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess', _700 => _700.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}>
|
|
12062
12076
|
<head>
|
|
12063
12077
|
<meta charset="utf-8">
|
|
12064
12078
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
@@ -12116,13 +12130,13 @@ if (import.meta.hot) {
|
|
|
12116
12130
|
});
|
|
12117
12131
|
}
|
|
12118
12132
|
}
|
|
12119
|
-
const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess',
|
|
12133
|
+
const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess', _701 => _701.getConfig, 'call', _702 => _702()]);
|
|
12120
12134
|
const normalizedFile = file.replace(/\\/g, "/");
|
|
12121
12135
|
if (currentFarmConfig && /\/route\.(?:ts|tsx|js|jsx)$/.test(normalizedFile) && _chunkVPTDD5XFcjs.getFarmAppDirectories.call(void 0, currentFarmConfig).some(
|
|
12122
12136
|
(appDir) => normalizedFile.startsWith(`${_chunk5QIKR7RRcjs.toPosixPath.call(void 0, appDir)}/api/`)
|
|
12123
12137
|
)) {
|
|
12124
12138
|
for (const mod of modules) server2.moduleGraph.invalidateModule(mod);
|
|
12125
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
12139
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _703 => _703(`updated ${file}`)]);
|
|
12126
12140
|
server2.ws.send({ type: "full-reload", path: "*" });
|
|
12127
12141
|
return [];
|
|
12128
12142
|
}
|
|
@@ -12132,7 +12146,7 @@ if (import.meta.hot) {
|
|
|
12132
12146
|
for (const mod of modules) {
|
|
12133
12147
|
server2.moduleGraph.invalidateModule(mod);
|
|
12134
12148
|
}
|
|
12135
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
12149
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _704 => _704(`updated ${file}`)]);
|
|
12136
12150
|
server2.ws.send({
|
|
12137
12151
|
type: "full-reload",
|
|
12138
12152
|
path: "*"
|
|
@@ -12145,17 +12159,17 @@ if (import.meta.hot) {
|
|
|
12145
12159
|
for (const mod of modules) {
|
|
12146
12160
|
server2.moduleGraph.invalidateModule(mod);
|
|
12147
12161
|
}
|
|
12148
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
12162
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _705 => _705(`updated ${file}`)]);
|
|
12149
12163
|
server2.ws.send({
|
|
12150
12164
|
type: "full-reload",
|
|
12151
12165
|
path: "*"
|
|
12152
12166
|
});
|
|
12153
12167
|
return [];
|
|
12154
12168
|
}
|
|
12155
|
-
const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess',
|
|
12156
|
-
const planRouteManager = _optionalChain([farmApp, 'optionalAccess',
|
|
12169
|
+
const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess', _706 => _706.experimental, 'optionalAccess', _707 => _707.isolatedClientHydration]);
|
|
12170
|
+
const planRouteManager = _optionalChain([farmApp, 'optionalAccess', _708 => _708.getRouteManager, 'call', _709 => _709()]);
|
|
12157
12171
|
const isHydrationPlanSource = currentSrcRoot !== null && normalizedFile.startsWith(`${currentSrcRoot}/`) && /\.[cm]?[jt]sx?$/.test(normalizedFile);
|
|
12158
|
-
const tracksAsyncOwnerIslands = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess',
|
|
12172
|
+
const tracksAsyncOwnerIslands = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _710 => _710.renderer])) && planRouteManager !== void 0;
|
|
12159
12173
|
if (isHydrationPlanSource && (isolatedHydrationMode === "enabled" || isolatedHydrationMode === "analyze" || tracksAsyncOwnerIslands)) {
|
|
12160
12174
|
const routeManager = planRouteManager;
|
|
12161
12175
|
if (routeManager) {
|
|
@@ -12215,7 +12229,7 @@ if (import.meta.hot) {
|
|
|
12215
12229
|
}
|
|
12216
12230
|
return [];
|
|
12217
12231
|
}
|
|
12218
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
12232
|
+
_optionalChain([farmApp, 'optionalAccess', _711 => _711.getRouteManager, 'call', _712 => _712(), 'access', _713 => _713.invalidateClientManifest, 'call', _714 => _714()]);
|
|
12219
12233
|
const manifestModule = server2.moduleGraph.getModuleById("/@farm/manifest");
|
|
12220
12234
|
if (manifestModule) {
|
|
12221
12235
|
server2.moduleGraph.invalidateModule(manifestModule);
|
|
@@ -12584,12 +12598,12 @@ async function parseRouteModuleProps2(routeModule, input) {
|
|
|
12584
12598
|
}
|
|
12585
12599
|
const schemas = routeModule.__farmRouteSchemas;
|
|
12586
12600
|
const params = parseRouteModuleSchema2(
|
|
12587
|
-
_optionalChain([schemas, 'optionalAccess',
|
|
12601
|
+
_optionalChain([schemas, 'optionalAccess', _715 => _715.params]),
|
|
12588
12602
|
input.props.params,
|
|
12589
12603
|
"params",
|
|
12590
12604
|
input.routePath
|
|
12591
12605
|
);
|
|
12592
|
-
const search = parseRouteModuleSchema2(_optionalChain([schemas, 'optionalAccess',
|
|
12606
|
+
const search = parseRouteModuleSchema2(_optionalChain([schemas, 'optionalAccess', _716 => _716.search]), input.search, "search", input.routePath);
|
|
12593
12607
|
return {
|
|
12594
12608
|
...input.props,
|
|
12595
12609
|
params,
|
|
@@ -14185,7 +14199,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, generateClientManifest, "generateClientMan
|
|
|
14185
14199
|
async function defineConfig(config = {}) {
|
|
14186
14200
|
const tailwindVitePlugin = await loadTailwindVitePlugin();
|
|
14187
14201
|
const appRoot = path17.resolve(config.root || process.cwd());
|
|
14188
|
-
if (_optionalChain([config, 'access',
|
|
14202
|
+
if (_optionalChain([config, 'access', _717 => _717.extends, 'optionalAccess', _718 => _718.length])) {
|
|
14189
14203
|
const { config: layeredConfig } = await import("./layers-4PNE2HOY.cjs").then(
|
|
14190
14204
|
({ resolveFarmLayers }) => resolveFarmLayers(config, {
|
|
14191
14205
|
root: appRoot,
|
|
@@ -14286,13 +14300,13 @@ async function defineConfig(config = {}) {
|
|
|
14286
14300
|
if (!serverStarted) {
|
|
14287
14301
|
serverStarted = true;
|
|
14288
14302
|
const elapsed = Date.now() - startTime;
|
|
14289
|
-
const address = _optionalChain([server, 'access',
|
|
14303
|
+
const address = _optionalChain([server, 'access', _719 => _719.httpServer, 'optionalAccess', _720 => _720.address, 'call', _721 => _721()]);
|
|
14290
14304
|
const resolvedPort = typeof address === "object" && address ? address.port : server.config.server.port || port || 3e3;
|
|
14291
14305
|
const hostConfig = server.config.server.host;
|
|
14292
14306
|
const isExposed = hostConfig === true || hostConfig === "0.0.0.0";
|
|
14293
14307
|
console.log("");
|
|
14294
14308
|
console.log(
|
|
14295
|
-
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${
|
|
14309
|
+
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${_chunkTTVHACQVcjs.FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
|
|
14296
14310
|
);
|
|
14297
14311
|
console.log("");
|
|
14298
14312
|
console.log(
|