@farm.js/core 0.1.29 → 0.1.31
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/app-markdown.cjs +4 -4
- package/dist/app-markdown.mjs +3 -3
- package/dist/{chunk-Q5JFU33Q.cjs → chunk-2FXWWUE5.cjs} +4 -4
- package/dist/{chunk-6G3ZZ2IE.mjs → chunk-5LJCOSKT.mjs} +1 -1
- package/dist/{chunk-ZYVFAOBT.mjs → chunk-6L6DQR5W.mjs} +7 -7
- package/dist/{chunk-YMUE7L3D.mjs → chunk-6VYZOPOT.mjs} +1 -1
- package/dist/{chunk-BZ3CHOFX.mjs → chunk-7QOCTYBS.mjs} +1 -1
- package/dist/{chunk-PQD2AI3B.mjs → chunk-AHAJGAYD.mjs} +1 -1
- package/dist/{chunk-XLTV4VOG.cjs → chunk-CUMINO7Z.cjs} +4 -4
- package/dist/{chunk-JFHKNFEO.cjs → chunk-DFLLARUK.cjs} +10 -10
- package/dist/{chunk-7CXKSRKL.mjs → chunk-FJZ3DQLK.mjs} +2 -2
- package/dist/{chunk-BZAGKCKB.cjs → chunk-FYRBX5IY.cjs} +2 -2
- package/dist/{chunk-74T3CEA7.cjs → chunk-IFI5FXEZ.cjs} +127 -74
- package/dist/{chunk-X4ZV4QC5.cjs → chunk-IMB4PIAR.cjs} +72 -72
- package/dist/{chunk-ATXI6LGT.mjs → chunk-JBC2FKRW.mjs} +6 -3
- package/dist/{chunk-6CNX6Q3K.cjs → chunk-KJ2TIHZZ.cjs} +6 -3
- package/dist/{chunk-ZDILFMWN.cjs → chunk-MXDTKXO6.cjs} +13 -13
- package/dist/{chunk-D234YWNA.mjs → chunk-TEN4FIZU.mjs} +1 -1
- package/dist/{chunk-2UABTL3Y.mjs → chunk-UAFSBWNT.mjs} +2 -2
- package/dist/{chunk-E7UN576T.mjs → chunk-VA62MHFV.mjs} +1 -1
- package/dist/{chunk-WPPX4G7Q.cjs → chunk-VYZSOYR4.cjs} +1 -1
- package/dist/{chunk-5KDPVSS3.mjs → chunk-WG2KHOMN.mjs} +63 -10
- package/dist/{chunk-NXG66MR7.cjs → chunk-X7KZBF63.cjs} +3 -3
- package/dist/{chunk-NPPL5YDT.cjs → chunk-YVGAEAA5.cjs} +2 -2
- package/dist/{devtools-THVNPI2M.mjs → devtools-BPBCYOU6.mjs} +3 -3
- package/dist/{devtools-GGVPZHJX.cjs → devtools-EWRDHCD5.cjs} +4 -4
- package/dist/docs.cjs +6 -6
- package/dist/docs.mjs +5 -5
- package/dist/index.cjs +12 -12
- package/dist/index.mjs +11 -11
- package/dist/internal/app-markdown-runtime.cjs +3 -3
- package/dist/internal/app-markdown-runtime.mjs +2 -2
- package/dist/internal/build-runtime.cjs +12 -12
- package/dist/internal/build-runtime.mjs +11 -11
- package/dist/internal/cli-runtime.cjs +5 -5
- package/dist/internal/cli-runtime.mjs +4 -4
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/config-runtime.cjs +4 -4
- package/dist/internal/config-runtime.mjs +3 -3
- package/dist/internal/product-telemetry-runtime.cjs +2 -2
- package/dist/internal/product-telemetry-runtime.mjs +1 -1
- package/dist/internal/production-runtime.cjs +4 -4
- package/dist/internal/production-runtime.mjs +3 -3
- package/dist/markdown.cjs +2 -2
- package/dist/markdown.mjs +1 -1
- package/dist/plugin.cjs +8 -8
- package/dist/plugin.mjs +7 -7
- package/dist/server.cjs +25 -25
- package/dist/server.mjs +8 -8
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +8 -8
- package/dist/vite.mjs +7 -7
- package/package.json +1 -1
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunk2FXWWUE5cjs = require('./chunk-2FXWWUE5.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
var _chunkIK6LVLKCcjs = require('./chunk-IK6LVLKC.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkDFLLARUKcjs = require('./chunk-DFLLARUK.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
var _chunk75WGQVQAcjs = require('./chunk-75WGQVQA.cjs');
|
|
@@ -39,7 +39,7 @@ function createFarmDocsAdapterRuntimeConfig(docs, options, moduleConfig) {
|
|
|
39
39
|
...moduleConfig ? { ...moduleConfig, ...docs.configOverrides } : _nullishCoalesce(docs.runtimeConfig, () => ( docs.config)),
|
|
40
40
|
entry: docs.config.entry || docs.entry.replace(/^\/+|\/+$/g, "") || "docs",
|
|
41
41
|
docsPath: docs.entry,
|
|
42
|
-
contentDir:
|
|
42
|
+
contentDir: _chunk2FXWWUE5cjs.resolveFarmDocsContentDir.call(void 0, docs, options)
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
_chunkS3JO3N4Hcjs.__name.call(void 0, createFarmDocsAdapterRuntimeConfig, "createFarmDocsAdapterRuntimeConfig");
|
|
@@ -274,25 +274,25 @@ function getDocsDescription(docs) {
|
|
|
274
274
|
}
|
|
275
275
|
_chunkS3JO3N4Hcjs.__name.call(void 0, getDocsDescription, "getDocsDescription");
|
|
276
276
|
function getLoadedDocsPages(context) {
|
|
277
|
-
return
|
|
277
|
+
return _chunk2FXWWUE5cjs.discoverFarmDocsPages.call(void 0, context.contentDir, context.docs).map((page) => _chunk2FXWWUE5cjs.loadFarmDocsPage.call(void 0, context.contentDir, context.docs, page.slug)).filter((page) => Boolean(page));
|
|
278
278
|
}
|
|
279
279
|
_chunkS3JO3N4Hcjs.__name.call(void 0, getLoadedDocsPages, "getLoadedDocsPages");
|
|
280
280
|
function toDocsSourcePage(page) {
|
|
281
281
|
return {
|
|
282
|
-
...
|
|
282
|
+
..._chunk2FXWWUE5cjs.toFarmDocsMarkdownPage.call(void 0, page),
|
|
283
283
|
sourcePath: page.sourcePath
|
|
284
284
|
};
|
|
285
285
|
}
|
|
286
286
|
_chunkS3JO3N4Hcjs.__name.call(void 0, toDocsSourcePage, "toDocsSourcePage");
|
|
287
287
|
function toDocsSitemapPage(page) {
|
|
288
288
|
return {
|
|
289
|
-
...
|
|
289
|
+
..._chunk2FXWWUE5cjs.toFarmDocsMarkdownPage.call(void 0, page),
|
|
290
290
|
sourcePath: page.sourcePath
|
|
291
291
|
};
|
|
292
292
|
}
|
|
293
293
|
_chunkS3JO3N4Hcjs.__name.call(void 0, toDocsSitemapPage, "toDocsSitemapPage");
|
|
294
294
|
function toDocsLlmsPage(page) {
|
|
295
|
-
return
|
|
295
|
+
return _chunk2FXWWUE5cjs.toFarmDocsMarkdownPage.call(void 0, page);
|
|
296
296
|
}
|
|
297
297
|
_chunkS3JO3N4Hcjs.__name.call(void 0, toDocsLlmsPage, "toDocsLlmsPage");
|
|
298
298
|
function getDocsLlmsOptions(context, request) {
|
|
@@ -386,7 +386,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, renderAgentsDocument, "renderAgentsDocumen
|
|
|
386
386
|
function buildAgentSpec(context, request) {
|
|
387
387
|
const url = new URL(request.url);
|
|
388
388
|
const origin = url.origin;
|
|
389
|
-
const pages =
|
|
389
|
+
const pages = _chunk2FXWWUE5cjs.discoverFarmDocsPages.call(void 0, context.contentDir, context.docs);
|
|
390
390
|
const spec = _chunkIK6LVLKCcjs.docsEngine.call(void 0, ).buildDocsAgentDiscoverySpec(getDocsDiscoveryOptions(context, request));
|
|
391
391
|
const title = getDocsTitle(context.docs);
|
|
392
392
|
return {
|
|
@@ -428,7 +428,7 @@ function buildAgentSpec(context, request) {
|
|
|
428
428
|
}
|
|
429
429
|
_chunkS3JO3N4Hcjs.__name.call(void 0, buildAgentSpec, "buildAgentSpec");
|
|
430
430
|
function buildDiagnostics(context) {
|
|
431
|
-
const pages =
|
|
431
|
+
const pages = _chunk2FXWWUE5cjs.discoverFarmDocsPages.call(void 0, context.contentDir, context.docs);
|
|
432
432
|
const diagnostics = _chunkIK6LVLKCcjs.docsEngine.call(void 0, ).buildDocsDiagnostics(context.docs.config, {
|
|
433
433
|
entry: context.docs.entry,
|
|
434
434
|
mcp: {
|
|
@@ -500,12 +500,12 @@ async function resolveAPIContext(options) {
|
|
|
500
500
|
config: options.config,
|
|
501
501
|
configPath: options.configPath
|
|
502
502
|
}));
|
|
503
|
-
const docs = isResolvedDocsConfig(docsInput) ? docsInput : await
|
|
503
|
+
const docs = isResolvedDocsConfig(docsInput) ? docsInput : await _chunkDFLLARUKcjs.resolveDocsConfig.call(void 0, docsInput, { root, srcDir });
|
|
504
504
|
return {
|
|
505
505
|
root,
|
|
506
506
|
srcDir,
|
|
507
507
|
docs,
|
|
508
|
-
contentDir:
|
|
508
|
+
contentDir: _chunk2FXWWUE5cjs.resolveFarmDocsContentDir.call(void 0, docs, { root, srcDir })
|
|
509
509
|
};
|
|
510
510
|
}
|
|
511
511
|
_chunkS3JO3N4Hcjs.__name.call(void 0, resolveAPIContext, "resolveAPIContext");
|
|
@@ -568,10 +568,10 @@ async function handleDocsAPIGet(request, context) {
|
|
|
568
568
|
if (format === "markdown" || url.pathname.endsWith(".md")) {
|
|
569
569
|
const pathParam = url.searchParams.get("path") || url.searchParams.get("slug");
|
|
570
570
|
const slug = normalizeDocsApiSlug(_nullishCoalesce(_nullishCoalesce(pathParam, () => ( pathTarget.slug)), () => ( "")), context.docs);
|
|
571
|
-
const page =
|
|
571
|
+
const page = _chunk2FXWWUE5cjs.loadFarmDocsPage.call(void 0, context.contentDir, context.docs, slug);
|
|
572
572
|
if (!page) return text("Docs page not found\n", "text/plain; charset=utf-8", { status: 404 });
|
|
573
573
|
return text(
|
|
574
|
-
_chunkIK6LVLKCcjs.docsEngine.call(void 0, ).renderDocsMarkdownDocument(
|
|
574
|
+
_chunkIK6LVLKCcjs.docsEngine.call(void 0, ).renderDocsMarkdownDocument(_chunk2FXWWUE5cjs.toFarmDocsMarkdownPage.call(void 0, page), {
|
|
575
575
|
origin: new URL(request.url).origin,
|
|
576
576
|
llms: getDocsLlmsOptions(context, request),
|
|
577
577
|
sitemap: context.docs.config.sitemap
|
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
loadFarmDocsPage,
|
|
4
4
|
resolveFarmDocsContentDir,
|
|
5
5
|
toFarmDocsMarkdownPage
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-AHAJGAYD.mjs";
|
|
7
7
|
import {
|
|
8
8
|
docsEngine,
|
|
9
9
|
loadFarmDocsEngine
|
|
10
10
|
} from "./chunk-2VQKKQ6D.mjs";
|
|
11
11
|
import {
|
|
12
12
|
resolveDocsConfig
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-FJZ3DQLK.mjs";
|
|
14
14
|
import {
|
|
15
15
|
getFarmDocsAdapterConfigModule
|
|
16
16
|
} from "./chunk-VVBO3QH7.mjs";
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
compileFarmDocsAdapterEdgeManifest,
|
|
12
12
|
createFarmDocsAPIHandler
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-UAFSBWNT.mjs";
|
|
14
14
|
import {
|
|
15
15
|
FARM_DOCS_LAST_MODIFIED_MANIFEST,
|
|
16
16
|
createFarmDocsHandler,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
loadFarmDocsPage,
|
|
21
21
|
resolveFarmDocsContentDir,
|
|
22
22
|
toFarmDocsMarkdownPage
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-AHAJGAYD.mjs";
|
|
24
24
|
import {
|
|
25
25
|
generateFarmDocsSearchClientRuntime,
|
|
26
26
|
isFarmDocsSearchEnabled,
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
getDeployTargetForPreset,
|
|
38
38
|
hasCustomFarmRouteContext,
|
|
39
39
|
resolveDeployOutputPath
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-FJZ3DQLK.mjs";
|
|
41
41
|
import {
|
|
42
42
|
resolveFarmInstrumentationFile
|
|
43
43
|
} from "./chunk-ZZSRYEYU.mjs";
|
|
@@ -73,7 +73,7 @@ import {
|
|
|
73
73
|
resolveFarmImageProviderForRuntime,
|
|
74
74
|
resolveFarmIsolatedClientHydrationMode,
|
|
75
75
|
resolveFarmNotFoundComponentPath
|
|
76
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-6L6DQR5W.mjs";
|
|
77
77
|
import {
|
|
78
78
|
findRequestBoundSourceBlockers,
|
|
79
79
|
generateFarmTypeArtifacts,
|
|
@@ -83,7 +83,7 @@ import {
|
|
|
83
83
|
import {
|
|
84
84
|
FARM_API_CATALOG_PATH,
|
|
85
85
|
resolveFarmApiCatalogInput
|
|
86
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-TEN4FIZU.mjs";
|
|
87
87
|
import {
|
|
88
88
|
isFarmPreviewDeploymentEnvironment
|
|
89
89
|
} from "./chunk-BOYNDCZL.mjs";
|
|
@@ -115,7 +115,7 @@ import {
|
|
|
115
115
|
} from "./chunk-DAATZTKJ.mjs";
|
|
116
116
|
import {
|
|
117
117
|
applyFarmCspHashesToHtml
|
|
118
|
-
} from "./chunk-
|
|
118
|
+
} from "./chunk-6VYZOPOT.mjs";
|
|
119
119
|
import {
|
|
120
120
|
applyFarmCronVercelCrons,
|
|
121
121
|
createFarmCronCloudflareConfig,
|
|
@@ -127,14 +127,14 @@ import {
|
|
|
127
127
|
} from "./chunk-4OOBRCJX.mjs";
|
|
128
128
|
import {
|
|
129
129
|
isFarmMarkdownPageFile
|
|
130
|
-
} from "./chunk-
|
|
130
|
+
} from "./chunk-7QOCTYBS.mjs";
|
|
131
131
|
import {
|
|
132
132
|
resolveFarmMdxComponentsModulePath,
|
|
133
133
|
resolveMdxConfig
|
|
134
134
|
} from "./chunk-FA2W42OV.mjs";
|
|
135
135
|
import {
|
|
136
136
|
getFarmMarkdownAlternatePath
|
|
137
|
-
} from "./chunk-
|
|
137
|
+
} from "./chunk-JBC2FKRW.mjs";
|
|
138
138
|
import {
|
|
139
139
|
applyFarmWorkflowVercelCrons,
|
|
140
140
|
prepareFarmWorkflowsForNitro
|
|
@@ -5203,6 +5203,7 @@ function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlot
|
|
|
5203
5203
|
config.renderer,
|
|
5204
5204
|
getFarmPresetRuntime(preset)
|
|
5205
5205
|
);
|
|
5206
|
+
const hasReactSyncRender = isReactRenderer(config.renderer);
|
|
5206
5207
|
const rendererServerImports = isReactRenderer(config.renderer) ? `import * as React from "react";
|
|
5207
5208
|
import * as ReactDOMServer from "react-dom/server";${hasIsolatedClientGraphRuntime ? '\nimport { isolateFarmServerPageGraph, wrapFarmIsolatedClientGraph } from "@farm.js/core/internal/isolated-boundary";' : ""}` : `import React, * as ReactDOMServer from ${JSON.stringify(config.renderer.server)};${generateFarmRendererAppSetupServerCode(config)}`;
|
|
5208
5209
|
const routeClientGraphServerRuntime = hasIsolatedClientGraphRuntime ? `function wrapFarmRouteClientGraph(element) {
|
|
@@ -5728,6 +5729,7 @@ ${routeClientGraphServerRuntime}
|
|
|
5728
5729
|
|
|
5729
5730
|
const farmRendererStreamingCapabilities = ${JSON.stringify(rendererStreamingCapabilities)};
|
|
5730
5731
|
const farmRendererName = ${JSON.stringify(config.renderer.name)};
|
|
5732
|
+
const farmReactSyncRender = ${JSON.stringify(hasReactSyncRender)};
|
|
5731
5733
|
const farmRendererRuntime = ${JSON.stringify(getFarmPresetRuntime(preset))};
|
|
5732
5734
|
const farmRendererRuntimeStreamingCapabilities = ReactDOMServer.capabilities &&
|
|
5733
5735
|
ReactDOMServer.capabilities.streaming;
|
|
@@ -5984,6 +5986,9 @@ const farmDocsHandler = ${config.docs?.enabled ? hasPrecompiledDocs ? "farmDocsP
|
|
|
5984
5986
|
contentDir: farmDocsResolvedConfig.contentDir || farmDocsResolvedConfig.config?.contentDir,
|
|
5985
5987
|
}, {
|
|
5986
5988
|
rootDir: farmDocsRuntimeRoot,
|
|
5989
|
+
// A production build's content cannot change, so the adapter reads its
|
|
5990
|
+
// navigation once instead of scanning the content directory per request.
|
|
5991
|
+
immutableContent: true,
|
|
5987
5992
|
clientEntry: "/__farm_client_js_src__",
|
|
5988
5993
|
// Font CSS is merged into the client stylesheet; farm-fonts.css only exists when the
|
|
5989
5994
|
// app has fonts, so linking it separately 404'd for apps without them.
|
|
@@ -6127,8 +6132,10 @@ function escapeFarmHtmlAttribute(value) {
|
|
|
6127
6132
|
.replace(/>/g, ">");
|
|
6128
6133
|
}
|
|
6129
6134
|
|
|
6130
|
-
async function renderFarmElement(ReactDOMServer, element) {
|
|
6135
|
+
async function renderFarmElement(ReactDOMServer, element, routeKey) {
|
|
6131
6136
|
const streamErrors = [];
|
|
6137
|
+
const syncHtml = renderFarmElementSync(ReactDOMServer, element, routeKey);
|
|
6138
|
+
if (syncHtml !== undefined) return { html: syncHtml, shellHtml: syncHtml, streamErrors };
|
|
6132
6139
|
let encoder;
|
|
6133
6140
|
const normalizeChunk = function(chunk) {
|
|
6134
6141
|
if (typeof chunk === "string") return (encoder ||= new TextEncoder()).encode(chunk);
|
|
@@ -6199,6 +6206,7 @@ async function renderFarmElement(ReactDOMServer, element) {
|
|
|
6199
6206
|
}
|
|
6200
6207
|
throwStreamError();
|
|
6201
6208
|
const html = decodeChunks(chunks);
|
|
6209
|
+
rememberFarmSyncRender(routeKey, html);
|
|
6202
6210
|
return { html, shellHtml: html, streamErrors };
|
|
6203
6211
|
}
|
|
6204
6212
|
|
|
@@ -6330,6 +6338,7 @@ async function renderFarmElement(ReactDOMServer, element) {
|
|
|
6330
6338
|
await complete;
|
|
6331
6339
|
throwStreamError();
|
|
6332
6340
|
const html = decodeChunks(chunks);
|
|
6341
|
+
rememberFarmSyncRender(routeKey, html);
|
|
6333
6342
|
return { html, shellHtml: html, streamErrors };
|
|
6334
6343
|
}
|
|
6335
6344
|
|
|
@@ -6370,6 +6379,45 @@ async function renderFarmElementToString(ReactDOMServer, element) {
|
|
|
6370
6379
|
return html;
|
|
6371
6380
|
}
|
|
6372
6381
|
|
|
6382
|
+
// Most pages render without suspending. React's renderToString renders them in
|
|
6383
|
+
// one synchronous pass with string output, about half the CPU of the streaming
|
|
6384
|
+
// renderer, and the same markup, except that React 19's streaming renderer adds
|
|
6385
|
+
// a doctype before an <html> root. A route uses it only after a streaming render
|
|
6386
|
+
// of that route finished without suspending (remembering whether that render
|
|
6387
|
+
// started with a doctype), so a page that suspends keeps streaming and renders
|
|
6388
|
+
// once. If such a route suspends later (a Suspense boundary left to the
|
|
6389
|
+
// client, marked <!--$!-->, or a throw), that request renders again through the
|
|
6390
|
+
// streaming path and the route streams for the rest of this server process.
|
|
6391
|
+
const farmSyncRenderRoutes = new Map();
|
|
6392
|
+
const farmStreamingRenderRoutes = new Set();
|
|
6393
|
+
const FARM_STREAMED_DOCTYPE = "<!DOCTYPE html>";
|
|
6394
|
+
|
|
6395
|
+
function rememberFarmSyncRender(routeKey, streamedHtml) {
|
|
6396
|
+
if (!farmReactSyncRender || routeKey === undefined) return;
|
|
6397
|
+
if (!farmStreamingRenderRoutes.has(routeKey)) {
|
|
6398
|
+
farmSyncRenderRoutes.set(routeKey, streamedHtml.startsWith(FARM_STREAMED_DOCTYPE));
|
|
6399
|
+
}
|
|
6400
|
+
}
|
|
6401
|
+
|
|
6402
|
+
function renderFarmElementSync(ReactDOMServer, element, routeKey) {
|
|
6403
|
+
if (!farmReactSyncRender) return undefined;
|
|
6404
|
+
const addsDoctype = routeKey === undefined ? undefined : farmSyncRenderRoutes.get(routeKey);
|
|
6405
|
+
if (addsDoctype === undefined) return undefined;
|
|
6406
|
+
if (typeof ReactDOMServer.renderToString !== "function") return undefined;
|
|
6407
|
+
let html;
|
|
6408
|
+
try {
|
|
6409
|
+
html = ReactDOMServer.renderToString(element);
|
|
6410
|
+
} catch {
|
|
6411
|
+
html = undefined;
|
|
6412
|
+
}
|
|
6413
|
+
if (typeof html !== "string" || html.includes("<!--$!-->")) {
|
|
6414
|
+
farmSyncRenderRoutes.delete(routeKey);
|
|
6415
|
+
farmStreamingRenderRoutes.add(routeKey);
|
|
6416
|
+
return undefined;
|
|
6417
|
+
}
|
|
6418
|
+
return addsDoctype && html.startsWith("<html") ? FARM_STREAMED_DOCTYPE + html : html;
|
|
6419
|
+
}
|
|
6420
|
+
|
|
6373
6421
|
function createFarmDocumentStream(contentStream, prefix, suffix, onComplete) {
|
|
6374
6422
|
const encoder = new TextEncoder();
|
|
6375
6423
|
const reader = contentStream.getReader();
|
|
@@ -8159,7 +8207,7 @@ async function handleFarmRequestInContext(
|
|
|
8159
8207
|
}
|
|
8160
8208
|
|
|
8161
8209
|
wrappedElement = wrapWithFarmIntegrationProviders(wrappedElement);
|
|
8162
|
-
return renderFarmElement(ReactDOMServer, wrappedElement);
|
|
8210
|
+
return renderFarmElement(ReactDOMServer, wrappedElement, route.pattern);
|
|
8163
8211
|
};
|
|
8164
8212
|
const renderedPage = ${hasMiddlewareRuntime ? `await _runWithMiddlewareData(middlewareData, () =>
|
|
8165
8213
|
_runWithMiddlewareContext(middlewareContext, renderPageElement)
|
|
@@ -9369,6 +9417,11 @@ function toFarmNodeResponse(request, response) {
|
|
|
9369
9417
|
baseURL: "/"
|
|
9370
9418
|
}
|
|
9371
9419
|
],
|
|
9420
|
+
// A self-hosted Node server sends static files itself, so precompress them
|
|
9421
|
+
// with gzip and let Nitro serve that by Accept-Encoding. Brotli at Nitro's
|
|
9422
|
+
// fixed top quality cost a docs app ~20 s of build CPU for a small further
|
|
9423
|
+
// saving. Serverless and edge targets sit behind a CDN that compresses.
|
|
9424
|
+
...preset === "node-server" ? { compressPublicAssets: { gzip: true } } : {},
|
|
9372
9425
|
...prerenderRoutes.length > 0 ? {
|
|
9373
9426
|
prerender: {
|
|
9374
9427
|
crawlLinks: false,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkKJ2TIHZZcjs = require('./chunk-KJ2TIHZZ.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
@@ -116,7 +116,7 @@ async function createFarmMarkdownSourceResponse(options) {
|
|
|
116
116
|
}
|
|
117
117
|
const url = new URL(options.request.url);
|
|
118
118
|
const hasMarkdownExtension = url.pathname.toLowerCase().endsWith(".md");
|
|
119
|
-
if (!hasMarkdownExtension && !
|
|
119
|
+
if (!hasMarkdownExtension && !_chunkKJ2TIHZZcjs.requestAcceptsMarkdown.call(void 0, options.request.headers.get("accept"))) {
|
|
120
120
|
return null;
|
|
121
121
|
}
|
|
122
122
|
const targetPathname = normalizeFarmMarkdownRoutePath(url.pathname);
|
|
@@ -134,7 +134,7 @@ async function createFarmMarkdownSourceResponse(options) {
|
|
|
134
134
|
if (!hasMarkdownExtension) {
|
|
135
135
|
headers.set("Vary", "Accept");
|
|
136
136
|
}
|
|
137
|
-
return
|
|
137
|
+
return _chunkKJ2TIHZZcjs.createFarmMarkdownViewResponse.call(void 0, {
|
|
138
138
|
request: options.request,
|
|
139
139
|
requestUrl: url,
|
|
140
140
|
markdown: source.source,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _chunkOWOUTKIJcjs = require('./chunk-OWOUTKIJ.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkCUMINO7Zcjs = require('./chunk-CUMINO7Z.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkJ63ZH5OQcjs = require('./chunk-J63ZH5OQ.cjs');
|
|
@@ -210,7 +210,7 @@ function createFarmMetadataRouteResponse(kind, value, routeModule = {}, options
|
|
|
210
210
|
if (isResponse(value)) {
|
|
211
211
|
return method === "HEAD" ? _chunkTKJZFIMLcjs.omitFarmResponseBody.call(void 0, value) : value;
|
|
212
212
|
}
|
|
213
|
-
const body = kind === "sitemap" ? serializeSitemap(value) : kind === "robots" ? serializeRobots(value) : kind === "llms" || kind === "llms-full" ?
|
|
213
|
+
const body = kind === "sitemap" ? serializeSitemap(value) : kind === "robots" ? serializeRobots(value) : kind === "llms" || kind === "llms-full" ? _chunkCUMINO7Zcjs.serializeFarmLlmsTxt.call(void 0, value) : serializeManifest(value);
|
|
214
214
|
const contentType = kind === "sitemap" ? "application/xml; charset=utf-8" : kind === "robots" || kind === "llms" || kind === "llms-full" ? "text/plain; charset=utf-8" : "application/manifest+json; charset=utf-8";
|
|
215
215
|
return new Response(method === "HEAD" ? null : body, {
|
|
216
216
|
headers: {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getDeployTargetForPreset
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FJZ3DQLK.mjs";
|
|
4
4
|
import "./chunk-XZNTNMHT.mjs";
|
|
5
5
|
import "./chunk-RSOJ7DRT.mjs";
|
|
6
6
|
import "./chunk-JBSVKMC5.mjs";
|
|
7
7
|
import "./chunk-GHFS7RUB.mjs";
|
|
8
8
|
import "./chunk-JHWOVJ3M.mjs";
|
|
9
9
|
import "./chunk-DAATZTKJ.mjs";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-6VYZOPOT.mjs";
|
|
11
11
|
import "./chunk-G2KY33I6.mjs";
|
|
12
12
|
import {
|
|
13
13
|
resolveCronConfig
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
import "./chunk-QCFFHV5H.mjs";
|
|
16
16
|
import "./chunk-4OOBRCJX.mjs";
|
|
17
17
|
import "./chunk-FA2W42OV.mjs";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-JBC2FKRW.mjs";
|
|
19
19
|
import "./chunk-MVL2RAJW.mjs";
|
|
20
20
|
import "./chunk-SFGWNC43.mjs";
|
|
21
21
|
import "./chunk-3ATMYLLJ.mjs";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkDFLLARUKcjs = require('./chunk-DFLLARUK.cjs');
|
|
4
4
|
require('./chunk-KR6CKSXT.cjs');
|
|
5
5
|
require('./chunk-6MVFL3R5.cjs');
|
|
6
6
|
require('./chunk-YJRZR7VU.cjs');
|
|
7
7
|
require('./chunk-Q5B3KJBP.cjs');
|
|
8
8
|
require('./chunk-VPTDD5XF.cjs');
|
|
9
9
|
require('./chunk-PSV6XKPO.cjs');
|
|
10
|
-
require('./chunk-
|
|
10
|
+
require('./chunk-CUMINO7Z.cjs');
|
|
11
11
|
require('./chunk-YFPGHF5F.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
@@ -15,7 +15,7 @@ var _chunk6EXBPJ24cjs = require('./chunk-6EXBPJ24.cjs');
|
|
|
15
15
|
require('./chunk-T5CERMEH.cjs');
|
|
16
16
|
require('./chunk-VEKFLAQM.cjs');
|
|
17
17
|
require('./chunk-OHY2ZWUG.cjs');
|
|
18
|
-
require('./chunk-
|
|
18
|
+
require('./chunk-KJ2TIHZZ.cjs');
|
|
19
19
|
require('./chunk-J63ZH5OQ.cjs');
|
|
20
20
|
require('./chunk-UYIHRDE4.cjs');
|
|
21
21
|
require('./chunk-MPEYMSCF.cjs');
|
|
@@ -352,7 +352,7 @@ async function createFarmDevtoolsSnapshot(input) {
|
|
|
352
352
|
}));
|
|
353
353
|
const deploymentPreset = String(_optionalChain([config, 'access', _13 => _13.deploy, 'optionalAccess', _14 => _14.preset]) || config.preset || "node-server");
|
|
354
354
|
const deploymentTarget = String(
|
|
355
|
-
_optionalChain([config, 'access', _15 => _15.deploy, 'optionalAccess', _16 => _16.target]) ||
|
|
355
|
+
_optionalChain([config, 'access', _15 => _15.deploy, 'optionalAccess', _16 => _16.target]) || _chunkDFLLARUKcjs.getDeployTargetForPreset.call(void 0, deploymentPreset) || "node"
|
|
356
356
|
);
|
|
357
357
|
const env = input.env || process.env;
|
|
358
358
|
if (pageRoutes.length === 0) {
|
package/dist/docs.cjs
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkMXDTKXO6cjs = require('./chunk-MXDTKXO6.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -13,11 +13,11 @@ var _chunkZDILFMWNcjs = require('./chunk-ZDILFMWN.cjs');
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunk2FXWWUE5cjs = require('./chunk-2FXWWUE5.cjs');
|
|
17
17
|
require('./chunk-MWWVKDW3.cjs');
|
|
18
18
|
require('./chunk-KGZIORNL.cjs');
|
|
19
19
|
require('./chunk-IK6LVLKC.cjs');
|
|
20
|
-
require('./chunk-
|
|
20
|
+
require('./chunk-DFLLARUK.cjs');
|
|
21
21
|
require('./chunk-KR6CKSXT.cjs');
|
|
22
22
|
require('./chunk-75WGQVQA.cjs');
|
|
23
23
|
require('./chunk-HREOKQWT.cjs');
|
|
@@ -26,13 +26,13 @@ require('./chunk-YJRZR7VU.cjs');
|
|
|
26
26
|
require('./chunk-Q5B3KJBP.cjs');
|
|
27
27
|
require('./chunk-VPTDD5XF.cjs');
|
|
28
28
|
require('./chunk-PSV6XKPO.cjs');
|
|
29
|
-
require('./chunk-
|
|
29
|
+
require('./chunk-CUMINO7Z.cjs');
|
|
30
30
|
require('./chunk-YFPGHF5F.cjs');
|
|
31
31
|
require('./chunk-6EXBPJ24.cjs');
|
|
32
32
|
require('./chunk-T5CERMEH.cjs');
|
|
33
33
|
require('./chunk-VEKFLAQM.cjs');
|
|
34
34
|
require('./chunk-OHY2ZWUG.cjs');
|
|
35
|
-
require('./chunk-
|
|
35
|
+
require('./chunk-KJ2TIHZZ.cjs');
|
|
36
36
|
require('./chunk-J63ZH5OQ.cjs');
|
|
37
37
|
require('./chunk-UYIHRDE4.cjs');
|
|
38
38
|
require('./chunk-MPEYMSCF.cjs');
|
|
@@ -79,4 +79,4 @@ require('./chunk-S3JO3N4H.cjs');
|
|
|
79
79
|
|
|
80
80
|
|
|
81
81
|
|
|
82
|
-
exports.createDocsAPI =
|
|
82
|
+
exports.createDocsAPI = _chunkMXDTKXO6cjs.createDocsAPI; exports.createFarmDocsAPIHandler = _chunkMXDTKXO6cjs.createFarmDocsAPIHandler; exports.createFarmDocsAdapterHandler = _chunkMXDTKXO6cjs.createFarmDocsAdapterHandler; exports.createFarmDocsHandler = _chunk2FXWWUE5cjs.createFarmDocsHandler; exports.discoverFarmDocsPages = _chunk2FXWWUE5cjs.discoverFarmDocsPages; exports.getFarmDocsDocumentNavigationMatchers = _chunk2FXWWUE5cjs.getFarmDocsDocumentNavigationMatchers; exports.getFarmDocsRouteTypeEntries = _chunk2FXWWUE5cjs.getFarmDocsRouteTypeEntries; exports.hasFarmDocsRuntimeAdapter = _chunkMXDTKXO6cjs.hasFarmDocsRuntimeAdapter; exports.isFarmDocsAPIRequest = _chunkMXDTKXO6cjs.isFarmDocsAPIRequest; exports.isFarmDocsRequest = _chunk2FXWWUE5cjs.isFarmDocsRequest; exports.loadFarmDocsPage = _chunk2FXWWUE5cjs.loadFarmDocsPage; exports.resolveFarmDocsContentDir = _chunk2FXWWUE5cjs.resolveFarmDocsContentDir;
|
package/dist/docs.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
createFarmDocsAdapterHandler,
|
|
5
5
|
hasFarmDocsRuntimeAdapter,
|
|
6
6
|
isFarmDocsAPIRequest
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-UAFSBWNT.mjs";
|
|
8
8
|
import {
|
|
9
9
|
createFarmDocsHandler,
|
|
10
10
|
discoverFarmDocsPages,
|
|
@@ -13,11 +13,11 @@ import {
|
|
|
13
13
|
isFarmDocsRequest,
|
|
14
14
|
loadFarmDocsPage,
|
|
15
15
|
resolveFarmDocsContentDir
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-AHAJGAYD.mjs";
|
|
17
17
|
import "./chunk-UP4CW6WP.mjs";
|
|
18
18
|
import "./chunk-TFQG7TBC.mjs";
|
|
19
19
|
import "./chunk-2VQKKQ6D.mjs";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-FJZ3DQLK.mjs";
|
|
21
21
|
import "./chunk-XZNTNMHT.mjs";
|
|
22
22
|
import "./chunk-VVBO3QH7.mjs";
|
|
23
23
|
import "./chunk-TVGP4BBZ.mjs";
|
|
@@ -26,13 +26,13 @@ import "./chunk-JBSVKMC5.mjs";
|
|
|
26
26
|
import "./chunk-GHFS7RUB.mjs";
|
|
27
27
|
import "./chunk-JHWOVJ3M.mjs";
|
|
28
28
|
import "./chunk-DAATZTKJ.mjs";
|
|
29
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-6VYZOPOT.mjs";
|
|
30
30
|
import "./chunk-G2KY33I6.mjs";
|
|
31
31
|
import "./chunk-YHOCRI4H.mjs";
|
|
32
32
|
import "./chunk-QCFFHV5H.mjs";
|
|
33
33
|
import "./chunk-4OOBRCJX.mjs";
|
|
34
34
|
import "./chunk-FA2W42OV.mjs";
|
|
35
|
-
import "./chunk-
|
|
35
|
+
import "./chunk-JBC2FKRW.mjs";
|
|
36
36
|
import "./chunk-MVL2RAJW.mjs";
|
|
37
37
|
import "./chunk-SFGWNC43.mjs";
|
|
38
38
|
import "./chunk-3ATMYLLJ.mjs";
|