@farm.js/core 0.1.28 → 0.1.30
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.d.mts +1 -1
- package/dist/api/route-manager.d.ts +1 -1
- package/dist/api/runtime.d.mts +2 -2
- package/dist/api/runtime.d.ts +2 -2
- package/dist/api.cjs +2 -2
- package/dist/api.d.mts +18 -4
- package/dist/api.d.ts +18 -4
- package/dist/api.mjs +1 -1
- package/dist/{app-DSSq6wiN.d.mts → app-DAuUTIZf.d.mts} +3 -3
- package/dist/app-markdown.cjs +5 -4
- package/dist/app-markdown.d.mts +3 -3
- package/dist/app-markdown.d.ts +3 -3
- package/dist/app-markdown.mjs +4 -3
- package/dist/{app-M8nVWvNU.d.ts → app-sUJ3jnTZ.d.ts} +3 -3
- package/dist/{chunk-N6UROPT7.mjs → chunk-2FQHH5SC.mjs} +12 -13
- package/dist/{chunk-2CNBR3EB.mjs → chunk-2UABTL3Y.mjs} +2 -2
- package/dist/{chunk-JUFRXDTK.cjs → chunk-3FCFQP5V.cjs} +17 -5
- package/dist/{chunk-XSPGWQWA.cjs → chunk-6CNX6Q3K.cjs} +96 -24
- package/dist/{chunk-NVBS5WSZ.mjs → chunk-6G3ZZ2IE.mjs} +1 -1
- package/dist/{chunk-QBPXNZGV.cjs → chunk-6MVFL3R5.cjs} +25 -6
- package/dist/{chunk-PZPDGOU5.mjs → chunk-7CXKSRKL.mjs} +11 -7
- package/dist/{chunk-K3YEZLSY.mjs → chunk-ATXI6LGT.mjs} +96 -24
- package/dist/{chunk-2DLN6HG4.mjs → chunk-BZ3CHOFX.mjs} +1 -1
- package/dist/{chunk-EWZ3XHKQ.cjs → chunk-BZAGKCKB.cjs} +2 -2
- package/dist/{chunk-FB3H4INL.mjs → chunk-D234YWNA.mjs} +1 -1
- package/dist/{chunk-KXGDXYUC.mjs → chunk-DGXN3L4D.mjs} +17 -5
- package/dist/chunk-FJ3M4CUX.cjs +46 -0
- package/dist/chunk-FXEF4PPL.mjs +47 -0
- package/dist/{chunk-ID6OVSLH.cjs → chunk-GIWC4CFJ.cjs} +175 -171
- package/dist/{chunk-F52CDFJM.cjs → chunk-HPQC2LHF.cjs} +435 -274
- package/dist/{chunk-FVCSLZWT.mjs → chunk-IVLUJUT4.mjs} +315 -154
- package/dist/{chunk-KOQ555NR.cjs → chunk-JFHKNFEO.cjs} +24 -20
- package/dist/{chunk-UX2DD2VK.mjs → chunk-K6V52QMI.mjs} +1 -1
- package/dist/{chunk-BYODCJD6.cjs → chunk-K7CELQLK.cjs} +12 -13
- package/dist/{chunk-A672WZEG.cjs → chunk-NPPL5YDT.cjs} +2 -2
- package/dist/{chunk-TII23GJC.cjs → chunk-NXG66MR7.cjs} +3 -3
- package/dist/{chunk-R6AIILII.cjs → chunk-OZVEHHMA.cjs} +15 -14
- package/dist/{chunk-T7HQ3I4C.mjs → chunk-PQD2AI3B.mjs} +1 -1
- package/dist/{chunk-VQXDC5UV.cjs → chunk-Q5JFU33Q.cjs} +4 -4
- package/dist/{chunk-FZC7EEPM.mjs → chunk-RSOJ7DRT.mjs} +26 -7
- package/dist/{chunk-ZRIE4KMG.mjs → chunk-S4K74WI4.mjs} +17 -13
- package/dist/{chunk-Y7GW7J46.cjs → chunk-X5TXZFMN.cjs} +1 -1
- package/dist/chunk-XD32KALF.cjs +47 -0
- package/dist/{chunk-RDV44SED.mjs → chunk-XJJVLDM6.mjs} +15 -14
- package/dist/{chunk-55ZY4ZA7.cjs → chunk-XLTV4VOG.cjs} +21 -16
- package/dist/{chunk-REGFZJEJ.mjs → chunk-YMUE7L3D.mjs} +18 -13
- package/dist/chunk-Z3HATSKO.mjs +46 -0
- package/dist/{chunk-MH24QDVJ.cjs → chunk-ZDILFMWN.cjs} +13 -13
- package/dist/{client-plugins-CgYNY7jF.d.mts → client-plugins-BX2ptm4H.d.mts} +7 -2
- package/dist/{client-plugins-Fl9Og3yB.d.ts → client-plugins-BmxM5KW_.d.ts} +7 -2
- package/dist/client-plugins.d.mts +2 -2
- package/dist/client-plugins.d.ts +2 -2
- package/dist/client.d.mts +5 -5
- package/dist/client.d.ts +5 -5
- package/dist/config.d.mts +2 -2
- package/dist/config.d.ts +2 -2
- package/dist/{devtools-5AREISIA.cjs → devtools-GGVPZHJX.cjs} +95 -20
- package/dist/{devtools-3E7ZANMZ.mjs → devtools-THVNPI2M.mjs} +79 -4
- package/dist/{devtools-client-4WAPJY5L.cjs → devtools-client-CXQ6PXI6.cjs} +1 -1
- package/dist/{devtools-client-LEUIHHAS.mjs → devtools-client-HJS2T34Y.mjs} +1 -1
- package/dist/docs.cjs +8 -7
- package/dist/docs.mjs +7 -6
- package/dist/index.cjs +18 -16
- package/dist/index.d.mts +24 -14
- package/dist/index.d.ts +24 -14
- package/dist/index.mjs +17 -15
- package/dist/integrations.d.mts +2 -2
- package/dist/integrations.d.ts +2 -2
- package/dist/internal/app-markdown-runtime.cjs +4 -3
- package/dist/internal/app-markdown-runtime.d.mts +3 -3
- package/dist/internal/app-markdown-runtime.d.ts +3 -3
- package/dist/internal/app-markdown-runtime.mjs +3 -2
- package/dist/internal/build-runtime.cjs +15 -13
- package/dist/internal/build-runtime.d.mts +4 -4
- package/dist/internal/build-runtime.d.ts +4 -4
- package/dist/internal/build-runtime.mjs +14 -12
- package/dist/internal/cli-runtime.cjs +7 -6
- package/dist/internal/cli-runtime.mjs +6 -5
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/compression-runtime.cjs +3 -2
- package/dist/internal/compression-runtime.d.mts +5 -3
- package/dist/internal/compression-runtime.d.ts +5 -3
- package/dist/internal/compression-runtime.mjs +2 -1
- package/dist/internal/config-runtime.cjs +6 -5
- 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 -4
- package/dist/internal/product-telemetry-runtime.cjs +10 -6
- package/dist/internal/product-telemetry-runtime.mjs +9 -5
- package/dist/internal/production-runtime.cjs +19 -5
- package/dist/internal/production-runtime.d.mts +35 -8
- package/dist/internal/production-runtime.d.ts +35 -8
- package/dist/internal/production-runtime.mjs +18 -4
- package/dist/markdown.cjs +3 -2
- package/dist/markdown.d.mts +2 -2
- package/dist/markdown.d.ts +2 -2
- package/dist/markdown.mjs +2 -1
- package/dist/{metadata-B0X-qtcQ.d.mts → metadata-DsEaK7mQ.d.mts} +1 -1
- package/dist/{metadata-BdDKgd7K.d.ts → metadata-fwZ3gfG6.d.ts} +1 -1
- package/dist/middleware.cjs +3 -2
- package/dist/middleware.d.mts +3 -3
- package/dist/middleware.d.ts +3 -3
- package/dist/middleware.mjs +2 -1
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/plugin.cjs +10 -9
- package/dist/plugin.d.mts +2 -2
- package/dist/plugin.d.ts +2 -2
- package/dist/plugin.mjs +9 -8
- package/dist/{production-runtime-BjgFgDIg.d.mts → production-runtime-Baqgwtvc.d.mts} +1 -1
- package/dist/{production-runtime-Dx_qMA3t.d.ts → production-runtime-DNkpFnmg.d.ts} +1 -1
- package/dist/{render-plan-_1TAWODt.d.mts → render-plan-DhwQnmmX.d.mts} +1 -1
- package/dist/{render-plan-B41EWmBb.d.ts → render-plan-rkIK9wd9.d.ts} +1 -1
- package/dist/renderer-client.d.mts +3 -3
- package/dist/renderer-client.d.ts +3 -3
- package/dist/{request-Dbf3G0zM.d.ts → request-BcY4RYPC.d.ts} +1 -1
- package/dist/{request-BhE4luLv.d.mts → request-CFy1BltJ.d.mts} +1 -1
- package/dist/request.d.mts +3 -3
- package/dist/request.d.ts +3 -3
- package/dist/{route-rendering-zzfx_GHf.d.mts → route-rendering-BkS0TBlB.d.mts} +1 -1
- package/dist/{route-rendering-Z7PveTZE.d.ts → route-rendering-D4XpMjam.d.ts} +1 -1
- package/dist/{router-BatNMsa1.d.mts → router-C4zPlC3V.d.mts} +1 -1
- package/dist/{router-DtNRhQl3.d.ts → router-Cq7BcZxg.d.ts} +1 -1
- package/dist/routes.d.mts +2 -2
- package/dist/routes.d.ts +2 -2
- package/dist/server-plugins.cjs +3 -2
- package/dist/server-plugins.d.mts +2 -2
- package/dist/server-plugins.d.ts +2 -2
- package/dist/server-plugins.mjs +2 -1
- package/dist/server.cjs +33 -28
- package/dist/server.d.mts +8 -8
- package/dist/server.d.ts +8 -8
- package/dist/server.mjs +16 -11
- package/dist/{spa-router-BE3bwU-J.d.ts → spa-router-B1HI3X9k.d.ts} +2 -2
- package/dist/{spa-router-DQOnHZVj.d.mts → spa-router-DzPZH-AO.d.mts} +2 -2
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/{utils-DLK1ERNl.d.mts → utils-CEBktlBG.d.mts} +1 -1
- package/dist/{utils-u7ZBSWAK.d.ts → utils-DMD1Hzta.d.ts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +10 -9
- package/dist/vite.d.mts +2 -2
- package/dist/vite.d.ts +2 -2
- package/dist/vite.mjs +9 -8
- package/package.json +1 -1
|
@@ -27,7 +27,7 @@ var _chunkJSROZYYOcjs = require('./chunk-JSROZYYO.cjs');
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var _chunkNPPL5YDTcjs = require('./chunk-NPPL5YDT.cjs');
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
var _chunkCXP5U3RWcjs = require('./chunk-CXP5U3RW.cjs');
|
|
@@ -64,7 +64,8 @@ var _chunkHREOKQWTcjs = require('./chunk-HREOKQWT.cjs');
|
|
|
64
64
|
|
|
65
65
|
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
|
|
68
|
+
var _chunk6MVFL3R5cjs = require('./chunk-6MVFL3R5.cjs');
|
|
68
69
|
|
|
69
70
|
|
|
70
71
|
|
|
@@ -107,7 +108,7 @@ var _chunkPSV6XKPOcjs = require('./chunk-PSV6XKPO.cjs');
|
|
|
107
108
|
|
|
108
109
|
|
|
109
110
|
|
|
110
|
-
var
|
|
111
|
+
var _chunkXLTV4VOGcjs = require('./chunk-XLTV4VOG.cjs');
|
|
111
112
|
|
|
112
113
|
|
|
113
114
|
|
|
@@ -125,12 +126,12 @@ var _chunkVEKFLAQMcjs = require('./chunk-VEKFLAQM.cjs');
|
|
|
125
126
|
|
|
126
127
|
|
|
127
128
|
|
|
128
|
-
var
|
|
129
|
+
var _chunkBZAGKCKBcjs = require('./chunk-BZAGKCKB.cjs');
|
|
129
130
|
|
|
130
131
|
|
|
131
132
|
|
|
132
133
|
|
|
133
|
-
var
|
|
134
|
+
var _chunkNXG66MR7cjs = require('./chunk-NXG66MR7.cjs');
|
|
134
135
|
|
|
135
136
|
|
|
136
137
|
|
|
@@ -144,7 +145,7 @@ var _chunkOHY2ZWUGcjs = require('./chunk-OHY2ZWUG.cjs');
|
|
|
144
145
|
|
|
145
146
|
|
|
146
147
|
|
|
147
|
-
var
|
|
148
|
+
var _chunk6CNX6Q3Kcjs = require('./chunk-6CNX6Q3K.cjs');
|
|
148
149
|
|
|
149
150
|
|
|
150
151
|
var _chunkMPEYMSCFcjs = require('./chunk-MPEYMSCF.cjs');
|
|
@@ -284,7 +285,7 @@ var _chunkE3UK5IIBcjs = require('./chunk-E3UK5IIB.cjs');
|
|
|
284
285
|
var _chunkUQZ4AYTHcjs = require('./chunk-UQZ4AYTH.cjs');
|
|
285
286
|
|
|
286
287
|
|
|
287
|
-
var
|
|
288
|
+
var _chunkX5TXZFMNcjs = require('./chunk-X5TXZFMN.cjs');
|
|
288
289
|
|
|
289
290
|
|
|
290
291
|
|
|
@@ -1503,8 +1504,10 @@ function getProjectImportAliases(projectRoot) {
|
|
|
1503
1504
|
return "-";
|
|
1504
1505
|
}
|
|
1505
1506
|
}).join(":");
|
|
1507
|
+
const sourceDir = _chunk6MVFL3R5cjs.getFarmProjectSourceDir.call(void 0, projectRoot);
|
|
1508
|
+
const cacheStamp = `${stamp}:${sourceDir}`;
|
|
1506
1509
|
const cached = projectImportAliasCache.get(projectRoot);
|
|
1507
|
-
if (_optionalChain([cached, 'optionalAccess', _88 => _88.stamp]) ===
|
|
1510
|
+
if (_optionalChain([cached, 'optionalAccess', _88 => _88.stamp]) === cacheStamp) return cached.aliases;
|
|
1508
1511
|
const aliases = [
|
|
1509
1512
|
...readTsconfigPathAliases(projectRoot),
|
|
1510
1513
|
...readPackageImportAliases(projectRoot)
|
|
@@ -1514,10 +1517,10 @@ function getProjectImportAliases(projectRoot) {
|
|
|
1514
1517
|
prefix: "@/",
|
|
1515
1518
|
suffix: "",
|
|
1516
1519
|
wildcard: true,
|
|
1517
|
-
targets: [path9.default.join(projectRoot,
|
|
1520
|
+
targets: [path9.default.join(projectRoot, sourceDir, "*")]
|
|
1518
1521
|
});
|
|
1519
1522
|
}
|
|
1520
|
-
projectImportAliasCache.set(projectRoot, { stamp, aliases });
|
|
1523
|
+
projectImportAliasCache.set(projectRoot, { stamp: cacheStamp, aliases });
|
|
1521
1524
|
return aliases;
|
|
1522
1525
|
}
|
|
1523
1526
|
_chunkS3JO3N4Hcjs.__name.call(void 0, getProjectImportAliases, "getProjectImportAliases");
|
|
@@ -2239,7 +2242,7 @@ var _RouteManager = class _RouteManager {
|
|
|
2239
2242
|
);
|
|
2240
2243
|
const routeEntries = Array.from(this.routes.values()).map((entry) => ({
|
|
2241
2244
|
entry,
|
|
2242
|
-
metadata:
|
|
2245
|
+
metadata: _chunkNXG66MR7cjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? markdownPagePlan() : getClientModuleHydrationPlan(
|
|
2243
2246
|
entry.modulePath,
|
|
2244
2247
|
normalizedProjectRoot,
|
|
2245
2248
|
isolatedMode,
|
|
@@ -2247,7 +2250,7 @@ var _RouteManager = class _RouteManager {
|
|
|
2247
2250
|
)
|
|
2248
2251
|
}));
|
|
2249
2252
|
const markdownFallback = routeEntries.find(
|
|
2250
|
-
({ entry, metadata }) =>
|
|
2253
|
+
({ entry, metadata }) => _chunkNXG66MR7cjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.fallbackReason
|
|
2251
2254
|
);
|
|
2252
2255
|
if (markdownFallback) {
|
|
2253
2256
|
_chunk5QIKR7RRcjs.logger.warn(
|
|
@@ -2255,7 +2258,7 @@ var _RouteManager = class _RouteManager {
|
|
|
2255
2258
|
);
|
|
2256
2259
|
}
|
|
2257
2260
|
const markdownStaticPackages = _optionalChain([routeEntries, 'access', _120 => _120.find, 'call', _121 => _121(
|
|
2258
|
-
({ entry, metadata }) =>
|
|
2261
|
+
({ entry, metadata }) => _chunkNXG66MR7cjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.staticPackageBoundaries
|
|
2259
2262
|
), 'optionalAccess', _122 => _122.metadata, 'access', _123 => _123.staticPackageBoundaries]);
|
|
2260
2263
|
if (markdownStaticPackages) {
|
|
2261
2264
|
_chunk5QIKR7RRcjs.logger.info(
|
|
@@ -2263,7 +2266,7 @@ var _RouteManager = class _RouteManager {
|
|
|
2263
2266
|
);
|
|
2264
2267
|
}
|
|
2265
2268
|
for (const { entry, metadata } of [...layoutEntries, ...routeEntries]) {
|
|
2266
|
-
if (
|
|
2269
|
+
if (_chunkNXG66MR7cjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) || !metadata.staticPackageBoundaries) continue;
|
|
2267
2270
|
_chunk5QIKR7RRcjs.logger.info(
|
|
2268
2271
|
`[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.`
|
|
2269
2272
|
);
|
|
@@ -2415,13 +2418,13 @@ var _RouteManager = class _RouteManager {
|
|
|
2415
2418
|
const { createRouteModuleFromProgrammaticPage } = await import("./routes.cjs");
|
|
2416
2419
|
return createRouteModuleFromProgrammaticPage(programmaticPage, this.rendererRuntime);
|
|
2417
2420
|
}
|
|
2418
|
-
if (
|
|
2421
|
+
if (_chunkNXG66MR7cjs.isFarmMarkdownPageFile.call(void 0, modulePath)) {
|
|
2419
2422
|
const mdxConfig = _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, this.config.mdx);
|
|
2420
|
-
const components = await
|
|
2423
|
+
const components = await _chunkBZAGKCKBcjs.loadFarmMdxComponents.call(void 0, mdxConfig, {
|
|
2421
2424
|
root: this.config.root,
|
|
2422
2425
|
loadModule: this.viteServer ? (componentModulePath) => _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, this.viteServer, componentModulePath) : void 0
|
|
2423
2426
|
});
|
|
2424
|
-
return await
|
|
2427
|
+
return await _chunkBZAGKCKBcjs.createFarmMarkdownRouteModuleFromFile.call(void 0, modulePath, {
|
|
2425
2428
|
components,
|
|
2426
2429
|
config: mdxConfig
|
|
2427
2430
|
});
|
|
@@ -2528,8 +2531,8 @@ var _RouteManager = class _RouteManager {
|
|
|
2528
2531
|
}
|
|
2529
2532
|
}
|
|
2530
2533
|
for (const [pattern, group] of canonicalPageGroups) {
|
|
2531
|
-
const componentFiles = group.files.filter((file) => !
|
|
2532
|
-
const markdownFiles = group.files.filter(
|
|
2534
|
+
const componentFiles = group.files.filter((file) => !_chunkNXG66MR7cjs.isFarmMarkdownPageFile.call(void 0, file));
|
|
2535
|
+
const markdownFiles = group.files.filter(_chunkNXG66MR7cjs.isFarmMarkdownPageFile);
|
|
2533
2536
|
if (componentFiles.length > 1) {
|
|
2534
2537
|
throw new Error(
|
|
2535
2538
|
`Duplicate page route "${pattern}". Found ${componentFiles.map((file) => path9.default.join(appDir, file)).join(" and ")}.`
|
|
@@ -4688,7 +4691,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, appendResponseVary, "appendResponseVary");
|
|
|
4688
4691
|
function renderI18nAlternateLinks(requestPath, snapshot, options) {
|
|
4689
4692
|
if (snapshot.routing === "none") return "";
|
|
4690
4693
|
const url = new URL(requestPath, "http://farm.local");
|
|
4691
|
-
return
|
|
4694
|
+
return _chunkNPPL5YDTcjs.renderFarmLocaleAlternateLinks.call(void 0, url.pathname, snapshot, options);
|
|
4692
4695
|
}
|
|
4693
4696
|
_chunkS3JO3N4Hcjs.__name.call(void 0, renderI18nAlternateLinks, "renderI18nAlternateLinks");
|
|
4694
4697
|
var PPR_REFRESH_MAX_ATTEMPTS = 3;
|
|
@@ -4827,7 +4830,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
4827
4830
|
this.routeManager = routeManager;
|
|
4828
4831
|
this.i18nRuntime = i18nRuntime;
|
|
4829
4832
|
this.viteServer = viteServer;
|
|
4830
|
-
this.security =
|
|
4833
|
+
this.security = _chunkXLTV4VOGcjs.resolveFarmSecurityConfig.call(void 0, config.security);
|
|
4831
4834
|
this.loadSSGManifest();
|
|
4832
4835
|
}
|
|
4833
4836
|
async initialize() {
|
|
@@ -5326,10 +5329,10 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
5326
5329
|
if (this.viteServer) await this.applyRendererAppSetup();
|
|
5327
5330
|
_chunkI57LW5VZcjs.setFarmBasePath.call(void 0, this.config.basePath);
|
|
5328
5331
|
_chunkOYEUREB6cjs.setFarmTrailingSlashPreference.call(void 0, this.config.trailingSlash);
|
|
5329
|
-
const cspNonce =
|
|
5332
|
+
const cspNonce = _chunkXLTV4VOGcjs.createFarmCspNonce.call(void 0, this.security);
|
|
5330
5333
|
if (cspNonce) {
|
|
5331
5334
|
req.__FARM_CSP_NONCE__ = cspNonce;
|
|
5332
|
-
const header =
|
|
5335
|
+
const header = _chunkXLTV4VOGcjs.getFarmSecurityHeader.call(void 0, this.security, cspNonce);
|
|
5333
5336
|
res.setHeader(header.key, header.value);
|
|
5334
5337
|
}
|
|
5335
5338
|
const request2 = _chunk5ZSWG4UXcjs.createWebRequestFromFarmRequest.call(void 0, req, {
|
|
@@ -5912,7 +5915,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
5912
5915
|
}
|
|
5913
5916
|
}
|
|
5914
5917
|
_chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, { type: "render.error", route: pathname, error });
|
|
5915
|
-
const errorStatus =
|
|
5918
|
+
const errorStatus = _chunkNPPL5YDTcjs.resolveDefaultErrorStatus.call(void 0, error);
|
|
5916
5919
|
if (pprRefreshRoute) {
|
|
5917
5920
|
_chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, {
|
|
5918
5921
|
type: "ppr.refresh.error",
|
|
@@ -6056,7 +6059,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6056
6059
|
);
|
|
6057
6060
|
metadata = _chunk3LUF2PE2cjs.addMetadataMarkdownAlternate.call(void 0,
|
|
6058
6061
|
metadata,
|
|
6059
|
-
|
|
6062
|
+
_chunk6CNX6Q3Kcjs.getFarmMarkdownAlternatePath.call(void 0, _chunk6CNX6Q3Kcjs.resolveMarkdownConfig.call(void 0, this.config.md), publicPathname)
|
|
6060
6063
|
);
|
|
6061
6064
|
return metadata;
|
|
6062
6065
|
}
|
|
@@ -6128,11 +6131,11 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6128
6131
|
path: match.routePath,
|
|
6129
6132
|
...llmsContext
|
|
6130
6133
|
}) : routeModule.default;
|
|
6131
|
-
const body = match.metadata.kind === "llms-full" && !(value instanceof Response) ? await
|
|
6134
|
+
const body = match.metadata.kind === "llms-full" && !(value instanceof Response) ? await _chunkXLTV4VOGcjs.renderFarmLlmsFullTxt.call(void 0, value, {
|
|
6132
6135
|
origin: url.origin,
|
|
6133
6136
|
readMarkdown: llmsContext.markdown
|
|
6134
6137
|
}) : value;
|
|
6135
|
-
const response =
|
|
6138
|
+
const response = _chunkNPPL5YDTcjs.createFarmMetadataRouteResponse.call(void 0, match.metadata.kind, body, routeModule, {
|
|
6136
6139
|
method,
|
|
6137
6140
|
request: request2
|
|
6138
6141
|
});
|
|
@@ -6150,7 +6153,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6150
6153
|
}
|
|
6151
6154
|
/** `/llms.txt` and `/llms-full.txt` from `agent.llmsTxt` when no file route owns them. */
|
|
6152
6155
|
getGeneratedLlmsKind(pathname) {
|
|
6153
|
-
const config =
|
|
6156
|
+
const config = _chunkXLTV4VOGcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _200 => _200.config, 'access', _201 => _201.agent, 'optionalAccess', _202 => _202.llmsTxt]));
|
|
6154
6157
|
if (!config.enabled) return null;
|
|
6155
6158
|
if (pathname === "/llms.txt") return "llms";
|
|
6156
6159
|
return pathname === "/llms-full.txt" && config.full ? "llms-full" : null;
|
|
@@ -6160,15 +6163,15 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6160
6163
|
const request2 = _chunk5ZSWG4UXcjs.createWebRequestFromFarmRequest.call(void 0, req, {
|
|
6161
6164
|
trustProxy: _optionalChain([this, 'access', _203 => _203.config, 'access', _204 => _204.server, 'optionalAccess', _205 => _205.trustProxy])
|
|
6162
6165
|
});
|
|
6163
|
-
const config =
|
|
6166
|
+
const config = _chunkXLTV4VOGcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _206 => _206.config, 'access', _207 => _207.agent, 'optionalAccess', _208 => _208.llmsTxt]));
|
|
6164
6167
|
const context = await this.createLlmsTxtContext(request2, { full: kind === "llms-full", req });
|
|
6165
|
-
const body = kind === "llms-full" ? await
|
|
6168
|
+
const body = kind === "llms-full" ? await _chunkXLTV4VOGcjs.renderFarmLlmsFullTxt.call(void 0, context.defaults, {
|
|
6166
6169
|
origin: new URL(request2.url).origin,
|
|
6167
6170
|
readMarkdown: context.markdown
|
|
6168
6171
|
}) : context.defaults;
|
|
6169
6172
|
await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0,
|
|
6170
6173
|
res,
|
|
6171
|
-
|
|
6174
|
+
_chunkNPPL5YDTcjs.createFarmMetadataRouteResponse.call(void 0,
|
|
6172
6175
|
kind,
|
|
6173
6176
|
body,
|
|
6174
6177
|
{ revalidate: config.revalidate },
|
|
@@ -6187,7 +6190,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6187
6190
|
}
|
|
6188
6191
|
}
|
|
6189
6192
|
getAgentCrawlers() {
|
|
6190
|
-
return
|
|
6193
|
+
return _chunkXLTV4VOGcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([this, 'access', _209 => _209.config, 'access', _210 => _210.agent, 'optionalAccess', _211 => _211.crawlers]));
|
|
6191
6194
|
}
|
|
6192
6195
|
/** `/robots.txt` from `agent.crawlers` when no robots.ts owns it. */
|
|
6193
6196
|
async renderGeneratedRobotsTxt(req, res) {
|
|
@@ -6195,7 +6198,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6195
6198
|
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;
|
|
6196
6199
|
const rootLayout = this.routeManager.getLayouts().get("/");
|
|
6197
6200
|
const rootMetadata = sitemapPath && rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
|
|
6198
|
-
const robots =
|
|
6201
|
+
const robots = _chunkXLTV4VOGcjs.createFarmAgentRobots.call(void 0, {
|
|
6199
6202
|
crawlers: this.getAgentCrawlers(),
|
|
6200
6203
|
sitemapPath,
|
|
6201
6204
|
metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _217 => _217.metadataBase]),
|
|
@@ -6203,7 +6206,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6203
6206
|
});
|
|
6204
6207
|
await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0,
|
|
6205
6208
|
res,
|
|
6206
|
-
|
|
6209
|
+
_chunkNPPL5YDTcjs.createFarmMetadataRouteResponse.call(void 0, "robots", robots, {}, { method: req.method })
|
|
6207
6210
|
);
|
|
6208
6211
|
} catch (error) {
|
|
6209
6212
|
_chunk5QIKR7RRcjs.logger.error(`Generated robots.txt failed: ${error}`);
|
|
@@ -6218,7 +6221,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6218
6221
|
}
|
|
6219
6222
|
/** Same inputs the production server gives llms.txt: static pages and root metadata. */
|
|
6220
6223
|
async createLlmsTxtContext(request2, options = {}) {
|
|
6221
|
-
const config =
|
|
6224
|
+
const config = _chunkXLTV4VOGcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _218 => _218.config, 'access', _219 => _219.agent, 'optionalAccess', _220 => _220.llmsTxt]));
|
|
6222
6225
|
const origin = new URL(request2.url).origin;
|
|
6223
6226
|
const staticRoutes = [...this.routeManager.getRoutes()].filter(
|
|
6224
6227
|
([pattern]) => !pattern.includes("[")
|
|
@@ -6236,16 +6239,16 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6236
6239
|
);
|
|
6237
6240
|
const rootLayout = this.routeManager.getLayouts().get("/");
|
|
6238
6241
|
const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
|
|
6239
|
-
const pages =
|
|
6242
|
+
const pages = _chunkXLTV4VOGcjs.collectFarmLlmsTxtPages.call(void 0, sources, {
|
|
6240
6243
|
origin,
|
|
6241
6244
|
basePath: this.config.basePath,
|
|
6242
|
-
markdown:
|
|
6245
|
+
markdown: _chunk6CNX6Q3Kcjs.resolveMarkdownConfig.call(void 0, this.config.md),
|
|
6243
6246
|
include: config.include,
|
|
6244
6247
|
exclude: config.exclude
|
|
6245
6248
|
});
|
|
6246
6249
|
return {
|
|
6247
6250
|
pages,
|
|
6248
|
-
defaults:
|
|
6251
|
+
defaults: _chunkXLTV4VOGcjs.createFarmDefaultLlmsTxt.call(void 0, { origin, pages, config, rootMetadata }),
|
|
6249
6252
|
...options.full ? { markdown: this.createDevMarkdownReader(options.req) } : {}
|
|
6250
6253
|
};
|
|
6251
6254
|
}
|
|
@@ -6265,11 +6268,11 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6265
6268
|
}
|
|
6266
6269
|
if (socket.encrypted) {
|
|
6267
6270
|
const address = { host: socket.localAddress, port: socket.localPort };
|
|
6268
|
-
return
|
|
6271
|
+
return _chunkXLTV4VOGcjs.createFarmLlmsMarkdownReader.call(void 0, (page) => requestOwnHttpsServer(page, address));
|
|
6269
6272
|
}
|
|
6270
6273
|
const host = socket.localAddress.includes(":") ? `[${socket.localAddress}]` : socket.localAddress;
|
|
6271
6274
|
const localOrigin = `http://${host}:${socket.localPort}`;
|
|
6272
|
-
const read =
|
|
6275
|
+
const read = _chunkXLTV4VOGcjs.createFarmLlmsMarkdownReader.call(void 0, (page) => fetch(page));
|
|
6273
6276
|
return (url) => {
|
|
6274
6277
|
const target = new URL(url);
|
|
6275
6278
|
return read(`${localOrigin}${target.pathname}${target.search}`);
|
|
@@ -6520,7 +6523,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6520
6523
|
i18nSnapshot,
|
|
6521
6524
|
this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
|
|
6522
6525
|
) : "";
|
|
6523
|
-
const themeDocument =
|
|
6526
|
+
const themeDocument = _chunkNPPL5YDTcjs.createFarmThemeDocumentParts.call(void 0,
|
|
6524
6527
|
this.config.theme,
|
|
6525
6528
|
this.config.basePath,
|
|
6526
6529
|
_chunkXWAWFQFScjs.getTheme.call(void 0, )
|
|
@@ -6757,7 +6760,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6757
6760
|
this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
|
|
6758
6761
|
) : "";
|
|
6759
6762
|
const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
|
|
6760
|
-
const themeDocument =
|
|
6763
|
+
const themeDocument = _chunkNPPL5YDTcjs.createFarmThemeDocumentParts.call(void 0,
|
|
6761
6764
|
this.config.theme,
|
|
6762
6765
|
this.config.basePath,
|
|
6763
6766
|
_chunkXWAWFQFScjs.getTheme.call(void 0, )
|
|
@@ -6766,7 +6769,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6766
6769
|
const devStyleLinks = this.collectDevStyleLinks();
|
|
6767
6770
|
const globalStylesheetLink = this.devGlobalStylesheetLink(true);
|
|
6768
6771
|
const cspNonce = this.getCspNonce(req);
|
|
6769
|
-
const secureDocumentHTML = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (html) => cspNonce ?
|
|
6772
|
+
const secureDocumentHTML = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (html) => cspNonce ? _chunkXLTV4VOGcjs.addFarmCspNonceToScriptTags.call(void 0, html, cspNonce) : html, "secureDocumentHTML");
|
|
6770
6773
|
const createLateNavigationRecovery = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (navigationError) => this.createLateNavigationRecoveryHTML(req, navigationError), "createLateNavigationRecovery");
|
|
6771
6774
|
const { pipe, abort } = renderToPipeableStream(streamRoot, {
|
|
6772
6775
|
nonce: cspNonce,
|
|
@@ -6813,7 +6816,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6813
6816
|
let firstChunk = true;
|
|
6814
6817
|
let checkedFullDocument = false;
|
|
6815
6818
|
let documentPrefix = "";
|
|
6816
|
-
const cspNonceRewriter = cspNonce ?
|
|
6819
|
+
const cspNonceRewriter = cspNonce ? _chunkXLTV4VOGcjs.createFarmCspNonceRewriter.call(void 0, cspNonce) : void 0;
|
|
6817
6820
|
const cspStreamDecoder = cspNonceRewriter ? new TextDecoder() : void 0;
|
|
6818
6821
|
const recordRenderedChunk = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (chunkText) => {
|
|
6819
6822
|
if (!chunkText) return;
|
|
@@ -7016,7 +7019,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7016
7019
|
*/
|
|
7017
7020
|
async createLateNavigationRecoveryHTML(req, error) {
|
|
7018
7021
|
if (_chunkOX6O6WVAcjs.isFarmRedirectError.call(void 0, error)) {
|
|
7019
|
-
return
|
|
7022
|
+
return _chunkNPPL5YDTcjs.createLateRedirectRecovery.call(void 0, this.localizeRedirectUrl(_chunkOX6O6WVAcjs.getFarmRedirectError.call(void 0, error).url));
|
|
7020
7023
|
}
|
|
7021
7024
|
const pathname = _chunk5ZSWG4UXcjs.resolveFarmRequestURL.call(void 0, req, {
|
|
7022
7025
|
trustProxy: _optionalChain([this, 'access', _253 => _253.config, 'access', _254 => _254.server, 'optionalAccess', _255 => _255.trustProxy])
|
|
@@ -7034,7 +7037,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7034
7037
|
_chunk5QIKR7RRcjs.logger.warn(`not-found page could not render outside its layout, using Farm's: ${error2}`);
|
|
7035
7038
|
}
|
|
7036
7039
|
}
|
|
7037
|
-
return
|
|
7040
|
+
return _chunkNPPL5YDTcjs.createLateNotFoundRecovery.call(void 0, content);
|
|
7038
7041
|
}
|
|
7039
7042
|
async render404(req, res) {
|
|
7040
7043
|
res.statusCode = 404;
|
|
@@ -7043,11 +7046,11 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7043
7046
|
}).pathname;
|
|
7044
7047
|
const acceptHeader = req.headers.accept;
|
|
7045
7048
|
const accept = Array.isArray(acceptHeader) ? acceptHeader.join(",") : acceptHeader;
|
|
7046
|
-
if (
|
|
7047
|
-
res.setHeader("Content-Type",
|
|
7049
|
+
if (_chunk6CNX6Q3Kcjs.farmRequestWantsMarkdown.call(void 0, pathname, accept)) {
|
|
7050
|
+
res.setHeader("Content-Type", _chunk6CNX6Q3Kcjs.FARM_MARKDOWN_CONTENT_TYPE);
|
|
7048
7051
|
res.setHeader("X-Farm-Markdown-Error", "404");
|
|
7049
7052
|
res.setHeader("Cache-Control", "no-store");
|
|
7050
|
-
res.end(
|
|
7053
|
+
res.end(_chunk6CNX6Q3Kcjs.createFarmMarkdownErrorBody.call(void 0, 404, pathname, this.config.basePath || "/"));
|
|
7051
7054
|
return;
|
|
7052
7055
|
}
|
|
7053
7056
|
const appDir = path9.join(this.config.root, this.config.srcDir, "app");
|
|
@@ -7109,8 +7112,8 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7109
7112
|
trustProxy: _optionalChain([this, 'access', _261 => _261.config, 'access', _262 => _262.server, 'optionalAccess', _263 => _263.trustProxy])
|
|
7110
7113
|
});
|
|
7111
7114
|
const diagnostics = isDev ? createDefaultErrorDiagnostics(error, this.config.root || process.cwd()) : void 0;
|
|
7112
|
-
const statusText =
|
|
7113
|
-
const content =
|
|
7115
|
+
const statusText = _chunkNPPL5YDTcjs.getDefaultErrorStatusText.call(void 0, statusCode);
|
|
7116
|
+
const content = _chunkNPPL5YDTcjs.createDefaultErrorMarkup.call(void 0, {
|
|
7114
7117
|
statusCode,
|
|
7115
7118
|
statusText,
|
|
7116
7119
|
requestPath: requestUrl.pathname,
|
|
@@ -7120,7 +7123,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7120
7123
|
stack: _optionalChain([diagnostics, 'optionalAccess', _266 => _266.stack]),
|
|
7121
7124
|
sourceFrame: _optionalChain([diagnostics, 'optionalAccess', _267 => _267.sourceFrame]),
|
|
7122
7125
|
development: isDev,
|
|
7123
|
-
farmVersion:
|
|
7126
|
+
farmVersion: _chunkX5TXZFMNcjs.FARM_VERSION,
|
|
7124
7127
|
nodeVersion: process.version,
|
|
7125
7128
|
mode: isDev ? "development" : "production"
|
|
7126
7129
|
});
|
|
@@ -7163,7 +7166,7 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
|
|
|
7163
7166
|
this.getI18nAlternateOptions(alternates.req, alternates.metadata)
|
|
7164
7167
|
) : "";
|
|
7165
7168
|
const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
|
|
7166
|
-
const themeDocument =
|
|
7169
|
+
const themeDocument = _chunkNPPL5YDTcjs.createFarmThemeDocumentParts.call(void 0,
|
|
7167
7170
|
this.config.theme,
|
|
7168
7171
|
this.config.basePath,
|
|
7169
7172
|
_chunkXWAWFQFScjs.getTheme.call(void 0, )
|
|
@@ -7223,7 +7226,7 @@ ${clientScript}
|
|
|
7223
7226
|
}
|
|
7224
7227
|
secureDocumentHTML(req, html) {
|
|
7225
7228
|
const nonce = this.getCspNonce(req);
|
|
7226
|
-
return nonce ?
|
|
7229
|
+
return nonce ? _chunkXLTV4VOGcjs.addFarmCspNonceToScriptTags.call(void 0, html, nonce) : html;
|
|
7227
7230
|
}
|
|
7228
7231
|
applyDeploymentHeaders(req, res) {
|
|
7229
7232
|
const deploymentId = this.getDeploymentId();
|
|
@@ -7319,7 +7322,7 @@ var _FarmApp = class _FarmApp {
|
|
|
7319
7322
|
storage: config.storage || {},
|
|
7320
7323
|
schema: config.schema || {},
|
|
7321
7324
|
cache: config.cache || {},
|
|
7322
|
-
auth: isResolvedAuthConfig(config.auth) ? config.auth :
|
|
7325
|
+
auth: isResolvedAuthConfig(config.auth) ? config.auth : _chunk6MVFL3R5cjs.resolveFarmAuthConfig.call(void 0, config.auth),
|
|
7323
7326
|
integrations: config.integrations || {},
|
|
7324
7327
|
plugins: config.plugins || [],
|
|
7325
7328
|
migrations: config.migrations || { commands: [] },
|
|
@@ -7331,9 +7334,9 @@ var _FarmApp = class _FarmApp {
|
|
|
7331
7334
|
context: config.context || (() => void 0),
|
|
7332
7335
|
server: _chunkEM6SBQKMcjs.resolveFarmServerConfig.call(void 0, config.server),
|
|
7333
7336
|
serverActions: _chunkT5CERMEHcjs.resolveServerActionsConfig.call(void 0, config.serverActions),
|
|
7334
|
-
security:
|
|
7337
|
+
security: _chunkXLTV4VOGcjs.resolveFarmSecurityConfig.call(void 0, config.security),
|
|
7335
7338
|
images: _chunkYFPGHF5Fcjs.resolveFarmImageConfig.call(void 0, config.images),
|
|
7336
|
-
performance:
|
|
7339
|
+
performance: _chunkXLTV4VOGcjs.resolveFarmPerformanceConfig.call(void 0, config.performance),
|
|
7337
7340
|
theme: _chunkOI6CMLWXcjs.resolveFarmThemeConfig.call(void 0, config.theme, basePath),
|
|
7338
7341
|
i18n: isResolvedI18nConfig(config.i18n) ? config.i18n : _chunkHBTUGXHScjs.resolveFarmI18nConfig.call(void 0, config.i18n, {
|
|
7339
7342
|
root,
|
|
@@ -7345,7 +7348,7 @@ var _FarmApp = class _FarmApp {
|
|
|
7345
7348
|
serverRuntimeConfig: config.serverRuntimeConfig || {},
|
|
7346
7349
|
publicRuntimeConfig: config.publicRuntimeConfig || {},
|
|
7347
7350
|
docs: isResolvedDocsConfig(config.docs) ? config.docs : defaultDocsConfig,
|
|
7348
|
-
md:
|
|
7351
|
+
md: _chunk6CNX6Q3Kcjs.resolveMarkdownConfig.call(void 0, config.md),
|
|
7349
7352
|
mdx: _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, config.mdx),
|
|
7350
7353
|
observability: _nullishCoalesce(config.observability, () => ( false)),
|
|
7351
7354
|
telemetry: config.telemetry !== false,
|
|
@@ -7354,7 +7357,7 @@ var _FarmApp = class _FarmApp {
|
|
|
7354
7357
|
config.devtools,
|
|
7355
7358
|
process.env.NODE_ENV === "production" ? "production" : "development"
|
|
7356
7359
|
),
|
|
7357
|
-
devIndicators:
|
|
7360
|
+
devIndicators: _chunk6MVFL3R5cjs.resolveFarmDevIndicatorsConfig.call(void 0,
|
|
7358
7361
|
config.devIndicators,
|
|
7359
7362
|
process.env.NODE_ENV === "production" ? "production" : "development"
|
|
7360
7363
|
),
|
|
@@ -8528,7 +8531,7 @@ function createPluginFactory(definition) {
|
|
|
8528
8531
|
}
|
|
8529
8532
|
_chunkS3JO3N4Hcjs.__name.call(void 0, createPluginFactory, "createPluginFactory");
|
|
8530
8533
|
function pluginSchemaName(pluginName) {
|
|
8531
|
-
const name =
|
|
8534
|
+
const name = _chunk6MVFL3R5cjs.pluginShortName.call(void 0, pluginName);
|
|
8532
8535
|
if (!/^[a-z0-9][a-z0-9_-]*$/iu.test(name)) {
|
|
8533
8536
|
throw new Error(
|
|
8534
8537
|
`Plugin "${pluginName}" declares a schema, so its name must end in a word made of letters, numbers, "-" or "_": that word becomes \`farm <name> migrate\`.`
|
|
@@ -8559,7 +8562,7 @@ function declarePluginSchema(plugin) {
|
|
|
8559
8562
|
schema: plugin.schema,
|
|
8560
8563
|
// Also listed by key, which tooling from before `external` existed reads.
|
|
8561
8564
|
models: Object.keys(models).filter((key) => !models[key].external),
|
|
8562
|
-
...plugin.dependsOn ? { dependsOn: plugin.dependsOn.map(
|
|
8565
|
+
...plugin.dependsOn ? { dependsOn: plugin.dependsOn.map(_chunk6MVFL3R5cjs.pluginShortName) } : {},
|
|
8563
8566
|
...plugin.version ? { version: plugin.version } : {},
|
|
8564
8567
|
..._optionalChain([plugin, 'access', _402 => _402.migrations, 'optionalAccess', _403 => _403.length]) ? { migrations: plugin.migrations } : {},
|
|
8565
8568
|
dialect: _optionalChain([database, 'optionalAccess', _404 => _404.dialect]),
|
|
@@ -9495,13 +9498,13 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, reportOpenAPIDevGenerationResult, "reportO
|
|
|
9495
9498
|
// src/vite.ts
|
|
9496
9499
|
var SERVER_FN_TRANSFORM_PLUGIN = "@farm.js/plugin/rsc:server-fn-actions";
|
|
9497
9500
|
function farmLlmsTxtGeneratedPaths(config) {
|
|
9498
|
-
const llms =
|
|
9501
|
+
const llms = _chunkXLTV4VOGcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([config, 'access', _474 => _474.agent, 'optionalAccess', _475 => _475.llmsTxt]));
|
|
9499
9502
|
if (!llms.enabled) return [];
|
|
9500
9503
|
return llms.full ? ["/llms.txt", "/llms-full.txt"] : ["/llms.txt"];
|
|
9501
9504
|
}
|
|
9502
9505
|
_chunkS3JO3N4Hcjs.__name.call(void 0, farmLlmsTxtGeneratedPaths, "farmLlmsTxtGeneratedPaths");
|
|
9503
9506
|
function farmAgentGeneratedPaths(config) {
|
|
9504
|
-
const crawlers =
|
|
9507
|
+
const crawlers = _chunkXLTV4VOGcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([config, 'access', _476 => _476.agent, 'optionalAccess', _477 => _477.crawlers]));
|
|
9505
9508
|
return [...farmLlmsTxtGeneratedPaths(config), ...crawlers.enabled ? ["/robots.txt"] : []];
|
|
9506
9509
|
}
|
|
9507
9510
|
_chunkS3JO3N4Hcjs.__name.call(void 0, farmAgentGeneratedPaths, "farmAgentGeneratedPaths");
|
|
@@ -9547,7 +9550,7 @@ function loadFarmWorkflowsDevRuntime() {
|
|
|
9547
9550
|
}
|
|
9548
9551
|
_chunkS3JO3N4Hcjs.__name.call(void 0, loadFarmWorkflowsDevRuntime, "loadFarmWorkflowsDevRuntime");
|
|
9549
9552
|
function loadFarmDevtoolsSnapshotRuntime() {
|
|
9550
|
-
return import("./devtools-
|
|
9553
|
+
return import("./devtools-GGVPZHJX.cjs");
|
|
9551
9554
|
}
|
|
9552
9555
|
_chunkS3JO3N4Hcjs.__name.call(void 0, loadFarmDevtoolsSnapshotRuntime, "loadFarmDevtoolsSnapshotRuntime");
|
|
9553
9556
|
function loadFarmDevtoolsUIRuntime() {
|
|
@@ -9555,7 +9558,7 @@ function loadFarmDevtoolsUIRuntime() {
|
|
|
9555
9558
|
}
|
|
9556
9559
|
_chunkS3JO3N4Hcjs.__name.call(void 0, loadFarmDevtoolsUIRuntime, "loadFarmDevtoolsUIRuntime");
|
|
9557
9560
|
function loadFarmDevtoolsClientRuntime() {
|
|
9558
|
-
return import("./devtools-client-
|
|
9561
|
+
return import("./devtools-client-CXQ6PXI6.cjs");
|
|
9559
9562
|
}
|
|
9560
9563
|
_chunkS3JO3N4Hcjs.__name.call(void 0, loadFarmDevtoolsClientRuntime, "loadFarmDevtoolsClientRuntime");
|
|
9561
9564
|
function farmI18nClientBridgePlugin() {
|
|
@@ -9634,7 +9637,7 @@ function renderFarmI18nStaticHead(requestPath, snapshot) {
|
|
|
9634
9637
|
if (!snapshot) return "";
|
|
9635
9638
|
const runtime = `<script>window.__FARM_I18N__ = ${serializeFarmInlineValue(snapshot)};</script>`;
|
|
9636
9639
|
if (snapshot.routing === "none") return runtime;
|
|
9637
|
-
return `${
|
|
9640
|
+
return `${_chunkNPPL5YDTcjs.renderFarmLocaleAlternateLinks.call(void 0, requestPath, snapshot)}${runtime}`;
|
|
9638
9641
|
}
|
|
9639
9642
|
_chunkS3JO3N4Hcjs.__name.call(void 0, renderFarmI18nStaticHead, "renderFarmI18nStaticHead");
|
|
9640
9643
|
function getPublicEnvDefine(config) {
|
|
@@ -10233,7 +10236,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
10233
10236
|
if (_optionalChain([farmConfig, 'access', _505 => _505.agent, 'optionalAccess', _506 => _506.noindexPreviews])) {
|
|
10234
10237
|
server.middlewares.use((_req, res, next) => {
|
|
10235
10238
|
if (_chunkCXP5U3RWcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env)) {
|
|
10236
|
-
res.setHeader("X-Robots-Tag",
|
|
10239
|
+
res.setHeader("X-Robots-Tag", _chunkXLTV4VOGcjs.FARM_PREVIEW_ROBOTS_TAG);
|
|
10237
10240
|
}
|
|
10238
10241
|
next();
|
|
10239
10242
|
});
|
|
@@ -10786,7 +10789,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10786
10789
|
...currentConfig,
|
|
10787
10790
|
openapi: options.openapi
|
|
10788
10791
|
},
|
|
10789
|
-
workflows: discoveredWorkflows
|
|
10792
|
+
workflows: discoveredWorkflows,
|
|
10793
|
+
plugins: _optionalChain([pm, 'optionalAccess', _552 => _552.getSortedPlugins, 'call', _553 => _553()])
|
|
10790
10794
|
});
|
|
10791
10795
|
res.statusCode = 200;
|
|
10792
10796
|
res.setHeader(
|
|
@@ -10809,7 +10813,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10809
10813
|
return;
|
|
10810
10814
|
}
|
|
10811
10815
|
const runAppMiddlewareForContentRoute = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => {
|
|
10812
|
-
if (!_optionalChain([middlewareManager, 'optionalAccess',
|
|
10816
|
+
if (!_optionalChain([middlewareManager, 'optionalAccess', _554 => _554.hasMiddleware, 'call', _555 => _555()])) return false;
|
|
10813
10817
|
const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
|
|
10814
10818
|
return runFarmMiddlewareWithNavigation(
|
|
10815
10819
|
farmApp.getServerRenderer(),
|
|
@@ -10820,7 +10824,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10820
10824
|
);
|
|
10821
10825
|
}, "runAppMiddlewareForContentRoute");
|
|
10822
10826
|
const openAPIRequestPathname = openAPIManager ? _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) : requestPathname;
|
|
10823
|
-
if (openAPIManager && _optionalChain([options, 'access',
|
|
10827
|
+
if (openAPIManager && _optionalChain([options, 'access', _556 => _556.openapi, 'optionalAccess', _557 => _557.specRoute]) && openAPIRequestPathname === options.openapi.specRoute) {
|
|
10824
10828
|
if (await runAppMiddlewareForContentRoute()) return;
|
|
10825
10829
|
if (requestMethod !== "GET" && requestMethod !== "HEAD") {
|
|
10826
10830
|
res.statusCode = 405;
|
|
@@ -10837,18 +10841,18 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10837
10841
|
res.end(requestMethod === "HEAD" ? void 0 : body);
|
|
10838
10842
|
return;
|
|
10839
10843
|
}
|
|
10840
|
-
if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access',
|
|
10844
|
+
if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access', _558 => _558.openapi, 'optionalAccess', _559 => _559.route])) {
|
|
10841
10845
|
if (await runAppMiddlewareForContentRoute()) return;
|
|
10842
10846
|
const docsHandler = openAPIManager.getDocsRouteHandler(parsedRequestUrl.origin);
|
|
10843
10847
|
return docsHandler(req, res);
|
|
10844
10848
|
}
|
|
10845
|
-
if (_optionalChain([options, 'access',
|
|
10849
|
+
if (_optionalChain([options, 'access', _560 => _560.agent, 'optionalAccess', _561 => _561.apiCatalog]) && _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) === _chunkNPPL5YDTcjs.FARM_API_CATALOG_PATH) {
|
|
10846
10850
|
if (await runAppMiddlewareForContentRoute()) return;
|
|
10847
10851
|
await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0,
|
|
10848
10852
|
res,
|
|
10849
|
-
|
|
10853
|
+
_chunkNPPL5YDTcjs.createFarmApiCatalogResponse.call(void 0,
|
|
10850
10854
|
requestMethod,
|
|
10851
|
-
|
|
10855
|
+
_chunkNPPL5YDTcjs.resolveFarmApiCatalogInput.call(void 0, { ...options, api: farmConfig.api }),
|
|
10852
10856
|
new Request(parsedRequestUrl, {
|
|
10853
10857
|
headers: { "user-agent": String(_nullishCoalesce(req.headers["user-agent"], () => ( ""))) }
|
|
10854
10858
|
})
|
|
@@ -10883,7 +10887,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10883
10887
|
return;
|
|
10884
10888
|
}
|
|
10885
10889
|
}
|
|
10886
|
-
const markdownSourceResponse = viteModuleRequest ? null : await
|
|
10890
|
+
const markdownSourceResponse = viteModuleRequest ? null : await _chunkNXG66MR7cjs.createFarmMarkdownSourceResponse.call(void 0, {
|
|
10887
10891
|
request: new Request(fullUrl, {
|
|
10888
10892
|
method: requestMethod,
|
|
10889
10893
|
headers: docsHeaders
|
|
@@ -10891,7 +10895,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10891
10895
|
config: farmApp.getConfig().mdx,
|
|
10892
10896
|
resolveSource: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (pathname2) => {
|
|
10893
10897
|
const match = farmApp.getRouteManager().matchRoute(pathname2);
|
|
10894
|
-
const sourcePath = _optionalChain([match, 'access',
|
|
10898
|
+
const sourcePath = _optionalChain([match, 'access', _562 => _562.route, 'optionalAccess', _563 => _563.markdownSourcePath]) || (match.route && _chunkNXG66MR7cjs.isFarmMarkdownPageFile.call(void 0, match.route.modulePath) ? match.route.modulePath : null);
|
|
10895
10899
|
if (!sourcePath) {
|
|
10896
10900
|
return null;
|
|
10897
10901
|
}
|
|
@@ -10906,7 +10910,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10906
10910
|
await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0, res, markdownSourceResponse);
|
|
10907
10911
|
return;
|
|
10908
10912
|
}
|
|
10909
|
-
const markdownResponse = viteModuleRequest ? null : await
|
|
10913
|
+
const markdownResponse = viteModuleRequest ? null : await _chunk6CNX6Q3Kcjs.createMarkdownMirrorResponse.call(void 0, {
|
|
10910
10914
|
request: new Request(fullUrl, {
|
|
10911
10915
|
method: requestMethod,
|
|
10912
10916
|
headers: docsHeaders
|
|
@@ -10928,21 +10932,21 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10928
10932
|
await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0, res, markdownResponse);
|
|
10929
10933
|
return;
|
|
10930
10934
|
}
|
|
10931
|
-
if (!viteModuleRequest &&
|
|
10932
|
-
const markdownRoute = farmApp.getRouteManager().matchRoute(
|
|
10935
|
+
if (!viteModuleRequest && _chunk6CNX6Q3Kcjs.farmRequestWantsMarkdown.call(void 0, requestPathname, req.headers.accept)) {
|
|
10936
|
+
const markdownRoute = farmApp.getRouteManager().matchRoute(_chunkNXG66MR7cjs.normalizeFarmMarkdownRoutePath.call(void 0, requestPathname));
|
|
10933
10937
|
if (!markdownRoute.route) {
|
|
10934
10938
|
if (await runAppMiddlewareForContentRoute()) return;
|
|
10935
10939
|
res.statusCode = 404;
|
|
10936
|
-
res.setHeader("Content-Type",
|
|
10940
|
+
res.setHeader("Content-Type", _chunk6CNX6Q3Kcjs.FARM_MARKDOWN_CONTENT_TYPE);
|
|
10937
10941
|
res.setHeader("X-Farm-Markdown-Error", "404");
|
|
10938
10942
|
res.setHeader("Cache-Control", "no-store");
|
|
10939
10943
|
res.end(
|
|
10940
|
-
|
|
10944
|
+
_chunk6CNX6Q3Kcjs.createFarmMarkdownErrorBody.call(void 0, 404, requestPathname, farmConfig.basePath || "/")
|
|
10941
10945
|
);
|
|
10942
10946
|
return;
|
|
10943
10947
|
}
|
|
10944
10948
|
}
|
|
10945
|
-
const markdownPageTarget =
|
|
10949
|
+
const markdownPageTarget = _chunk6CNX6Q3Kcjs.resolveMarkdownMirrorTarget.call(void 0,
|
|
10946
10950
|
farmApp.getConfig().md,
|
|
10947
10951
|
requestPathname,
|
|
10948
10952
|
{
|
|
@@ -10955,7 +10959,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10955
10959
|
if (!varyValues.some((value) => value.toLowerCase() === "accept")) {
|
|
10956
10960
|
res.setHeader("Vary", [...varyValues, "Accept"].join(", "));
|
|
10957
10961
|
}
|
|
10958
|
-
const alternatePath =
|
|
10962
|
+
const alternatePath = _chunk6CNX6Q3Kcjs.getFarmMarkdownMirrorPath.call(void 0, markdownPageTarget.pathname);
|
|
10959
10963
|
const alternateLink = `<${alternatePath}>; rel="alternate"; type="text/markdown"`;
|
|
10960
10964
|
const currentLink = res.getHeader("Link");
|
|
10961
10965
|
res.setHeader(
|
|
@@ -11007,7 +11011,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11007
11011
|
"beforeRequest",
|
|
11008
11012
|
(plugin) => {
|
|
11009
11013
|
const owner = _chunkZ5HIWVDPcjs.getFarmIntegrationPluginOwner.call(void 0, plugin);
|
|
11010
|
-
return plugin.name !== _chunkYZTASLPQcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME && (_optionalChain([owner, 'optionalAccess',
|
|
11014
|
+
return plugin.name !== _chunkYZTASLPQcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME && (_optionalChain([owner, 'optionalAccess', _564 => _564.source]) !== "lifecycle" || owner.key !== matchedRoute.key);
|
|
11011
11015
|
},
|
|
11012
11016
|
req,
|
|
11013
11017
|
res
|
|
@@ -11137,7 +11141,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11137
11141
|
const apiHandler = apiRouteManager.getHandler({ throwOnError: true });
|
|
11138
11142
|
const hasExplicitAPIRoute = hasMatchedApiRoute || Boolean(apiRouteManager.matchRoute(pathname2));
|
|
11139
11143
|
if (apiHandler && hasExplicitAPIRoute) {
|
|
11140
|
-
const apiRoutePattern = _optionalChain([matchedApiRoute, 'optionalAccess',
|
|
11144
|
+
const apiRoutePattern = _optionalChain([matchedApiRoute, 'optionalAccess', _565 => _565.route, 'access', _566 => _566.path]) || _optionalChain([apiRouteManager, 'access', _567 => _567.matchRoute, 'call', _568 => _568(pathname2), 'optionalAccess', _569 => _569.route, 'access', _570 => _570.path]) || urlPath2;
|
|
11141
11145
|
_chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, {
|
|
11142
11146
|
type: "route.matched",
|
|
11143
11147
|
pathname: pathname2,
|
|
@@ -11227,7 +11231,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11227
11231
|
return;
|
|
11228
11232
|
}
|
|
11229
11233
|
}
|
|
11230
|
-
if (farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
11234
|
+
if (farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _571 => _571.isFarmDocsAPIRequest, 'call', _572 => _572(pathname2)])) {
|
|
11231
11235
|
try {
|
|
11232
11236
|
const url = `http://${req.headers.host || "localhost:3000"}${req.url}`;
|
|
11233
11237
|
const headers = new Headers();
|
|
@@ -11300,18 +11304,18 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11300
11304
|
res.end(JSON.stringify({ error: "API route not found", pathname: pathname2 }));
|
|
11301
11305
|
return;
|
|
11302
11306
|
}
|
|
11303
|
-
if (_optionalChain([req, 'access',
|
|
11307
|
+
if (_optionalChain([req, 'access', _573 => _573.url, 'optionalAccess', _574 => _574.startsWith, 'call', _575 => _575("/@")]) || _optionalChain([req, 'access', _576 => _576.url, 'optionalAccess', _577 => _577.startsWith, 'call', _578 => _578("/node_modules")])) {
|
|
11304
11308
|
return next();
|
|
11305
11309
|
}
|
|
11306
11310
|
if (shouldBypassFarmRouterForDottedPath(
|
|
11307
11311
|
requestPathname,
|
|
11308
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
11312
|
+
_optionalChain([farmApp, 'optionalAccess', _579 => _579.getRouteManager, 'call', _580 => _580()]),
|
|
11309
11313
|
[server.config.publicDir, server.config.root],
|
|
11310
11314
|
farmAgentGeneratedPaths(farmConfig)
|
|
11311
11315
|
)) {
|
|
11312
11316
|
return next();
|
|
11313
11317
|
}
|
|
11314
|
-
if (_optionalChain([req, 'access',
|
|
11318
|
+
if (_optionalChain([req, 'access', _581 => _581.url, 'optionalAccess', _582 => _582.startsWith, 'call', _583 => _583("/__farm/page-data")])) {
|
|
11315
11319
|
const urlObj = parsedRequestUrl;
|
|
11316
11320
|
const targetPath = urlObj.searchParams.get("path") || "/";
|
|
11317
11321
|
try {
|
|
@@ -11339,7 +11343,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11339
11343
|
});
|
|
11340
11344
|
let middlewareMap = /* @__PURE__ */ new Map();
|
|
11341
11345
|
let middlewareContext = /* @__PURE__ */ new Map();
|
|
11342
|
-
if (_optionalChain([middlewareManager, 'optionalAccess',
|
|
11346
|
+
if (_optionalChain([middlewareManager, 'optionalAccess', _584 => _584.hasMiddleware, 'call', _585 => _585()])) {
|
|
11343
11347
|
const targetNodeRequest = createPageDataMiddlewareRequest(req, targetRequestUrl);
|
|
11344
11348
|
const handled = await runFarmMiddlewareWithNavigation(
|
|
11345
11349
|
farmApp.getServerRenderer(),
|
|
@@ -11367,10 +11371,10 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11367
11371
|
if (pm) {
|
|
11368
11372
|
await pm.runHookParallel("afterRouteMatch", {
|
|
11369
11373
|
pathname: targetPath,
|
|
11370
|
-
matched: !!_optionalChain([match, 'optionalAccess',
|
|
11371
|
-
routePattern: _optionalChain([match, 'optionalAccess',
|
|
11372
|
-
params: _optionalChain([match, 'optionalAccess',
|
|
11373
|
-
layoutPatterns: (_optionalChain([match, 'optionalAccess',
|
|
11374
|
+
matched: !!_optionalChain([match, 'optionalAccess', _586 => _586.route]),
|
|
11375
|
+
routePattern: _optionalChain([match, 'optionalAccess', _587 => _587.route, 'optionalAccess', _588 => _588.pattern]) || null,
|
|
11376
|
+
params: _optionalChain([match, 'optionalAccess', _589 => _589.params]) || {},
|
|
11377
|
+
layoutPatterns: (_optionalChain([match, 'optionalAccess', _590 => _590.layouts]) || []).map((l) => l.pattern)
|
|
11374
11378
|
});
|
|
11375
11379
|
}
|
|
11376
11380
|
if (!match) {
|
|
@@ -11451,7 +11455,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11451
11455
|
}
|
|
11452
11456
|
mergedMetadata = _chunk3LUF2PE2cjs.addMetadataMarkdownAlternate.call(void 0,
|
|
11453
11457
|
mergedMetadata,
|
|
11454
|
-
|
|
11458
|
+
_chunk6CNX6Q3Kcjs.getFarmMarkdownAlternatePath.call(void 0, farmApp.getConfig().md, targetRequestUrl.pathname)
|
|
11455
11459
|
);
|
|
11456
11460
|
const routeSlots = await Promise.all(
|
|
11457
11461
|
slots.map(async (slot) => {
|
|
@@ -11521,7 +11525,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11521
11525
|
middlewareContext,
|
|
11522
11526
|
() => renderer.renderNavigationFragment({
|
|
11523
11527
|
PageComponent: routeModule.default,
|
|
11524
|
-
LoadingComponent: _optionalChain([loadingModule, 'optionalAccess',
|
|
11528
|
+
LoadingComponent: _optionalChain([loadingModule, 'optionalAccess', _591 => _591.default]),
|
|
11525
11529
|
pageProps: routeProps,
|
|
11526
11530
|
params,
|
|
11527
11531
|
layouts: layouts.map((layout, index) => ({
|
|
@@ -11627,14 +11631,14 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11627
11631
|
trustProxy: currentServerConfig.trustProxy
|
|
11628
11632
|
}).pathname;
|
|
11629
11633
|
const routeManager2 = farmApp.getRouteManager();
|
|
11630
|
-
const hasBeforeRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
11631
|
-
const hasAfterRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
11632
|
-
const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
11633
|
-
const hasBeforeRenderHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
11634
|
-
const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
11635
|
-
const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
11636
|
-
const hasRuntimeRequestHooks = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
11637
|
-
const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
11634
|
+
const hasBeforeRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _592 => _592.hasHook, 'call', _593 => _593("beforeRouteMatch")]), () => ( false));
|
|
11635
|
+
const hasAfterRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _594 => _594.hasHook, 'call', _595 => _595("afterRouteMatch")]), () => ( false));
|
|
11636
|
+
const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _596 => _596.hasHook, 'call', _597 => _597("beforeRequest")]), () => ( false));
|
|
11637
|
+
const hasBeforeRenderHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _598 => _598.hasHook, 'call', _599 => _599("beforeRender")]), () => ( false));
|
|
11638
|
+
const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _600 => _600.hasHook, 'call', _601 => _601("afterResponse")]), () => ( false));
|
|
11639
|
+
const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _602 => _602.hasHook, 'call', _603 => _603("transformHTML")]), () => ( false))) || (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _604 => _604.hasHook, 'call', _605 => _605("afterRender")]), () => ( false)));
|
|
11640
|
+
const hasRuntimeRequestHooks = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _606 => _606.hasRuntimeRequestHooks, 'call', _607 => _607()]), () => ( false));
|
|
11641
|
+
const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _608 => _608.hasRuntimeHook, 'call', _609 => _609("after")]), () => ( false));
|
|
11638
11642
|
const requestedMatch = routeManager2.matchRoute(requestedPathname);
|
|
11639
11643
|
let runtimeSession;
|
|
11640
11644
|
if (pm && hasRuntimeRequestHooks) {
|
|
@@ -11645,8 +11649,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11645
11649
|
kind: "page",
|
|
11646
11650
|
route: {
|
|
11647
11651
|
pathname: requestedPathname,
|
|
11648
|
-
pattern: _optionalChain([requestedMatch, 'optionalAccess',
|
|
11649
|
-
params: _optionalChain([requestedMatch, 'optionalAccess',
|
|
11652
|
+
pattern: _optionalChain([requestedMatch, 'optionalAccess', _610 => _610.route, 'optionalAccess', _611 => _611.pattern]) || null,
|
|
11653
|
+
params: _optionalChain([requestedMatch, 'optionalAccess', _612 => _612.params]) || {}
|
|
11650
11654
|
}
|
|
11651
11655
|
}
|
|
11652
11656
|
);
|
|
@@ -11679,17 +11683,17 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11679
11683
|
if (pm && hasAfterRouteMatchHook) {
|
|
11680
11684
|
await pm.runHookParallel("afterRouteMatch", {
|
|
11681
11685
|
pathname,
|
|
11682
|
-
matched: !!_optionalChain([routeMatch, 'optionalAccess',
|
|
11683
|
-
routePattern: _optionalChain([routeMatch, 'optionalAccess',
|
|
11684
|
-
params: _optionalChain([routeMatch, 'optionalAccess',
|
|
11685
|
-
layoutPatterns: (_optionalChain([routeMatch, 'optionalAccess',
|
|
11686
|
+
matched: !!_optionalChain([routeMatch, 'optionalAccess', _613 => _613.route]),
|
|
11687
|
+
routePattern: _optionalChain([routeMatch, 'optionalAccess', _614 => _614.route, 'optionalAccess', _615 => _615.pattern]) || null,
|
|
11688
|
+
params: _optionalChain([routeMatch, 'optionalAccess', _616 => _616.params]) || {},
|
|
11689
|
+
layoutPatterns: (_optionalChain([routeMatch, 'optionalAccess', _617 => _617.layouts]) || []).map((l) => l.pattern)
|
|
11686
11690
|
});
|
|
11687
11691
|
}
|
|
11688
11692
|
const renderPayload = {
|
|
11689
11693
|
pathname,
|
|
11690
11694
|
method,
|
|
11691
|
-
routePattern: _optionalChain([routeMatch, 'optionalAccess',
|
|
11692
|
-
params: _optionalChain([routeMatch, 'optionalAccess',
|
|
11695
|
+
routePattern: _optionalChain([routeMatch, 'optionalAccess', _618 => _618.route, 'optionalAccess', _619 => _619.pattern]) || null,
|
|
11696
|
+
params: _optionalChain([routeMatch, 'optionalAccess', _620 => _620.params]) || {}
|
|
11693
11697
|
};
|
|
11694
11698
|
const shouldInterceptResponse = Boolean(
|
|
11695
11699
|
pm && (hasAfterResponseHook || hasHTMLTransformHook || runtimeSession && hasRuntimeAfterHook)
|
|
@@ -11711,7 +11715,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11711
11715
|
emitError: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (error) => emitPluginError("response-end", error, { pathname }), "emitError")
|
|
11712
11716
|
}) : void 0;
|
|
11713
11717
|
try {
|
|
11714
|
-
if (_optionalChain([middlewareManager, 'optionalAccess',
|
|
11718
|
+
if (_optionalChain([middlewareManager, 'optionalAccess', _621 => _621.hasMiddleware, 'call', _622 => _622()])) {
|
|
11715
11719
|
const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
|
|
11716
11720
|
const handled = await runFarmMiddlewareWithNavigation(
|
|
11717
11721
|
farmApp.getServerRenderer(),
|
|
@@ -11721,7 +11725,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11721
11725
|
() => middlewareManager.execute(req, res)
|
|
11722
11726
|
);
|
|
11723
11727
|
if (handled) {
|
|
11724
|
-
if (!_optionalChain([responseInterceptor, 'optionalAccess',
|
|
11728
|
+
if (!_optionalChain([responseInterceptor, 'optionalAccess', _623 => _623.isEnded, 'call', _624 => _624()])) {
|
|
11725
11729
|
const duration = Date.now() - startTime;
|
|
11726
11730
|
logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
|
|
11727
11731
|
}
|
|
@@ -11733,7 +11737,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11733
11737
|
req.url || "/",
|
|
11734
11738
|
`http://${req.headers.host || "localhost:3000"}`
|
|
11735
11739
|
).pathname;
|
|
11736
|
-
const hasLocalPageRoute = Boolean(_optionalChain([routeManager2, 'access',
|
|
11740
|
+
const hasLocalPageRoute = Boolean(_optionalChain([routeManager2, 'access', _625 => _625.matchRoute, 'call', _626 => _626(currentPathname), 'optionalAccess', _627 => _627.route]));
|
|
11737
11741
|
await pm.runHookParallelFiltered(
|
|
11738
11742
|
"beforeRequest",
|
|
11739
11743
|
(plugin) => !hasLocalPageRoute || plugin.name !== _chunkYZTASLPQcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME,
|
|
@@ -11741,8 +11745,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11741
11745
|
res
|
|
11742
11746
|
);
|
|
11743
11747
|
}
|
|
11744
|
-
if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess',
|
|
11745
|
-
if (!_optionalChain([responseInterceptor, 'optionalAccess',
|
|
11748
|
+
if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess', _628 => _628.isEnded, 'call', _629 => _629()])) {
|
|
11749
|
+
if (!_optionalChain([responseInterceptor, 'optionalAccess', _630 => _630.isEnded, 'call', _631 => _631()])) {
|
|
11746
11750
|
const duration = Date.now() - startTime;
|
|
11747
11751
|
logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
|
|
11748
11752
|
}
|
|
@@ -11800,36 +11804,36 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11800
11804
|
if (imageModule) return imageModule;
|
|
11801
11805
|
}
|
|
11802
11806
|
if (_chunk6V4TDWECcjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
|
|
11803
|
-
const renderer = _optionalChain([farmApp, 'optionalAccess',
|
|
11804
|
-
return generateProgrammaticRouteModule(id, _optionalChain([server, 'optionalAccess',
|
|
11807
|
+
const renderer = _optionalChain([farmApp, 'optionalAccess', _632 => _632.getConfig, 'call', _633 => _633(), 'access', _634 => _634.renderer]) || _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, options.renderer);
|
|
11808
|
+
return generateProgrammaticRouteModule(id, _optionalChain([server, 'optionalAccess', _635 => _635.config, 'access', _636 => _636.root]) || options.root, renderer);
|
|
11805
11809
|
}
|
|
11806
11810
|
if (isFarmClientVirtualId(id)) {
|
|
11807
|
-
const resolvedConfig = _optionalChain([farmApp, 'optionalAccess',
|
|
11808
|
-
const renderer = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
11809
|
-
const integrations = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
11810
|
-
const root = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
11811
|
-
const docs = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
11811
|
+
const resolvedConfig = _optionalChain([farmApp, 'optionalAccess', _637 => _637.getConfig, 'call', _638 => _638()]);
|
|
11812
|
+
const renderer = _optionalChain([resolvedConfig, 'optionalAccess', _639 => _639.renderer]) || _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, options.renderer);
|
|
11813
|
+
const integrations = _optionalChain([resolvedConfig, 'optionalAccess', _640 => _640.integrations]) || options.integrations;
|
|
11814
|
+
const root = _optionalChain([resolvedConfig, 'optionalAccess', _641 => _641.root]) || _optionalChain([server, 'optionalAccess', _642 => _642.config, 'access', _643 => _643.root]) || process.cwd();
|
|
11815
|
+
const docs = _optionalChain([resolvedConfig, 'optionalAccess', _644 => _644.docs]);
|
|
11812
11816
|
const adapterOwnsDocsRuntime = Boolean(
|
|
11813
|
-
_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess',
|
|
11817
|
+
_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess', _645 => _645.adapter, 'optionalAccess', _646 => _646.server]) && docs.adapter.react
|
|
11814
11818
|
);
|
|
11815
|
-
const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
11819
|
+
const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _647 => _647.devtools]), () => ( _chunkYJRZR7VUcjs.resolveFarmDevtoolsConfig.call(void 0, false, "production")));
|
|
11816
11820
|
const [docsRuntime, docsSearchRuntime, devtoolsClientRuntime] = await Promise.all([
|
|
11817
|
-
_optionalChain([docs, 'optionalAccess',
|
|
11818
|
-
_optionalChain([docs, 'optionalAccess',
|
|
11821
|
+
_optionalChain([docs, 'optionalAccess', _648 => _648.enabled]) ? loadFarmDocsDevRuntime() : null,
|
|
11822
|
+
_optionalChain([docs, 'optionalAccess', _649 => _649.enabled]) && !adapterOwnsDocsRuntime ? loadFarmDocsSearchDevRuntime() : null,
|
|
11819
11823
|
devtools.enabled ? loadFarmDevtoolsClientRuntime() : null
|
|
11820
11824
|
]);
|
|
11821
|
-
const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess',
|
|
11825
|
+
const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess', _650 => _650.isFarmDocsSearchEnabled, 'call', _651 => _651(docs)]), () => ( false));
|
|
11822
11826
|
const generatedDocsSearchRuntime = docsSearchRuntime ? docsSearchRuntime.generateFarmDocsSearchClientRuntime(
|
|
11823
11827
|
docsSearchEnabled,
|
|
11824
11828
|
docsSearchEnabled ? docsSearchRuntime.resolveFarmDocsSearchClientModule(root) : void 0
|
|
11825
11829
|
) : EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME;
|
|
11826
11830
|
const generatedDevtoolsClientRuntime = devtoolsClientRuntime ? devtoolsClientRuntime.generateFarmDevtoolsClientRuntime(devtools) : "";
|
|
11827
|
-
const generatedDevIndicatorsClientRuntime = farmApp ?
|
|
11831
|
+
const generatedDevIndicatorsClientRuntime = farmApp ? _chunk6MVFL3R5cjs.generateFarmDevIndicatorsClientRuntime.call(void 0, farmApp.getConfig().devIndicators) : "";
|
|
11828
11832
|
const integrationProviders = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _chunkZ5HIWVDPcjs.getIntegrationProviders.call(void 0, integrations) : [];
|
|
11829
11833
|
const isolatedHydrationMode = resolveFarmIsolatedClientHydrationMode(
|
|
11830
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
11834
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _652 => _652.experimental, 'optionalAccess', _653 => _653.isolatedClientHydration]),
|
|
11831
11835
|
{
|
|
11832
|
-
serverComponents: _optionalChain([resolvedConfig, 'optionalAccess',
|
|
11836
|
+
serverComponents: _optionalChain([resolvedConfig, 'optionalAccess', _654 => _654.experimental, 'optionalAccess', _655 => _655.serverComponents]) === true,
|
|
11833
11837
|
hasUnsupportedIntegrationProvider: integrationProviders.filter((provider) => provider.component || provider.type === "clerk").some((provider) => provider.supportsIsolatedHydration !== true)
|
|
11834
11838
|
}
|
|
11835
11839
|
);
|
|
@@ -11837,22 +11841,22 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11837
11841
|
integrationProviders,
|
|
11838
11842
|
[
|
|
11839
11843
|
..._chunkZ5HIWVDPcjs.getIntegrationDocumentNavigationMatchers.call(void 0, integrations),
|
|
11840
|
-
..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess',
|
|
11844
|
+
..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess', _656 => _656.getFarmDocsDocumentNavigationMatchers, 'call', _657 => _657(docs)]), () => ( []))
|
|
11841
11845
|
],
|
|
11842
11846
|
generatedDocsSearchRuntime,
|
|
11843
11847
|
`${generatedDevtoolsClientRuntime}
|
|
11844
11848
|
${generatedDevIndicatorsClientRuntime}`,
|
|
11845
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
11849
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _658 => _658.plugins]) || [],
|
|
11846
11850
|
root,
|
|
11847
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
11848
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
11849
|
-
_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess',
|
|
11851
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _659 => _659.srcDir]) || options.srcDir || "src",
|
|
11852
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _660 => _660.publicRuntimeConfig]) || options.publicRuntimeConfig,
|
|
11853
|
+
_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess', _661 => _661.adapter, 'optionalAccess', _662 => _662.react]) : void 0,
|
|
11850
11854
|
renderer,
|
|
11851
|
-
isolatedHydrationMode === "enabled" || _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
11852
|
-
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
11853
|
-
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
11855
|
+
isolatedHydrationMode === "enabled" || _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _663 => _663.getRouteManager, 'call', _664 => _664(), 'access', _665 => _665.getIsolatedClientBoundaryModules, 'call', _666 => _666(root)])))), 'optionalAccess', _667 => _667.size]) > 0,
|
|
11856
|
+
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _668 => _668.trailingSlash]), () => ( false)),
|
|
11857
|
+
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _669 => _669.basePath]), () => ( "/")),
|
|
11854
11858
|
generateClientCachePersistenceCode(
|
|
11855
|
-
resolveFarmClientCacheAdapterEntry(root, _optionalChain([resolvedConfig, 'optionalAccess',
|
|
11859
|
+
resolveFarmClientCacheAdapterEntry(root, _optionalChain([resolvedConfig, 'optionalAccess', _670 => _670.cache]))
|
|
11856
11860
|
),
|
|
11857
11861
|
_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _chunk75WGQVQAcjs.getFarmDocsAdapterConfigModule.call(void 0, docs) : void 0
|
|
11858
11862
|
);
|
|
@@ -11861,7 +11865,7 @@ ${generatedDevIndicatorsClientRuntime}`,
|
|
|
11861
11865
|
return generateServerCode();
|
|
11862
11866
|
}
|
|
11863
11867
|
if (id === "/@farm/manifest") {
|
|
11864
|
-
const routeManager = _optionalChain([farmApp, 'optionalAccess',
|
|
11868
|
+
const routeManager = _optionalChain([farmApp, 'optionalAccess', _671 => _671.getRouteManager, 'call', _672 => _672()]);
|
|
11865
11869
|
if (!routeManager) {
|
|
11866
11870
|
return `
|
|
11867
11871
|
export const getManifest = () => ({
|
|
@@ -11876,7 +11880,7 @@ export const getManifest = () => ({
|
|
|
11876
11880
|
const manifest = routeManager.generateClientManifest(server.config.root);
|
|
11877
11881
|
const globalStylesheetHref = resolveDevGlobalStylesheetHref(
|
|
11878
11882
|
server.config.root,
|
|
11879
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
11883
|
+
_optionalChain([farmApp, 'optionalAccess', _673 => _673.getConfig, 'call', _674 => _674(), 'access', _675 => _675.srcDir])
|
|
11880
11884
|
);
|
|
11881
11885
|
const fullManifest = {
|
|
11882
11886
|
clientEntry: "/@farm/client.js",
|
|
@@ -11927,17 +11931,17 @@ export const manifest = getManifest();
|
|
|
11927
11931
|
}
|
|
11928
11932
|
},
|
|
11929
11933
|
async transform(code, id, transformOptions) {
|
|
11930
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
11931
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
11932
|
-
if (_optionalChain([currentConfig, 'access',
|
|
11934
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _676 => _676.ssr])) {
|
|
11935
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _677 => _677.getConfig, 'call', _678 => _678()]), () => ( options));
|
|
11936
|
+
if (_optionalChain([currentConfig, 'access', _679 => _679.experimental, 'optionalAccess', _680 => _680.serverActions]) !== true || !serverFnTransformActive) {
|
|
11933
11937
|
const violation = findClientServerFnViolation(code, id);
|
|
11934
11938
|
if (violation) {
|
|
11935
11939
|
this.error(formatServerFnBoundaryError(violation, id));
|
|
11936
11940
|
}
|
|
11937
11941
|
}
|
|
11938
11942
|
}
|
|
11939
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
11940
|
-
warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
11943
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _681 => _681.ssr]) && shouldInspectClientBoundary(id, code)) {
|
|
11944
|
+
warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _682 => _682.getConfig, 'call', _683 => _683()]), () => ( options)));
|
|
11941
11945
|
}
|
|
11942
11946
|
if (typeof imageImports.transform === "function") {
|
|
11943
11947
|
const imageModule = await imageImports.transform.call(this, code, id, transformOptions);
|
|
@@ -11952,13 +11956,13 @@ export const manifest = getManifest();
|
|
|
11952
11956
|
id,
|
|
11953
11957
|
transformOptions
|
|
11954
11958
|
);
|
|
11955
|
-
const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess',
|
|
11959
|
+
const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess', _684 => _684.code, 'optionalAccess', _685 => _685.toString, 'call', _686 => _686()]);
|
|
11956
11960
|
if (fontCode) {
|
|
11957
11961
|
transformedCode = fontCode;
|
|
11958
11962
|
transformed = true;
|
|
11959
11963
|
}
|
|
11960
11964
|
}
|
|
11961
|
-
if (_optionalChain([transformOptions, 'optionalAccess',
|
|
11965
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _687 => _687.ssr]) && server) {
|
|
11962
11966
|
const rewrittenImports = rewriteEarlySsrRelativeImports({
|
|
11963
11967
|
code: transformedCode,
|
|
11964
11968
|
id,
|
|
@@ -11978,12 +11982,12 @@ export const manifest = getManifest();
|
|
|
11978
11982
|
}
|
|
11979
11983
|
transformedCode = stripUseClientDirective(transformedCode);
|
|
11980
11984
|
transformed = true;
|
|
11981
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
11985
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _688 => _688.getConfig, 'call', _689 => _689()]), () => ( options));
|
|
11982
11986
|
let isolatedModuleReference = null;
|
|
11983
|
-
const root = currentConfig.root || _optionalChain([server, 'optionalAccess',
|
|
11987
|
+
const root = currentConfig.root || _optionalChain([server, 'optionalAccess', _690 => _690.config, 'access', _691 => _691.root]) || process.cwd();
|
|
11984
11988
|
const cleanId = id.split("?", 1)[0];
|
|
11985
|
-
const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
11986
|
-
const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess',
|
|
11989
|
+
const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _692 => _692.getRouteManager, 'call', _693 => _693(), 'access', _694 => _694.getIsolatedClientBoundaryModules, 'call', _695 => _695(root)])));
|
|
11990
|
+
const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess', _696 => _696.has, 'call', _697 => _697(path17.resolve(cleanId))]) === true;
|
|
11987
11991
|
if (_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration && isIsolatableClientBoundarySource(clientBoundarySource)) {
|
|
11988
11992
|
isolatedModuleReference = _chunk5QIKR7RRcjs.toViteModuleId.call(void 0, cleanId, root);
|
|
11989
11993
|
const transformedBoundary = transformIsolatedClientBoundaryModule({
|
|
@@ -12020,7 +12024,7 @@ export const manifest = getManifest();
|
|
|
12020
12024
|
);
|
|
12021
12025
|
return;
|
|
12022
12026
|
}` : "";
|
|
12023
|
-
const hmrCode = _optionalChain([transformOptions, 'optionalAccess',
|
|
12027
|
+
const hmrCode = _optionalChain([transformOptions, 'optionalAccess', _698 => _698.ssr]) || !shouldEmitFarmClientRootHmr(currentConfig.renderer) ? "" : `
|
|
12024
12028
|
if (import.meta.hot) {
|
|
12025
12029
|
import.meta.hot.accept((newModule) => {
|
|
12026
12030
|
${isolatedHmrUpdate}
|
|
@@ -12074,14 +12078,14 @@ if (import.meta.hot) {
|
|
|
12074
12078
|
}
|
|
12075
12079
|
_chunk5QIKR7RRcjs.logger.info(`Found ${ssgPages.length} SSG pages, ${ssrRoutes.length} SSR routes`);
|
|
12076
12080
|
_chunk5QIKR7RRcjs.logger.info("Pre-rendering SSG pages...");
|
|
12077
|
-
const outDir = path17.join(_optionalChain([server, 'optionalAccess',
|
|
12081
|
+
const outDir = path17.join(_optionalChain([server, 'optionalAccess', _699 => _699.config, 'access', _700 => _700.root]) || process.cwd(), options.outDir || "dist");
|
|
12078
12082
|
const clientDir = path17.join(outDir, "client");
|
|
12079
12083
|
for (const page of ssgPages) {
|
|
12080
12084
|
try {
|
|
12081
12085
|
const staticRequest = new Request(new URL(page.urlPath, "http://farm.static"));
|
|
12082
12086
|
await farmApp.getServerRenderer().runWithRequestContext(staticRequest, async () => {
|
|
12083
12087
|
const mod = await routeManager.loadRouteModule(page.filePath);
|
|
12084
|
-
if (!_optionalChain([mod, 'optionalAccess',
|
|
12088
|
+
if (!_optionalChain([mod, 'optionalAccess', _701 => _701.default])) return;
|
|
12085
12089
|
const { layouts } = routeManager.matchRoute(page.urlPath);
|
|
12086
12090
|
const layoutModules = await Promise.all(
|
|
12087
12091
|
layouts.map((l) => routeManager.loadLayoutModule(l.modulePath))
|
|
@@ -12113,7 +12117,7 @@ if (import.meta.hot) {
|
|
|
12113
12117
|
const i18nSnapshot = _chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
12114
12118
|
const i18nHead = renderFarmI18nStaticHead(page.urlPath, i18nSnapshot);
|
|
12115
12119
|
const fullHtml = `<!DOCTYPE html>
|
|
12116
|
-
<html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
12120
|
+
<html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess', _702 => _702.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}>
|
|
12117
12121
|
<head>
|
|
12118
12122
|
<meta charset="utf-8">
|
|
12119
12123
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
@@ -12171,13 +12175,13 @@ if (import.meta.hot) {
|
|
|
12171
12175
|
});
|
|
12172
12176
|
}
|
|
12173
12177
|
}
|
|
12174
|
-
const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess',
|
|
12178
|
+
const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess', _703 => _703.getConfig, 'call', _704 => _704()]);
|
|
12175
12179
|
const normalizedFile = file.replace(/\\/g, "/");
|
|
12176
12180
|
if (currentFarmConfig && /\/route\.(?:ts|tsx|js|jsx)$/.test(normalizedFile) && _chunkVPTDD5XFcjs.getFarmAppDirectories.call(void 0, currentFarmConfig).some(
|
|
12177
12181
|
(appDir) => normalizedFile.startsWith(`${_chunk5QIKR7RRcjs.toPosixPath.call(void 0, appDir)}/api/`)
|
|
12178
12182
|
)) {
|
|
12179
12183
|
for (const mod of modules) server2.moduleGraph.invalidateModule(mod);
|
|
12180
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
12184
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _705 => _705(`updated ${file}`)]);
|
|
12181
12185
|
server2.ws.send({ type: "full-reload", path: "*" });
|
|
12182
12186
|
return [];
|
|
12183
12187
|
}
|
|
@@ -12187,7 +12191,7 @@ if (import.meta.hot) {
|
|
|
12187
12191
|
for (const mod of modules) {
|
|
12188
12192
|
server2.moduleGraph.invalidateModule(mod);
|
|
12189
12193
|
}
|
|
12190
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
12194
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _706 => _706(`updated ${file}`)]);
|
|
12191
12195
|
server2.ws.send({
|
|
12192
12196
|
type: "full-reload",
|
|
12193
12197
|
path: "*"
|
|
@@ -12200,17 +12204,17 @@ if (import.meta.hot) {
|
|
|
12200
12204
|
for (const mod of modules) {
|
|
12201
12205
|
server2.moduleGraph.invalidateModule(mod);
|
|
12202
12206
|
}
|
|
12203
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
12207
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _707 => _707(`updated ${file}`)]);
|
|
12204
12208
|
server2.ws.send({
|
|
12205
12209
|
type: "full-reload",
|
|
12206
12210
|
path: "*"
|
|
12207
12211
|
});
|
|
12208
12212
|
return [];
|
|
12209
12213
|
}
|
|
12210
|
-
const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess',
|
|
12211
|
-
const planRouteManager = _optionalChain([farmApp, 'optionalAccess',
|
|
12214
|
+
const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess', _708 => _708.experimental, 'optionalAccess', _709 => _709.isolatedClientHydration]);
|
|
12215
|
+
const planRouteManager = _optionalChain([farmApp, 'optionalAccess', _710 => _710.getRouteManager, 'call', _711 => _711()]);
|
|
12212
12216
|
const isHydrationPlanSource = currentSrcRoot !== null && normalizedFile.startsWith(`${currentSrcRoot}/`) && /\.[cm]?[jt]sx?$/.test(normalizedFile);
|
|
12213
|
-
const tracksAsyncOwnerIslands = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess',
|
|
12217
|
+
const tracksAsyncOwnerIslands = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _712 => _712.renderer])) && planRouteManager !== void 0;
|
|
12214
12218
|
if (isHydrationPlanSource && (isolatedHydrationMode === "enabled" || isolatedHydrationMode === "analyze" || tracksAsyncOwnerIslands)) {
|
|
12215
12219
|
const routeManager = planRouteManager;
|
|
12216
12220
|
if (routeManager) {
|
|
@@ -12270,7 +12274,7 @@ if (import.meta.hot) {
|
|
|
12270
12274
|
}
|
|
12271
12275
|
return [];
|
|
12272
12276
|
}
|
|
12273
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
12277
|
+
_optionalChain([farmApp, 'optionalAccess', _713 => _713.getRouteManager, 'call', _714 => _714(), 'access', _715 => _715.invalidateClientManifest, 'call', _716 => _716()]);
|
|
12274
12278
|
const manifestModule = server2.moduleGraph.getModuleById("/@farm/manifest");
|
|
12275
12279
|
if (manifestModule) {
|
|
12276
12280
|
server2.moduleGraph.invalidateModule(manifestModule);
|
|
@@ -12639,12 +12643,12 @@ async function parseRouteModuleProps2(routeModule, input) {
|
|
|
12639
12643
|
}
|
|
12640
12644
|
const schemas = routeModule.__farmRouteSchemas;
|
|
12641
12645
|
const params = parseRouteModuleSchema2(
|
|
12642
|
-
_optionalChain([schemas, 'optionalAccess',
|
|
12646
|
+
_optionalChain([schemas, 'optionalAccess', _717 => _717.params]),
|
|
12643
12647
|
input.props.params,
|
|
12644
12648
|
"params",
|
|
12645
12649
|
input.routePath
|
|
12646
12650
|
);
|
|
12647
|
-
const search = parseRouteModuleSchema2(_optionalChain([schemas, 'optionalAccess',
|
|
12651
|
+
const search = parseRouteModuleSchema2(_optionalChain([schemas, 'optionalAccess', _718 => _718.search]), input.search, "search", input.routePath);
|
|
12648
12652
|
return {
|
|
12649
12653
|
...input.props,
|
|
12650
12654
|
params,
|
|
@@ -14240,7 +14244,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, generateClientManifest, "generateClientMan
|
|
|
14240
14244
|
async function defineConfig(config = {}) {
|
|
14241
14245
|
const tailwindVitePlugin = await loadTailwindVitePlugin();
|
|
14242
14246
|
const appRoot = path17.resolve(config.root || process.cwd());
|
|
14243
|
-
if (_optionalChain([config, 'access',
|
|
14247
|
+
if (_optionalChain([config, 'access', _719 => _719.extends, 'optionalAccess', _720 => _720.length])) {
|
|
14244
14248
|
const { config: layeredConfig } = await import("./layers-4PNE2HOY.cjs").then(
|
|
14245
14249
|
({ resolveFarmLayers }) => resolveFarmLayers(config, {
|
|
14246
14250
|
root: appRoot,
|
|
@@ -14341,13 +14345,13 @@ async function defineConfig(config = {}) {
|
|
|
14341
14345
|
if (!serverStarted) {
|
|
14342
14346
|
serverStarted = true;
|
|
14343
14347
|
const elapsed = Date.now() - startTime;
|
|
14344
|
-
const address = _optionalChain([server, 'access',
|
|
14348
|
+
const address = _optionalChain([server, 'access', _721 => _721.httpServer, 'optionalAccess', _722 => _722.address, 'call', _723 => _723()]);
|
|
14345
14349
|
const resolvedPort = typeof address === "object" && address ? address.port : server.config.server.port || port || 3e3;
|
|
14346
14350
|
const hostConfig = server.config.server.host;
|
|
14347
14351
|
const isExposed = hostConfig === true || hostConfig === "0.0.0.0";
|
|
14348
14352
|
console.log("");
|
|
14349
14353
|
console.log(
|
|
14350
|
-
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${
|
|
14354
|
+
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${_chunkX5TXZFMNcjs.FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
|
|
14351
14355
|
);
|
|
14352
14356
|
console.log("");
|
|
14353
14357
|
console.log(
|