@farm.js/core 0.1.40 → 0.1.41
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-mcp-XNF4JqHw.d.mts → agent-mcp-BOqIxJLI.d.mts} +8 -2
- package/dist/{agent-mcp-DRlXq3lM.d.ts → agent-mcp-D0eZKfci.d.ts} +8 -2
- package/dist/agent-runtime.d.mts +2 -2
- package/dist/agent-runtime.d.ts +2 -2
- package/dist/api/client.cjs +3 -3
- package/dist/api/client.mjs +2 -2
- package/dist/api/route-manager.cjs +8 -8
- package/dist/api/route-manager.d.mts +4 -4
- package/dist/api/route-manager.d.ts +4 -4
- package/dist/api/route-manager.mjs +7 -7
- package/dist/api/runtime.cjs +6 -6
- package/dist/api/runtime.d.mts +3 -3
- package/dist/api/runtime.d.ts +3 -3
- package/dist/api/runtime.mjs +5 -5
- package/dist/api.cjs +10 -10
- package/dist/api.d.mts +4 -4
- package/dist/api.d.ts +4 -4
- package/dist/api.mjs +9 -9
- package/dist/{app-CWjCklhF.d.mts → app-CzTSMJaf.d.mts} +5 -5
- package/dist/{app-CDJHPqZn.d.ts → app-DM8e1z3G.d.ts} +5 -5
- package/dist/app-markdown.d.mts +3 -3
- package/dist/app-markdown.d.ts +3 -3
- package/dist/cache.cjs +3 -3
- package/dist/cache.mjs +2 -2
- package/dist/{chunk-UM3ZV5EP.mjs → chunk-24SP5TGU.mjs} +1 -1
- package/dist/{chunk-B6IMBBOS.cjs → chunk-25LPIZSX.cjs} +3 -3
- package/dist/{chunk-WW374SGU.mjs → chunk-26RUNDIR.mjs} +1 -1
- package/dist/{chunk-B77AUCBV.cjs → chunk-2FUIT2G2.cjs} +3 -3
- package/dist/{chunk-54QWHSNR.cjs → chunk-32TZ3QTP.cjs} +149 -155
- package/dist/{chunk-BPGO2IEP.mjs → chunk-35WS7P2V.mjs} +24 -126
- package/dist/{chunk-CKFK3Z2V.mjs → chunk-4C7KTKX7.mjs} +1 -1
- package/dist/{chunk-MNUSIXGS.mjs → chunk-4KQDHTWX.mjs} +1 -1
- package/dist/{chunk-DATEWH3W.cjs → chunk-6IZWX6ES.cjs} +22 -8
- package/dist/{chunk-Y6LRPO2K.mjs → chunk-6LVRDOAW.mjs} +19 -5
- package/dist/{chunk-UMQAK3KP.cjs → chunk-6MVFHNYZ.cjs} +2 -2
- package/dist/{chunk-OLQ73ZO5.mjs → chunk-6PKXK4TY.mjs} +3 -3
- package/dist/{chunk-PYQ3ZG4Z.mjs → chunk-724JLMS4.mjs} +4 -4
- package/dist/{chunk-PNCM5MFD.mjs → chunk-7UEEHAW7.mjs} +1 -1
- package/dist/{chunk-7VAJSSPG.mjs → chunk-B2GSRB3P.mjs} +1 -1
- package/dist/{chunk-ZKVJYQPO.mjs → chunk-BGGWKZ2V.mjs} +11 -10
- package/dist/{chunk-JXB6DVCO.mjs → chunk-BPNRQ5BA.mjs} +1 -1
- package/dist/{chunk-GNVEJUT5.cjs → chunk-C5KVWHIH.cjs} +21 -21
- package/dist/chunk-COABSY3U.mjs +196 -0
- package/dist/{chunk-Y2GNNXGV.cjs → chunk-D64OPY6A.cjs} +5 -5
- package/dist/{chunk-DKU6NXRK.cjs → chunk-EH3464KF.cjs} +1 -1
- package/dist/{chunk-Y4QVEU67.mjs → chunk-ENOBPDKZ.mjs} +2 -2
- package/dist/{chunk-FLZ4H25A.cjs → chunk-EX4MKHXN.cjs} +6 -6
- package/dist/{chunk-I64GEPOB.cjs → chunk-FEYQCYT7.cjs} +3 -3
- package/dist/{chunk-AXB5P7BK.mjs → chunk-FIAPD365.mjs} +1 -1
- package/dist/{chunk-FCOLU5P6.mjs → chunk-FJGIVDA5.mjs} +38 -15
- package/dist/{chunk-7FHZ3E6D.cjs → chunk-GB7LDGY5.cjs} +2 -2
- package/dist/{chunk-45UZKX2J.mjs → chunk-HJ64F4GS.mjs} +2 -2
- package/dist/{chunk-IRYK4Z5M.cjs → chunk-I5MG3TKE.cjs} +2 -2
- package/dist/{chunk-YR2P74F7.cjs → chunk-IFWSR7YZ.cjs} +2 -2
- package/dist/{chunk-5E65AL7P.mjs → chunk-IN6RCKLL.mjs} +5 -4
- package/dist/{chunk-EORXKFLR.cjs → chunk-JEIG3EWE.cjs} +1 -1
- package/dist/{chunk-TAKG7ZCD.cjs → chunk-JOTUZIM4.cjs} +14 -14
- package/dist/{chunk-TFX4RTH2.mjs → chunk-JOW4HDJO.mjs} +1 -1
- package/dist/{chunk-H44XGLFU.cjs → chunk-L6A26QT5.cjs} +9 -9
- package/dist/{chunk-EW4MEVLE.cjs → chunk-L6HYACBE.cjs} +7 -7
- package/dist/{chunk-OZN4XL6L.cjs → chunk-LIZTLA5F.cjs} +7 -6
- package/dist/{chunk-62DY5GKS.mjs → chunk-LLUA2LSC.mjs} +2 -2
- package/dist/{chunk-LDPKAYVS.cjs → chunk-LYIZHJTK.cjs} +2 -2
- package/dist/{chunk-2DMWQWNJ.mjs → chunk-MEASUNVY.mjs} +1 -1
- package/dist/{chunk-T4II4MMW.mjs → chunk-MHHCLYXU.mjs} +1 -1
- package/dist/{chunk-SHFXCE5A.cjs → chunk-MHN4UR5U.cjs} +4 -4
- package/dist/{chunk-5JEC43MQ.cjs → chunk-MN4TQJ3W.cjs} +9 -9
- package/dist/{chunk-5XS5NCVM.cjs → chunk-MY5PZYAD.cjs} +4 -4
- package/dist/{chunk-2JG2LJDI.cjs → chunk-NBPNUQYO.cjs} +2 -2
- package/dist/{chunk-4XO5GSD6.cjs → chunk-NFG4PUPI.cjs} +2 -2
- package/dist/{chunk-5LL6TKII.mjs → chunk-O7USYJ4U.mjs} +1 -1
- package/dist/{chunk-GKQL726H.cjs → chunk-OQ4YXWH4.cjs} +74 -73
- package/dist/{chunk-VBN3UAPQ.mjs → chunk-P2UJF4SS.mjs} +1 -1
- package/dist/{chunk-PGW7HZE2.cjs → chunk-PN676AZF.cjs} +6 -6
- package/dist/{chunk-IMQO6ZUU.mjs → chunk-PYHPXPSW.mjs} +2 -2
- package/dist/{chunk-KK22JPQM.cjs → chunk-QEILRWVV.cjs} +30 -132
- package/dist/{chunk-UXMIFB44.cjs → chunk-QIBP5EFA.cjs} +5 -5
- package/dist/{chunk-XKIUHXHW.mjs → chunk-R65GCA6A.mjs} +45 -51
- package/dist/{chunk-EGCT3AHF.cjs → chunk-ROQ4C4LJ.cjs} +121 -98
- package/dist/{chunk-QJM7A4CR.cjs → chunk-S7MTDRYA.cjs} +10 -10
- package/dist/{chunk-ACLPN56I.mjs → chunk-SGB4IW7K.mjs} +1 -1
- package/dist/{chunk-T6DLMX5V.mjs → chunk-SVPGWJZF.mjs} +3 -3
- package/dist/{chunk-I63UCMXW.mjs → chunk-ULQOP5UI.mjs} +2 -2
- package/dist/{chunk-HBEBV7OZ.mjs → chunk-UQUEANTY.mjs} +1 -1
- package/dist/chunk-VHRS3MCW.cjs +196 -0
- package/dist/{chunk-H56MQYEG.mjs → chunk-VLPII2JJ.mjs} +1 -1
- package/dist/{chunk-WCWV25PG.mjs → chunk-VTBXE6QG.mjs} +2 -2
- package/dist/{chunk-E55H6UKH.cjs → chunk-WLHA5USH.cjs} +9 -9
- package/dist/{chunk-YJBWB6GF.mjs → chunk-WMBRZI5V.mjs} +1 -1
- package/dist/{chunk-AGR7F3LA.cjs → chunk-WROEFVNO.cjs} +3 -3
- package/dist/{chunk-CA62IQY3.cjs → chunk-WU7ZS3EM.cjs} +2 -2
- package/dist/{chunk-ZOABCQGT.mjs → chunk-X3NGFVRF.mjs} +37 -22
- package/dist/{chunk-XJAEZCT6.mjs → chunk-XUC6CFLE.mjs} +1 -1
- package/dist/{chunk-6ILGLCXF.cjs → chunk-YWCYV7QC.cjs} +8 -8
- package/dist/{chunk-T36UJS3X.mjs → chunk-YYQVGKO5.mjs} +2 -2
- package/dist/{chunk-XVIEGKTT.cjs → chunk-ZTP3BJG6.cjs} +41 -26
- package/dist/{client-plugins-B_5QbNrp.d.mts → client-plugins-CkYwvDJ0.d.mts} +1 -1
- package/dist/{client-plugins-DgSfIWIF.d.ts → client-plugins-DfeKd0sD.d.ts} +1 -1
- package/dist/client-plugins.d.mts +2 -2
- package/dist/client-plugins.d.ts +2 -2
- package/dist/client.cjs +5 -5
- package/dist/client.d.mts +6 -6
- package/dist/client.d.ts +6 -6
- package/dist/client.mjs +4 -4
- package/dist/client.react-server.mjs +2 -0
- package/dist/config.d.mts +2 -2
- package/dist/config.d.ts +2 -2
- package/dist/{devtools-ANJ7JAPQ.cjs → devtools-2YHAJYH6.cjs} +5 -5
- package/dist/{devtools-VEQQDVHE.mjs → devtools-N3QLRIQU.mjs} +4 -4
- package/dist/docs.cjs +7 -7
- package/dist/docs.d.mts +3 -3
- package/dist/docs.d.ts +3 -3
- package/dist/docs.mjs +6 -6
- package/dist/headers.cjs +4 -4
- package/dist/headers.mjs +3 -3
- package/dist/image/server.d.mts +1 -1
- package/dist/image/server.d.ts +1 -1
- package/dist/image/sharp.d.mts +1 -1
- package/dist/image/sharp.d.ts +1 -1
- package/dist/{image-config-Duob7wER.d.ts → image-config-BpH1q5R8.d.mts} +4 -1
- package/dist/{image-config-Duob7wER.d.mts → image-config-BpH1q5R8.d.ts} +4 -1
- package/dist/image.d.mts +1 -1
- package/dist/image.d.ts +1 -1
- package/dist/index.cjs +39 -37
- package/dist/index.d.mts +15 -135
- package/dist/index.d.ts +15 -135
- package/dist/index.mjs +38 -36
- package/dist/integrations.d.mts +2 -2
- package/dist/integrations.d.ts +2 -2
- package/dist/internal/app-markdown-runtime.d.mts +3 -3
- package/dist/internal/app-markdown-runtime.d.ts +3 -3
- package/dist/internal/build-runtime.cjs +22 -22
- package/dist/internal/build-runtime.d.mts +4 -4
- package/dist/internal/build-runtime.d.ts +4 -4
- package/dist/internal/build-runtime.mjs +21 -21
- package/dist/internal/cli-runtime.cjs +12 -12
- package/dist/internal/cli-runtime.mjs +11 -11
- 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 +5 -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 +4 -4
- package/dist/internal/docs-precompiled-runtime.cjs +3 -3
- package/dist/internal/docs-precompiled-runtime.mjs +2 -2
- package/dist/internal/infra-analytics-runtime.cjs +5 -5
- package/dist/internal/infra-analytics-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 +20 -12
- package/dist/internal/production-runtime.d.mts +30 -10
- package/dist/internal/production-runtime.d.ts +30 -10
- package/dist/internal/production-runtime.mjs +20 -12
- package/dist/markdown.d.mts +2 -2
- package/dist/markdown.d.ts +2 -2
- package/dist/middleware.cjs +7 -7
- package/dist/middleware.d.mts +4 -4
- package/dist/middleware.d.ts +4 -4
- package/dist/middleware.mjs +6 -6
- package/dist/navigation.cjs +4 -4
- package/dist/navigation.d.mts +5 -5
- package/dist/navigation.d.ts +5 -5
- package/dist/navigation.mjs +3 -3
- package/dist/{nitro-NFG2LBRC.mjs → nitro-KDACKNHU.mjs} +1 -1
- package/dist/{nitro-S2QABUFA.cjs → nitro-NPGU6VBT.cjs} +2 -2
- package/dist/plugin.cjs +20 -20
- package/dist/plugin.d.mts +4 -3
- package/dist/plugin.d.ts +4 -3
- package/dist/plugin.mjs +19 -19
- package/dist/{production-runtime-j_WCfuwB.d.mts → production-runtime-BTkXQdYy.d.mts} +1 -1
- package/dist/{production-runtime-DfknD3g_.d.ts → production-runtime-DFC7pgbp.d.ts} +1 -1
- package/dist/query/client.cjs +2 -2
- package/dist/query/client.mjs +3 -3
- package/dist/{render-plan-ChUtsymc.d.mts → render-plan-5rFeWmk7.d.mts} +1 -1
- package/dist/{render-plan-CFIhcYYS.d.ts → render-plan-BoAK9xFC.d.ts} +1 -1
- package/dist/renderer-client.d.mts +4 -4
- package/dist/renderer-client.d.ts +4 -4
- package/dist/{request-F4HRwzSd.d.mts → request-BxBWigtl.d.mts} +1 -1
- package/dist/{request-RJvelT8L.d.ts → request-fciwmd3n.d.ts} +1 -1
- package/dist/request.cjs +3 -3
- package/dist/request.d.mts +3 -3
- package/dist/request.d.ts +3 -3
- package/dist/request.mjs +2 -2
- package/dist/{route-rendering-3a4fbNyC.d.mts → route-rendering-BCM1QzEf.d.mts} +1 -1
- package/dist/{route-rendering-D4coJ-kw.d.ts → route-rendering-BLZT0IP0.d.ts} +1 -1
- package/dist/{router-WLEW3Te1.d.ts → router-CkheNX3-.d.ts} +1 -1
- package/dist/{router-DqIssGRO.d.mts → router-DyZJWc1_.d.mts} +1 -1
- package/dist/routes.cjs +4 -4
- package/dist/routes.d.mts +2 -2
- package/dist/routes.d.ts +2 -2
- package/dist/routes.mjs +3 -3
- package/dist/{runtime-BrNdLOq9.d.ts → runtime-DfU4sKa5.d.ts} +1 -1
- package/dist/{runtime-CmE_j-js.d.mts → runtime-wexvUN5J.d.mts} +1 -1
- package/dist/server-fn.cjs +4 -4
- package/dist/server-fn.mjs +3 -3
- package/dist/server-plugins.cjs +5 -5
- package/dist/server-plugins.d.mts +3 -3
- package/dist/server-plugins.d.ts +3 -3
- package/dist/server-plugins.mjs +4 -4
- package/dist/server-query.cjs +5 -5
- package/dist/server-query.mjs +4 -4
- package/dist/server.cjs +45 -45
- package/dist/server.d.mts +10 -9
- package/dist/server.d.ts +10 -9
- package/dist/server.mjs +24 -24
- package/dist/{spa-router-D_0VXqPC.d.ts → spa-router-CcejECnG.d.ts} +2 -2
- package/dist/{spa-router-C41zjnFl.d.mts → spa-router-DgsMXqfX.d.mts} +2 -2
- package/dist/ssg-1FGaFISl.d.ts +184 -0
- package/dist/ssg-Bg4bMMhM.d.mts +184 -0
- package/dist/testing.cjs +11 -11
- package/dist/testing.d.mts +2 -2
- package/dist/testing.d.ts +2 -2
- package/dist/testing.mjs +8 -8
- package/dist/theme/server.cjs +4 -4
- package/dist/theme/server.mjs +3 -3
- package/dist/{utils-BKWSe3S7.d.mts → utils-8wtTYiH4.d.mts} +1 -1
- package/dist/{utils-YYcWsOJp.d.ts → utils-Dxbh6Hgj.d.ts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +37 -21
- package/dist/vite.d.mts +41 -4
- package/dist/vite.d.ts +41 -4
- package/dist/vite.mjs +37 -21
- package/dist/workflows.cjs +2 -2
- package/dist/workflows.mjs +1 -1
- package/package.json +2 -1
- package/dist/chunk-DAO7JGTS.mjs +0 -73
- package/dist/chunk-SYQ3MOWW.cjs +0 -73
- package/dist/programmatic-routes-client-DcoxEaLe.d.mts +0 -55
- package/dist/programmatic-routes-client-DcoxEaLe.d.ts +0 -55
- /package/dist/{chunk-MOSYH4CY.mjs → chunk-FWCGUVVL.mjs} +0 -0
- /package/dist/{chunk-4A3YUB4D.cjs → chunk-KF6VDJH7.cjs} +0 -0
|
@@ -9,10 +9,10 @@ var _chunk4PPEPOZZcjs = require('./chunk-4PPEPOZZ.cjs');
|
|
|
9
9
|
var _chunkMQ3H6LT5cjs = require('./chunk-MQ3H6LT5.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkS7MTDRYAcjs = require('./chunk-S7MTDRYA.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkKF6VDJH7cjs = require('./chunk-KF6VDJH7.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
var _chunk2CQ74SP6cjs = require('./chunk-2CQ74SP6.cjs');
|
|
@@ -23,7 +23,7 @@ var _chunk2CQ74SP6cjs = require('./chunk-2CQ74SP6.cjs');
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _chunkQIBP5EFAcjs = require('./chunk-QIBP5EFA.cjs');
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
var _chunkCGVPXIRNcjs = require('./chunk-CGVPXIRN.cjs');
|
|
@@ -47,7 +47,7 @@ var _chunkUQZ4AYTHcjs = require('./chunk-UQZ4AYTH.cjs');
|
|
|
47
47
|
var _chunk5NAVKJCZcjs = require('./chunk-5NAVKJCZ.cjs');
|
|
48
48
|
|
|
49
49
|
|
|
50
|
-
var
|
|
50
|
+
var _chunkZTP3BJG6cjs = require('./chunk-ZTP3BJG6.cjs');
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
|
|
@@ -114,7 +114,7 @@ function farmApiPlugin(options = {}) {
|
|
|
114
114
|
const existing = apiRoutesCache.get(routePath);
|
|
115
115
|
const existingFile = _optionalChain([endpointSources, 'access', _ => _.get, 'call', _2 => _2(routePath), 'optionalAccess', _3 => _3.get, 'call', _4 => _4(normalizedMethod)]);
|
|
116
116
|
if (existingFile) {
|
|
117
|
-
throw new (0,
|
|
117
|
+
throw new (0, _chunkS7MTDRYAcjs.APIRouteConflictError)(routePath, normalizedMethod, existingFile, filePath);
|
|
118
118
|
}
|
|
119
119
|
if (existing) {
|
|
120
120
|
if (!existing.methods.includes(normalizedMethod)) {
|
|
@@ -190,7 +190,7 @@ function farmApiPlugin(options = {}) {
|
|
|
190
190
|
const createRouter = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => {
|
|
191
191
|
const plugins = options.plugins ? await (_nullishCoalesce(routePlugins, () => ( (routePlugins = Promise.resolve(options.plugins({ root: projectRoot })))))) : [];
|
|
192
192
|
pluginMergedRoutes = plugins.length ? new Map(
|
|
193
|
-
|
|
193
|
+
_chunkQIBP5EFAcjs.mergePluginAPIRoutes.call(void 0, [...apiRoutesCache.values()], plugins, void 0, {
|
|
194
194
|
bodySizeLimit,
|
|
195
195
|
// A plugin calling an app endpoint (an MCP tool, say) goes back through this server,
|
|
196
196
|
// so the middleware that guards the endpoint's path runs for it.
|
|
@@ -210,7 +210,7 @@ function farmApiPlugin(options = {}) {
|
|
|
210
210
|
const url = new URL(request.url);
|
|
211
211
|
const method = request.method.toUpperCase();
|
|
212
212
|
const pathname = url.pathname;
|
|
213
|
-
const match =
|
|
213
|
+
const match = _chunkQIBP5EFAcjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), pathname, basePath);
|
|
214
214
|
if (!match) {
|
|
215
215
|
return new Response(JSON.stringify({ error: "Not Found" }), {
|
|
216
216
|
status: 404,
|
|
@@ -218,18 +218,18 @@ function farmApiPlugin(options = {}) {
|
|
|
218
218
|
});
|
|
219
219
|
}
|
|
220
220
|
const { route, params } = match;
|
|
221
|
-
const endpoint =
|
|
221
|
+
const endpoint = _chunkQIBP5EFAcjs.resolveAPIRouteEndpoint.call(void 0, route, method);
|
|
222
222
|
if (!endpoint) {
|
|
223
223
|
return new Response(JSON.stringify({ error: "Method Not Allowed" }), {
|
|
224
224
|
status: 405,
|
|
225
225
|
headers: {
|
|
226
|
-
Allow:
|
|
226
|
+
Allow: _chunkQIBP5EFAcjs.getAllowedAPIRouteMethods.call(void 0, route).join(", "),
|
|
227
227
|
"Content-Type": "application/json"
|
|
228
228
|
}
|
|
229
229
|
});
|
|
230
230
|
}
|
|
231
231
|
try {
|
|
232
|
-
return await
|
|
232
|
+
return await _chunkQIBP5EFAcjs.invokeAPIRouteEndpoint.call(void 0, endpoint, request, params, bodySizeLimit);
|
|
233
233
|
} catch (error) {
|
|
234
234
|
return new Response(JSON.stringify({ error: error.message || "Internal Server Error" }), {
|
|
235
235
|
status: 500,
|
|
@@ -278,7 +278,7 @@ function farmApiPlugin(options = {}) {
|
|
|
278
278
|
const routeModule = await _chunkPJ42JESYcjs.loadFarmDevModule.call(void 0, server, filePath);
|
|
279
279
|
const endpoints = {};
|
|
280
280
|
const availableMethods = [];
|
|
281
|
-
for (const method of
|
|
281
|
+
for (const method of _chunkQIBP5EFAcjs.API_ROUTE_METHODS) {
|
|
282
282
|
if (routeModule[method]) {
|
|
283
283
|
availableMethods.push(method);
|
|
284
284
|
endpoints[method] = routeModule[method];
|
|
@@ -291,7 +291,7 @@ function farmApiPlugin(options = {}) {
|
|
|
291
291
|
log(`API route discovered: ${availableMethods.join(", ")} ${routePath}`);
|
|
292
292
|
}
|
|
293
293
|
} catch (e) {
|
|
294
|
-
if (e instanceof
|
|
294
|
+
if (e instanceof _chunkS7MTDRYAcjs.APIRouteConflictError || e instanceof _chunkNO3WWW3Ncjs.AmbiguousRouteError) throw e;
|
|
295
295
|
log(`API route load failed at ${filePath}: ${e.message}`);
|
|
296
296
|
}
|
|
297
297
|
}
|
|
@@ -318,7 +318,7 @@ function farmApiPlugin(options = {}) {
|
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
320
|
} catch (e) {
|
|
321
|
-
if (e instanceof
|
|
321
|
+
if (e instanceof _chunkS7MTDRYAcjs.APIRouteConflictError || e instanceof _chunkNO3WWW3Ncjs.AmbiguousRouteError) throw e;
|
|
322
322
|
log(`Root routes.ts load failed: ${e.message}`);
|
|
323
323
|
}
|
|
324
324
|
break;
|
|
@@ -328,7 +328,7 @@ function farmApiPlugin(options = {}) {
|
|
|
328
328
|
const discoverProgrammaticRoutes = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => {
|
|
329
329
|
const path = await import("path");
|
|
330
330
|
const srcRoot = path.join(server.config.root, srcDir);
|
|
331
|
-
const routeFiles =
|
|
331
|
+
const routeFiles = _chunkKF6VDJH7cjs.findProgrammaticRouteFilesInDir.call(void 0, srcRoot);
|
|
332
332
|
if (routeFiles.length === 0) return;
|
|
333
333
|
const { getProgrammaticRouteManifest } = await import("./routes.cjs");
|
|
334
334
|
for (const routeFile of routeFiles) {
|
|
@@ -349,7 +349,7 @@ function farmApiPlugin(options = {}) {
|
|
|
349
349
|
}
|
|
350
350
|
}
|
|
351
351
|
} catch (e) {
|
|
352
|
-
if (e instanceof
|
|
352
|
+
if (e instanceof _chunkS7MTDRYAcjs.APIRouteConflictError || e instanceof _chunkNO3WWW3Ncjs.AmbiguousRouteError) throw e;
|
|
353
353
|
log(`Programmatic routes file load failed at ${routeFile}: ${e.message}`);
|
|
354
354
|
}
|
|
355
355
|
}
|
|
@@ -401,7 +401,7 @@ function farmApiPlugin(options = {}) {
|
|
|
401
401
|
const pathname = url.split("?")[0];
|
|
402
402
|
const method = req.method || "GET";
|
|
403
403
|
if (discoveryPromise) await waitForDiscovery();
|
|
404
|
-
if (!
|
|
404
|
+
if (!_chunkQIBP5EFAcjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), pathname, basePath)) {
|
|
405
405
|
return next();
|
|
406
406
|
}
|
|
407
407
|
if (!apiRouterHandler) {
|
|
@@ -422,10 +422,10 @@ function farmApiPlugin(options = {}) {
|
|
|
422
422
|
}
|
|
423
423
|
const currentUrl = req.url || url;
|
|
424
424
|
const currentPathname = currentUrl.split("?")[0];
|
|
425
|
-
if (currentPathname !== pathname && !
|
|
425
|
+
if (currentPathname !== pathname && !_chunkQIBP5EFAcjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), currentPathname, basePath)) {
|
|
426
426
|
return next();
|
|
427
427
|
}
|
|
428
|
-
const fullUrl =
|
|
428
|
+
const fullUrl = _chunkZTP3BJG6cjs.resolveFarmRequestURL.call(void 0, req);
|
|
429
429
|
const headers = new Headers();
|
|
430
430
|
for (const [key, value] of Object.entries(req.headers)) {
|
|
431
431
|
if (value) {
|
|
@@ -526,7 +526,7 @@ function farmApiPlugin(options = {}) {
|
|
|
526
526
|
log(`API router recreated`);
|
|
527
527
|
} catch (e) {
|
|
528
528
|
restoreRouteState(previousState);
|
|
529
|
-
if (e instanceof
|
|
529
|
+
if (e instanceof _chunkS7MTDRYAcjs.APIRouteConflictError || e instanceof _chunkNO3WWW3Ncjs.AmbiguousRouteError) throw e;
|
|
530
530
|
log(`Root routes.ts HMR failed: ${e.message}`);
|
|
531
531
|
}
|
|
532
532
|
return [];
|
|
@@ -554,7 +554,7 @@ function farmApiPlugin(options = {}) {
|
|
|
554
554
|
const routeModule = await _chunkPJ42JESYcjs.loadFarmDevModule.call(void 0, server, file);
|
|
555
555
|
removeEndpointsFromFile(file);
|
|
556
556
|
const availableMethods = [];
|
|
557
|
-
for (const method of
|
|
557
|
+
for (const method of _chunkQIBP5EFAcjs.API_ROUTE_METHODS) {
|
|
558
558
|
if (!routeModule[method]) continue;
|
|
559
559
|
availableMethods.push(method);
|
|
560
560
|
addEndpoint(routePath, file, method, routeModule[method]);
|
|
@@ -564,7 +564,7 @@ function farmApiPlugin(options = {}) {
|
|
|
564
564
|
log(`API router recreated`);
|
|
565
565
|
} catch (e) {
|
|
566
566
|
restoreRouteState(previousState);
|
|
567
|
-
if (e instanceof
|
|
567
|
+
if (e instanceof _chunkS7MTDRYAcjs.APIRouteConflictError || e instanceof _chunkNO3WWW3Ncjs.AmbiguousRouteError) throw e;
|
|
568
568
|
log(`API route HMR failed: ${e.message}`);
|
|
569
569
|
}
|
|
570
570
|
return [];
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__name
|
|
3
|
+
} from "./chunk-LPEX4YW6.mjs";
|
|
4
|
+
|
|
5
|
+
// src/route-rendering.ts
|
|
6
|
+
function normalizeDynamicMode(value) {
|
|
7
|
+
switch (value) {
|
|
8
|
+
case "auto":
|
|
9
|
+
case "force-static":
|
|
10
|
+
case "force-dynamic":
|
|
11
|
+
case "error":
|
|
12
|
+
return value;
|
|
13
|
+
default:
|
|
14
|
+
return void 0;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
__name(normalizeDynamicMode, "normalizeDynamicMode");
|
|
18
|
+
function mergeRouteRenderingDirectiveConfig(directiveConfig, mod, options) {
|
|
19
|
+
const pprEnabled = options?.experimentalPPR === true;
|
|
20
|
+
let ssg = directiveConfig?.ssg ?? false;
|
|
21
|
+
let requestedPPR = directiveConfig?.ppr ?? false;
|
|
22
|
+
let revalidate = directiveConfig?.revalidate;
|
|
23
|
+
const moduleDynamic = normalizeDynamicMode(mod?.dynamic);
|
|
24
|
+
const dynamic = moduleDynamic ?? directiveConfig?.dynamic;
|
|
25
|
+
const hasExplicitSsg = typeof mod?.ssg === "boolean";
|
|
26
|
+
const hasExplicitPPR = typeof mod?.ppr === "boolean" || typeof mod?.experimental_ppr === "boolean";
|
|
27
|
+
if (hasExplicitSsg) {
|
|
28
|
+
ssg = mod.ssg === true;
|
|
29
|
+
}
|
|
30
|
+
if (hasExplicitPPR) {
|
|
31
|
+
requestedPPR = mod?.ppr === true || mod?.experimental_ppr === true;
|
|
32
|
+
}
|
|
33
|
+
if (typeof mod?.revalidate === "number") {
|
|
34
|
+
if (mod.revalidate > 0) {
|
|
35
|
+
revalidate = mod.revalidate;
|
|
36
|
+
if (!hasExplicitSsg && !requestedPPR) {
|
|
37
|
+
ssg = true;
|
|
38
|
+
}
|
|
39
|
+
} else {
|
|
40
|
+
revalidate = void 0;
|
|
41
|
+
if (!hasExplicitSsg) {
|
|
42
|
+
ssg = false;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
} else if (mod?.revalidate === false) {
|
|
46
|
+
revalidate = void 0;
|
|
47
|
+
}
|
|
48
|
+
if (moduleDynamic === "force-static" || moduleDynamic === "error") {
|
|
49
|
+
ssg = true;
|
|
50
|
+
requestedPPR = false;
|
|
51
|
+
} else if (moduleDynamic === "force-dynamic") {
|
|
52
|
+
ssg = false;
|
|
53
|
+
requestedPPR = false;
|
|
54
|
+
revalidate = void 0;
|
|
55
|
+
}
|
|
56
|
+
if (directiveConfig?.requestBound && ssg) {
|
|
57
|
+
ssg = false;
|
|
58
|
+
revalidate = void 0;
|
|
59
|
+
}
|
|
60
|
+
const ppr = pprEnabled && !ssg && requestedPPR;
|
|
61
|
+
return {
|
|
62
|
+
ssg,
|
|
63
|
+
ppr,
|
|
64
|
+
revalidate: ssg || ppr ? revalidate : void 0,
|
|
65
|
+
dynamic,
|
|
66
|
+
directive: directiveConfig?.directive
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
__name(mergeRouteRenderingDirectiveConfig, "mergeRouteRenderingDirectiveConfig");
|
|
70
|
+
|
|
71
|
+
// src/ssg-paths.ts
|
|
72
|
+
var OPTIONAL_CATCH_ALL_SEGMENT = /^\[\[\.\.\.([^\]]+)\]\]$/;
|
|
73
|
+
var REQUIRED_CATCH_ALL_SEGMENT = /^\[\.\.\.([^\]]+)\]$/;
|
|
74
|
+
var REQUIRED_DYNAMIC_SEGMENT = /^\[([^\]]+)\]$/;
|
|
75
|
+
function materializeSSGRoutePath(routePattern, params) {
|
|
76
|
+
const outputSegments = [];
|
|
77
|
+
for (const segment of routePattern.split("/")) {
|
|
78
|
+
if (!segment) {
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
const optionalCatchAll = segment.match(OPTIONAL_CATCH_ALL_SEGMENT);
|
|
82
|
+
if (optionalCatchAll) {
|
|
83
|
+
const parameterName = optionalCatchAll[1];
|
|
84
|
+
const value = params[parameterName];
|
|
85
|
+
const values = readCatchAllSegments(value, {
|
|
86
|
+
optional: true,
|
|
87
|
+
parameterName,
|
|
88
|
+
routePattern
|
|
89
|
+
});
|
|
90
|
+
outputSegments.push(...values.map(encodePathSegment));
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
const requiredCatchAll = segment.match(REQUIRED_CATCH_ALL_SEGMENT);
|
|
94
|
+
if (requiredCatchAll) {
|
|
95
|
+
const parameterName = requiredCatchAll[1];
|
|
96
|
+
const value = params[parameterName];
|
|
97
|
+
const values = readCatchAllSegments(value, {
|
|
98
|
+
optional: false,
|
|
99
|
+
parameterName,
|
|
100
|
+
routePattern
|
|
101
|
+
});
|
|
102
|
+
outputSegments.push(...values.map(encodePathSegment));
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
const requiredDynamic = segment.match(REQUIRED_DYNAMIC_SEGMENT);
|
|
106
|
+
if (requiredDynamic) {
|
|
107
|
+
const parameterName = requiredDynamic[1];
|
|
108
|
+
const value = params[parameterName];
|
|
109
|
+
if (isStaticPathArray(value)) {
|
|
110
|
+
throw new Error(
|
|
111
|
+
`Cannot materialize SSG route "${routePattern}": parameter "${parameterName}" must be a scalar value; arrays are only supported for catch-all segments.`
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
if (isMissingPathValue(value)) {
|
|
115
|
+
throw missingRequiredParameterError(routePattern, parameterName);
|
|
116
|
+
}
|
|
117
|
+
outputSegments.push(encodePathSegment(value));
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
outputSegments.push(segment);
|
|
121
|
+
}
|
|
122
|
+
return outputSegments.length > 0 ? `/${outputSegments.join("/")}` : "/";
|
|
123
|
+
}
|
|
124
|
+
__name(materializeSSGRoutePath, "materializeSSGRoutePath");
|
|
125
|
+
function readCatchAllSegments(value, options) {
|
|
126
|
+
if (isMissingPathValue(value) || isStaticPathArray(value) && value.length === 0) {
|
|
127
|
+
if (options.optional) {
|
|
128
|
+
return [];
|
|
129
|
+
}
|
|
130
|
+
throw missingRequiredParameterError(options.routePattern, options.parameterName);
|
|
131
|
+
}
|
|
132
|
+
const segments = isStaticPathArray(value) ? [...value] : [value];
|
|
133
|
+
if (segments.some(isMissingPathValue)) {
|
|
134
|
+
throw new Error(
|
|
135
|
+
`Cannot materialize SSG route "${options.routePattern}": catch-all parameter "${options.parameterName}" contains an empty path segment.`
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
return segments;
|
|
139
|
+
}
|
|
140
|
+
__name(readCatchAllSegments, "readCatchAllSegments");
|
|
141
|
+
function getOptionalCatchAllParameterNames(routePattern) {
|
|
142
|
+
return new Set(
|
|
143
|
+
routePattern.split("/").map((segment) => segment.match(OPTIONAL_CATCH_ALL_SEGMENT)?.[1]).filter((name) => Boolean(name))
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
__name(getOptionalCatchAllParameterNames, "getOptionalCatchAllParameterNames");
|
|
147
|
+
function normalizeStaticPathParams(params, optionalCatchAllParams) {
|
|
148
|
+
const entries = Object.entries(params).map(([key, value]) => {
|
|
149
|
+
const emptyOptionalCatchAll = optionalCatchAllParams.has(key) && (isMissingPathValue(value) || isStaticPathArray(value) && value.length === 0);
|
|
150
|
+
return [
|
|
151
|
+
key,
|
|
152
|
+
emptyOptionalCatchAll ? "" : isStaticPathArray(value) ? value.map(String).join("/") : String(value)
|
|
153
|
+
];
|
|
154
|
+
});
|
|
155
|
+
for (const name of optionalCatchAllParams) {
|
|
156
|
+
if (!Object.prototype.hasOwnProperty.call(params, name)) {
|
|
157
|
+
entries.push([name, ""]);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return Object.fromEntries(entries);
|
|
161
|
+
}
|
|
162
|
+
__name(normalizeStaticPathParams, "normalizeStaticPathParams");
|
|
163
|
+
function isMissingPathValue(value) {
|
|
164
|
+
return value === "" || value === null || typeof value === "undefined";
|
|
165
|
+
}
|
|
166
|
+
__name(isMissingPathValue, "isMissingPathValue");
|
|
167
|
+
function isStaticPathArray(value) {
|
|
168
|
+
return Array.isArray(value);
|
|
169
|
+
}
|
|
170
|
+
__name(isStaticPathArray, "isStaticPathArray");
|
|
171
|
+
function missingRequiredParameterError(routePattern, parameterName) {
|
|
172
|
+
return new Error(
|
|
173
|
+
`Cannot materialize SSG route "${routePattern}": required parameter "${parameterName}" is missing or empty.`
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
__name(missingRequiredParameterError, "missingRequiredParameterError");
|
|
177
|
+
function encodePathSegment(value) {
|
|
178
|
+
const encoded = encodeURIComponent(String(value)).replace(
|
|
179
|
+
/[!'()*]/g,
|
|
180
|
+
(character) => `%${character.charCodeAt(0).toString(16).toUpperCase()}`
|
|
181
|
+
);
|
|
182
|
+
if (encoded === "." || encoded === "..") {
|
|
183
|
+
throw new Error(
|
|
184
|
+
`Cannot materialize SSG path segment "${encoded}": dot-only segments are unsafe to prerender.`
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
return encoded;
|
|
188
|
+
}
|
|
189
|
+
__name(encodePathSegment, "encodePathSegment");
|
|
190
|
+
|
|
191
|
+
export {
|
|
192
|
+
mergeRouteRenderingDirectiveConfig,
|
|
193
|
+
materializeSSGRoutePath,
|
|
194
|
+
getOptionalCatchAllParameterNames,
|
|
195
|
+
normalizeStaticPathParams
|
|
196
|
+
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkNBPNUQYOcjs = require('./chunk-NBPNUQYO.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -86,19 +86,19 @@ var WebResponseHeaderMap = _WebResponseHeaderMap;
|
|
|
86
86
|
var _WebCookieJar = class _WebCookieJar {
|
|
87
87
|
constructor(request, headers) {
|
|
88
88
|
this.headers = headers;
|
|
89
|
-
this.cookies =
|
|
89
|
+
this.cookies = _chunkNBPNUQYOcjs.parseMiddlewareCookieHeader.call(void 0, request.headers.get("cookie"));
|
|
90
90
|
}
|
|
91
91
|
get(name) {
|
|
92
92
|
return this.cookies[name];
|
|
93
93
|
}
|
|
94
94
|
set(name, value, options = {}) {
|
|
95
95
|
this.cookies[name] = value;
|
|
96
|
-
const cookieString =
|
|
96
|
+
const cookieString = _chunkNBPNUQYOcjs.serializeMiddlewareCookie.call(void 0, name, value, options);
|
|
97
97
|
this.headers.appendSetCookie(cookieString);
|
|
98
98
|
}
|
|
99
99
|
delete(name, options = {}) {
|
|
100
100
|
delete this.cookies[name];
|
|
101
|
-
this.headers.appendSetCookie(
|
|
101
|
+
this.headers.appendSetCookie(_chunkNBPNUQYOcjs.serializeMiddlewareCookieDeletion.call(void 0, name, options));
|
|
102
102
|
}
|
|
103
103
|
getAll() {
|
|
104
104
|
return { ...this.cookies };
|
|
@@ -417,7 +417,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, normalizeConfigMiddleware, "normalizeConfi
|
|
|
417
417
|
function normalizeFileMiddleware(modules = []) {
|
|
418
418
|
const entries = [];
|
|
419
419
|
for (const moduleEntry of modules) {
|
|
420
|
-
const normalized =
|
|
420
|
+
const normalized = _chunkNBPNUQYOcjs.normalizeMiddlewareModule.call(void 0, moduleEntry.module, moduleEntry.path);
|
|
421
421
|
if (!normalized) {
|
|
422
422
|
continue;
|
|
423
423
|
}
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
farmCspBlocksFrameworkInlineScripts,
|
|
33
33
|
getFarmSecurityHeader,
|
|
34
34
|
resolveFarmSecurityConfig
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-7UEEHAW7.mjs";
|
|
36
36
|
import {
|
|
37
37
|
loadFarmConfigFile,
|
|
38
38
|
resolveFarmLayers
|
|
@@ -61,7 +61,7 @@ import {
|
|
|
61
61
|
} from "./chunk-SFGWNC43.mjs";
|
|
62
62
|
import {
|
|
63
63
|
resolveWorkflowsConfig
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-BPNRQ5BA.mjs";
|
|
65
65
|
import {
|
|
66
66
|
resolveFarmThemeConfig
|
|
67
67
|
} from "./chunk-AELACLOB.mjs";
|
|
@@ -32,7 +32,7 @@ var _chunkD5IHNDHIcjs = require('./chunk-D5IHNDHI.cjs');
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
var
|
|
35
|
+
var _chunk25LPIZSXcjs = require('./chunk-25LPIZSX.cjs');
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
|
|
@@ -61,7 +61,7 @@ var _chunkD4ROBNTKcjs = require('./chunk-D4ROBNTK.cjs');
|
|
|
61
61
|
var _chunkUYIHRDE4cjs = require('./chunk-UYIHRDE4.cjs');
|
|
62
62
|
|
|
63
63
|
|
|
64
|
-
var
|
|
64
|
+
var _chunkJEIG3EWEcjs = require('./chunk-JEIG3EWE.cjs');
|
|
65
65
|
|
|
66
66
|
|
|
67
67
|
var _chunkOI6CMLWXcjs = require('./chunk-OI6CMLWX.cjs');
|
|
@@ -711,9 +711,9 @@ async function resolveConfig(userConfig, mode) {
|
|
|
711
711
|
const routeRules = _chunkQ5B3KJBPcjs.normalizeRouteRules.call(void 0, userConfig.routeRules);
|
|
712
712
|
const routeRuleRedirects = _chunkQ5B3KJBPcjs.routeRulesToRedirects.call(void 0, routeRules);
|
|
713
713
|
const routeRuleHeaders = _chunkQ5B3KJBPcjs.routeRulesToHeaders.call(void 0, routeRules);
|
|
714
|
-
const security =
|
|
715
|
-
const securityHeader =
|
|
716
|
-
if (
|
|
714
|
+
const security = _chunk25LPIZSXcjs.resolveFarmSecurityConfig.call(void 0, userConfig.security);
|
|
715
|
+
const securityHeader = _chunk25LPIZSXcjs.getFarmSecurityHeader.call(void 0, security);
|
|
716
|
+
if (_chunk25LPIZSXcjs.farmCspBlocksFrameworkInlineScripts.call(void 0, security)) {
|
|
717
717
|
_chunk5QIKR7RRcjs.logger.warn(
|
|
718
718
|
"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."
|
|
719
719
|
);
|
|
@@ -778,7 +778,7 @@ async function resolveConfig(userConfig, mode) {
|
|
|
778
778
|
mdx,
|
|
779
779
|
migrations: resolveMigrationsConfig(userConfig.migrations),
|
|
780
780
|
cron: _chunk6EXBPJ24cjs.resolveCronConfig.call(void 0, userConfig.cron),
|
|
781
|
-
workflows:
|
|
781
|
+
workflows: _chunkJEIG3EWEcjs.resolveWorkflowsConfig.call(void 0, userConfig.workflows),
|
|
782
782
|
api,
|
|
783
783
|
observability: _nullishCoalesce(userConfig.observability, () => ( false)),
|
|
784
784
|
telemetry: userConfig.telemetry !== false,
|
|
@@ -14,7 +14,7 @@ var _chunkSOR334EBcjs = require('./chunk-SOR334EB.cjs');
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunk6MVFHNYZcjs = require('./chunk-6MVFHNYZ.cjs');
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
var _chunkNYJMY3JAcjs = require('./chunk-NYJMY3JA.cjs');
|
|
@@ -616,7 +616,7 @@ async function resolveProgrammaticRouteData(route, dataHooks, context) {
|
|
|
616
616
|
const cacheKey = _chunkNYJMY3JAcjs.createFarmCacheKey.call(void 0, ["route-data", routeDataKey]);
|
|
617
617
|
const cacheOptions = {
|
|
618
618
|
tags: [
|
|
619
|
-
|
|
619
|
+
_chunk6MVFHNYZcjs.createRouteDataCacheTag.call(void 0, routeDataKey),
|
|
620
620
|
...await resolveProgrammaticRouteDataKeys(dataHooks.tags, context)
|
|
621
621
|
],
|
|
622
622
|
paths: [
|
|
@@ -625,7 +625,7 @@ async function resolveProgrammaticRouteData(route, dataHooks, context) {
|
|
|
625
625
|
],
|
|
626
626
|
revalidate
|
|
627
627
|
};
|
|
628
|
-
return
|
|
628
|
+
return _chunk6MVFHNYZcjs.getFarmDataCache.call(void 0, ).getOrSet(cacheKey, () => dataHooks.main(context), cacheOptions);
|
|
629
629
|
}
|
|
630
630
|
_chunkS3JO3N4Hcjs.__name.call(void 0, resolveProgrammaticRouteData, "resolveProgrammaticRouteData");
|
|
631
631
|
async function resolveProgrammaticRouteDataKeys(input, context) {
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
collectSSGPages,
|
|
3
3
|
matchSSGPage,
|
|
4
4
|
resolveRouteRenderingConfigFromFile
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-35WS7P2V.mjs";
|
|
6
6
|
import {
|
|
7
7
|
classifyFarmDocumentPrefix,
|
|
8
8
|
composeFarmFullDocument,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
renderFarmLocaleAlternateLinks,
|
|
25
25
|
resolveDefaultErrorStatus,
|
|
26
26
|
routeBoundaryCoversDirectory
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-SVPGWJZF.mjs";
|
|
28
28
|
import {
|
|
29
29
|
FARM_DEFAULT_MCP_PATH,
|
|
30
30
|
collectFarmDefaultMCPPages,
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
import {
|
|
49
49
|
_setDefaultFarmThemeConfig,
|
|
50
50
|
getTheme
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-FIAPD365.mjs";
|
|
52
52
|
import {
|
|
53
53
|
isSecretDocsConfigKey
|
|
54
54
|
} from "./chunk-J7K2NZD6.mjs";
|
|
@@ -96,7 +96,7 @@ import {
|
|
|
96
96
|
getFarmSecurityHeader,
|
|
97
97
|
resolveFarmSecurityConfig,
|
|
98
98
|
stampFarmCspNonce
|
|
99
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-7UEEHAW7.mjs";
|
|
100
100
|
import {
|
|
101
101
|
getFarmAppDirectories,
|
|
102
102
|
getFarmSourceRoots
|
|
@@ -132,7 +132,7 @@ import {
|
|
|
132
132
|
} from "./chunk-I6UVKUYK.mjs";
|
|
133
133
|
import {
|
|
134
134
|
resolveWorkflowsConfig
|
|
135
|
-
} from "./chunk-
|
|
135
|
+
} from "./chunk-BPNRQ5BA.mjs";
|
|
136
136
|
import {
|
|
137
137
|
initStorage
|
|
138
138
|
} from "./chunk-JGHCKIRI.mjs";
|
|
@@ -161,7 +161,7 @@ import {
|
|
|
161
161
|
import {
|
|
162
162
|
findProgrammaticRouteFiles,
|
|
163
163
|
loadProgrammaticRouteManifests
|
|
164
|
-
} from "./chunk-
|
|
164
|
+
} from "./chunk-FWCGUVVL.mjs";
|
|
165
165
|
import {
|
|
166
166
|
_runWithFarmI18nRequest,
|
|
167
167
|
_setDefaultFarmI18nRuntime,
|
|
@@ -191,7 +191,7 @@ import {
|
|
|
191
191
|
configureFarmCache,
|
|
192
192
|
getFarmDataCache,
|
|
193
193
|
normalizeRevalidatePath
|
|
194
|
-
} from "./chunk-
|
|
194
|
+
} from "./chunk-B2GSRB3P.mjs";
|
|
195
195
|
import {
|
|
196
196
|
toFileModuleUrl
|
|
197
197
|
} from "./chunk-7GNWGLWB.mjs";
|
|
@@ -237,7 +237,7 @@ import {
|
|
|
237
237
|
} from "./chunk-P7XDC7UJ.mjs";
|
|
238
238
|
import {
|
|
239
239
|
FARM_VERSION
|
|
240
|
-
} from "./chunk-
|
|
240
|
+
} from "./chunk-VLPII2JJ.mjs";
|
|
241
241
|
import {
|
|
242
242
|
resolveFarmTrailingSlashRedirect,
|
|
243
243
|
setFarmTrailingSlashPreference
|
|
@@ -284,11 +284,11 @@ import {
|
|
|
284
284
|
createWebRequestFromFarmRequest,
|
|
285
285
|
getCurrentRequestOrNull,
|
|
286
286
|
resolveFarmRequestURL
|
|
287
|
-
} from "./chunk-
|
|
287
|
+
} from "./chunk-X3NGFVRF.mjs";
|
|
288
288
|
import {
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
} from "./chunk-
|
|
289
|
+
_peekCurrentRequest,
|
|
290
|
+
_resolveCurrentCspNonce
|
|
291
|
+
} from "./chunk-6LVRDOAW.mjs";
|
|
292
292
|
import {
|
|
293
293
|
localizeFarmHref,
|
|
294
294
|
localizeFarmPathname,
|
|
@@ -3179,6 +3179,7 @@ function farmFontImportsPlugin(options = {}) {
|
|
|
3179
3179
|
id,
|
|
3180
3180
|
root,
|
|
3181
3181
|
production,
|
|
3182
|
+
importCss: options.importCss,
|
|
3182
3183
|
parse: /* @__PURE__ */ __name((source) => this.parse(source), "parse"),
|
|
3183
3184
|
register: /* @__PURE__ */ __name((moduleId, calls) => registry.register(moduleId, calls, production), "register")
|
|
3184
3185
|
});
|
|
@@ -3219,7 +3220,7 @@ async function transformFarmFontCalls(options) {
|
|
|
3219
3220
|
new Set(calls.map((call) => call.binding).filter((value) => Boolean(value)))
|
|
3220
3221
|
)
|
|
3221
3222
|
);
|
|
3222
|
-
const imports = options.production ? "" : Array.from(new Set(fonts.map((font) => font.id))).map((id) => `import ${JSON.stringify(`virtual:farm-font-css/${id}.css`)};`).join("\n");
|
|
3223
|
+
const imports = options.production && !options.importCss ? "" : Array.from(new Set(fonts.map((font) => font.id))).map((id) => `import ${JSON.stringify(`virtual:farm-font-css/${id}.css`)};`).join("\n");
|
|
3223
3224
|
return {
|
|
3224
3225
|
code: `${applyReplacements(options.code, replacements)}
|
|
3225
3226
|
${imports}
|
|
@@ -5555,7 +5556,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
5555
5556
|
key: pprCacheKey
|
|
5556
5557
|
});
|
|
5557
5558
|
}
|
|
5558
|
-
const outerRequest =
|
|
5559
|
+
const outerRequest = _peekCurrentRequest();
|
|
5559
5560
|
const countRequestReads = /* @__PURE__ */ __name(() => (outerRequest ? _getRequestReadCount(outerRequest) : 0) + _getRequestReadCount(currentRequest), "countRequestReads");
|
|
5560
5561
|
const requestReadsBeforeRender = countRequestReads();
|
|
5561
5562
|
let LoadingFallbackComponent = null;
|
|
@@ -7642,6 +7643,19 @@ function resolveFarmImageProviderForRuntime(images, options) {
|
|
|
7642
7643
|
return Object.freeze({ ...images, provider: "none" });
|
|
7643
7644
|
}
|
|
7644
7645
|
__name(resolveFarmImageProviderForRuntime, "resolveFarmImageProviderForRuntime");
|
|
7646
|
+
function resolveFarmImageServerRuntime(images, preset) {
|
|
7647
|
+
const provider = images.provider ?? "auto";
|
|
7648
|
+
if (provider === "none") return "none";
|
|
7649
|
+
const cloudflarePreset = CLOUDFLARE_IMAGE_PRESETS.has(preset);
|
|
7650
|
+
if (provider === "node" && cloudflarePreset) {
|
|
7651
|
+
throw new Error('images.provider "node" cannot run in a Cloudflare deployment');
|
|
7652
|
+
}
|
|
7653
|
+
if (provider === "cloudflare" && !cloudflarePreset) {
|
|
7654
|
+
throw new Error('images.provider "cloudflare" requires a Cloudflare deployment preset');
|
|
7655
|
+
}
|
|
7656
|
+
return provider === "cloudflare" || provider === "auto" && cloudflarePreset ? "cloudflare" : "node";
|
|
7657
|
+
}
|
|
7658
|
+
__name(resolveFarmImageServerRuntime, "resolveFarmImageServerRuntime");
|
|
7645
7659
|
|
|
7646
7660
|
// src/app-manifest-packages.ts
|
|
7647
7661
|
import fs6 from "fs";
|
|
@@ -8205,9 +8219,17 @@ function farmLayoutComponentKey(Component) {
|
|
|
8205
8219
|
return key;
|
|
8206
8220
|
}
|
|
8207
8221
|
|
|
8222
|
+
// React.Children is React's own; other renderers (Preact) hand children over as plain arrays.
|
|
8223
|
+
function farmChildrenToArray(children) {
|
|
8224
|
+
if (React.Children) return React.Children.toArray(children);
|
|
8225
|
+
return [children].flat(Infinity).filter(function (child) {
|
|
8226
|
+
return child !== null && child !== undefined && typeof child !== "boolean";
|
|
8227
|
+
});
|
|
8228
|
+
}
|
|
8229
|
+
|
|
8208
8230
|
function unwrapFarmDocumentElement(node) {
|
|
8209
8231
|
if (!React.isValidElement(node) || node.type !== "html") return undefined;
|
|
8210
|
-
const children =
|
|
8232
|
+
const children = farmChildrenToArray(node.props.children);
|
|
8211
8233
|
const body = children.find(function (child) {
|
|
8212
8234
|
return React.isValidElement(child) && child.type === "body";
|
|
8213
8235
|
});
|
|
@@ -8675,6 +8697,7 @@ export {
|
|
|
8675
8697
|
createFarmApp,
|
|
8676
8698
|
SHARP_INSTALL_HINT,
|
|
8677
8699
|
resolveFarmImageProviderForRuntime,
|
|
8700
|
+
resolveFarmImageServerRuntime,
|
|
8678
8701
|
resolveFarmAppPackages,
|
|
8679
8702
|
collectFarmWebMCPTools,
|
|
8680
8703
|
generateFarmClientPluginEntryCode,
|