@farm.js/core 0.1.24 → 0.1.26
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 -2
- package/dist/agent-runtime.d.ts +2 -2
- package/dist/api/route-manager.cjs +4 -4
- package/dist/api/route-manager.d.mts +2 -2
- package/dist/api/route-manager.d.ts +2 -2
- 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 +3 -3
- package/dist/api.d.ts +3 -3
- package/dist/api.mjs +6 -6
- package/dist/{app-BZDWwwFa.d.mts → app-29vG5tmY.d.mts} +3 -3
- package/dist/{app-BV-7wV5q.d.ts → app-Cx71s_PT.d.ts} +3 -3
- package/dist/app-markdown.cjs +6 -4
- package/dist/app-markdown.d.mts +3 -3
- package/dist/app-markdown.d.ts +3 -3
- package/dist/app-markdown.mjs +5 -3
- package/dist/{chunk-ISTFC3MZ.cjs → chunk-2CT6XUNO.cjs} +99 -26
- package/dist/{chunk-G6GNNB44.cjs → chunk-3TQG7CGC.cjs} +201 -180
- package/dist/{chunk-KNPRCKXK.cjs → chunk-3TQWUUNP.cjs} +9 -7
- package/dist/{chunk-LYM7HY34.cjs → chunk-3WSWXPYM.cjs} +4 -4
- package/dist/{chunk-GZ3ZPTQV.mjs → chunk-52SH7TKB.mjs} +2 -2
- package/dist/{chunk-JIKGGIOL.mjs → chunk-6D242YGO.mjs} +1 -1
- package/dist/{chunk-MVUREHPN.mjs → chunk-74RZNRY6.mjs} +1 -1
- package/dist/{chunk-BD7FZ63M.cjs → chunk-ALIFMS4A.cjs} +1 -1
- package/dist/{chunk-PGQBL5DN.mjs → chunk-ARXCHQLX.mjs} +79 -2
- 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-XI3GWPUS.cjs → chunk-CRQPYWLK.cjs} +14 -14
- package/dist/{chunk-47H7VENP.mjs → chunk-DU2CASV6.mjs} +1 -1
- package/dist/{chunk-QTBEAKCJ.cjs → chunk-H7CJRJ4L.cjs} +16 -16
- package/dist/chunk-J63ZH5OQ.cjs +62 -0
- package/dist/{chunk-N255VYFP.mjs → chunk-JM5GQL4H.mjs} +8 -3
- package/dist/{chunk-6VEHUKZ2.mjs → chunk-MM5D6VLP.mjs} +4 -20
- package/dist/chunk-MVL2RAJW.mjs +62 -0
- package/dist/{chunk-YA6LLTIJ.cjs → chunk-ND224OE2.cjs} +4 -20
- package/dist/{chunk-YGMK6ESJ.mjs → chunk-OFKG57MZ.mjs} +2 -2
- package/dist/chunk-OOIL3BWR.mjs +1229 -0
- package/dist/{chunk-BNSD3VDY.mjs → chunk-PPIW3MH6.mjs} +1 -1
- package/dist/{chunk-WNUBR4CA.mjs → chunk-QGG336NI.mjs} +1 -1
- package/dist/chunk-QIH2HD6H.cjs +1229 -0
- package/dist/{chunk-OYDRPBBV.cjs → chunk-QJ4D3UKJ.cjs} +80 -3
- package/dist/{chunk-LQIRVSBY.cjs → chunk-QLXEYIAW.cjs} +13 -13
- package/dist/{chunk-ARHWIOUZ.mjs → chunk-QPPQHB6X.mjs} +111 -40
- package/dist/{chunk-7BC6GAL7.mjs → chunk-RAI7NULA.mjs} +76 -3
- package/dist/{chunk-AH7HOAQ3.cjs → chunk-RCYINC4A.cjs} +9 -4
- package/dist/{chunk-SIQMTHCZ.cjs → chunk-SZ4LYNUX.cjs} +212 -141
- package/dist/{chunk-5UX4C5QI.mjs → chunk-TKDY6AJP.mjs} +1 -1
- package/dist/{chunk-YJJLXIIS.cjs → chunk-U74A3P2P.cjs} +7 -7
- package/dist/{chunk-6YSEHN46.mjs → chunk-UXQXGB5A.mjs} +36 -15
- package/dist/{chunk-72VJRKJD.mjs → chunk-VZWO3XVL.mjs} +2 -2
- package/dist/{chunk-I5YBCWQ6.cjs → chunk-W2HZKYES.cjs} +2 -2
- package/dist/{chunk-DNLQMFER.cjs → chunk-WFPRVVF2.cjs} +26 -19
- package/dist/{chunk-BDJNP7AQ.mjs → chunk-YMUH2BLR.mjs} +10 -3
- package/dist/{client-plugins-B_XzCegf.d.mts → client-plugins-B8RPJnot.d.mts} +129 -4
- package/dist/{client-plugins-CKsXQfXY.d.ts → client-plugins-bPBf4haK.d.ts} +129 -4
- package/dist/client-plugins.d.mts +2 -2
- package/dist/client-plugins.d.ts +2 -2
- package/dist/client.cjs +4 -4
- package/dist/client.d.mts +6 -6
- package/dist/client.d.ts +6 -6
- package/dist/client.mjs +3 -3
- package/dist/config.d.mts +2 -2
- package/dist/config.d.ts +2 -2
- package/dist/{devtools-OY4SNU3P.mjs → devtools-5D4ZDRPR.mjs} +5 -3
- package/dist/{devtools-UHRSZ7VA.cjs → devtools-QZJEUOJW.cjs} +6 -4
- package/dist/docs.cjs +8 -6
- package/dist/docs.mjs +7 -5
- package/dist/index.cjs +29 -23
- package/dist/index.d.mts +14 -14
- package/dist/index.d.ts +14 -14
- package/dist/index.mjs +28 -22
- package/dist/integrations.d.mts +2 -2
- package/dist/integrations.d.ts +2 -2
- package/dist/internal/app-markdown-runtime.cjs +5 -3
- package/dist/internal/app-markdown-runtime.d.mts +2 -2
- package/dist/internal/app-markdown-runtime.d.ts +2 -2
- package/dist/internal/app-markdown-runtime.mjs +4 -2
- package/dist/internal/build-runtime.cjs +18 -17
- package/dist/internal/build-runtime.d.mts +4 -4
- package/dist/internal/build-runtime.d.ts +4 -4
- package/dist/internal/build-runtime.mjs +17 -16
- package/dist/internal/cli-runtime.cjs +6 -5
- package/dist/internal/cli-runtime.mjs +5 -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 +2 -2
- package/dist/internal/compression-runtime.d.ts +2 -2
- package/dist/internal/config-runtime.cjs +6 -4
- package/dist/internal/config-runtime.d.mts +3 -3
- package/dist/internal/config-runtime.d.ts +3 -3
- package/dist/internal/config-runtime.mjs +5 -3
- package/dist/internal/infra-analytics-runtime.cjs +4 -3
- package/dist/internal/infra-analytics-runtime.mjs +2 -1
- package/dist/internal/product-telemetry-runtime.cjs +2 -2
- package/dist/internal/product-telemetry-runtime.mjs +1 -1
- package/dist/internal/production-runtime.cjs +12 -5
- package/dist/internal/production-runtime.d.mts +33 -9
- package/dist/internal/production-runtime.d.ts +33 -9
- package/dist/internal/production-runtime.mjs +11 -4
- package/dist/markdown.cjs +6 -2
- package/dist/markdown.d.mts +63 -1
- package/dist/markdown.d.ts +63 -1
- package/dist/markdown.mjs +5 -1
- package/dist/{metadata-B08w4EYV.d.mts → metadata-C3na4CBj.d.mts} +1 -1
- package/dist/{metadata-IQEblkZp.d.ts → metadata-CzBP4Mfp.d.ts} +1 -1
- package/dist/middleware.d.mts +4 -4
- package/dist/middleware.d.ts +4 -4
- package/dist/navigation.cjs +5 -5
- package/dist/navigation.d.mts +5 -5
- package/dist/navigation.d.ts +5 -5
- package/dist/navigation.mjs +4 -4
- package/dist/observability-BupkiN0m.d.mts +447 -0
- package/dist/observability-BupkiN0m.d.ts +447 -0
- package/dist/observability.d.mts +2 -417
- package/dist/observability.d.ts +2 -417
- package/dist/plugin.cjs +13 -12
- package/dist/plugin.d.mts +2 -2
- package/dist/plugin.d.ts +2 -2
- package/dist/plugin.mjs +12 -11
- package/dist/{production-runtime-DRSOkc-d.d.ts → production-runtime-CYg4wM4E.d.ts} +1 -1
- package/dist/{production-runtime-C3bGFEaM.d.mts → production-runtime-DP94hPGe.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-Bl6Fzg5z.d.ts} +1 -1
- package/dist/{render-plan-B6CKNl4e.d.mts → render-plan-CKAJg0jC.d.mts} +1 -1
- package/dist/renderer-client.cjs +5 -5
- package/dist/renderer-client.d.mts +4 -4
- package/dist/renderer-client.d.ts +4 -4
- package/dist/renderer-client.mjs +2 -2
- package/dist/{request-Dn6VURbE.d.ts → request-CR-Bp1Px.d.ts} +1 -1
- package/dist/{request-DgD1XsTx.d.mts → request-CrBCcPZZ.d.mts} +1 -1
- package/dist/request.d.mts +3 -3
- package/dist/request.d.ts +3 -3
- package/dist/{route-rendering-76A5I_kE.d.mts → route-rendering-C1NAHo-C.d.mts} +1 -1
- package/dist/{route-rendering-LAmQEdyG.d.ts → route-rendering-CZH5FegB.d.ts} +1 -1
- package/dist/{router-CnrRSa9d.d.mts → router-B57eDJ3u.d.mts} +1 -1
- package/dist/{router-BSOOGya2.d.ts → router-Cg_kD3Bd.d.ts} +1 -1
- package/dist/routes.d.mts +2 -2
- package/dist/routes.d.ts +2 -2
- package/dist/server-plugins.d.mts +3 -3
- package/dist/server-plugins.d.ts +3 -3
- package/dist/server.cjs +163 -106
- package/dist/server.d.mts +8 -8
- package/dist/server.d.ts +8 -8
- package/dist/server.mjs +144 -87
- package/dist/{spa-router-BMrSsG5b.d.ts → spa-router-BstQUO6Q.d.ts} +2 -2
- package/dist/{spa-router-DnYhWCvI.d.mts → spa-router-DTdbuinx.d.mts} +2 -2
- package/dist/testing.cjs +4 -4
- package/dist/testing.d.mts +2 -2
- package/dist/testing.d.ts +2 -2
- package/dist/testing.mjs +3 -3
- package/dist/{utils-ABkktwku.d.mts → utils-CS3ZLnEJ.d.mts} +1 -1
- package/dist/{utils-C3GguS-Q.d.ts → utils-D3rdsIvM.d.ts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +13 -12
- package/dist/vite.d.mts +2 -2
- package/dist/vite.d.ts +2 -2
- package/dist/vite.mjs +12 -11
- package/package.json +1 -1
- package/dist/chunk-BBVSJVBZ.cjs +0 -600
- package/dist/chunk-OFEY6KHO.mjs +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 _chunkQJ4D3UKJcjs = require('./chunk-QJ4D3UKJ.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 _chunk2CT6XUNOcjs = require('./chunk-2CT6XUNO.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 _chunkW2HZKYEScjs = require('./chunk-W2HZKYES.cjs');
|
|
126
129
|
|
|
127
130
|
|
|
128
131
|
|
|
129
132
|
|
|
130
|
-
var
|
|
133
|
+
var _chunkRCYINC4Acjs = require('./chunk-RCYINC4A.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 _chunkQIH2HD6Hcjs = require('./chunk-QIH2HD6H.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 _chunkALIFMS4Acjs = require('./chunk-ALIFMS4A.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: _chunkRCYINC4Acjs.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 }) => _chunkRCYINC4Acjs.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 }) => _chunkRCYINC4Acjs.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 (_chunkRCYINC4Acjs.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 (_chunkRCYINC4Acjs.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 _chunkW2HZKYEScjs.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 _chunkW2HZKYEScjs.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) => !_chunkRCYINC4Acjs.isFarmMarkdownPageFile.call(void 0, file));
|
|
2530
|
+
const markdownFiles = group.files.filter(_chunkRCYINC4Acjs.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 ")}.`
|
|
@@ -3039,7 +3042,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, collectDevStylesheetUrls, "collectDevStyle
|
|
|
3039
3042
|
|
|
3040
3043
|
// src/server/full-document.ts
|
|
3041
3044
|
var CONTENTS_WRAPPER = /^<div\b[^>]*style="display\s*:\s*contents"[^>]*>/i;
|
|
3042
|
-
var HOISTED_HEAD_ELEMENT = /^(?:<(?:meta|link|base)\b[^>]*>|<title\b[^>]*>[\s\S]*?<\/title>)/i;
|
|
3045
|
+
var HOISTED_HEAD_ELEMENT = /^(?:<(?:meta|link|base)\b[^>]*>|<title\b[^>]*>[\s\S]*?<\/title>|<script\b[^>]*\basync\b[^>]*><\/script>|<style\b[^>]*\bdata-precedence\b[^>]*>[\s\S]*?<\/style>)/i;
|
|
3043
3046
|
function peelDocumentPrefix(markup) {
|
|
3044
3047
|
let inner = markup.replace(/^\s+/, "");
|
|
3045
3048
|
let hoisted = "";
|
|
@@ -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 _chunkQJ4D3UKJcjs.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 = _chunk2CT6XUNOcjs.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 = _chunk2CT6XUNOcjs.createFarmCspNonce.call(void 0, this.security);
|
|
5325
5328
|
if (cspNonce) {
|
|
5326
5329
|
req.__FARM_CSP_NONCE__ = cspNonce;
|
|
5327
|
-
const header =
|
|
5330
|
+
const header = _chunk2CT6XUNOcjs.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 = _chunkQJ4D3UKJcjs.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
|
+
_chunkQIH2HD6Hcjs.getFarmMarkdownAlternatePath.call(void 0, _chunkQIH2HD6Hcjs.resolveMarkdownConfig.call(void 0, this.config.md), publicPathname)
|
|
6055
6058
|
);
|
|
6056
6059
|
return metadata;
|
|
6057
6060
|
}
|
|
@@ -6123,12 +6126,13 @@ 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 _chunk2CT6XUNOcjs.renderFarmLlmsFullTxt.call(void 0, value, {
|
|
6127
6130
|
origin: url.origin,
|
|
6128
6131
|
readMarkdown: llmsContext.markdown
|
|
6129
6132
|
}) : value;
|
|
6130
|
-
const response =
|
|
6131
|
-
method
|
|
6133
|
+
const response = _chunkQJ4D3UKJcjs.createFarmMetadataRouteResponse.call(void 0, match.metadata.kind, body, routeModule, {
|
|
6134
|
+
method,
|
|
6135
|
+
request: request2
|
|
6132
6136
|
});
|
|
6133
6137
|
await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0, res, response);
|
|
6134
6138
|
} catch (error) {
|
|
@@ -6144,7 +6148,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6144
6148
|
}
|
|
6145
6149
|
/** `/llms.txt` and `/llms-full.txt` from `agent.llmsTxt` when no file route owns them. */
|
|
6146
6150
|
getGeneratedLlmsKind(pathname) {
|
|
6147
|
-
const config =
|
|
6151
|
+
const config = _chunk2CT6XUNOcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _200 => _200.config, 'access', _201 => _201.agent, 'optionalAccess', _202 => _202.llmsTxt]));
|
|
6148
6152
|
if (!config.enabled) return null;
|
|
6149
6153
|
if (pathname === "/llms.txt") return "llms";
|
|
6150
6154
|
return pathname === "/llms-full.txt" && config.full ? "llms-full" : null;
|
|
@@ -6154,19 +6158,19 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6154
6158
|
const request2 = _chunk5ZSWG4UXcjs.createWebRequestFromFarmRequest.call(void 0, req, {
|
|
6155
6159
|
trustProxy: _optionalChain([this, 'access', _203 => _203.config, 'access', _204 => _204.server, 'optionalAccess', _205 => _205.trustProxy])
|
|
6156
6160
|
});
|
|
6157
|
-
const config =
|
|
6161
|
+
const config = _chunk2CT6XUNOcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _206 => _206.config, 'access', _207 => _207.agent, 'optionalAccess', _208 => _208.llmsTxt]));
|
|
6158
6162
|
const context = await this.createLlmsTxtContext(request2, { full: kind === "llms-full", req });
|
|
6159
|
-
const body = kind === "llms-full" ? await
|
|
6163
|
+
const body = kind === "llms-full" ? await _chunk2CT6XUNOcjs.renderFarmLlmsFullTxt.call(void 0, context.defaults, {
|
|
6160
6164
|
origin: new URL(request2.url).origin,
|
|
6161
6165
|
readMarkdown: context.markdown
|
|
6162
6166
|
}) : context.defaults;
|
|
6163
6167
|
await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0,
|
|
6164
6168
|
res,
|
|
6165
|
-
|
|
6169
|
+
_chunkQJ4D3UKJcjs.createFarmMetadataRouteResponse.call(void 0,
|
|
6166
6170
|
kind,
|
|
6167
6171
|
body,
|
|
6168
6172
|
{ revalidate: config.revalidate },
|
|
6169
|
-
{ method: req.method }
|
|
6173
|
+
{ method: req.method, request: request2 }
|
|
6170
6174
|
)
|
|
6171
6175
|
);
|
|
6172
6176
|
} catch (error) {
|
|
@@ -6181,7 +6185,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6181
6185
|
}
|
|
6182
6186
|
}
|
|
6183
6187
|
getAgentCrawlers() {
|
|
6184
|
-
return
|
|
6188
|
+
return _chunk2CT6XUNOcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([this, 'access', _209 => _209.config, 'access', _210 => _210.agent, 'optionalAccess', _211 => _211.crawlers]));
|
|
6185
6189
|
}
|
|
6186
6190
|
/** `/robots.txt` from `agent.crawlers` when no robots.ts owns it. */
|
|
6187
6191
|
async renderGeneratedRobotsTxt(req, res) {
|
|
@@ -6189,7 +6193,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6189
6193
|
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
6194
|
const rootLayout = this.routeManager.getLayouts().get("/");
|
|
6191
6195
|
const rootMetadata = sitemapPath && rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
|
|
6192
|
-
const robots =
|
|
6196
|
+
const robots = _chunk2CT6XUNOcjs.createFarmAgentRobots.call(void 0, {
|
|
6193
6197
|
crawlers: this.getAgentCrawlers(),
|
|
6194
6198
|
sitemapPath,
|
|
6195
6199
|
metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _217 => _217.metadataBase]),
|
|
@@ -6197,7 +6201,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6197
6201
|
});
|
|
6198
6202
|
await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0,
|
|
6199
6203
|
res,
|
|
6200
|
-
|
|
6204
|
+
_chunkQJ4D3UKJcjs.createFarmMetadataRouteResponse.call(void 0, "robots", robots, {}, { method: req.method })
|
|
6201
6205
|
);
|
|
6202
6206
|
} catch (error) {
|
|
6203
6207
|
_chunk5QIKR7RRcjs.logger.error(`Generated robots.txt failed: ${error}`);
|
|
@@ -6212,7 +6216,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6212
6216
|
}
|
|
6213
6217
|
/** Same inputs the production server gives llms.txt: static pages and root metadata. */
|
|
6214
6218
|
async createLlmsTxtContext(request2, options = {}) {
|
|
6215
|
-
const config =
|
|
6219
|
+
const config = _chunk2CT6XUNOcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _218 => _218.config, 'access', _219 => _219.agent, 'optionalAccess', _220 => _220.llmsTxt]));
|
|
6216
6220
|
const origin = new URL(request2.url).origin;
|
|
6217
6221
|
const staticRoutes = [...this.routeManager.getRoutes()].filter(
|
|
6218
6222
|
([pattern]) => !pattern.includes("[")
|
|
@@ -6230,16 +6234,16 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6230
6234
|
);
|
|
6231
6235
|
const rootLayout = this.routeManager.getLayouts().get("/");
|
|
6232
6236
|
const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
|
|
6233
|
-
const pages =
|
|
6237
|
+
const pages = _chunk2CT6XUNOcjs.collectFarmLlmsTxtPages.call(void 0, sources, {
|
|
6234
6238
|
origin,
|
|
6235
6239
|
basePath: this.config.basePath,
|
|
6236
|
-
markdown:
|
|
6240
|
+
markdown: _chunkQIH2HD6Hcjs.resolveMarkdownConfig.call(void 0, this.config.md),
|
|
6237
6241
|
include: config.include,
|
|
6238
6242
|
exclude: config.exclude
|
|
6239
6243
|
});
|
|
6240
6244
|
return {
|
|
6241
6245
|
pages,
|
|
6242
|
-
defaults:
|
|
6246
|
+
defaults: _chunk2CT6XUNOcjs.createFarmDefaultLlmsTxt.call(void 0, { origin, pages, config, rootMetadata }),
|
|
6243
6247
|
...options.full ? { markdown: this.createDevMarkdownReader(options.req) } : {}
|
|
6244
6248
|
};
|
|
6245
6249
|
}
|
|
@@ -6259,11 +6263,11 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6259
6263
|
}
|
|
6260
6264
|
if (socket.encrypted) {
|
|
6261
6265
|
const address = { host: socket.localAddress, port: socket.localPort };
|
|
6262
|
-
return
|
|
6266
|
+
return _chunk2CT6XUNOcjs.createFarmLlmsMarkdownReader.call(void 0, (page) => requestOwnHttpsServer(page, address));
|
|
6263
6267
|
}
|
|
6264
6268
|
const host = socket.localAddress.includes(":") ? `[${socket.localAddress}]` : socket.localAddress;
|
|
6265
6269
|
const localOrigin = `http://${host}:${socket.localPort}`;
|
|
6266
|
-
const read =
|
|
6270
|
+
const read = _chunk2CT6XUNOcjs.createFarmLlmsMarkdownReader.call(void 0, (page) => fetch(page));
|
|
6267
6271
|
return (url) => {
|
|
6268
6272
|
const target = new URL(url);
|
|
6269
6273
|
return read(`${localOrigin}${target.pathname}${target.search}`);
|
|
@@ -6502,7 +6506,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6502
6506
|
tags: metaTags,
|
|
6503
6507
|
hasFavicon,
|
|
6504
6508
|
hasExplicitTitle
|
|
6505
|
-
} =
|
|
6509
|
+
} = _chunk3TQWUUNPcjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
|
|
6506
6510
|
pathname: getFarmMetadataPathname(req),
|
|
6507
6511
|
jsonLd: _optionalChain([this, 'access', _232 => _232.config, 'access', _233 => _233.agent, 'optionalAccess', _234 => _234.jsonLd])
|
|
6508
6512
|
});
|
|
@@ -6514,7 +6518,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6514
6518
|
i18nSnapshot,
|
|
6515
6519
|
this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
|
|
6516
6520
|
) : "";
|
|
6517
|
-
const themeDocument =
|
|
6521
|
+
const themeDocument = _chunkQJ4D3UKJcjs.createFarmThemeDocumentParts.call(void 0,
|
|
6518
6522
|
this.config.theme,
|
|
6519
6523
|
this.config.basePath,
|
|
6520
6524
|
_chunkXWAWFQFScjs.getTheme.call(void 0, )
|
|
@@ -6740,7 +6744,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6740
6744
|
title,
|
|
6741
6745
|
tags: metaTags,
|
|
6742
6746
|
hasFavicon
|
|
6743
|
-
} =
|
|
6747
|
+
} = _chunk3TQWUUNPcjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
|
|
6744
6748
|
pathname: getFarmMetadataPathname(req),
|
|
6745
6749
|
jsonLd: _optionalChain([this, 'access', _243 => _243.config, 'access', _244 => _244.agent, 'optionalAccess', _245 => _245.jsonLd])
|
|
6746
6750
|
});
|
|
@@ -6751,7 +6755,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6751
6755
|
this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
|
|
6752
6756
|
) : "";
|
|
6753
6757
|
const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
|
|
6754
|
-
const themeDocument =
|
|
6758
|
+
const themeDocument = _chunkQJ4D3UKJcjs.createFarmThemeDocumentParts.call(void 0,
|
|
6755
6759
|
this.config.theme,
|
|
6756
6760
|
this.config.basePath,
|
|
6757
6761
|
_chunkXWAWFQFScjs.getTheme.call(void 0, )
|
|
@@ -6760,7 +6764,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6760
6764
|
const devStyleLinks = this.collectDevStyleLinks();
|
|
6761
6765
|
const globalStylesheetLink = this.devGlobalStylesheetLink(true);
|
|
6762
6766
|
const cspNonce = this.getCspNonce(req);
|
|
6763
|
-
const secureDocumentHTML = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (html) => cspNonce ?
|
|
6767
|
+
const secureDocumentHTML = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (html) => cspNonce ? _chunk2CT6XUNOcjs.addFarmCspNonceToScriptTags.call(void 0, html, cspNonce) : html, "secureDocumentHTML");
|
|
6764
6768
|
const createLateNavigationRecovery = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (navigationError) => this.createLateNavigationRecoveryHTML(req, navigationError), "createLateNavigationRecovery");
|
|
6765
6769
|
const { pipe, abort } = renderToPipeableStream(streamRoot, {
|
|
6766
6770
|
nonce: cspNonce,
|
|
@@ -6807,7 +6811,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6807
6811
|
let firstChunk = true;
|
|
6808
6812
|
let checkedFullDocument = false;
|
|
6809
6813
|
let documentPrefix = "";
|
|
6810
|
-
const cspNonceRewriter = cspNonce ?
|
|
6814
|
+
const cspNonceRewriter = cspNonce ? _chunk2CT6XUNOcjs.createFarmCspNonceRewriter.call(void 0, cspNonce) : void 0;
|
|
6811
6815
|
const cspStreamDecoder = cspNonceRewriter ? new TextDecoder() : void 0;
|
|
6812
6816
|
const recordRenderedChunk = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (chunkText) => {
|
|
6813
6817
|
if (!chunkText) return;
|
|
@@ -6991,8 +6995,8 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6991
6995
|
}
|
|
6992
6996
|
/** The not-found document's head: layout and not-found metadata, as production renders it. */
|
|
6993
6997
|
async notFoundMetadataHead(layoutModule, notFoundModule) {
|
|
6994
|
-
const metadata = await
|
|
6995
|
-
const { title, tags, hasFavicon } =
|
|
6998
|
+
const metadata = await _chunk3TQWUUNPcjs.resolveFarmNotFoundMetadata.call(void 0, [layoutModule], notFoundModule);
|
|
6999
|
+
const { title, tags, hasFavicon } = _chunk3TQWUUNPcjs.renderMetadataHead.call(void 0, metadata);
|
|
6996
7000
|
return {
|
|
6997
7001
|
head: `${hasFavicon ? "" : '<link rel="icon" href="data:,">\n '}<title>${title}</title>${tags}`,
|
|
6998
7002
|
metadata
|
|
@@ -7010,7 +7014,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7010
7014
|
*/
|
|
7011
7015
|
async createLateNavigationRecoveryHTML(req, error) {
|
|
7012
7016
|
if (_chunkOX6O6WVAcjs.isFarmRedirectError.call(void 0, error)) {
|
|
7013
|
-
return
|
|
7017
|
+
return _chunkQJ4D3UKJcjs.createLateRedirectRecovery.call(void 0, this.localizeRedirectUrl(_chunkOX6O6WVAcjs.getFarmRedirectError.call(void 0, error).url));
|
|
7014
7018
|
}
|
|
7015
7019
|
const pathname = _chunk5ZSWG4UXcjs.resolveFarmRequestURL.call(void 0, req, {
|
|
7016
7020
|
trustProxy: _optionalChain([this, 'access', _253 => _253.config, 'access', _254 => _254.server, 'optionalAccess', _255 => _255.trustProxy])
|
|
@@ -7028,7 +7032,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7028
7032
|
_chunk5QIKR7RRcjs.logger.warn(`not-found page could not render outside its layout, using Farm's: ${error2}`);
|
|
7029
7033
|
}
|
|
7030
7034
|
}
|
|
7031
|
-
return
|
|
7035
|
+
return _chunkQJ4D3UKJcjs.createLateNotFoundRecovery.call(void 0, content);
|
|
7032
7036
|
}
|
|
7033
7037
|
async render404(req, res) {
|
|
7034
7038
|
res.statusCode = 404;
|
|
@@ -7037,11 +7041,11 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7037
7041
|
}).pathname;
|
|
7038
7042
|
const acceptHeader = req.headers.accept;
|
|
7039
7043
|
const accept = Array.isArray(acceptHeader) ? acceptHeader.join(",") : acceptHeader;
|
|
7040
|
-
if (
|
|
7041
|
-
res.setHeader("Content-Type",
|
|
7044
|
+
if (_chunkQIH2HD6Hcjs.farmRequestWantsMarkdown.call(void 0, pathname, accept)) {
|
|
7045
|
+
res.setHeader("Content-Type", _chunkQIH2HD6Hcjs.FARM_MARKDOWN_CONTENT_TYPE);
|
|
7042
7046
|
res.setHeader("X-Farm-Markdown-Error", "404");
|
|
7043
7047
|
res.setHeader("Cache-Control", "no-store");
|
|
7044
|
-
res.end(
|
|
7048
|
+
res.end(_chunkQIH2HD6Hcjs.createFarmMarkdownErrorBody.call(void 0, 404, pathname, this.config.basePath || "/"));
|
|
7045
7049
|
return;
|
|
7046
7050
|
}
|
|
7047
7051
|
const appDir = path9.join(this.config.root, this.config.srcDir, "app");
|
|
@@ -7103,8 +7107,8 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7103
7107
|
trustProxy: _optionalChain([this, 'access', _261 => _261.config, 'access', _262 => _262.server, 'optionalAccess', _263 => _263.trustProxy])
|
|
7104
7108
|
});
|
|
7105
7109
|
const diagnostics = isDev ? createDefaultErrorDiagnostics(error, this.config.root || process.cwd()) : void 0;
|
|
7106
|
-
const statusText =
|
|
7107
|
-
const content =
|
|
7110
|
+
const statusText = _chunkQJ4D3UKJcjs.getDefaultErrorStatusText.call(void 0, statusCode);
|
|
7111
|
+
const content = _chunkQJ4D3UKJcjs.createDefaultErrorMarkup.call(void 0, {
|
|
7108
7112
|
statusCode,
|
|
7109
7113
|
statusText,
|
|
7110
7114
|
requestPath: requestUrl.pathname,
|
|
@@ -7114,7 +7118,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7114
7118
|
stack: _optionalChain([diagnostics, 'optionalAccess', _266 => _266.stack]),
|
|
7115
7119
|
sourceFrame: _optionalChain([diagnostics, 'optionalAccess', _267 => _267.sourceFrame]),
|
|
7116
7120
|
development: isDev,
|
|
7117
|
-
farmVersion:
|
|
7121
|
+
farmVersion: _chunkALIFMS4Acjs.FARM_VERSION,
|
|
7118
7122
|
nodeVersion: process.version,
|
|
7119
7123
|
mode: isDev ? "development" : "production"
|
|
7120
7124
|
});
|
|
@@ -7157,7 +7161,7 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
|
|
|
7157
7161
|
this.getI18nAlternateOptions(alternates.req, alternates.metadata)
|
|
7158
7162
|
) : "";
|
|
7159
7163
|
const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
|
|
7160
|
-
const themeDocument =
|
|
7164
|
+
const themeDocument = _chunkQJ4D3UKJcjs.createFarmThemeDocumentParts.call(void 0,
|
|
7161
7165
|
this.config.theme,
|
|
7162
7166
|
this.config.basePath,
|
|
7163
7167
|
_chunkXWAWFQFScjs.getTheme.call(void 0, )
|
|
@@ -7217,7 +7221,7 @@ ${clientScript}
|
|
|
7217
7221
|
}
|
|
7218
7222
|
secureDocumentHTML(req, html) {
|
|
7219
7223
|
const nonce = this.getCspNonce(req);
|
|
7220
|
-
return nonce ?
|
|
7224
|
+
return nonce ? _chunk2CT6XUNOcjs.addFarmCspNonceToScriptTags.call(void 0, html, nonce) : html;
|
|
7221
7225
|
}
|
|
7222
7226
|
applyDeploymentHeaders(req, res) {
|
|
7223
7227
|
const deploymentId = this.getDeploymentId();
|
|
@@ -7325,9 +7329,9 @@ var _FarmApp = class _FarmApp {
|
|
|
7325
7329
|
context: config.context || (() => void 0),
|
|
7326
7330
|
server: _chunkEM6SBQKMcjs.resolveFarmServerConfig.call(void 0, config.server),
|
|
7327
7331
|
serverActions: _chunkT5CERMEHcjs.resolveServerActionsConfig.call(void 0, config.serverActions),
|
|
7328
|
-
security:
|
|
7332
|
+
security: _chunk2CT6XUNOcjs.resolveFarmSecurityConfig.call(void 0, config.security),
|
|
7329
7333
|
images: _chunkYFPGHF5Fcjs.resolveFarmImageConfig.call(void 0, config.images),
|
|
7330
|
-
performance:
|
|
7334
|
+
performance: _chunk2CT6XUNOcjs.resolveFarmPerformanceConfig.call(void 0, config.performance),
|
|
7331
7335
|
theme: _chunkOI6CMLWXcjs.resolveFarmThemeConfig.call(void 0, config.theme, basePath),
|
|
7332
7336
|
i18n: isResolvedI18nConfig(config.i18n) ? config.i18n : _chunkHBTUGXHScjs.resolveFarmI18nConfig.call(void 0, config.i18n, {
|
|
7333
7337
|
root,
|
|
@@ -7339,7 +7343,7 @@ var _FarmApp = class _FarmApp {
|
|
|
7339
7343
|
serverRuntimeConfig: config.serverRuntimeConfig || {},
|
|
7340
7344
|
publicRuntimeConfig: config.publicRuntimeConfig || {},
|
|
7341
7345
|
docs: isResolvedDocsConfig(config.docs) ? config.docs : defaultDocsConfig,
|
|
7342
|
-
md:
|
|
7346
|
+
md: _chunkQIH2HD6Hcjs.resolveMarkdownConfig.call(void 0, config.md),
|
|
7343
7347
|
mdx: _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, config.mdx),
|
|
7344
7348
|
observability: _nullishCoalesce(config.observability, () => ( false)),
|
|
7345
7349
|
telemetry: config.telemetry !== false,
|
|
@@ -9462,13 +9466,13 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, reportOpenAPIDevGenerationResult, "reportO
|
|
|
9462
9466
|
// src/vite.ts
|
|
9463
9467
|
var SERVER_FN_TRANSFORM_PLUGIN = "@farm.js/plugin/rsc:server-fn-actions";
|
|
9464
9468
|
function farmLlmsTxtGeneratedPaths(config) {
|
|
9465
|
-
const llms =
|
|
9469
|
+
const llms = _chunk2CT6XUNOcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([config, 'access', _474 => _474.agent, 'optionalAccess', _475 => _475.llmsTxt]));
|
|
9466
9470
|
if (!llms.enabled) return [];
|
|
9467
9471
|
return llms.full ? ["/llms.txt", "/llms-full.txt"] : ["/llms.txt"];
|
|
9468
9472
|
}
|
|
9469
9473
|
_chunkS3JO3N4Hcjs.__name.call(void 0, farmLlmsTxtGeneratedPaths, "farmLlmsTxtGeneratedPaths");
|
|
9470
9474
|
function farmAgentGeneratedPaths(config) {
|
|
9471
|
-
const crawlers =
|
|
9475
|
+
const crawlers = _chunk2CT6XUNOcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([config, 'access', _476 => _476.agent, 'optionalAccess', _477 => _477.crawlers]));
|
|
9472
9476
|
return [...farmLlmsTxtGeneratedPaths(config), ...crawlers.enabled ? ["/robots.txt"] : []];
|
|
9473
9477
|
}
|
|
9474
9478
|
_chunkS3JO3N4Hcjs.__name.call(void 0, farmAgentGeneratedPaths, "farmAgentGeneratedPaths");
|
|
@@ -9514,7 +9518,7 @@ function loadFarmWorkflowsDevRuntime() {
|
|
|
9514
9518
|
}
|
|
9515
9519
|
_chunkS3JO3N4Hcjs.__name.call(void 0, loadFarmWorkflowsDevRuntime, "loadFarmWorkflowsDevRuntime");
|
|
9516
9520
|
function loadFarmDevtoolsSnapshotRuntime() {
|
|
9517
|
-
return import("./devtools-
|
|
9521
|
+
return import("./devtools-QZJEUOJW.cjs");
|
|
9518
9522
|
}
|
|
9519
9523
|
_chunkS3JO3N4Hcjs.__name.call(void 0, loadFarmDevtoolsSnapshotRuntime, "loadFarmDevtoolsSnapshotRuntime");
|
|
9520
9524
|
function loadFarmDevtoolsUIRuntime() {
|
|
@@ -9601,7 +9605,7 @@ function renderFarmI18nStaticHead(requestPath, snapshot) {
|
|
|
9601
9605
|
if (!snapshot) return "";
|
|
9602
9606
|
const runtime = `<script>window.__FARM_I18N__ = ${serializeFarmInlineValue(snapshot)};</script>`;
|
|
9603
9607
|
if (snapshot.routing === "none") return runtime;
|
|
9604
|
-
return `${
|
|
9608
|
+
return `${_chunkQJ4D3UKJcjs.renderFarmLocaleAlternateLinks.call(void 0, requestPath, snapshot)}${runtime}`;
|
|
9605
9609
|
}
|
|
9606
9610
|
_chunkS3JO3N4Hcjs.__name.call(void 0, renderFarmI18nStaticHead, "renderFarmI18nStaticHead");
|
|
9607
9611
|
function getPublicEnvDefine(config) {
|
|
@@ -10200,7 +10204,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
10200
10204
|
if (_optionalChain([farmConfig, 'access', _505 => _505.agent, 'optionalAccess', _506 => _506.noindexPreviews])) {
|
|
10201
10205
|
server.middlewares.use((_req, res, next) => {
|
|
10202
10206
|
if (_chunkCXP5U3RWcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env)) {
|
|
10203
|
-
res.setHeader("X-Robots-Tag",
|
|
10207
|
+
res.setHeader("X-Robots-Tag", _chunk2CT6XUNOcjs.FARM_PREVIEW_ROBOTS_TAG);
|
|
10204
10208
|
}
|
|
10205
10209
|
next();
|
|
10206
10210
|
});
|
|
@@ -10412,7 +10416,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
10412
10416
|
layoutCount: discoveredRoutes.filter((r) => r.kind === "layout").length
|
|
10413
10417
|
});
|
|
10414
10418
|
}
|
|
10415
|
-
apiRouteManager = new (0,
|
|
10419
|
+
apiRouteManager = new (0, _chunkBD2U4ZL6cjs.APIRouteManager)(appDirs, server, {
|
|
10416
10420
|
plugins: farmConfig.plugins,
|
|
10417
10421
|
i18n: farmApp.getI18nRuntime(),
|
|
10418
10422
|
bodySizeLimit: serverConfig.bodySizeLimit,
|
|
@@ -10809,6 +10813,20 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10809
10813
|
const docsHandler = openAPIManager.getDocsRouteHandler(parsedRequestUrl.origin);
|
|
10810
10814
|
return docsHandler(req, res);
|
|
10811
10815
|
}
|
|
10816
|
+
if (_optionalChain([options, 'access', _558 => _558.agent, 'optionalAccess', _559 => _559.apiCatalog]) && _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) === _chunkQJ4D3UKJcjs.FARM_API_CATALOG_PATH) {
|
|
10817
|
+
if (await runAppMiddlewareForContentRoute()) return;
|
|
10818
|
+
await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0,
|
|
10819
|
+
res,
|
|
10820
|
+
_chunkQJ4D3UKJcjs.createFarmApiCatalogResponse.call(void 0,
|
|
10821
|
+
requestMethod,
|
|
10822
|
+
_chunkQJ4D3UKJcjs.resolveFarmApiCatalogInput.call(void 0, { ...options, api: farmConfig.api }),
|
|
10823
|
+
new Request(parsedRequestUrl, {
|
|
10824
|
+
headers: { "user-agent": String(_nullishCoalesce(req.headers["user-agent"], () => ( ""))) }
|
|
10825
|
+
})
|
|
10826
|
+
)
|
|
10827
|
+
);
|
|
10828
|
+
return;
|
|
10829
|
+
}
|
|
10812
10830
|
const docsHeaders = new Headers();
|
|
10813
10831
|
for (const [key, value] of Object.entries(req.headers)) {
|
|
10814
10832
|
if (value) {
|
|
@@ -10836,7 +10854,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10836
10854
|
return;
|
|
10837
10855
|
}
|
|
10838
10856
|
}
|
|
10839
|
-
const markdownSourceResponse = viteModuleRequest ? null : await
|
|
10857
|
+
const markdownSourceResponse = viteModuleRequest ? null : await _chunkRCYINC4Acjs.createFarmMarkdownSourceResponse.call(void 0, {
|
|
10840
10858
|
request: new Request(fullUrl, {
|
|
10841
10859
|
method: requestMethod,
|
|
10842
10860
|
headers: docsHeaders
|
|
@@ -10844,7 +10862,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10844
10862
|
config: farmApp.getConfig().mdx,
|
|
10845
10863
|
resolveSource: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (pathname2) => {
|
|
10846
10864
|
const match = farmApp.getRouteManager().matchRoute(pathname2);
|
|
10847
|
-
const sourcePath = _optionalChain([match, 'access',
|
|
10865
|
+
const sourcePath = _optionalChain([match, 'access', _560 => _560.route, 'optionalAccess', _561 => _561.markdownSourcePath]) || (match.route && _chunkRCYINC4Acjs.isFarmMarkdownPageFile.call(void 0, match.route.modulePath) ? match.route.modulePath : null);
|
|
10848
10866
|
if (!sourcePath) {
|
|
10849
10867
|
return null;
|
|
10850
10868
|
}
|
|
@@ -10859,35 +10877,37 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10859
10877
|
await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0, res, markdownSourceResponse);
|
|
10860
10878
|
return;
|
|
10861
10879
|
}
|
|
10862
|
-
const markdownResponse = viteModuleRequest ? null : await
|
|
10880
|
+
const markdownResponse = viteModuleRequest ? null : await _chunkQIH2HD6Hcjs.createMarkdownMirrorResponse.call(void 0, {
|
|
10863
10881
|
request: new Request(fullUrl, {
|
|
10864
10882
|
method: requestMethod,
|
|
10865
10883
|
headers: docsHeaders
|
|
10866
10884
|
}),
|
|
10867
10885
|
config: farmApp.getConfig().md,
|
|
10868
10886
|
routeExists: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (pathname2) => Boolean(farmApp.getRouteManager().matchRoute(pathname2).route), "routeExists"),
|
|
10869
|
-
|
|
10887
|
+
// Keep the page's own redirect (a sign-in gate, say) so the mirror
|
|
10888
|
+
// answers with it, as production does, instead of the target page.
|
|
10889
|
+
renderPage: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (request2) => fetch(request2, { redirect: "manual" }), "renderPage")
|
|
10870
10890
|
});
|
|
10871
10891
|
if (markdownResponse) {
|
|
10872
10892
|
if (await runAppMiddlewareForContentRoute()) return;
|
|
10873
10893
|
await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0, res, markdownResponse);
|
|
10874
10894
|
return;
|
|
10875
10895
|
}
|
|
10876
|
-
if (!viteModuleRequest &&
|
|
10877
|
-
const markdownRoute = farmApp.getRouteManager().matchRoute(
|
|
10896
|
+
if (!viteModuleRequest && _chunkQIH2HD6Hcjs.farmRequestWantsMarkdown.call(void 0, requestPathname, req.headers.accept)) {
|
|
10897
|
+
const markdownRoute = farmApp.getRouteManager().matchRoute(_chunkRCYINC4Acjs.normalizeFarmMarkdownRoutePath.call(void 0, requestPathname));
|
|
10878
10898
|
if (!markdownRoute.route) {
|
|
10879
10899
|
if (await runAppMiddlewareForContentRoute()) return;
|
|
10880
10900
|
res.statusCode = 404;
|
|
10881
|
-
res.setHeader("Content-Type",
|
|
10901
|
+
res.setHeader("Content-Type", _chunkQIH2HD6Hcjs.FARM_MARKDOWN_CONTENT_TYPE);
|
|
10882
10902
|
res.setHeader("X-Farm-Markdown-Error", "404");
|
|
10883
10903
|
res.setHeader("Cache-Control", "no-store");
|
|
10884
10904
|
res.end(
|
|
10885
|
-
|
|
10905
|
+
_chunkQIH2HD6Hcjs.createFarmMarkdownErrorBody.call(void 0, 404, requestPathname, farmConfig.basePath || "/")
|
|
10886
10906
|
);
|
|
10887
10907
|
return;
|
|
10888
10908
|
}
|
|
10889
10909
|
}
|
|
10890
|
-
const markdownPageTarget =
|
|
10910
|
+
const markdownPageTarget = _chunkQIH2HD6Hcjs.resolveMarkdownMirrorTarget.call(void 0,
|
|
10891
10911
|
farmApp.getConfig().md,
|
|
10892
10912
|
requestPathname,
|
|
10893
10913
|
{
|
|
@@ -10900,7 +10920,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10900
10920
|
if (!varyValues.some((value) => value.toLowerCase() === "accept")) {
|
|
10901
10921
|
res.setHeader("Vary", [...varyValues, "Accept"].join(", "));
|
|
10902
10922
|
}
|
|
10903
|
-
const alternatePath =
|
|
10923
|
+
const alternatePath = _chunkQIH2HD6Hcjs.getFarmMarkdownMirrorPath.call(void 0, markdownPageTarget.pathname);
|
|
10904
10924
|
const alternateLink = `<${alternatePath}>; rel="alternate"; type="text/markdown"`;
|
|
10905
10925
|
const currentLink = res.getHeader("Link");
|
|
10906
10926
|
res.setHeader(
|
|
@@ -10952,7 +10972,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10952
10972
|
"beforeRequest",
|
|
10953
10973
|
(plugin) => {
|
|
10954
10974
|
const owner = _chunkZ5HIWVDPcjs.getFarmIntegrationPluginOwner.call(void 0, plugin);
|
|
10955
|
-
return plugin.name !== _chunkYZTASLPQcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME && (_optionalChain([owner, 'optionalAccess',
|
|
10975
|
+
return plugin.name !== _chunkYZTASLPQcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME && (_optionalChain([owner, 'optionalAccess', _562 => _562.source]) !== "lifecycle" || owner.key !== matchedRoute.key);
|
|
10956
10976
|
},
|
|
10957
10977
|
req,
|
|
10958
10978
|
res
|
|
@@ -11043,7 +11063,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11043
11063
|
}
|
|
11044
11064
|
const matchedApiRoute = apiRouteManager.matchRoute(requestPathname);
|
|
11045
11065
|
const hasMatchedApiRoute = Boolean(matchedApiRoute);
|
|
11046
|
-
if (hasMatchedApiRoute ||
|
|
11066
|
+
if (hasMatchedApiRoute || _chunkYAOX43YIcjs.isFarmAPIPathname.call(void 0, requestPathname, apiServerBasePath)) {
|
|
11047
11067
|
const startTime2 = Date.now();
|
|
11048
11068
|
const method2 = req.method || "GET";
|
|
11049
11069
|
const urlPath2 = req.url || "/";
|
|
@@ -11082,7 +11102,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11082
11102
|
const apiHandler = apiRouteManager.getHandler({ throwOnError: true });
|
|
11083
11103
|
const hasExplicitAPIRoute = hasMatchedApiRoute || Boolean(apiRouteManager.matchRoute(pathname2));
|
|
11084
11104
|
if (apiHandler && hasExplicitAPIRoute) {
|
|
11085
|
-
const apiRoutePattern = _optionalChain([matchedApiRoute, 'optionalAccess',
|
|
11105
|
+
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
11106
|
_chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, {
|
|
11087
11107
|
type: "route.matched",
|
|
11088
11108
|
pathname: pathname2,
|
|
@@ -11172,7 +11192,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11172
11192
|
return;
|
|
11173
11193
|
}
|
|
11174
11194
|
}
|
|
11175
|
-
if (farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
11195
|
+
if (farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _569 => _569.isFarmDocsAPIRequest, 'call', _570 => _570(pathname2)])) {
|
|
11176
11196
|
try {
|
|
11177
11197
|
const url = `http://${req.headers.host || "localhost:3000"}${req.url}`;
|
|
11178
11198
|
const headers = new Headers();
|
|
@@ -11245,18 +11265,18 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11245
11265
|
res.end(JSON.stringify({ error: "API route not found", pathname: pathname2 }));
|
|
11246
11266
|
return;
|
|
11247
11267
|
}
|
|
11248
|
-
if (_optionalChain([req, 'access',
|
|
11268
|
+
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
11269
|
return next();
|
|
11250
11270
|
}
|
|
11251
11271
|
if (shouldBypassFarmRouterForDottedPath(
|
|
11252
11272
|
requestPathname,
|
|
11253
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
11273
|
+
_optionalChain([farmApp, 'optionalAccess', _577 => _577.getRouteManager, 'call', _578 => _578()]),
|
|
11254
11274
|
[server.config.publicDir, server.config.root],
|
|
11255
11275
|
farmAgentGeneratedPaths(farmConfig)
|
|
11256
11276
|
)) {
|
|
11257
11277
|
return next();
|
|
11258
11278
|
}
|
|
11259
|
-
if (_optionalChain([req, 'access',
|
|
11279
|
+
if (_optionalChain([req, 'access', _579 => _579.url, 'optionalAccess', _580 => _580.startsWith, 'call', _581 => _581("/__farm/page-data")])) {
|
|
11260
11280
|
const urlObj = parsedRequestUrl;
|
|
11261
11281
|
const targetPath = urlObj.searchParams.get("path") || "/";
|
|
11262
11282
|
try {
|
|
@@ -11284,7 +11304,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11284
11304
|
});
|
|
11285
11305
|
let middlewareMap = /* @__PURE__ */ new Map();
|
|
11286
11306
|
let middlewareContext = /* @__PURE__ */ new Map();
|
|
11287
|
-
if (_optionalChain([middlewareManager, 'optionalAccess',
|
|
11307
|
+
if (_optionalChain([middlewareManager, 'optionalAccess', _582 => _582.hasMiddleware, 'call', _583 => _583()])) {
|
|
11288
11308
|
const targetNodeRequest = createPageDataMiddlewareRequest(req, targetRequestUrl);
|
|
11289
11309
|
const handled = await runFarmMiddlewareWithNavigation(
|
|
11290
11310
|
farmApp.getServerRenderer(),
|
|
@@ -11312,10 +11332,10 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11312
11332
|
if (pm) {
|
|
11313
11333
|
await pm.runHookParallel("afterRouteMatch", {
|
|
11314
11334
|
pathname: targetPath,
|
|
11315
|
-
matched: !!_optionalChain([match, 'optionalAccess',
|
|
11316
|
-
routePattern: _optionalChain([match, 'optionalAccess',
|
|
11317
|
-
params: _optionalChain([match, 'optionalAccess',
|
|
11318
|
-
layoutPatterns: (_optionalChain([match, 'optionalAccess',
|
|
11335
|
+
matched: !!_optionalChain([match, 'optionalAccess', _584 => _584.route]),
|
|
11336
|
+
routePattern: _optionalChain([match, 'optionalAccess', _585 => _585.route, 'optionalAccess', _586 => _586.pattern]) || null,
|
|
11337
|
+
params: _optionalChain([match, 'optionalAccess', _587 => _587.params]) || {},
|
|
11338
|
+
layoutPatterns: (_optionalChain([match, 'optionalAccess', _588 => _588.layouts]) || []).map((l) => l.pattern)
|
|
11319
11339
|
});
|
|
11320
11340
|
}
|
|
11321
11341
|
if (!match) {
|
|
@@ -11379,24 +11399,24 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11379
11399
|
routePath: route.pattern
|
|
11380
11400
|
});
|
|
11381
11401
|
for (const layoutModule of layoutModules) {
|
|
11382
|
-
mergedMetadata =
|
|
11402
|
+
mergedMetadata = _chunk3TQWUUNPcjs.mergeMetadata.call(void 0, mergedMetadata, layoutModule.metadata);
|
|
11383
11403
|
if (typeof layoutModule.generateMetadata === "function") {
|
|
11384
|
-
mergedMetadata =
|
|
11404
|
+
mergedMetadata = _chunk3TQWUUNPcjs.mergeMetadata.call(void 0,
|
|
11385
11405
|
mergedMetadata,
|
|
11386
11406
|
await layoutModule.generateMetadata({ params: routeProps.params })
|
|
11387
11407
|
);
|
|
11388
11408
|
}
|
|
11389
11409
|
}
|
|
11390
|
-
mergedMetadata =
|
|
11410
|
+
mergedMetadata = _chunk3TQWUUNPcjs.mergeMetadata.call(void 0, mergedMetadata, routeModule.metadata);
|
|
11391
11411
|
if (typeof routeModule.generateMetadata === "function") {
|
|
11392
|
-
mergedMetadata =
|
|
11412
|
+
mergedMetadata = _chunk3TQWUUNPcjs.mergeMetadata.call(void 0,
|
|
11393
11413
|
mergedMetadata,
|
|
11394
11414
|
await routeModule.generateMetadata(routeProps)
|
|
11395
11415
|
);
|
|
11396
11416
|
}
|
|
11397
|
-
mergedMetadata =
|
|
11417
|
+
mergedMetadata = _chunk3TQWUUNPcjs.addMetadataMarkdownAlternate.call(void 0,
|
|
11398
11418
|
mergedMetadata,
|
|
11399
|
-
|
|
11419
|
+
_chunkQIH2HD6Hcjs.getFarmMarkdownAlternatePath.call(void 0, farmApp.getConfig().md, targetRequestUrl.pathname)
|
|
11400
11420
|
);
|
|
11401
11421
|
const routeSlots = await Promise.all(
|
|
11402
11422
|
slots.map(async (slot) => {
|
|
@@ -11466,7 +11486,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11466
11486
|
middlewareContext,
|
|
11467
11487
|
() => renderer.renderNavigationFragment({
|
|
11468
11488
|
PageComponent: routeModule.default,
|
|
11469
|
-
LoadingComponent: _optionalChain([loadingModule, 'optionalAccess',
|
|
11489
|
+
LoadingComponent: _optionalChain([loadingModule, 'optionalAccess', _589 => _589.default]),
|
|
11470
11490
|
pageProps: routeProps,
|
|
11471
11491
|
params,
|
|
11472
11492
|
layouts: layouts.map((layout, index) => ({
|
|
@@ -11572,14 +11592,14 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11572
11592
|
trustProxy: currentServerConfig.trustProxy
|
|
11573
11593
|
}).pathname;
|
|
11574
11594
|
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',
|
|
11595
|
+
const hasBeforeRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _590 => _590.hasHook, 'call', _591 => _591("beforeRouteMatch")]), () => ( false));
|
|
11596
|
+
const hasAfterRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _592 => _592.hasHook, 'call', _593 => _593("afterRouteMatch")]), () => ( false));
|
|
11597
|
+
const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _594 => _594.hasHook, 'call', _595 => _595("beforeRequest")]), () => ( false));
|
|
11598
|
+
const hasBeforeRenderHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _596 => _596.hasHook, 'call', _597 => _597("beforeRender")]), () => ( false));
|
|
11599
|
+
const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _598 => _598.hasHook, 'call', _599 => _599("afterResponse")]), () => ( false));
|
|
11600
|
+
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)));
|
|
11601
|
+
const hasRuntimeRequestHooks = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _604 => _604.hasRuntimeRequestHooks, 'call', _605 => _605()]), () => ( false));
|
|
11602
|
+
const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _606 => _606.hasRuntimeHook, 'call', _607 => _607("after")]), () => ( false));
|
|
11583
11603
|
const requestedMatch = routeManager2.matchRoute(requestedPathname);
|
|
11584
11604
|
let runtimeSession;
|
|
11585
11605
|
if (pm && hasRuntimeRequestHooks) {
|
|
@@ -11590,8 +11610,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11590
11610
|
kind: "page",
|
|
11591
11611
|
route: {
|
|
11592
11612
|
pathname: requestedPathname,
|
|
11593
|
-
pattern: _optionalChain([requestedMatch, 'optionalAccess',
|
|
11594
|
-
params: _optionalChain([requestedMatch, 'optionalAccess',
|
|
11613
|
+
pattern: _optionalChain([requestedMatch, 'optionalAccess', _608 => _608.route, 'optionalAccess', _609 => _609.pattern]) || null,
|
|
11614
|
+
params: _optionalChain([requestedMatch, 'optionalAccess', _610 => _610.params]) || {}
|
|
11595
11615
|
}
|
|
11596
11616
|
}
|
|
11597
11617
|
);
|
|
@@ -11624,17 +11644,17 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11624
11644
|
if (pm && hasAfterRouteMatchHook) {
|
|
11625
11645
|
await pm.runHookParallel("afterRouteMatch", {
|
|
11626
11646
|
pathname,
|
|
11627
|
-
matched: !!_optionalChain([routeMatch, 'optionalAccess',
|
|
11628
|
-
routePattern: _optionalChain([routeMatch, 'optionalAccess',
|
|
11629
|
-
params: _optionalChain([routeMatch, 'optionalAccess',
|
|
11630
|
-
layoutPatterns: (_optionalChain([routeMatch, 'optionalAccess',
|
|
11647
|
+
matched: !!_optionalChain([routeMatch, 'optionalAccess', _611 => _611.route]),
|
|
11648
|
+
routePattern: _optionalChain([routeMatch, 'optionalAccess', _612 => _612.route, 'optionalAccess', _613 => _613.pattern]) || null,
|
|
11649
|
+
params: _optionalChain([routeMatch, 'optionalAccess', _614 => _614.params]) || {},
|
|
11650
|
+
layoutPatterns: (_optionalChain([routeMatch, 'optionalAccess', _615 => _615.layouts]) || []).map((l) => l.pattern)
|
|
11631
11651
|
});
|
|
11632
11652
|
}
|
|
11633
11653
|
const renderPayload = {
|
|
11634
11654
|
pathname,
|
|
11635
11655
|
method,
|
|
11636
|
-
routePattern: _optionalChain([routeMatch, 'optionalAccess',
|
|
11637
|
-
params: _optionalChain([routeMatch, 'optionalAccess',
|
|
11656
|
+
routePattern: _optionalChain([routeMatch, 'optionalAccess', _616 => _616.route, 'optionalAccess', _617 => _617.pattern]) || null,
|
|
11657
|
+
params: _optionalChain([routeMatch, 'optionalAccess', _618 => _618.params]) || {}
|
|
11638
11658
|
};
|
|
11639
11659
|
const shouldInterceptResponse = Boolean(
|
|
11640
11660
|
pm && (hasAfterResponseHook || hasHTMLTransformHook || runtimeSession && hasRuntimeAfterHook)
|
|
@@ -11656,7 +11676,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11656
11676
|
emitError: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (error) => emitPluginError("response-end", error, { pathname }), "emitError")
|
|
11657
11677
|
}) : void 0;
|
|
11658
11678
|
try {
|
|
11659
|
-
if (_optionalChain([middlewareManager, 'optionalAccess',
|
|
11679
|
+
if (_optionalChain([middlewareManager, 'optionalAccess', _619 => _619.hasMiddleware, 'call', _620 => _620()])) {
|
|
11660
11680
|
const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
|
|
11661
11681
|
const handled = await runFarmMiddlewareWithNavigation(
|
|
11662
11682
|
farmApp.getServerRenderer(),
|
|
@@ -11666,7 +11686,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11666
11686
|
() => middlewareManager.execute(req, res)
|
|
11667
11687
|
);
|
|
11668
11688
|
if (handled) {
|
|
11669
|
-
if (!_optionalChain([responseInterceptor, 'optionalAccess',
|
|
11689
|
+
if (!_optionalChain([responseInterceptor, 'optionalAccess', _621 => _621.isEnded, 'call', _622 => _622()])) {
|
|
11670
11690
|
const duration = Date.now() - startTime;
|
|
11671
11691
|
logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
|
|
11672
11692
|
}
|
|
@@ -11678,7 +11698,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11678
11698
|
req.url || "/",
|
|
11679
11699
|
`http://${req.headers.host || "localhost:3000"}`
|
|
11680
11700
|
).pathname;
|
|
11681
|
-
const hasLocalPageRoute = Boolean(_optionalChain([routeManager2, 'access',
|
|
11701
|
+
const hasLocalPageRoute = Boolean(_optionalChain([routeManager2, 'access', _623 => _623.matchRoute, 'call', _624 => _624(currentPathname), 'optionalAccess', _625 => _625.route]));
|
|
11682
11702
|
await pm.runHookParallelFiltered(
|
|
11683
11703
|
"beforeRequest",
|
|
11684
11704
|
(plugin) => !hasLocalPageRoute || plugin.name !== _chunkYZTASLPQcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME,
|
|
@@ -11686,8 +11706,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11686
11706
|
res
|
|
11687
11707
|
);
|
|
11688
11708
|
}
|
|
11689
|
-
if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess',
|
|
11690
|
-
if (!_optionalChain([responseInterceptor, 'optionalAccess',
|
|
11709
|
+
if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess', _626 => _626.isEnded, 'call', _627 => _627()])) {
|
|
11710
|
+
if (!_optionalChain([responseInterceptor, 'optionalAccess', _628 => _628.isEnded, 'call', _629 => _629()])) {
|
|
11691
11711
|
const duration = Date.now() - startTime;
|
|
11692
11712
|
logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
|
|
11693
11713
|
}
|
|
@@ -11745,25 +11765,25 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11745
11765
|
if (imageModule) return imageModule;
|
|
11746
11766
|
}
|
|
11747
11767
|
if (_chunk6V4TDWECcjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
|
|
11748
|
-
const renderer = _optionalChain([farmApp, 'optionalAccess',
|
|
11749
|
-
return generateProgrammaticRouteModule(id, _optionalChain([server, 'optionalAccess',
|
|
11768
|
+
const renderer = _optionalChain([farmApp, 'optionalAccess', _630 => _630.getConfig, 'call', _631 => _631(), 'access', _632 => _632.renderer]) || _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, options.renderer);
|
|
11769
|
+
return generateProgrammaticRouteModule(id, _optionalChain([server, 'optionalAccess', _633 => _633.config, 'access', _634 => _634.root]) || options.root, renderer);
|
|
11750
11770
|
}
|
|
11751
11771
|
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',
|
|
11772
|
+
const resolvedConfig = _optionalChain([farmApp, 'optionalAccess', _635 => _635.getConfig, 'call', _636 => _636()]);
|
|
11773
|
+
const renderer = _optionalChain([resolvedConfig, 'optionalAccess', _637 => _637.renderer]) || _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, options.renderer);
|
|
11774
|
+
const integrations = _optionalChain([resolvedConfig, 'optionalAccess', _638 => _638.integrations]) || options.integrations;
|
|
11775
|
+
const root = _optionalChain([resolvedConfig, 'optionalAccess', _639 => _639.root]) || _optionalChain([server, 'optionalAccess', _640 => _640.config, 'access', _641 => _641.root]) || process.cwd();
|
|
11776
|
+
const docs = _optionalChain([resolvedConfig, 'optionalAccess', _642 => _642.docs]);
|
|
11757
11777
|
const adapterOwnsDocsRuntime = Boolean(
|
|
11758
|
-
_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess',
|
|
11778
|
+
_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess', _643 => _643.adapter, 'optionalAccess', _644 => _644.server]) && docs.adapter.react
|
|
11759
11779
|
);
|
|
11760
|
-
const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
11780
|
+
const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _645 => _645.devtools]), () => ( _chunkYJRZR7VUcjs.resolveFarmDevtoolsConfig.call(void 0, false, "production")));
|
|
11761
11781
|
const [docsRuntime, docsSearchRuntime, devtoolsClientRuntime] = await Promise.all([
|
|
11762
|
-
_optionalChain([docs, 'optionalAccess',
|
|
11763
|
-
_optionalChain([docs, 'optionalAccess',
|
|
11782
|
+
_optionalChain([docs, 'optionalAccess', _646 => _646.enabled]) ? loadFarmDocsDevRuntime() : null,
|
|
11783
|
+
_optionalChain([docs, 'optionalAccess', _647 => _647.enabled]) && !adapterOwnsDocsRuntime ? loadFarmDocsSearchDevRuntime() : null,
|
|
11764
11784
|
devtools.enabled ? loadFarmDevtoolsClientRuntime() : null
|
|
11765
11785
|
]);
|
|
11766
|
-
const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess',
|
|
11786
|
+
const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess', _648 => _648.isFarmDocsSearchEnabled, 'call', _649 => _649(docs)]), () => ( false));
|
|
11767
11787
|
const generatedDocsSearchRuntime = docsSearchRuntime ? docsSearchRuntime.generateFarmDocsSearchClientRuntime(
|
|
11768
11788
|
docsSearchEnabled,
|
|
11769
11789
|
docsSearchEnabled ? docsSearchRuntime.resolveFarmDocsSearchClientModule(root) : void 0
|
|
@@ -11772,9 +11792,9 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11772
11792
|
const generatedDevIndicatorsClientRuntime = farmApp ? _chunkQBPXNZGVcjs.generateFarmDevIndicatorsClientRuntime.call(void 0, farmApp.getConfig().devIndicators) : "";
|
|
11773
11793
|
const integrationProviders = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _chunkZ5HIWVDPcjs.getIntegrationProviders.call(void 0, integrations) : [];
|
|
11774
11794
|
const isolatedHydrationMode = resolveFarmIsolatedClientHydrationMode(
|
|
11775
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
11795
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _650 => _650.experimental, 'optionalAccess', _651 => _651.isolatedClientHydration]),
|
|
11776
11796
|
{
|
|
11777
|
-
serverComponents: _optionalChain([resolvedConfig, 'optionalAccess',
|
|
11797
|
+
serverComponents: _optionalChain([resolvedConfig, 'optionalAccess', _652 => _652.experimental, 'optionalAccess', _653 => _653.serverComponents]) === true,
|
|
11778
11798
|
hasUnsupportedIntegrationProvider: integrationProviders.filter((provider) => provider.component || provider.type === "clerk").some((provider) => provider.supportsIsolatedHydration !== true)
|
|
11779
11799
|
}
|
|
11780
11800
|
);
|
|
@@ -11782,22 +11802,22 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11782
11802
|
integrationProviders,
|
|
11783
11803
|
[
|
|
11784
11804
|
..._chunkZ5HIWVDPcjs.getIntegrationDocumentNavigationMatchers.call(void 0, integrations),
|
|
11785
|
-
..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess',
|
|
11805
|
+
..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess', _654 => _654.getFarmDocsDocumentNavigationMatchers, 'call', _655 => _655(docs)]), () => ( []))
|
|
11786
11806
|
],
|
|
11787
11807
|
generatedDocsSearchRuntime,
|
|
11788
11808
|
`${generatedDevtoolsClientRuntime}
|
|
11789
11809
|
${generatedDevIndicatorsClientRuntime}`,
|
|
11790
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
11810
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _656 => _656.plugins]) || [],
|
|
11791
11811
|
root,
|
|
11792
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
11793
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
11794
|
-
_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess',
|
|
11812
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _657 => _657.srcDir]) || options.srcDir || "src",
|
|
11813
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _658 => _658.publicRuntimeConfig]) || options.publicRuntimeConfig,
|
|
11814
|
+
_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess', _659 => _659.adapter, 'optionalAccess', _660 => _660.react]) : void 0,
|
|
11795
11815
|
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',
|
|
11816
|
+
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,
|
|
11817
|
+
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _666 => _666.trailingSlash]), () => ( false)),
|
|
11818
|
+
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _667 => _667.basePath]), () => ( "/")),
|
|
11799
11819
|
generateClientCachePersistenceCode(
|
|
11800
|
-
resolveFarmClientCacheAdapterEntry(root, _optionalChain([resolvedConfig, 'optionalAccess',
|
|
11820
|
+
resolveFarmClientCacheAdapterEntry(root, _optionalChain([resolvedConfig, 'optionalAccess', _668 => _668.cache]))
|
|
11801
11821
|
),
|
|
11802
11822
|
_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _chunk75WGQVQAcjs.getFarmDocsAdapterConfigModule.call(void 0, docs) : void 0
|
|
11803
11823
|
);
|
|
@@ -11806,7 +11826,7 @@ ${generatedDevIndicatorsClientRuntime}`,
|
|
|
11806
11826
|
return generateServerCode();
|
|
11807
11827
|
}
|
|
11808
11828
|
if (id === "/@farm/manifest") {
|
|
11809
|
-
const routeManager = _optionalChain([farmApp, 'optionalAccess',
|
|
11829
|
+
const routeManager = _optionalChain([farmApp, 'optionalAccess', _669 => _669.getRouteManager, 'call', _670 => _670()]);
|
|
11810
11830
|
if (!routeManager) {
|
|
11811
11831
|
return `
|
|
11812
11832
|
export const getManifest = () => ({
|
|
@@ -11821,7 +11841,7 @@ export const getManifest = () => ({
|
|
|
11821
11841
|
const manifest = routeManager.generateClientManifest(server.config.root);
|
|
11822
11842
|
const globalStylesheetHref = resolveDevGlobalStylesheetHref(
|
|
11823
11843
|
server.config.root,
|
|
11824
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
11844
|
+
_optionalChain([farmApp, 'optionalAccess', _671 => _671.getConfig, 'call', _672 => _672(), 'access', _673 => _673.srcDir])
|
|
11825
11845
|
);
|
|
11826
11846
|
const fullManifest = {
|
|
11827
11847
|
clientEntry: "/@farm/client.js",
|
|
@@ -11872,17 +11892,17 @@ export const manifest = getManifest();
|
|
|
11872
11892
|
}
|
|
11873
11893
|
},
|
|
11874
11894
|
async transform(code, id, transformOptions) {
|
|
11875
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
11876
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
11877
|
-
if (_optionalChain([currentConfig, 'access',
|
|
11895
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _674 => _674.ssr])) {
|
|
11896
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _675 => _675.getConfig, 'call', _676 => _676()]), () => ( options));
|
|
11897
|
+
if (_optionalChain([currentConfig, 'access', _677 => _677.experimental, 'optionalAccess', _678 => _678.serverActions]) !== true || !serverFnTransformActive) {
|
|
11878
11898
|
const violation = findClientServerFnViolation(code, id);
|
|
11879
11899
|
if (violation) {
|
|
11880
11900
|
this.error(formatServerFnBoundaryError(violation, id));
|
|
11881
11901
|
}
|
|
11882
11902
|
}
|
|
11883
11903
|
}
|
|
11884
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
11885
|
-
warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
11904
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _679 => _679.ssr]) && shouldInspectClientBoundary(id, code)) {
|
|
11905
|
+
warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _680 => _680.getConfig, 'call', _681 => _681()]), () => ( options)));
|
|
11886
11906
|
}
|
|
11887
11907
|
if (typeof imageImports.transform === "function") {
|
|
11888
11908
|
const imageModule = await imageImports.transform.call(this, code, id, transformOptions);
|
|
@@ -11897,13 +11917,13 @@ export const manifest = getManifest();
|
|
|
11897
11917
|
id,
|
|
11898
11918
|
transformOptions
|
|
11899
11919
|
);
|
|
11900
|
-
const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess',
|
|
11920
|
+
const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess', _682 => _682.code, 'optionalAccess', _683 => _683.toString, 'call', _684 => _684()]);
|
|
11901
11921
|
if (fontCode) {
|
|
11902
11922
|
transformedCode = fontCode;
|
|
11903
11923
|
transformed = true;
|
|
11904
11924
|
}
|
|
11905
11925
|
}
|
|
11906
|
-
if (_optionalChain([transformOptions, 'optionalAccess',
|
|
11926
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _685 => _685.ssr]) && server) {
|
|
11907
11927
|
const rewrittenImports = rewriteEarlySsrRelativeImports({
|
|
11908
11928
|
code: transformedCode,
|
|
11909
11929
|
id,
|
|
@@ -11923,12 +11943,12 @@ export const manifest = getManifest();
|
|
|
11923
11943
|
}
|
|
11924
11944
|
transformedCode = stripUseClientDirective(transformedCode);
|
|
11925
11945
|
transformed = true;
|
|
11926
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
11946
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _686 => _686.getConfig, 'call', _687 => _687()]), () => ( options));
|
|
11927
11947
|
let isolatedModuleReference = null;
|
|
11928
|
-
const root = currentConfig.root || _optionalChain([server, 'optionalAccess',
|
|
11948
|
+
const root = currentConfig.root || _optionalChain([server, 'optionalAccess', _688 => _688.config, 'access', _689 => _689.root]) || process.cwd();
|
|
11929
11949
|
const cleanId = id.split("?", 1)[0];
|
|
11930
|
-
const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
11931
|
-
const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess',
|
|
11950
|
+
const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _690 => _690.getRouteManager, 'call', _691 => _691(), 'access', _692 => _692.getIsolatedClientBoundaryModules, 'call', _693 => _693(root)])));
|
|
11951
|
+
const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess', _694 => _694.has, 'call', _695 => _695(path17.resolve(cleanId))]) === true;
|
|
11932
11952
|
if (_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration && isIsolatableClientBoundarySource(clientBoundarySource)) {
|
|
11933
11953
|
isolatedModuleReference = _chunk5QIKR7RRcjs.toViteModuleId.call(void 0, cleanId, root);
|
|
11934
11954
|
const transformedBoundary = transformIsolatedClientBoundaryModule({
|
|
@@ -11965,7 +11985,7 @@ export const manifest = getManifest();
|
|
|
11965
11985
|
);
|
|
11966
11986
|
return;
|
|
11967
11987
|
}` : "";
|
|
11968
|
-
const hmrCode = _optionalChain([transformOptions, 'optionalAccess',
|
|
11988
|
+
const hmrCode = _optionalChain([transformOptions, 'optionalAccess', _696 => _696.ssr]) || !shouldEmitFarmClientRootHmr(currentConfig.renderer) ? "" : `
|
|
11969
11989
|
if (import.meta.hot) {
|
|
11970
11990
|
import.meta.hot.accept((newModule) => {
|
|
11971
11991
|
${isolatedHmrUpdate}
|
|
@@ -12019,14 +12039,14 @@ if (import.meta.hot) {
|
|
|
12019
12039
|
}
|
|
12020
12040
|
_chunk5QIKR7RRcjs.logger.info(`Found ${ssgPages.length} SSG pages, ${ssrRoutes.length} SSR routes`);
|
|
12021
12041
|
_chunk5QIKR7RRcjs.logger.info("Pre-rendering SSG pages...");
|
|
12022
|
-
const outDir = path17.join(_optionalChain([server, 'optionalAccess',
|
|
12042
|
+
const outDir = path17.join(_optionalChain([server, 'optionalAccess', _697 => _697.config, 'access', _698 => _698.root]) || process.cwd(), options.outDir || "dist");
|
|
12023
12043
|
const clientDir = path17.join(outDir, "client");
|
|
12024
12044
|
for (const page of ssgPages) {
|
|
12025
12045
|
try {
|
|
12026
12046
|
const staticRequest = new Request(new URL(page.urlPath, "http://farm.static"));
|
|
12027
12047
|
await farmApp.getServerRenderer().runWithRequestContext(staticRequest, async () => {
|
|
12028
12048
|
const mod = await routeManager.loadRouteModule(page.filePath);
|
|
12029
|
-
if (!_optionalChain([mod, 'optionalAccess',
|
|
12049
|
+
if (!_optionalChain([mod, 'optionalAccess', _699 => _699.default])) return;
|
|
12030
12050
|
const { layouts } = routeManager.matchRoute(page.urlPath);
|
|
12031
12051
|
const layoutModules = await Promise.all(
|
|
12032
12052
|
layouts.map((l) => routeManager.loadLayoutModule(l.modulePath))
|
|
@@ -12058,7 +12078,7 @@ if (import.meta.hot) {
|
|
|
12058
12078
|
const i18nSnapshot = _chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
12059
12079
|
const i18nHead = renderFarmI18nStaticHead(page.urlPath, i18nSnapshot);
|
|
12060
12080
|
const fullHtml = `<!DOCTYPE html>
|
|
12061
|
-
<html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
12081
|
+
<html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess', _700 => _700.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}>
|
|
12062
12082
|
<head>
|
|
12063
12083
|
<meta charset="utf-8">
|
|
12064
12084
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
@@ -12116,13 +12136,13 @@ if (import.meta.hot) {
|
|
|
12116
12136
|
});
|
|
12117
12137
|
}
|
|
12118
12138
|
}
|
|
12119
|
-
const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess',
|
|
12139
|
+
const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess', _701 => _701.getConfig, 'call', _702 => _702()]);
|
|
12120
12140
|
const normalizedFile = file.replace(/\\/g, "/");
|
|
12121
12141
|
if (currentFarmConfig && /\/route\.(?:ts|tsx|js|jsx)$/.test(normalizedFile) && _chunkVPTDD5XFcjs.getFarmAppDirectories.call(void 0, currentFarmConfig).some(
|
|
12122
12142
|
(appDir) => normalizedFile.startsWith(`${_chunk5QIKR7RRcjs.toPosixPath.call(void 0, appDir)}/api/`)
|
|
12123
12143
|
)) {
|
|
12124
12144
|
for (const mod of modules) server2.moduleGraph.invalidateModule(mod);
|
|
12125
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
12145
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _703 => _703(`updated ${file}`)]);
|
|
12126
12146
|
server2.ws.send({ type: "full-reload", path: "*" });
|
|
12127
12147
|
return [];
|
|
12128
12148
|
}
|
|
@@ -12132,7 +12152,7 @@ if (import.meta.hot) {
|
|
|
12132
12152
|
for (const mod of modules) {
|
|
12133
12153
|
server2.moduleGraph.invalidateModule(mod);
|
|
12134
12154
|
}
|
|
12135
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
12155
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _704 => _704(`updated ${file}`)]);
|
|
12136
12156
|
server2.ws.send({
|
|
12137
12157
|
type: "full-reload",
|
|
12138
12158
|
path: "*"
|
|
@@ -12145,17 +12165,17 @@ if (import.meta.hot) {
|
|
|
12145
12165
|
for (const mod of modules) {
|
|
12146
12166
|
server2.moduleGraph.invalidateModule(mod);
|
|
12147
12167
|
}
|
|
12148
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
12168
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _705 => _705(`updated ${file}`)]);
|
|
12149
12169
|
server2.ws.send({
|
|
12150
12170
|
type: "full-reload",
|
|
12151
12171
|
path: "*"
|
|
12152
12172
|
});
|
|
12153
12173
|
return [];
|
|
12154
12174
|
}
|
|
12155
|
-
const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess',
|
|
12156
|
-
const planRouteManager = _optionalChain([farmApp, 'optionalAccess',
|
|
12175
|
+
const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess', _706 => _706.experimental, 'optionalAccess', _707 => _707.isolatedClientHydration]);
|
|
12176
|
+
const planRouteManager = _optionalChain([farmApp, 'optionalAccess', _708 => _708.getRouteManager, 'call', _709 => _709()]);
|
|
12157
12177
|
const isHydrationPlanSource = currentSrcRoot !== null && normalizedFile.startsWith(`${currentSrcRoot}/`) && /\.[cm]?[jt]sx?$/.test(normalizedFile);
|
|
12158
|
-
const tracksAsyncOwnerIslands = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess',
|
|
12178
|
+
const tracksAsyncOwnerIslands = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _710 => _710.renderer])) && planRouteManager !== void 0;
|
|
12159
12179
|
if (isHydrationPlanSource && (isolatedHydrationMode === "enabled" || isolatedHydrationMode === "analyze" || tracksAsyncOwnerIslands)) {
|
|
12160
12180
|
const routeManager = planRouteManager;
|
|
12161
12181
|
if (routeManager) {
|
|
@@ -12215,7 +12235,7 @@ if (import.meta.hot) {
|
|
|
12215
12235
|
}
|
|
12216
12236
|
return [];
|
|
12217
12237
|
}
|
|
12218
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
12238
|
+
_optionalChain([farmApp, 'optionalAccess', _711 => _711.getRouteManager, 'call', _712 => _712(), 'access', _713 => _713.invalidateClientManifest, 'call', _714 => _714()]);
|
|
12219
12239
|
const manifestModule = server2.moduleGraph.getModuleById("/@farm/manifest");
|
|
12220
12240
|
if (manifestModule) {
|
|
12221
12241
|
server2.moduleGraph.invalidateModule(manifestModule);
|
|
@@ -12584,12 +12604,12 @@ async function parseRouteModuleProps2(routeModule, input) {
|
|
|
12584
12604
|
}
|
|
12585
12605
|
const schemas = routeModule.__farmRouteSchemas;
|
|
12586
12606
|
const params = parseRouteModuleSchema2(
|
|
12587
|
-
_optionalChain([schemas, 'optionalAccess',
|
|
12607
|
+
_optionalChain([schemas, 'optionalAccess', _715 => _715.params]),
|
|
12588
12608
|
input.props.params,
|
|
12589
12609
|
"params",
|
|
12590
12610
|
input.routePath
|
|
12591
12611
|
);
|
|
12592
|
-
const search = parseRouteModuleSchema2(_optionalChain([schemas, 'optionalAccess',
|
|
12612
|
+
const search = parseRouteModuleSchema2(_optionalChain([schemas, 'optionalAccess', _716 => _716.search]), input.search, "search", input.routePath);
|
|
12593
12613
|
return {
|
|
12594
12614
|
...input.props,
|
|
12595
12615
|
params,
|
|
@@ -14185,7 +14205,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, generateClientManifest, "generateClientMan
|
|
|
14185
14205
|
async function defineConfig(config = {}) {
|
|
14186
14206
|
const tailwindVitePlugin = await loadTailwindVitePlugin();
|
|
14187
14207
|
const appRoot = path17.resolve(config.root || process.cwd());
|
|
14188
|
-
if (_optionalChain([config, 'access',
|
|
14208
|
+
if (_optionalChain([config, 'access', _717 => _717.extends, 'optionalAccess', _718 => _718.length])) {
|
|
14189
14209
|
const { config: layeredConfig } = await import("./layers-4PNE2HOY.cjs").then(
|
|
14190
14210
|
({ resolveFarmLayers }) => resolveFarmLayers(config, {
|
|
14191
14211
|
root: appRoot,
|
|
@@ -14286,13 +14306,13 @@ async function defineConfig(config = {}) {
|
|
|
14286
14306
|
if (!serverStarted) {
|
|
14287
14307
|
serverStarted = true;
|
|
14288
14308
|
const elapsed = Date.now() - startTime;
|
|
14289
|
-
const address = _optionalChain([server, 'access',
|
|
14309
|
+
const address = _optionalChain([server, 'access', _719 => _719.httpServer, 'optionalAccess', _720 => _720.address, 'call', _721 => _721()]);
|
|
14290
14310
|
const resolvedPort = typeof address === "object" && address ? address.port : server.config.server.port || port || 3e3;
|
|
14291
14311
|
const hostConfig = server.config.server.host;
|
|
14292
14312
|
const isExposed = hostConfig === true || hostConfig === "0.0.0.0";
|
|
14293
14313
|
console.log("");
|
|
14294
14314
|
console.log(
|
|
14295
|
-
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${
|
|
14315
|
+
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${_chunkALIFMS4Acjs.FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
|
|
14296
14316
|
);
|
|
14297
14317
|
console.log("");
|
|
14298
14318
|
console.log(
|
|
@@ -14446,4 +14466,5 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, defineConfig, "defineConfig");
|
|
|
14446
14466
|
|
|
14447
14467
|
|
|
14448
14468
|
|
|
14449
|
-
|
|
14469
|
+
|
|
14470
|
+
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.HOISTED_HEAD_ELEMENT = HOISTED_HEAD_ELEMENT; 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.loadTailwindVitePlugin = loadTailwindVitePlugin; exports.SHARP_INSTALL_HINT = SHARP_INSTALL_HINT; exports.resolveFarmImageProviderForRuntime = resolveFarmImageProviderForRuntime; 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;
|