@farm.js/core 0.1.24 → 0.1.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-runtime.d.mts +2 -2
- package/dist/agent-runtime.d.ts +2 -2
- package/dist/api/route-manager.cjs +4 -4
- package/dist/api/route-manager.d.mts +2 -2
- package/dist/api/route-manager.d.ts +2 -2
- package/dist/api/route-manager.mjs +3 -3
- package/dist/api/runtime.cjs +3 -3
- package/dist/api/runtime.mjs +2 -2
- package/dist/api.cjs +7 -7
- package/dist/api.d.mts +3 -3
- package/dist/api.d.ts +3 -3
- package/dist/api.mjs +6 -6
- package/dist/{app-BZDWwwFa.d.mts → app-29vG5tmY.d.mts} +3 -3
- package/dist/{app-BV-7wV5q.d.ts → app-Cx71s_PT.d.ts} +3 -3
- package/dist/app-markdown.cjs +6 -4
- package/dist/app-markdown.d.mts +3 -3
- package/dist/app-markdown.d.ts +3 -3
- package/dist/app-markdown.mjs +5 -3
- package/dist/{chunk-ISTFC3MZ.cjs → chunk-2CT6XUNO.cjs} +99 -26
- package/dist/{chunk-G6GNNB44.cjs → chunk-3TQG7CGC.cjs} +201 -180
- package/dist/{chunk-KNPRCKXK.cjs → chunk-3TQWUUNP.cjs} +9 -7
- package/dist/{chunk-LYM7HY34.cjs → chunk-3WSWXPYM.cjs} +4 -4
- package/dist/{chunk-GZ3ZPTQV.mjs → chunk-52SH7TKB.mjs} +2 -2
- package/dist/{chunk-JIKGGIOL.mjs → chunk-6D242YGO.mjs} +1 -1
- package/dist/{chunk-MVUREHPN.mjs → chunk-74RZNRY6.mjs} +1 -1
- package/dist/{chunk-BD7FZ63M.cjs → chunk-ALIFMS4A.cjs} +1 -1
- package/dist/{chunk-PGQBL5DN.mjs → chunk-ARXCHQLX.mjs} +79 -2
- package/dist/{chunk-2QLBIPFT.cjs → chunk-B6ZCT36X.cjs} +4 -4
- package/dist/{chunk-IMBMOEWT.cjs → chunk-BD2U4ZL6.cjs} +8 -8
- package/dist/{chunk-2M435BUE.mjs → chunk-CEYUWDWA.mjs} +7 -5
- package/dist/{chunk-XI3GWPUS.cjs → chunk-CRQPYWLK.cjs} +14 -14
- package/dist/{chunk-47H7VENP.mjs → chunk-DU2CASV6.mjs} +1 -1
- package/dist/{chunk-QTBEAKCJ.cjs → chunk-H7CJRJ4L.cjs} +16 -16
- package/dist/chunk-J63ZH5OQ.cjs +62 -0
- package/dist/{chunk-N255VYFP.mjs → chunk-JM5GQL4H.mjs} +8 -3
- package/dist/{chunk-6VEHUKZ2.mjs → chunk-MM5D6VLP.mjs} +4 -20
- package/dist/chunk-MVL2RAJW.mjs +62 -0
- package/dist/{chunk-YA6LLTIJ.cjs → chunk-ND224OE2.cjs} +4 -20
- package/dist/{chunk-YGMK6ESJ.mjs → chunk-OFKG57MZ.mjs} +2 -2
- package/dist/chunk-OOIL3BWR.mjs +1229 -0
- package/dist/{chunk-BNSD3VDY.mjs → chunk-PPIW3MH6.mjs} +1 -1
- package/dist/{chunk-WNUBR4CA.mjs → chunk-QGG336NI.mjs} +1 -1
- package/dist/chunk-QIH2HD6H.cjs +1229 -0
- package/dist/{chunk-OYDRPBBV.cjs → chunk-QJ4D3UKJ.cjs} +80 -3
- package/dist/{chunk-LQIRVSBY.cjs → chunk-QLXEYIAW.cjs} +13 -13
- package/dist/{chunk-ARHWIOUZ.mjs → chunk-QPPQHB6X.mjs} +111 -40
- package/dist/{chunk-7BC6GAL7.mjs → chunk-RAI7NULA.mjs} +76 -3
- package/dist/{chunk-AH7HOAQ3.cjs → chunk-RCYINC4A.cjs} +9 -4
- package/dist/{chunk-SIQMTHCZ.cjs → chunk-SZ4LYNUX.cjs} +212 -141
- package/dist/{chunk-5UX4C5QI.mjs → chunk-TKDY6AJP.mjs} +1 -1
- package/dist/{chunk-YJJLXIIS.cjs → chunk-U74A3P2P.cjs} +7 -7
- package/dist/{chunk-6YSEHN46.mjs → chunk-UXQXGB5A.mjs} +36 -15
- package/dist/{chunk-72VJRKJD.mjs → chunk-VZWO3XVL.mjs} +2 -2
- package/dist/{chunk-I5YBCWQ6.cjs → chunk-W2HZKYES.cjs} +2 -2
- package/dist/{chunk-DNLQMFER.cjs → chunk-WFPRVVF2.cjs} +26 -19
- package/dist/{chunk-BDJNP7AQ.mjs → chunk-YMUH2BLR.mjs} +10 -3
- package/dist/{client-plugins-B_XzCegf.d.mts → client-plugins-B8RPJnot.d.mts} +129 -4
- package/dist/{client-plugins-CKsXQfXY.d.ts → client-plugins-bPBf4haK.d.ts} +129 -4
- package/dist/client-plugins.d.mts +2 -2
- package/dist/client-plugins.d.ts +2 -2
- package/dist/client.cjs +4 -4
- package/dist/client.d.mts +6 -6
- package/dist/client.d.ts +6 -6
- package/dist/client.mjs +3 -3
- package/dist/config.d.mts +2 -2
- package/dist/config.d.ts +2 -2
- package/dist/{devtools-OY4SNU3P.mjs → devtools-5D4ZDRPR.mjs} +5 -3
- package/dist/{devtools-UHRSZ7VA.cjs → devtools-QZJEUOJW.cjs} +6 -4
- package/dist/docs.cjs +8 -6
- package/dist/docs.mjs +7 -5
- package/dist/index.cjs +29 -23
- package/dist/index.d.mts +14 -14
- package/dist/index.d.ts +14 -14
- package/dist/index.mjs +28 -22
- package/dist/integrations.d.mts +2 -2
- package/dist/integrations.d.ts +2 -2
- package/dist/internal/app-markdown-runtime.cjs +5 -3
- package/dist/internal/app-markdown-runtime.d.mts +2 -2
- package/dist/internal/app-markdown-runtime.d.ts +2 -2
- package/dist/internal/app-markdown-runtime.mjs +4 -2
- package/dist/internal/build-runtime.cjs +18 -17
- package/dist/internal/build-runtime.d.mts +4 -4
- package/dist/internal/build-runtime.d.ts +4 -4
- package/dist/internal/build-runtime.mjs +17 -16
- package/dist/internal/cli-runtime.cjs +6 -5
- package/dist/internal/cli-runtime.mjs +5 -4
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/compression-runtime.d.mts +2 -2
- package/dist/internal/compression-runtime.d.ts +2 -2
- package/dist/internal/config-runtime.cjs +6 -4
- package/dist/internal/config-runtime.d.mts +3 -3
- package/dist/internal/config-runtime.d.ts +3 -3
- package/dist/internal/config-runtime.mjs +5 -3
- package/dist/internal/infra-analytics-runtime.cjs +4 -3
- package/dist/internal/infra-analytics-runtime.mjs +2 -1
- package/dist/internal/product-telemetry-runtime.cjs +2 -2
- package/dist/internal/product-telemetry-runtime.mjs +1 -1
- package/dist/internal/production-runtime.cjs +12 -5
- package/dist/internal/production-runtime.d.mts +33 -9
- package/dist/internal/production-runtime.d.ts +33 -9
- package/dist/internal/production-runtime.mjs +11 -4
- package/dist/markdown.cjs +6 -2
- package/dist/markdown.d.mts +63 -1
- package/dist/markdown.d.ts +63 -1
- package/dist/markdown.mjs +5 -1
- package/dist/{metadata-B08w4EYV.d.mts → metadata-C3na4CBj.d.mts} +1 -1
- package/dist/{metadata-IQEblkZp.d.ts → metadata-CzBP4Mfp.d.ts} +1 -1
- package/dist/middleware.d.mts +4 -4
- package/dist/middleware.d.ts +4 -4
- package/dist/navigation.cjs +5 -5
- package/dist/navigation.d.mts +5 -5
- package/dist/navigation.d.ts +5 -5
- package/dist/navigation.mjs +4 -4
- package/dist/observability-BupkiN0m.d.mts +447 -0
- package/dist/observability-BupkiN0m.d.ts +447 -0
- package/dist/observability.d.mts +2 -417
- package/dist/observability.d.ts +2 -417
- package/dist/plugin.cjs +13 -12
- package/dist/plugin.d.mts +2 -2
- package/dist/plugin.d.ts +2 -2
- package/dist/plugin.mjs +12 -11
- package/dist/{production-runtime-DRSOkc-d.d.ts → production-runtime-CYg4wM4E.d.ts} +1 -1
- package/dist/{production-runtime-C3bGFEaM.d.mts → production-runtime-DP94hPGe.d.mts} +1 -1
- package/dist/query/client.cjs +6 -6
- package/dist/query/client.mjs +2 -2
- package/dist/{render-plan-CCFuMLNS.d.ts → render-plan-Bl6Fzg5z.d.ts} +1 -1
- package/dist/{render-plan-B6CKNl4e.d.mts → render-plan-CKAJg0jC.d.mts} +1 -1
- package/dist/renderer-client.cjs +5 -5
- package/dist/renderer-client.d.mts +4 -4
- package/dist/renderer-client.d.ts +4 -4
- package/dist/renderer-client.mjs +2 -2
- package/dist/{request-Dn6VURbE.d.ts → request-CR-Bp1Px.d.ts} +1 -1
- package/dist/{request-DgD1XsTx.d.mts → request-CrBCcPZZ.d.mts} +1 -1
- package/dist/request.d.mts +3 -3
- package/dist/request.d.ts +3 -3
- package/dist/{route-rendering-76A5I_kE.d.mts → route-rendering-C1NAHo-C.d.mts} +1 -1
- package/dist/{route-rendering-LAmQEdyG.d.ts → route-rendering-CZH5FegB.d.ts} +1 -1
- package/dist/{router-CnrRSa9d.d.mts → router-B57eDJ3u.d.mts} +1 -1
- package/dist/{router-BSOOGya2.d.ts → router-Cg_kD3Bd.d.ts} +1 -1
- package/dist/routes.d.mts +2 -2
- package/dist/routes.d.ts +2 -2
- package/dist/server-plugins.d.mts +3 -3
- package/dist/server-plugins.d.ts +3 -3
- package/dist/server.cjs +163 -106
- package/dist/server.d.mts +8 -8
- package/dist/server.d.ts +8 -8
- package/dist/server.mjs +144 -87
- package/dist/{spa-router-BMrSsG5b.d.ts → spa-router-BstQUO6Q.d.ts} +2 -2
- package/dist/{spa-router-DnYhWCvI.d.mts → spa-router-DTdbuinx.d.mts} +2 -2
- package/dist/testing.cjs +4 -4
- package/dist/testing.d.mts +2 -2
- package/dist/testing.d.ts +2 -2
- package/dist/testing.mjs +3 -3
- package/dist/{utils-ABkktwku.d.mts → utils-CS3ZLnEJ.d.mts} +1 -1
- package/dist/{utils-C3GguS-Q.d.ts → utils-D3rdsIvM.d.ts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +13 -12
- package/dist/vite.d.mts +2 -2
- package/dist/vite.d.ts +2 -2
- package/dist/vite.mjs +12 -11
- package/package.json +1 -1
- package/dist/chunk-BBVSJVBZ.cjs +0 -600
- package/dist/chunk-OFEY6KHO.mjs +0 -600
- package/dist/{chunk-XP777LRD.mjs → chunk-GDUYXFIS.mjs} +3 -3
- package/dist/{chunk-4PNUXIVU.cjs → chunk-YAOX43YI.cjs} +3 -3
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkCRQPYWLKcjs = require('./chunk-CRQPYWLK.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkB6ZCT36Xcjs = require('./chunk-B6ZCT36X.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkI57LW5VZcjs = require('./chunk-I57LW5VZ.cjs');
|
|
@@ -13,7 +13,7 @@ var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
|
13
13
|
|
|
14
14
|
// src/navigation.ts
|
|
15
15
|
function useRouter2() {
|
|
16
|
-
const router =
|
|
16
|
+
const router = _chunkCRQPYWLKcjs.useRouter.call(void 0, );
|
|
17
17
|
return {
|
|
18
18
|
push: router.push,
|
|
19
19
|
replace: router.replace,
|
|
@@ -21,21 +21,21 @@ function useRouter2() {
|
|
|
21
21
|
forward: router.forward,
|
|
22
22
|
refresh() {
|
|
23
23
|
if (typeof window === "undefined") return Promise.resolve();
|
|
24
|
-
return
|
|
24
|
+
return _chunkB6ZCT36Xcjs.getRouter.call(void 0, ).refresh();
|
|
25
25
|
},
|
|
26
26
|
prefetch(href) {
|
|
27
27
|
if (typeof window === "undefined") return Promise.resolve();
|
|
28
|
-
return
|
|
28
|
+
return _chunkB6ZCT36Xcjs.getRouter.call(void 0, ).prefetch(_chunkI57LW5VZcjs.applyFarmBasePath.call(void 0, href));
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
_chunkS3JO3N4Hcjs.__name.call(void 0, useRouter2, "useRouter");
|
|
33
33
|
function usePathname() {
|
|
34
|
-
return
|
|
34
|
+
return _chunkCRQPYWLKcjs.useRouter.call(void 0, ).pathname;
|
|
35
35
|
}
|
|
36
36
|
_chunkS3JO3N4Hcjs.__name.call(void 0, usePathname, "usePathname");
|
|
37
37
|
function useSearchParams() {
|
|
38
|
-
return
|
|
38
|
+
return _chunkCRQPYWLKcjs.useRouter.call(void 0, ).searchParams;
|
|
39
39
|
}
|
|
40
40
|
_chunkS3JO3N4Hcjs.__name.call(void 0, useSearchParams, "useSearchParams");
|
|
41
41
|
|
|
@@ -16,15 +16,18 @@ import {
|
|
|
16
16
|
resolveSchemaModels
|
|
17
17
|
} from "./chunk-ZMSZZXOR.mjs";
|
|
18
18
|
import {
|
|
19
|
+
FARM_API_CATALOG_PATH,
|
|
19
20
|
createDefaultErrorMarkup,
|
|
21
|
+
createFarmApiCatalogResponse,
|
|
20
22
|
createFarmMetadataRouteResponse,
|
|
21
23
|
createFarmThemeDocumentParts,
|
|
22
24
|
createLateNotFoundRecovery,
|
|
23
25
|
createLateRedirectRecovery,
|
|
24
26
|
getDefaultErrorStatusText,
|
|
25
27
|
renderFarmLocaleAlternateLinks,
|
|
26
|
-
resolveDefaultErrorStatus
|
|
27
|
-
|
|
28
|
+
resolveDefaultErrorStatus,
|
|
29
|
+
resolveFarmApiCatalogInput
|
|
30
|
+
} from "./chunk-ARXCHQLX.mjs";
|
|
28
31
|
import {
|
|
29
32
|
isFarmPreviewDeploymentEnvironment
|
|
30
33
|
} from "./chunk-BOYNDCZL.mjs";
|
|
@@ -104,7 +107,7 @@ import {
|
|
|
104
107
|
resolveFarmLlmsTxtConfig,
|
|
105
108
|
resolveFarmPerformanceConfig,
|
|
106
109
|
resolveFarmSecurityConfig
|
|
107
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-RAI7NULA.mjs";
|
|
108
111
|
import {
|
|
109
112
|
getPublicFarmImageConfig,
|
|
110
113
|
resolveFarmImageConfig
|
|
@@ -122,12 +125,12 @@ import {
|
|
|
122
125
|
import {
|
|
123
126
|
createFarmMarkdownRouteModuleFromFile,
|
|
124
127
|
loadFarmMdxComponents
|
|
125
|
-
} from "./chunk-
|
|
128
|
+
} from "./chunk-74RZNRY6.mjs";
|
|
126
129
|
import {
|
|
127
130
|
createFarmMarkdownSourceResponse,
|
|
128
131
|
isFarmMarkdownPageFile,
|
|
129
132
|
normalizeFarmMarkdownRoutePath
|
|
130
|
-
} from "./chunk-
|
|
133
|
+
} from "./chunk-JM5GQL4H.mjs";
|
|
131
134
|
import {
|
|
132
135
|
resolveFarmMdxComponentsModulePath,
|
|
133
136
|
resolveMdxConfig
|
|
@@ -141,7 +144,7 @@ import {
|
|
|
141
144
|
getFarmMarkdownMirrorPath,
|
|
142
145
|
resolveMarkdownConfig,
|
|
143
146
|
resolveMarkdownMirrorTarget
|
|
144
|
-
} from "./chunk-
|
|
147
|
+
} from "./chunk-OOIL3BWR.mjs";
|
|
145
148
|
import {
|
|
146
149
|
resolveWorkflowsConfig
|
|
147
150
|
} from "./chunk-3ATMYLLJ.mjs";
|
|
@@ -182,7 +185,7 @@ import {
|
|
|
182
185
|
} from "./chunk-IOEH4VWN.mjs";
|
|
183
186
|
import {
|
|
184
187
|
APIRouteManager
|
|
185
|
-
} from "./chunk-
|
|
188
|
+
} from "./chunk-QGG336NI.mjs";
|
|
186
189
|
import {
|
|
187
190
|
findProgrammaticRouteFiles,
|
|
188
191
|
loadProgrammaticRouteManifests
|
|
@@ -201,7 +204,7 @@ import {
|
|
|
201
204
|
} from "./chunk-YOZYCI6Z.mjs";
|
|
202
205
|
import {
|
|
203
206
|
isFarmAPIPathname
|
|
204
|
-
} from "./chunk-
|
|
207
|
+
} from "./chunk-GDUYXFIS.mjs";
|
|
205
208
|
import {
|
|
206
209
|
resolveFarmAPIServerBasePath
|
|
207
210
|
} from "./chunk-I6XDAKWQ.mjs";
|
|
@@ -271,7 +274,7 @@ import {
|
|
|
271
274
|
} from "./chunk-Z2RZJZIZ.mjs";
|
|
272
275
|
import {
|
|
273
276
|
FARM_VERSION
|
|
274
|
-
} from "./chunk-
|
|
277
|
+
} from "./chunk-PPIW3MH6.mjs";
|
|
275
278
|
import {
|
|
276
279
|
resolveFarmTrailingSlashRedirect,
|
|
277
280
|
setFarmTrailingSlashPreference
|
|
@@ -290,7 +293,7 @@ import {
|
|
|
290
293
|
mergeMetadata,
|
|
291
294
|
renderMetadataHead,
|
|
292
295
|
resolveFarmNotFoundMetadata
|
|
293
|
-
} from "./chunk-
|
|
296
|
+
} from "./chunk-CEYUWDWA.mjs";
|
|
294
297
|
import {
|
|
295
298
|
FARM_DEPLOYMENT_ID_HEADER,
|
|
296
299
|
createFarmDeploymentCookie,
|
|
@@ -3039,7 +3042,7 @@ __name(collectDevStylesheetUrls, "collectDevStylesheetUrls");
|
|
|
3039
3042
|
|
|
3040
3043
|
// src/server/full-document.ts
|
|
3041
3044
|
var CONTENTS_WRAPPER = /^<div\b[^>]*style="display\s*:\s*contents"[^>]*>/i;
|
|
3042
|
-
var HOISTED_HEAD_ELEMENT = /^(?:<(?:meta|link|base)\b[^>]*>|<title\b[^>]*>[\s\S]*?<\/title>)/i;
|
|
3045
|
+
var HOISTED_HEAD_ELEMENT = /^(?:<(?:meta|link|base)\b[^>]*>|<title\b[^>]*>[\s\S]*?<\/title>|<script\b[^>]*\basync\b[^>]*><\/script>|<style\b[^>]*\bdata-precedence\b[^>]*>[\s\S]*?<\/style>)/i;
|
|
3043
3046
|
function peelDocumentPrefix(markup) {
|
|
3044
3047
|
let inner = markup.replace(/^\s+/, "");
|
|
3045
3048
|
let hoisted = "";
|
|
@@ -6128,7 +6131,8 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6128
6131
|
readMarkdown: llmsContext.markdown
|
|
6129
6132
|
}) : value;
|
|
6130
6133
|
const response = createFarmMetadataRouteResponse(match.metadata.kind, body, routeModule, {
|
|
6131
|
-
method
|
|
6134
|
+
method,
|
|
6135
|
+
request: request2
|
|
6132
6136
|
});
|
|
6133
6137
|
await sendWebResponse(res, response);
|
|
6134
6138
|
} catch (error) {
|
|
@@ -6166,7 +6170,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6166
6170
|
kind,
|
|
6167
6171
|
body,
|
|
6168
6172
|
{ revalidate: config.revalidate },
|
|
6169
|
-
{ method: req.method }
|
|
6173
|
+
{ method: req.method, request: request2 }
|
|
6170
6174
|
)
|
|
6171
6175
|
);
|
|
6172
6176
|
} catch (error) {
|
|
@@ -9514,7 +9518,7 @@ function loadFarmWorkflowsDevRuntime() {
|
|
|
9514
9518
|
}
|
|
9515
9519
|
__name(loadFarmWorkflowsDevRuntime, "loadFarmWorkflowsDevRuntime");
|
|
9516
9520
|
function loadFarmDevtoolsSnapshotRuntime() {
|
|
9517
|
-
return import("./devtools-
|
|
9521
|
+
return import("./devtools-5D4ZDRPR.mjs");
|
|
9518
9522
|
}
|
|
9519
9523
|
__name(loadFarmDevtoolsSnapshotRuntime, "loadFarmDevtoolsSnapshotRuntime");
|
|
9520
9524
|
function loadFarmDevtoolsUIRuntime() {
|
|
@@ -10809,6 +10813,20 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10809
10813
|
const docsHandler = openAPIManager.getDocsRouteHandler(parsedRequestUrl.origin);
|
|
10810
10814
|
return docsHandler(req, res);
|
|
10811
10815
|
}
|
|
10816
|
+
if (options.agent?.apiCatalog && stripFarmBasePath(requestPathname, farmConfig.basePath) === FARM_API_CATALOG_PATH) {
|
|
10817
|
+
if (await runAppMiddlewareForContentRoute()) return;
|
|
10818
|
+
await sendWebResponse(
|
|
10819
|
+
res,
|
|
10820
|
+
createFarmApiCatalogResponse(
|
|
10821
|
+
requestMethod,
|
|
10822
|
+
resolveFarmApiCatalogInput({ ...options, api: farmConfig.api }),
|
|
10823
|
+
new Request(parsedRequestUrl, {
|
|
10824
|
+
headers: { "user-agent": String(req.headers["user-agent"] ?? "") }
|
|
10825
|
+
})
|
|
10826
|
+
)
|
|
10827
|
+
);
|
|
10828
|
+
return;
|
|
10829
|
+
}
|
|
10812
10830
|
const docsHeaders = new Headers();
|
|
10813
10831
|
for (const [key, value] of Object.entries(req.headers)) {
|
|
10814
10832
|
if (value) {
|
|
@@ -10866,7 +10884,9 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10866
10884
|
}),
|
|
10867
10885
|
config: farmApp.getConfig().md,
|
|
10868
10886
|
routeExists: /* @__PURE__ */ __name((pathname2) => Boolean(farmApp.getRouteManager().matchRoute(pathname2).route), "routeExists"),
|
|
10869
|
-
|
|
10887
|
+
// Keep the page's own redirect (a sign-in gate, say) so the mirror
|
|
10888
|
+
// answers with it, as production does, instead of the target page.
|
|
10889
|
+
renderPage: /* @__PURE__ */ __name(async (request2) => fetch(request2, { redirect: "manual" }), "renderPage")
|
|
10870
10890
|
});
|
|
10871
10891
|
if (markdownResponse) {
|
|
10872
10892
|
if (await runAppMiddlewareForContentRoute()) return;
|
|
@@ -14410,6 +14430,7 @@ export {
|
|
|
14410
14430
|
createMarkdownPageHydrationPlanner,
|
|
14411
14431
|
enforceFarmIsolatedHydrationRouteBudget,
|
|
14412
14432
|
RouteManager,
|
|
14433
|
+
HOISTED_HEAD_ELEMENT,
|
|
14413
14434
|
resolveFarmNotFoundComponentPath,
|
|
14414
14435
|
farmFontImportsPlugin,
|
|
14415
14436
|
mergeFarmFontCss,
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-IOEH4VWN.mjs";
|
|
7
7
|
import {
|
|
8
8
|
APIRouteConflictError
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-QGG336NI.mjs";
|
|
10
10
|
import {
|
|
11
11
|
findProgrammaticRouteFilesInDir
|
|
12
12
|
} from "./chunk-YOYF2E4U.mjs";
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
invokeAPIRouteEndpoint,
|
|
20
20
|
matchAPIRouteAtBasePath,
|
|
21
21
|
resolveAPIRouteEndpoint
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-GDUYXFIS.mjs";
|
|
23
23
|
import {
|
|
24
24
|
isProgrammaticRoutesFileName
|
|
25
25
|
} from "./chunk-EA5K5BKU.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
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 _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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 _chunkRCYINC4Acjs = require('./chunk-RCYINC4A.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
@@ -11,7 +11,7 @@ var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
|
11
11
|
var _url = require('url');
|
|
12
12
|
async function createFarmMarkdownRouteModuleFromFile(filePath, options = {}) {
|
|
13
13
|
const source = await _promises.readFile.call(void 0, filePath, "utf8");
|
|
14
|
-
return
|
|
14
|
+
return _chunkRCYINC4Acjs.createFarmMarkdownRouteModule.call(void 0, {
|
|
15
15
|
source,
|
|
16
16
|
filePath,
|
|
17
17
|
components: options.components,
|
|
@@ -28,7 +28,7 @@ var _chunkPSV6XKPOcjs = require('./chunk-PSV6XKPO.cjs');
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
var
|
|
31
|
+
var _chunk2CT6XUNOcjs = require('./chunk-2CT6XUNO.cjs');
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
var _chunkYFPGHF5Fcjs = require('./chunk-YFPGHF5F.cjs');
|
|
@@ -47,7 +47,7 @@ var _chunkVEKFLAQMcjs = require('./chunk-VEKFLAQM.cjs');
|
|
|
47
47
|
var _chunkOHY2ZWUGcjs = require('./chunk-OHY2ZWUG.cjs');
|
|
48
48
|
|
|
49
49
|
|
|
50
|
-
var
|
|
50
|
+
var _chunkQIH2HD6Hcjs = require('./chunk-QIH2HD6H.cjs');
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
var _chunkUYIHRDE4cjs = require('./chunk-UYIHRDE4.cjs');
|
|
@@ -133,12 +133,19 @@ function resolveFarmAgentConfig(input) {
|
|
|
133
133
|
const jsonLd = _optionalChain([input, 'optionalAccess', _ => _.jsonLd]);
|
|
134
134
|
return {
|
|
135
135
|
jsonLd: !jsonLd ? false : jsonLd === true ? {} : jsonLd,
|
|
136
|
-
noindexPreviews:
|
|
137
|
-
llmsTxt:
|
|
138
|
-
crawlers:
|
|
136
|
+
noindexPreviews: _chunk2CT6XUNOcjs.resolveFarmNoindexPreviews.call(void 0, _optionalChain([input, 'optionalAccess', _2 => _2.noindexPreviews])),
|
|
137
|
+
llmsTxt: _chunk2CT6XUNOcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([input, 'optionalAccess', _3 => _3.llmsTxt])),
|
|
138
|
+
crawlers: _chunk2CT6XUNOcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([input, 'optionalAccess', _4 => _4.crawlers])),
|
|
139
|
+
apiCatalog: resolveFarmApiCatalogEnabled(_optionalChain([input, 'optionalAccess', _5 => _5.apiCatalog]))
|
|
139
140
|
};
|
|
140
141
|
}
|
|
141
142
|
_chunkS3JO3N4Hcjs.__name.call(void 0, resolveFarmAgentConfig, "resolveFarmAgentConfig");
|
|
143
|
+
function resolveFarmApiCatalogEnabled(input) {
|
|
144
|
+
if (input === void 0) return false;
|
|
145
|
+
if (typeof input !== "boolean") throw new TypeError("agent.apiCatalog must be a boolean.");
|
|
146
|
+
return input;
|
|
147
|
+
}
|
|
148
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, resolveFarmApiCatalogEnabled, "resolveFarmApiCatalogEnabled");
|
|
142
149
|
|
|
143
150
|
// src/docs/framework-detect.ts
|
|
144
151
|
var _promises = require('fs/promises');
|
|
@@ -214,7 +221,7 @@ async function applyFarmDocsFrameworkAutoDetection(userConfig, options) {
|
|
|
214
221
|
/* @vite-ignore */
|
|
215
222
|
_url.pathToFileURL.call(void 0, configEntryPath).href
|
|
216
223
|
);
|
|
217
|
-
const withDocs = _optionalChain([frameworkConfig, 'optionalAccess',
|
|
224
|
+
const withDocs = _optionalChain([frameworkConfig, 'optionalAccess', _6 => _6.withDocs]);
|
|
218
225
|
if (typeof withDocs !== "function") {
|
|
219
226
|
noticeOnce(
|
|
220
227
|
"missing-withdocs",
|
|
@@ -224,7 +231,7 @@ async function applyFarmDocsFrameworkAutoDetection(userConfig, options) {
|
|
|
224
231
|
return userConfig;
|
|
225
232
|
}
|
|
226
233
|
const applied = withDocs(userConfig);
|
|
227
|
-
const adapter = _optionalChain([applied, 'optionalAccess',
|
|
234
|
+
const adapter = _optionalChain([applied, 'optionalAccess', _7 => _7.docs, 'optionalAccess', _8 => _8.adapter]);
|
|
228
235
|
if (!isSupportedAdapterDescriptor(adapter)) {
|
|
229
236
|
noticeOnce(
|
|
230
237
|
"unsupported-descriptor",
|
|
@@ -335,7 +342,7 @@ var PLATFORM_BUILD_ENV_TARGETS = [
|
|
|
335
342
|
];
|
|
336
343
|
function detectPlatformDeployTarget(env = process.env) {
|
|
337
344
|
for (const [key, target] of PLATFORM_BUILD_ENV_TARGETS) {
|
|
338
|
-
const value = _optionalChain([env, 'access',
|
|
345
|
+
const value = _optionalChain([env, 'access', _9 => _9[key], 'optionalAccess', _10 => _10.trim, 'call', _11 => _11(), 'access', _12 => _12.toLowerCase, 'call', _13 => _13()]);
|
|
339
346
|
if (value === "1" || value === "true") return target;
|
|
340
347
|
}
|
|
341
348
|
return void 0;
|
|
@@ -375,7 +382,7 @@ function resolveDeployConfig(config, overrides = {}) {
|
|
|
375
382
|
);
|
|
376
383
|
}
|
|
377
384
|
}
|
|
378
|
-
const platformOutput = resolvedTarget === "vercel" ? _optionalChain([deploy, 'access',
|
|
385
|
+
const platformOutput = resolvedTarget === "vercel" ? _optionalChain([deploy, 'access', _14 => _14.vercel, 'optionalAccess', _15 => _15.outputDirectory]) : resolvedTarget === "cloudflare" ? _optionalChain([deploy, 'access', _16 => _16.cloudflare, 'optionalAccess', _17 => _17.outputDir]) : resolvedTarget === "netlify" ? _optionalChain([deploy, 'access', _18 => _18.netlify, 'optionalAccess', _19 => _19.outputDir]) : void 0;
|
|
379
386
|
const outputDir = overrides.outputDir || deploy.outputDir || deploy.output || platformOutput || getDefaultDeployOutputDir(resolvedTarget, preset, distDir);
|
|
380
387
|
return {
|
|
381
388
|
...deploy,
|
|
@@ -571,14 +578,14 @@ async function resolveDocsConfig(userDocs, options = {}) {
|
|
|
571
578
|
config: void 0,
|
|
572
579
|
configPath: void 0
|
|
573
580
|
});
|
|
574
|
-
const loadedDocsConfig = sanitizeDocsConfig(_optionalChain([loadedConfig, 'optionalAccess',
|
|
581
|
+
const loadedDocsConfig = sanitizeDocsConfig(_optionalChain([loadedConfig, 'optionalAccess', _20 => _20.config]) || {});
|
|
575
582
|
const mergedDocsConfig = {
|
|
576
583
|
...loadedDocsConfig,
|
|
577
584
|
...inlineDocsConfig,
|
|
578
585
|
...directDocsConfig
|
|
579
586
|
};
|
|
580
587
|
const runtimeDocsConfig = {
|
|
581
|
-
..._optionalChain([loadedConfig, 'optionalAccess',
|
|
588
|
+
..._optionalChain([loadedConfig, 'optionalAccess', _21 => _21.config]) || {},
|
|
582
589
|
...isRecord(docsOptions.config) ? docsOptions.config : {},
|
|
583
590
|
...omitUndefined({
|
|
584
591
|
...docsOptions,
|
|
@@ -604,7 +611,7 @@ async function resolveDocsConfig(userDocs, options = {}) {
|
|
|
604
611
|
entry: entryRoute,
|
|
605
612
|
...docsOptions.adapter ? { adapter: docsOptions.adapter } : {},
|
|
606
613
|
contentDir,
|
|
607
|
-
configPath: _optionalChain([loadedConfig, 'optionalAccess',
|
|
614
|
+
configPath: _optionalChain([loadedConfig, 'optionalAccess', _22 => _22.configPath]),
|
|
608
615
|
config: {
|
|
609
616
|
...mergedDocsConfig,
|
|
610
617
|
entry: docsEntry,
|
|
@@ -673,9 +680,9 @@ async function resolveConfig(userConfig, mode) {
|
|
|
673
680
|
const routeRules = _chunkQ5B3KJBPcjs.normalizeRouteRules.call(void 0, userConfig.routeRules);
|
|
674
681
|
const routeRuleRedirects = _chunkQ5B3KJBPcjs.routeRulesToRedirects.call(void 0, routeRules);
|
|
675
682
|
const routeRuleHeaders = _chunkQ5B3KJBPcjs.routeRulesToHeaders.call(void 0, routeRules);
|
|
676
|
-
const security =
|
|
677
|
-
const securityHeader =
|
|
678
|
-
if (
|
|
683
|
+
const security = _chunk2CT6XUNOcjs.resolveFarmSecurityConfig.call(void 0, userConfig.security);
|
|
684
|
+
const securityHeader = _chunk2CT6XUNOcjs.getFarmSecurityHeader.call(void 0, security);
|
|
685
|
+
if (_chunk2CT6XUNOcjs.farmCspBlocksFrameworkInlineScripts.call(void 0, security)) {
|
|
679
686
|
_chunk5QIKR7RRcjs.logger.warn(
|
|
680
687
|
"security.csp blocks the inline scripts Farm injects for theming and hydration. Set security.csp.nonce to true for managed dynamic nonces and prerendered hashes, or make the governing script directive allow 'unsafe-inline' without a nonce, hash, or 'strict-dynamic' source."
|
|
681
688
|
);
|
|
@@ -684,14 +691,14 @@ async function resolveConfig(userConfig, mode) {
|
|
|
684
691
|
const root = userConfig.root || process.cwd();
|
|
685
692
|
const srcDir = userConfig.srcDir || "src";
|
|
686
693
|
const docs = await resolveDocsConfig(userConfig.docs, { root, srcDir });
|
|
687
|
-
const md =
|
|
694
|
+
const md = _chunkQIH2HD6Hcjs.resolveMarkdownConfig.call(void 0, userConfig.md);
|
|
688
695
|
const mdx = _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, userConfig.mdx);
|
|
689
696
|
const env = _chunkVEKFLAQMcjs.resolveEnv.call(void 0, userConfig.env, process.env);
|
|
690
697
|
_chunkVEKFLAQMcjs.setEnv.call(void 0, env);
|
|
691
698
|
const api = await _chunkS3A45T7Fcjs.resolveFarmAPIConfig.call(void 0, userConfig.api, { root, mode, env });
|
|
692
699
|
const auth = _chunkQBPXNZGVcjs.resolveFarmAuthConfig.call(void 0, userConfig.auth);
|
|
693
700
|
const mcp = resolveFarmMCPConfig(userConfig.mcp);
|
|
694
|
-
if (auth.enabled && _optionalChain([userConfig, 'access',
|
|
701
|
+
if (auth.enabled && _optionalChain([userConfig, 'access', _23 => _23.integrations, 'optionalAccess', _24 => _24.auth])) {
|
|
695
702
|
throw new Error(
|
|
696
703
|
"Choose either the top-level `auth` config or `integrations.auth`; they cannot both own the auth route."
|
|
697
704
|
);
|
|
@@ -701,7 +708,7 @@ async function resolveConfig(userConfig, mode) {
|
|
|
701
708
|
mode
|
|
702
709
|
});
|
|
703
710
|
const nativeMCPPlugin = await resolveFarmMCPPlugin(mcp, { root });
|
|
704
|
-
if (nativeMCPPlugin && _optionalChain([userConfig, 'access',
|
|
711
|
+
if (nativeMCPPlugin && _optionalChain([userConfig, 'access', _25 => _25.plugins, 'optionalAccess', _26 => _26.some, 'call', _27 => _27((plugin) => _optionalChain([plugin, 'optionalAccess', _28 => _28.name]) === "farm:api-mcp")])) {
|
|
705
712
|
throw new Error(
|
|
706
713
|
"Choose either the top-level `mcp` config or `apiMcp()` in `plugins`; they configure the same MCP transport."
|
|
707
714
|
);
|
|
@@ -775,7 +782,7 @@ async function resolveConfig(userConfig, mode) {
|
|
|
775
782
|
], "headers"),
|
|
776
783
|
routeRules,
|
|
777
784
|
images: _chunkYFPGHF5Fcjs.resolveFarmImageConfig.call(void 0, userConfig.images),
|
|
778
|
-
performance:
|
|
785
|
+
performance: _chunk2CT6XUNOcjs.resolveFarmPerformanceConfig.call(void 0, userConfig.performance),
|
|
779
786
|
theme: _chunkOI6CMLWXcjs.resolveFarmThemeConfig.call(void 0, userConfig.theme, basePath),
|
|
780
787
|
publicDir: userConfig.publicDir || "public",
|
|
781
788
|
i18n: _chunkHBTUGXHScjs.resolveFarmI18nConfig.call(void 0, userConfig.i18n, { root, mode, basePath }),
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
resolveFarmNoindexPreviews,
|
|
29
29
|
resolveFarmPerformanceConfig,
|
|
30
30
|
resolveFarmSecurityConfig
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-RAI7NULA.mjs";
|
|
32
32
|
import {
|
|
33
33
|
resolveFarmImageConfig
|
|
34
34
|
} from "./chunk-G2KY33I6.mjs";
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
} from "./chunk-FA2W42OV.mjs";
|
|
48
48
|
import {
|
|
49
49
|
resolveMarkdownConfig
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-OOIL3BWR.mjs";
|
|
51
51
|
import {
|
|
52
52
|
bundleNodeModule
|
|
53
53
|
} from "./chunk-SFGWNC43.mjs";
|
|
@@ -135,10 +135,17 @@ function resolveFarmAgentConfig(input) {
|
|
|
135
135
|
jsonLd: !jsonLd ? false : jsonLd === true ? {} : jsonLd,
|
|
136
136
|
noindexPreviews: resolveFarmNoindexPreviews(input?.noindexPreviews),
|
|
137
137
|
llmsTxt: resolveFarmLlmsTxtConfig(input?.llmsTxt),
|
|
138
|
-
crawlers: resolveFarmAgentCrawlers(input?.crawlers)
|
|
138
|
+
crawlers: resolveFarmAgentCrawlers(input?.crawlers),
|
|
139
|
+
apiCatalog: resolveFarmApiCatalogEnabled(input?.apiCatalog)
|
|
139
140
|
};
|
|
140
141
|
}
|
|
141
142
|
__name(resolveFarmAgentConfig, "resolveFarmAgentConfig");
|
|
143
|
+
function resolveFarmApiCatalogEnabled(input) {
|
|
144
|
+
if (input === void 0) return false;
|
|
145
|
+
if (typeof input !== "boolean") throw new TypeError("agent.apiCatalog must be a boolean.");
|
|
146
|
+
return input;
|
|
147
|
+
}
|
|
148
|
+
__name(resolveFarmApiCatalogEnabled, "resolveFarmApiCatalogEnabled");
|
|
142
149
|
|
|
143
150
|
// src/docs/framework-detect.ts
|
|
144
151
|
import { readFile } from "fs/promises";
|