@farm.js/core 0.1.68 → 0.1.69
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.d-wkVPK1GA.d.mts → agent-mcp.d-DOfBMEzP.d.mts} +1 -1
- package/dist/{agent-mcp.d-Uh5xr7aX.d.ts → agent-mcp.d-DnIgriX1.d.ts} +1 -1
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/{analyzer-CQDU7E3Y.mjs → analyzer-NAL5TJUP.mjs} +2 -2
- package/dist/analyzer-SAJSV6SP.cjs +16 -0
- package/dist/api/node.d.mts +3 -3
- package/dist/api/node.d.ts +3 -3
- package/dist/api/route-manager.d.mts +3 -3
- package/dist/api/route-manager.d.ts +3 -3
- package/dist/api/runtime.d.mts +2 -2
- package/dist/api/runtime.d.ts +2 -2
- package/dist/api.cjs +2 -2
- package/dist/api.d.mts +4 -21
- package/dist/api.d.ts +4 -21
- package/dist/api.mjs +1 -1
- package/dist/{app-manifest.d-BT5i2F-o.d.ts → app-manifest.d-CaAcaukR.d.ts} +1 -1
- package/dist/{app-manifest.d-Dd4q5CFx.d.mts → app-manifest.d-_BVbI0xp.d.mts} +1 -1
- package/dist/app-markdown.d.mts +2 -2
- package/dist/app-markdown.d.ts +2 -2
- package/dist/{app.d-BVOpL_f2.d.ts → app.d-BWeDqOaF.d.ts} +4 -4
- package/dist/{app.d-BhiDXex_.d.mts → app.d-CaPwtytN.d.mts} +4 -4
- package/dist/{base-path.d-BOUV5ozD.d.mts → base-path.d-CTDVF0Fc.d.mts} +2 -1
- package/dist/{base-path.d-BOUV5ozD.d.ts → base-path.d-CTDVF0Fc.d.ts} +2 -1
- package/dist/{chunk-SQ6IWJ3H.cjs → chunk-22LGTSBA.cjs} +1 -1
- package/dist/{chunk-T5XFZQCL.mjs → chunk-2P7UYHZP.mjs} +1 -1
- package/dist/{chunk-LDEXTX4I.cjs → chunk-4JRAMCUP.cjs} +11 -4
- package/dist/{chunk-TNK2TVRS.cjs → chunk-4W4ZWSV2.cjs} +196 -155
- package/dist/{chunk-MNJDNTGO.mjs → chunk-5TOWKGV3.mjs} +1 -1
- package/dist/{chunk-7LK5CTUM.cjs → chunk-6GQJVY4E.cjs} +18 -13
- package/dist/{chunk-5JKDFRTK.cjs → chunk-ABIBASLJ.cjs} +2 -2
- package/dist/{chunk-F6CMGWAL.mjs → chunk-ANMIR6US.mjs} +1 -1
- package/dist/{chunk-Z6SOXHAD.mjs → chunk-CKCKCUYO.mjs} +72 -31
- package/dist/{chunk-2ZOYOYEE.mjs → chunk-D5F7RPZP.mjs} +71 -1
- package/dist/{chunk-F36LS2C7.cjs → chunk-DHR2WDSL.cjs} +27 -27
- package/dist/{chunk-URN7VFO7.cjs → chunk-F6YLXK5L.cjs} +10 -11
- package/dist/{chunk-YTNBCXCW.cjs → chunk-GQ6QOH7T.cjs} +9 -5
- package/dist/{chunk-BZWTBELF.cjs → chunk-GTQOEEE7.cjs} +77 -7
- package/dist/{chunk-IGDYL2IA.cjs → chunk-GUMKIQJL.cjs} +2 -2
- package/dist/{chunk-4UAQB5LB.mjs → chunk-IYLZZTP6.mjs} +4 -4
- package/dist/{chunk-WUTFJOV7.cjs → chunk-JFPKARWM.cjs} +16 -8
- package/dist/{chunk-225APHKC.cjs → chunk-L5OZN6YW.cjs} +3 -3
- package/dist/{chunk-KWCZKJYU.cjs → chunk-L6NWQ3DR.cjs} +351 -277
- package/dist/{chunk-6OFOIMNS.mjs → chunk-MAGFDK4Q.mjs} +1 -1
- package/dist/{chunk-5IQ2ERQA.cjs → chunk-O47W53D3.cjs} +1 -1
- package/dist/{chunk-3TXKFRSO.mjs → chunk-OEL5EPOJ.mjs} +1 -1
- package/dist/{chunk-A3T445WK.mjs → chunk-PDQ6EGPK.mjs} +8 -1
- package/dist/{chunk-VRGY3X2I.mjs → chunk-PEYDQMSA.mjs} +5 -6
- package/dist/{chunk-KSZK34HU.mjs → chunk-PJQ5W356.mjs} +16 -8
- package/dist/{chunk-JSOCDYER.cjs → chunk-Q4HH5Q6A.cjs} +15 -1
- package/dist/{chunk-NT4W4H52.mjs → chunk-SZORL7EW.mjs} +18 -13
- package/dist/{chunk-Z3PW3DIR.cjs → chunk-TKYOJ5G2.cjs} +3 -3
- package/dist/{chunk-DIXFKAPM.mjs → chunk-UHU4QALN.mjs} +153 -79
- package/dist/{chunk-WPB67LE5.mjs → chunk-ULMXZYOA.mjs} +1 -1
- package/dist/{chunk-MZ4CRSY7.cjs → chunk-VO65MYJD.cjs} +4 -4
- package/dist/{chunk-DXZ57EPE.mjs → chunk-YOHHL2UE.mjs} +14 -0
- package/dist/{chunk-VFNAK6A5.mjs → chunk-ZR2QB45W.mjs} +7 -3
- package/dist/{chunk-KDO6T6OB.mjs → chunk-ZYCEEE3V.mjs} +1 -1
- package/dist/{client-component.d-DNVSLEPi.d.ts → client-component.d-CfJxuXZl.d.ts} +2 -2
- package/dist/{client-component.d-BvQOxSqh.d.mts → client-component.d-CnEeVvGG.d.mts} +2 -2
- package/dist/{client-plugins.d-CNDqcAuf.d.ts → client-plugins.d-D7dHV1Nf.d.ts} +15 -3
- package/dist/{client-plugins.d-CE1lVK2R.d.mts → client-plugins.d-Do5ULA0x.d.mts} +15 -3
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client.d.mts +6 -6
- package/dist/client.d.ts +6 -6
- package/dist/config.d.mts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/desktop.d.mts +2 -2
- package/dist/desktop.d.ts +2 -2
- package/dist/{devtools-R27T3BRY.cjs → devtools-7HNDS4SY.cjs} +2 -2
- package/dist/{devtools-2A2GPC7B.mjs → devtools-BP4EBTKQ.mjs} +1 -1
- package/dist/docs.cjs +5 -3
- package/dist/docs.d.mts +15 -3
- package/dist/docs.d.ts +15 -3
- package/dist/docs.mjs +5 -3
- package/dist/environment/vite.cjs +3 -3
- package/dist/environment/vite.mjs +2 -2
- package/dist/image/server.cjs +2 -2
- package/dist/image/server.mjs +1 -1
- package/dist/image/sharp.cjs +9 -9
- package/dist/image/sharp.mjs +1 -1
- package/dist/index.cjs +17 -16
- package/dist/{index.d-Bt3kl19W.d.mts → index.d-B1MpEJAo.d.mts} +1 -1
- package/dist/{index.d-Cx_-DaKV.d.ts → index.d-CVFk37uX.d.ts} +1 -1
- package/dist/index.d.mts +17 -17
- package/dist/index.d.ts +17 -17
- package/dist/index.mjs +17 -16
- package/dist/integrations/orm.d.mts +1 -1
- package/dist/integrations/orm.d.ts +1 -1
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/internal/app-markdown-runtime.d.mts +2 -2
- package/dist/internal/app-markdown-runtime.d.ts +2 -2
- package/dist/internal/build-runtime.cjs +15 -16
- package/dist/internal/build-runtime.d.mts +3 -3
- package/dist/internal/build-runtime.d.ts +3 -3
- package/dist/internal/build-runtime.mjs +14 -15
- package/dist/internal/cli-runtime.cjs +2 -2
- package/dist/internal/cli-runtime.mjs +1 -1
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.d.mts +5 -5
- package/dist/internal/client-runtime.d.ts +5 -5
- package/dist/internal/compression-runtime.d.mts +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/config-runtime.cjs +3 -3
- package/dist/internal/config-runtime.d.mts +3 -3
- package/dist/internal/config-runtime.d.ts +3 -3
- package/dist/internal/config-runtime.mjs +2 -2
- package/dist/internal/infra-analytics-runtime.cjs +6 -6
- package/dist/internal/infra-analytics-runtime.mjs +4 -4
- package/dist/internal/native-server-fns.cjs +4 -4
- package/dist/internal/native-server-fns.mjs +3 -3
- package/dist/internal/product-telemetry-runtime.cjs +3 -3
- package/dist/internal/product-telemetry-runtime.mjs +2 -2
- package/dist/internal/production-runtime.cjs +8 -4
- package/dist/internal/production-runtime.d.mts +19 -12
- package/dist/internal/production-runtime.d.ts +19 -12
- package/dist/internal/production-runtime.mjs +8 -4
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/middleware.d.mts +1 -1
- package/dist/middleware.d.ts +1 -1
- package/dist/{mount.d-Bki4pOaJ.d.mts → mount.d-CBqr-LfI.d.mts} +1 -1
- package/dist/{mount.d-DjR5aerM.d.ts → mount.d-CGzN61Kq.d.ts} +1 -1
- package/dist/{navigation-delegate.d-VDkziXTK.d.mts → navigation-delegate.d-BwCOhpj7.d.mts} +1 -1
- package/dist/{navigation-delegate.d-CtghaSP3.d.ts → navigation-delegate.d-CLH2dXjy.d.ts} +1 -1
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/{plugin-WIU4GDD4.cjs → plugin-F2O4BFTK.cjs} +2 -2
- package/dist/{plugin-SAS22JL7.mjs → plugin-VEBRN7A3.mjs} +1 -1
- package/dist/plugin.cjs +10 -10
- package/dist/plugin.d.mts +3 -3
- package/dist/plugin.d.ts +3 -3
- package/dist/plugin.mjs +9 -9
- package/dist/{render-plan.d-BSwV8PE4.d.mts → render-plan.d-CzGDjcT0.d.mts} +1 -1
- package/dist/{render-plan.d-i9sI4tc9.d.ts → render-plan.d-W6LmjD6y.d.ts} +1 -1
- package/dist/renderer-client.d.mts +4 -4
- package/dist/renderer-client.d.ts +4 -4
- package/dist/{request.d-Dgln8tuI.d.ts → request.d-CTVRZiQv.d.ts} +1 -1
- package/dist/{request.d-C24FNQ_7.d.mts → request.d-CgNVderU.d.mts} +1 -1
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/{route-rendering.d-Ds0BfwQi.d.mts → route-rendering.d-D0bmZVJA.d.mts} +1 -1
- package/dist/{route-rendering.d-CUylZKJA.d.ts → route-rendering.d-FDSNtCMg.d.ts} +1 -1
- package/dist/{router.d-B56rMOFm.d.ts → router.d-DZ3ldniI.d.ts} +1 -1
- package/dist/{router.d-CFPcbqzc.d.mts → router.d-GRKm_uAV.d.mts} +1 -1
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/{rsc-pipeline-3T7V6OUT.cjs → rsc-pipeline-J4KKBSCH.cjs} +4 -5
- package/dist/{rsc-pipeline-GA4AQWZI.mjs → rsc-pipeline-PJZOVYSY.mjs} +3 -4
- package/dist/{runtime-REUTNTI5.cjs → runtime-OLEO5NXF.cjs} +4 -4
- package/dist/{runtime-ZYCKKY7L.mjs → runtime-QDBSE4H6.mjs} +2 -2
- package/dist/{runtime.d-DLRO-ExG.d.mts → runtime.d-DqXihlxm.d.mts} +1 -1
- package/dist/{runtime.d-H7k9hOQE.d.ts → runtime.d-pqFQBU2N.d.ts} +1 -1
- package/dist/server-plugins.d.mts +2 -2
- package/dist/server-plugins.d.ts +2 -2
- package/dist/server.cjs +31 -31
- package/dist/server.d.mts +9 -9
- package/dist/server.d.ts +9 -9
- package/dist/server.mjs +12 -12
- package/dist/{spa-router.d-Dr7oanhl.d.ts → spa-router.d-DhOhaQ-7.d.ts} +2 -2
- package/dist/{spa-router.d-g4CzhEH1.d.mts → spa-router.d-Dhvy60p4.d.mts} +2 -2
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/{utils.d-BxxyDEb8.d.ts → utils.d-BVCMRRau.d.ts} +1 -1
- package/dist/{utils.d-HIla3pD_.d.mts → utils.d-Q8EHCpkF.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +10 -10
- package/dist/vite.d.mts +4 -4
- package/dist/vite.d.ts +4 -4
- package/dist/vite.mjs +9 -9
- package/package.json +2 -2
- package/dist/analyzer-PPAHM4AW.cjs +0 -16
- package/dist/chunk-HHLEYA4B.cjs +0 -17
- package/dist/chunk-QYNZ3CTI.mjs +0 -17
|
@@ -315,7 +315,7 @@ async function validateImageSourceUrl(sourceUrl, requestOrigin, trustedLocalOrig
|
|
|
315
315
|
if (sourceUrl.username || sourceUrl.password || sourceUrl.hash) {
|
|
316
316
|
throw new FarmImageRequestError("DISALLOWED_SOURCE", 400, "Unsafe image source URL");
|
|
317
317
|
}
|
|
318
|
-
const isLocalSource = sourceUrl.origin ===
|
|
318
|
+
const isLocalSource = sourceUrl.origin === (_nullishCoalesce(trustedLocalOrigin, () => ( requestOrigin)));
|
|
319
319
|
if (isLocalSource) {
|
|
320
320
|
if (sourceUrl.pathname === config.path || !matchesLocalPatterns(sourceUrl, config.localPatterns)) {
|
|
321
321
|
throw new FarmImageRequestError(
|
|
@@ -315,7 +315,7 @@ async function validateImageSourceUrl(sourceUrl, requestOrigin, trustedLocalOrig
|
|
|
315
315
|
if (sourceUrl.username || sourceUrl.password || sourceUrl.hash) {
|
|
316
316
|
throw new FarmImageRequestError("DISALLOWED_SOURCE", 400, "Unsafe image source URL");
|
|
317
317
|
}
|
|
318
|
-
const isLocalSource = sourceUrl.origin ===
|
|
318
|
+
const isLocalSource = sourceUrl.origin === (trustedLocalOrigin ?? requestOrigin);
|
|
319
319
|
if (isLocalSource) {
|
|
320
320
|
if (sourceUrl.pathname === config.path || !matchesLocalPatterns(sourceUrl, config.localPatterns)) {
|
|
321
321
|
throw new FarmImageRequestError(
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from "./chunk-VE3FWJBO.mjs";
|
|
18
18
|
import {
|
|
19
19
|
resolveDocsConfig
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-SZORL7EW.mjs";
|
|
21
21
|
import {
|
|
22
22
|
getFarmDocsAdapterConfigModule,
|
|
23
23
|
isSecretDocsConfigKey
|
|
@@ -155,6 +155,12 @@ async function listFarmDocsAdapterPages(docs, options) {
|
|
|
155
155
|
}
|
|
156
156
|
return [...new Set(pages)];
|
|
157
157
|
}
|
|
158
|
+
async function listFarmDocsPagePaths(docs, options) {
|
|
159
|
+
if (options.adapter) return await listFarmDocsAdapterPages(docs, options) ?? [];
|
|
160
|
+
return getFarmDocsRoots(docs).flatMap(
|
|
161
|
+
(root) => discoverFarmDocsPages(resolveFarmDocsContentDir(root, options), root).map(({ href }) => href)
|
|
162
|
+
);
|
|
163
|
+
}
|
|
158
164
|
async function createFarmDocsAdapterHandler(docs, options) {
|
|
159
165
|
if (!hasFarmDocsRuntimeAdapter(docs)) {
|
|
160
166
|
throw new Error("Farm docs adapter requires server and react runtime entrypoints.");
|
|
@@ -722,6 +728,7 @@ export {
|
|
|
722
728
|
getFarmDocsConfigModuleRoot,
|
|
723
729
|
compileFarmDocsAdapterEdgeManifest,
|
|
724
730
|
listFarmDocsAdapterPages,
|
|
731
|
+
listFarmDocsPagePaths,
|
|
725
732
|
createFarmDocsAdapterHandler,
|
|
726
733
|
isFarmDocsAPIRequest,
|
|
727
734
|
createDocsAPI,
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
hasFarmServerRuntimePlugins
|
|
3
|
-
} from "./chunk-QYNZ3CTI.mjs";
|
|
4
1
|
import {
|
|
5
2
|
FARM_RSC_INSTALL_HINT,
|
|
6
3
|
findFarmAppPackageDir,
|
|
@@ -13,15 +10,16 @@ import {
|
|
|
13
10
|
} from "./chunk-FN5UEC7I.mjs";
|
|
14
11
|
import {
|
|
15
12
|
resolveDeployOutputPath
|
|
16
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-SZORL7EW.mjs";
|
|
17
14
|
import {
|
|
18
15
|
farmDesktopDevGuardPlugin,
|
|
19
16
|
loadFarmReactPlugin
|
|
20
17
|
} from "./chunk-QOSDWGKT.mjs";
|
|
21
18
|
import {
|
|
22
19
|
generateFarmClientPluginEntryCode,
|
|
20
|
+
hasFarmServerRuntimePlugins,
|
|
23
21
|
loadTailwindVitePlugin
|
|
24
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-YOHHL2UE.mjs";
|
|
25
23
|
import {
|
|
26
24
|
resolveFarmPlatform
|
|
27
25
|
} from "./chunk-SMUW7UST.mjs";
|
|
@@ -39,6 +37,7 @@ var FARM_RSC_CONFIG_KEYS = [
|
|
|
39
37
|
"srcDir",
|
|
40
38
|
"extends",
|
|
41
39
|
"basePath",
|
|
40
|
+
"trailingSlash",
|
|
42
41
|
"api",
|
|
43
42
|
"server",
|
|
44
43
|
"middleware",
|
|
@@ -211,7 +210,7 @@ async function resolveFarmRscServerPlugins(userConfig, config, root) {
|
|
|
211
210
|
}
|
|
212
211
|
async function configureFarmRscPlugins(config, command) {
|
|
213
212
|
if (config.plugins.length === 0) return config;
|
|
214
|
-
const { PluginManager } = await import("./plugin-
|
|
213
|
+
const { PluginManager } = await import("./plugin-VEBRN7A3.mjs");
|
|
215
214
|
const manager = new PluginManager({
|
|
216
215
|
config,
|
|
217
216
|
isDev: command === "serve",
|
|
@@ -809,6 +809,21 @@ var PluginManager = class {
|
|
|
809
809
|
session.waitUntil
|
|
810
810
|
);
|
|
811
811
|
}
|
|
812
|
+
/**
|
|
813
|
+
* @internal Reports an error the handler answered to `runtime.error` and `onError`, as the
|
|
814
|
+
* runtime scope's `reportError` does, without failing the session: `after` still runs, and a
|
|
815
|
+
* later throw in it is reported too.
|
|
816
|
+
*/
|
|
817
|
+
async reportRuntimeRequestError(session, error) {
|
|
818
|
+
await this.runRuntimeErrorHooks(
|
|
819
|
+
session.request,
|
|
820
|
+
error,
|
|
821
|
+
session.ctx,
|
|
822
|
+
Date.now() - session.startedAt,
|
|
823
|
+
session.options,
|
|
824
|
+
session.waitUntil
|
|
825
|
+
);
|
|
826
|
+
}
|
|
812
827
|
async runRuntimeRequest(request, handler, options = {}) {
|
|
813
828
|
return this.completeRuntimeRequest(await this.beginRuntimeRequest(request, options), handler);
|
|
814
829
|
}
|
|
@@ -822,14 +837,7 @@ var PluginManager = class {
|
|
|
822
837
|
const response = session.response ?? await handler(session.request, {
|
|
823
838
|
// Not a failed session: the handler answers, so `after` runs and a later throw in it
|
|
824
839
|
// is still reported.
|
|
825
|
-
reportError: (error) => this.
|
|
826
|
-
session.request,
|
|
827
|
-
error,
|
|
828
|
-
session.ctx,
|
|
829
|
-
Date.now() - session.startedAt,
|
|
830
|
-
session.options,
|
|
831
|
-
session.waitUntil
|
|
832
|
-
)
|
|
840
|
+
reportError: (error) => this.reportRuntimeRequestError(session, error)
|
|
833
841
|
});
|
|
834
842
|
if (!(response instanceof Response)) {
|
|
835
843
|
throw new TypeError("Farm plugin runtime handlers must return a Response");
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
var _chunkBDYM2TN3cjs = require('./chunk-BDYM2TN3.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
6
9
|
|
|
7
10
|
var _chunkKORZ6PREcjs = require('./chunk-KORZ6PRE.cjs');
|
|
8
11
|
|
|
@@ -278,6 +281,16 @@ function isArrayIndex(key) {
|
|
|
278
281
|
return Number.isInteger(value) && value >= 0 && value < 4294967295 && String(value) === key;
|
|
279
282
|
}
|
|
280
283
|
|
|
284
|
+
// src/plugin-server-runtime.ts
|
|
285
|
+
function hasFarmServerRuntimePlugins(plugins) {
|
|
286
|
+
return (plugins || []).some((plugin) => {
|
|
287
|
+
if (_chunkBDYM2TN3cjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) === false) return false;
|
|
288
|
+
return Boolean(
|
|
289
|
+
plugin.setup || plugin.init || plugin.ready || plugin.shutdown || plugin.runtime || plugin.router || plugin.render || plugin.beforeRouteMatch || plugin.afterRouteMatch || plugin.beforeRender || plugin.afterRender || plugin.onError || plugin.transformHTML
|
|
290
|
+
);
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
|
|
281
294
|
// src/build/tailwind.ts
|
|
282
295
|
|
|
283
296
|
|
|
@@ -372,4 +385,5 @@ function createMissingTailwindPlugin() {
|
|
|
372
385
|
|
|
373
386
|
|
|
374
387
|
|
|
375
|
-
|
|
388
|
+
|
|
389
|
+
exports.resolveFarmAppClientEntry = resolveFarmAppClientEntry; exports.resolveFarmClientPlugins = resolveFarmClientPlugins; exports.generateFarmClientPluginEntryCode = generateFarmClientPluginEntryCode; exports.hasFarmServerRuntimePlugins = hasFarmServerRuntimePlugins; exports.loadTailwindVitePlugin = loadTailwindVitePlugin;
|
|
@@ -547,6 +547,12 @@ async function applyFarmDocsFrameworkAutoDetection(userConfig, options) {
|
|
|
547
547
|
|
|
548
548
|
// src/config.ts
|
|
549
549
|
var FARM_RESOLVED_CUSTOM_CONTEXT = /* @__PURE__ */ Symbol.for("farm.resolvedCustomContext");
|
|
550
|
+
var FARM_DEPLOY_TARGET_PRESETS = {
|
|
551
|
+
vercel: "vercel",
|
|
552
|
+
cloudflare: "cloudflare-pages",
|
|
553
|
+
netlify: "netlify",
|
|
554
|
+
node: "node-server"
|
|
555
|
+
};
|
|
550
556
|
function resolveSchemaConfig(config) {
|
|
551
557
|
if (config === void 0) return {};
|
|
552
558
|
if (!config || typeof config !== "object" || Array.isArray(config)) {
|
|
@@ -583,18 +589,8 @@ function normalizeDeployTarget(target) {
|
|
|
583
589
|
return target;
|
|
584
590
|
}
|
|
585
591
|
function getPresetForDeployTarget(target) {
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
return "vercel";
|
|
589
|
-
case "cloudflare":
|
|
590
|
-
return "cloudflare-pages";
|
|
591
|
-
case "netlify":
|
|
592
|
-
return "netlify";
|
|
593
|
-
case "node":
|
|
594
|
-
return "node-server";
|
|
595
|
-
default:
|
|
596
|
-
return void 0;
|
|
597
|
-
}
|
|
592
|
+
const normalized = normalizeDeployTarget(target);
|
|
593
|
+
return normalized && Object.prototype.hasOwnProperty.call(FARM_DEPLOY_TARGET_PRESETS, normalized) ? FARM_DEPLOY_TARGET_PRESETS[normalized] : void 0;
|
|
598
594
|
}
|
|
599
595
|
function getDeployTargetForPreset(preset) {
|
|
600
596
|
if (!preset) return void 0;
|
|
@@ -637,8 +633,18 @@ function assertFarmDeployNameSupported(kind, name) {
|
|
|
637
633
|
`Deploy ${kind} "vercel-edge" is not supported: Farm's Nitro version has no vercel-edge preset. Use the "vercel" ${kind} instead, which deploys Vercel Functions on Fluid compute.`
|
|
638
634
|
);
|
|
639
635
|
}
|
|
636
|
+
function assertFarmDeployTargetSupported(target) {
|
|
637
|
+
if (!target || getPresetForDeployTarget(target)) return;
|
|
638
|
+
assertFarmDeployNameSupported("target", target);
|
|
639
|
+
const targets = Object.keys(FARM_DEPLOY_TARGET_PRESETS).map((name) => `"${name}"`).join(", ");
|
|
640
|
+
throw new Error(
|
|
641
|
+
`Unknown deploy target "${String(target)}". Farm's deploy targets are ${targets}. To build with another Nitro preset, set deploy.preset instead.`
|
|
642
|
+
);
|
|
643
|
+
}
|
|
640
644
|
function resolveDeployConfig(config, overrides = {}) {
|
|
641
645
|
const deploy = config.deploy || {};
|
|
646
|
+
assertFarmDeployTargetSupported(deploy.target);
|
|
647
|
+
assertFarmDeployTargetSupported(overrides.target);
|
|
642
648
|
const distDir = config.distDir || ".farm";
|
|
643
649
|
const overrideTarget = normalizeDeployTarget(overrides.target);
|
|
644
650
|
let target = overrideTarget ? overrideTarget : overrides.preset ? getDeployTargetForPreset(overrides.preset) : normalizeDeployTarget(deploy.target);
|
|
@@ -662,7 +668,6 @@ function resolveDeployConfig(config, overrides = {}) {
|
|
|
662
668
|
const preset = overrides.preset || overrideTargetPreset || configuredPreset || getPresetForDeployTarget(target) || "node-server";
|
|
663
669
|
const resolvedTarget = target || getDeployTargetForPreset(preset);
|
|
664
670
|
assertFarmDeployNameSupported("preset", preset);
|
|
665
|
-
assertFarmDeployNameSupported("target", resolvedTarget);
|
|
666
671
|
if (detectedTarget && resolvedTarget !== detectedTarget) {
|
|
667
672
|
const mismatchKey = `mismatch:${resolvedTarget}:${detectedTarget}`;
|
|
668
673
|
if (!warnedPlatformMismatches.has(mismatchKey)) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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 _chunkGQ6QOH7Tcjs = require('./chunk-GQ6QOH7T.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkFT6KJHS3cjs = require('./chunk-FT6KJHS3.cjs');
|
|
@@ -273,7 +273,7 @@ function requestEvent(metadata, method, status, durationMs) {
|
|
|
273
273
|
id: uuid(),
|
|
274
274
|
requestId: metadata.id,
|
|
275
275
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
276
|
-
route: routeTemplate(
|
|
276
|
+
route: routeTemplate(_chunkGQ6QOH7Tcjs.getFarmRouteLabel.call(void 0, metadata.route)),
|
|
277
277
|
agent: metadata.agent,
|
|
278
278
|
kind: "request",
|
|
279
279
|
method,
|
|
@@ -286,7 +286,7 @@ function toolEvent(metadata, event) {
|
|
|
286
286
|
id: uuid(),
|
|
287
287
|
requestId: metadata.id,
|
|
288
288
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
289
|
-
route: routeTemplate(
|
|
289
|
+
route: routeTemplate(_chunkGQ6QOH7Tcjs.getFarmRouteLabel.call(void 0, metadata.route)),
|
|
290
290
|
agent: metadata.agent,
|
|
291
291
|
kind: "mcp.tool",
|
|
292
292
|
tool: event.tool,
|