@farm.js/core 0.1.37 → 0.1.39
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-BC0bAGVF.d.mts → agent-mcp-BhneNPb4.d.mts} +1 -1
- package/dist/{agent-mcp-jyDHbQKe.d.ts → agent-mcp-HcTYQmNX.d.ts} +1 -1
- package/dist/{agent-mcp-handler-SJAHFSPI.cjs → agent-mcp-handler-MRGP3WJ3.cjs} +5 -5
- package/dist/{agent-mcp-handler-LPJ2CADR.mjs → agent-mcp-handler-OLRMZONF.mjs} +4 -4
- package/dist/agent-runtime.cjs +3 -3
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/agent-runtime.mjs +2 -2
- package/dist/api/client.cjs +3 -3
- package/dist/api/client.mjs +2 -2
- package/dist/api/route-manager.cjs +5 -5
- package/dist/api/route-manager.d.mts +3 -3
- package/dist/api/route-manager.d.ts +3 -3
- package/dist/api/route-manager.mjs +4 -4
- package/dist/api/runtime.cjs +4 -4
- package/dist/api/runtime.d.mts +2 -2
- package/dist/api/runtime.d.ts +2 -2
- package/dist/api/runtime.mjs +3 -3
- 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-CKO3iN1c.d.ts → app-CMkoghtp.d.ts} +21 -3
- package/dist/{app-Cbkj9ufe.d.mts → app-DVzmmbNO.d.mts} +21 -3
- package/dist/app-markdown.cjs +4 -4
- package/dist/app-markdown.d.mts +2 -2
- package/dist/app-markdown.d.ts +2 -2
- package/dist/app-markdown.mjs +3 -3
- package/dist/chunk-2ZYGC6SS.cjs +576 -0
- package/dist/{chunk-75X755YZ.cjs → chunk-34UCJRQO.cjs} +2 -2
- package/dist/{chunk-CVH2BXPY.cjs → chunk-3LOLJTFV.cjs} +6 -6
- package/dist/{chunk-4GPOC4LN.cjs → chunk-472NCAZ7.cjs} +3 -3
- package/dist/{chunk-O6WAEAX3.mjs → chunk-5BWWFHR2.mjs} +70 -15
- package/dist/{chunk-6LGFV2CQ.cjs → chunk-5OKBARDN.cjs} +2 -2
- package/dist/{chunk-3IP27TCG.cjs → chunk-5PWXMJOH.cjs} +19 -19
- package/dist/{chunk-WT4TGLXT.cjs → chunk-5ULKUBIA.cjs} +6 -6
- package/dist/{chunk-WRPHYQVY.mjs → chunk-677THUVP.mjs} +1 -1
- package/dist/chunk-6BK3K2GB.mjs +318 -0
- package/dist/{chunk-HEVMCTSR.mjs → chunk-6HB6V3R7.mjs} +1 -1
- package/dist/{chunk-NICDYKBS.cjs → chunk-6XWDE2P2.cjs} +22 -4
- package/dist/{chunk-CXEN47J3.mjs → chunk-73WX6PRY.mjs} +25 -0
- package/dist/{chunk-EXG5LD6B.mjs → chunk-75HN5IZ3.mjs} +21 -9
- package/dist/{chunk-7O5M4UKW.cjs → chunk-A657YSP4.cjs} +2 -2
- package/dist/{chunk-LBDP3YT3.mjs → chunk-ARC7I3O2.mjs} +1 -1
- package/dist/{chunk-Q5FYSK45.cjs → chunk-AS2VPMEE.cjs} +640 -521
- package/dist/{chunk-Z5BEWYVO.mjs → chunk-ATSDUUFK.mjs} +27 -1
- package/dist/{chunk-EMMQ64QW.cjs → chunk-B5J2YVG7.cjs} +16 -16
- package/dist/{chunk-FWE7LEQC.cjs → chunk-BD3D7EZV.cjs} +4 -4
- package/dist/{chunk-Z7LA7MHQ.mjs → chunk-BFJTHYTN.mjs} +1 -1
- package/dist/{chunk-UJZLSXUB.cjs → chunk-BWIQR4DH.cjs} +30 -4
- package/dist/{chunk-W2YDNK66.cjs → chunk-BXDJXFQG.cjs} +4 -4
- package/dist/{chunk-MCIZVNOQ.mjs → chunk-BZHXGVMA.mjs} +1 -1
- package/dist/{chunk-7DWNJI73.cjs → chunk-CIOT4HGT.cjs} +37 -19
- package/dist/{chunk-KDTBF3UU.mjs → chunk-CNNOLE4O.mjs} +1 -1
- package/dist/{chunk-TDNWPAVR.mjs → chunk-CUM5NYL5.mjs} +1 -1
- package/dist/{chunk-HITLGIAO.cjs → chunk-CY2ZQ5C6.cjs} +7 -6
- package/dist/{chunk-KPFKMDM7.mjs → chunk-EGCTIS5F.mjs} +2 -2
- package/dist/{chunk-VR4GD5I3.cjs → chunk-EIPC3FDA.cjs} +12 -4
- package/dist/{chunk-B5PFZLKV.cjs → chunk-EKN7NSZO.cjs} +25 -8
- package/dist/{chunk-6SJ2KJTA.mjs → chunk-EPYU2EBL.mjs} +1 -1
- package/dist/{chunk-LBGILORX.mjs → chunk-GKBWWRBG.mjs} +101 -10
- package/dist/{chunk-PTZ2TVNE.cjs → chunk-H5CLOUZS.cjs} +5 -5
- package/dist/{chunk-DTSROJ5J.mjs → chunk-HD5CF3OE.mjs} +1 -1
- package/dist/{chunk-3A4KGQYI.cjs → chunk-HRETEZ2Z.cjs} +27 -15
- package/dist/{chunk-ATWHHSY2.cjs → chunk-HRSAQ23K.cjs} +7 -7
- package/dist/{chunk-IAIYV4RZ.mjs → chunk-HXRYZWTA.mjs} +1 -1
- package/dist/{chunk-4P6ULFMD.mjs → chunk-HYTZYOW2.mjs} +222 -103
- package/dist/{chunk-HMRSWN47.mjs → chunk-INL3THCU.mjs} +1 -1
- package/dist/{chunk-FBOJ55OM.mjs → chunk-IVLZZZEI.mjs} +1 -1
- package/dist/{chunk-ENLZ4R3Y.mjs → chunk-J7K2NZD6.mjs} +7 -6
- package/dist/{chunk-PMQHMWZU.cjs → chunk-JCYYXBAJ.cjs} +3 -3
- package/dist/{chunk-K3SAEIM3.mjs → chunk-KTSUBU2E.mjs} +2 -2
- package/dist/{chunk-LPFV45AY.cjs → chunk-LMPAPBUA.cjs} +19 -19
- package/dist/{chunk-EK4QAEFZ.cjs → chunk-LZESP4IR.cjs} +25 -0
- package/dist/{chunk-TW4GYDBJ.mjs → chunk-MLY2RP5R.mjs} +10 -2
- package/dist/{chunk-BHY547NB.cjs → chunk-NBBEQLOK.cjs} +9 -9
- package/dist/{chunk-WQ7T2263.mjs → chunk-OAHTRMIC.mjs} +3 -3
- package/dist/{chunk-HZFM2LWQ.mjs → chunk-P3PLW4FR.mjs} +34 -2
- package/dist/{chunk-UH6QN5NL.mjs → chunk-P664ZVTV.mjs} +2 -2
- package/dist/{chunk-TE2G5ION.cjs → chunk-PGZDEPTM.cjs} +88 -33
- package/dist/{chunk-3KGDJLJK.mjs → chunk-POSPE3IO.mjs} +19 -1
- package/dist/{chunk-FGRYBX5X.mjs → chunk-PVZE2JGJ.mjs} +2 -2
- package/dist/{chunk-TPLJVC7E.mjs → chunk-QFW2IH5E.mjs} +23 -6
- package/dist/{chunk-5BXGGEC7.cjs → chunk-QG775BRV.cjs} +17 -17
- package/dist/{chunk-S3VWVTVA.mjs → chunk-QRKIMN7T.mjs} +13 -1
- package/dist/chunk-QTXBII4Z.cjs +632 -0
- package/dist/{chunk-NQ6QFZWD.cjs → chunk-QUCXCDE2.cjs} +1 -1
- package/dist/{chunk-NFMDCAOS.mjs → chunk-QYMZOOC5.mjs} +3 -3
- package/dist/{chunk-CI6E3UOH.cjs → chunk-RG4A6LB2.cjs} +7 -7
- package/dist/{chunk-LOFKRKO7.cjs → chunk-RVXFINNS.cjs} +113 -22
- package/dist/{chunk-7SQ5SGYZ.cjs → chunk-RW63BOV7.cjs} +2 -2
- package/dist/{chunk-U6MPZ35Q.cjs → chunk-RWFLWR5J.cjs} +8 -8
- package/dist/{chunk-EUV4YR3V.cjs → chunk-SGBJ247Q.cjs} +18 -2
- package/dist/{chunk-J3ANCZKA.mjs → chunk-SKVTP5PR.mjs} +1 -1
- package/dist/{chunk-YCKO6FRS.mjs → chunk-SOP2EAA6.mjs} +1 -1
- package/dist/{chunk-ND2CWPOD.mjs → chunk-TS4JHGUJ.mjs} +1 -1
- package/dist/chunk-U6QLDL3G.mjs +576 -0
- package/dist/{chunk-OW67PDDS.cjs → chunk-ULASELLA.cjs} +13 -1
- package/dist/{chunk-4GWRFP22.cjs → chunk-UPJLHLJU.cjs} +35 -3
- package/dist/{chunk-WWIKMBRN.mjs → chunk-VNGH5MLF.mjs} +17 -1
- package/dist/{chunk-NNSAQX3U.mjs → chunk-VT4WFRHA.mjs} +1 -1
- package/dist/{chunk-JPNFPAZ4.mjs → chunk-VWBHM3F6.mjs} +2 -2
- package/dist/{chunk-ADOAUDQ6.cjs → chunk-VXEEATVD.cjs} +2 -2
- package/dist/{chunk-RRMVL6CJ.mjs → chunk-W36M2BQ4.mjs} +1 -1
- package/dist/{chunk-4WQ6PGSJ.cjs → chunk-WEW2JVA4.cjs} +4 -4
- package/dist/{chunk-4E5WBPEG.mjs → chunk-WFRT7JPX.mjs} +8 -533
- package/dist/{chunk-VXAWRDK7.mjs → chunk-WLL43JMO.mjs} +1 -1
- package/dist/chunk-WW46B6HA.cjs +318 -0
- package/dist/{chunk-D3C5LBQY.cjs → chunk-WXJLNP33.cjs} +2 -2
- package/dist/{chunk-NDILNQ4L.cjs → chunk-XKG2BLFN.cjs} +2 -2
- package/dist/{chunk-6TJITR2B.cjs → chunk-YFYUYWL7.cjs} +870 -751
- package/dist/{chunk-XOPOIFTJ.mjs → chunk-YKZRDB5Z.mjs} +25 -7
- package/dist/{chunk-K4I4O5TS.mjs → chunk-ZUPXLIGB.mjs} +790 -671
- package/dist/{chunk-G2TEB74S.cjs → chunk-ZXH4TS3F.cjs} +2 -2
- package/dist/{client-plugins-CV4eJ9De.d.mts → client-plugins-CsCuCLBz.d.mts} +58 -7
- package/dist/{client-plugins-C8DjftDF.d.ts → client-plugins-D0ke-Hc8.d.ts} +58 -7
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client.cjs +7 -7
- package/dist/client.d.mts +5 -5
- package/dist/client.d.ts +5 -5
- package/dist/client.mjs +6 -6
- package/dist/config.d.mts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/{devtools-KVOY2TCZ.mjs → devtools-5AFIPVUJ.mjs} +8 -6
- package/dist/{devtools-JXFQNWSH.cjs → devtools-LW4QQ5J3.cjs} +9 -7
- package/dist/docs.cjs +12 -10
- package/dist/docs.d.mts +20 -2
- package/dist/docs.d.ts +20 -2
- package/dist/docs.mjs +11 -9
- package/dist/headers.cjs +6 -4
- package/dist/headers.d.mts +11 -1
- package/dist/headers.d.ts +11 -1
- package/dist/headers.mjs +5 -3
- package/dist/index.cjs +55 -42
- package/dist/index.d.mts +15 -15
- package/dist/index.d.ts +15 -15
- package/dist/index.mjs +55 -42
- package/dist/integrations.cjs +5 -3
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/integrations.mjs +4 -2
- package/dist/internal/app-markdown-runtime.cjs +3 -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 +2 -2
- package/dist/internal/build-runtime.cjs +30 -29
- package/dist/internal/build-runtime.d.mts +3 -3
- package/dist/internal/build-runtime.d.ts +3 -3
- package/dist/internal/build-runtime.mjs +29 -28
- package/dist/internal/cli-runtime.cjs +11 -9
- package/dist/internal/cli-runtime.mjs +10 -8
- 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 +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/config-runtime.cjs +9 -7
- package/dist/internal/config-runtime.d.mts +2 -2
- package/dist/internal/config-runtime.d.ts +2 -2
- package/dist/internal/config-runtime.mjs +8 -6
- package/dist/internal/docs-precompiled-runtime.cjs +19 -13
- package/dist/internal/docs-precompiled-runtime.d.mts +5 -0
- package/dist/internal/docs-precompiled-runtime.d.ts +5 -0
- package/dist/internal/docs-precompiled-runtime.mjs +14 -8
- 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-node-env.cjs +6 -2
- package/dist/internal/production-node-env.d.mts +10 -1
- package/dist/internal/production-node-env.d.ts +10 -1
- package/dist/internal/production-node-env.mjs +5 -1
- package/dist/internal/production-runtime.cjs +38 -16
- package/dist/internal/production-runtime.d.mts +51 -11
- package/dist/internal/production-runtime.d.ts +51 -11
- package/dist/internal/production-runtime.mjs +40 -18
- package/dist/markdown.cjs +8 -2
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/markdown.mjs +7 -1
- package/dist/middleware.cjs +10 -8
- package/dist/middleware.d.mts +24 -4
- package/dist/middleware.d.ts +24 -4
- package/dist/middleware.mjs +10 -8
- package/dist/navigation.cjs +6 -6
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/navigation.mjs +5 -5
- package/dist/plugin.cjs +23 -22
- package/dist/plugin.d.mts +1 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.mjs +22 -21
- package/dist/{production-runtime-C2kkrPVZ.d.ts → production-runtime-BaI3WHnV.d.ts} +1 -1
- package/dist/{production-runtime-Du_FHb2-.d.mts → production-runtime-DfRP0cV0.d.mts} +1 -1
- package/dist/query/client.cjs +8 -8
- package/dist/query/client.mjs +3 -3
- package/dist/{render-plan-BnnPTpus.d.ts → render-plan-CfIdJKAf.d.ts} +1 -1
- package/dist/{render-plan-Cgx7v8tJ.d.mts → render-plan-Dg8RBYFa.d.mts} +1 -1
- package/dist/renderer-client.cjs +5 -5
- package/dist/renderer-client.d.mts +3 -3
- package/dist/renderer-client.d.ts +3 -3
- package/dist/renderer-client.mjs +2 -2
- package/dist/renderer.d.mts +13 -4
- package/dist/renderer.d.ts +13 -4
- package/dist/{request-BNWr7r5e.d.ts → request-CEbHIIl4.d.ts} +4 -2
- package/dist/{request-sKayKcop.d.mts → request-DfE02G_A.d.mts} +4 -2
- package/dist/request.cjs +3 -3
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/request.mjs +2 -2
- package/dist/{route-rendering-DWFp3Yq4.d.mts → route-rendering-BHyOfXjD.d.mts} +1 -1
- package/dist/{route-rendering-Bx4Auw6Q.d.ts → route-rendering-C4oHbv6C.d.ts} +1 -1
- package/dist/{router-BK6K42Ij.d.mts → router-DwhA61SB.d.mts} +1 -1
- package/dist/{router-DnW_2tQi.d.ts → router-uRN_29Em.d.ts} +1 -1
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/{runtime-DJDaCMd_.d.mts → runtime-BEdHhN4C.d.mts} +1 -1
- package/dist/{runtime-CA3Ei5k_.d.ts → runtime-COk03hmx.d.ts} +1 -1
- package/dist/server-fn.cjs +3 -3
- package/dist/server-fn.mjs +2 -2
- package/dist/server-plugins.cjs +5 -5
- package/dist/server-plugins.d.mts +2 -2
- package/dist/server-plugins.d.ts +2 -2
- package/dist/server-plugins.mjs +4 -4
- package/dist/server-query.cjs +4 -4
- package/dist/server-query.mjs +3 -3
- package/dist/server.cjs +49 -48
- package/dist/server.d.mts +7 -7
- package/dist/server.d.ts +7 -7
- package/dist/server.mjs +27 -26
- package/dist/{spa-router-Mwbd7g2L.d.ts → spa-router-DrVOBVGg.d.ts} +2 -2
- package/dist/{spa-router-D6fUA4Rn.d.mts → spa-router-w4aFOuyn.d.mts} +2 -2
- package/dist/testing.cjs +5 -5
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.mjs +4 -4
- package/dist/theme/server.cjs +4 -4
- package/dist/theme/server.mjs +3 -3
- package/dist/{utils-p9Hs-jCc.d.mts → utils-BtYehqeU.d.mts} +1 -1
- package/dist/{utils-BwVcAfUR.d.ts → utils-Dhuqwmd2.d.ts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +23 -22
- package/dist/vite.d.mts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.mjs +22 -21
- package/package.json +1 -1
- package/dist/chunk-655RLQQL.mjs +0 -43
- package/dist/chunk-MRMI32SN.cjs +0 -1157
- package/dist/chunk-MT763TDW.cjs +0 -43
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunk5OKBARDNcjs = require('./chunk-5OKBARDN.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
var _chunkSK35NQKKcjs = require('./chunk-SK35NQKK.cjs');
|
|
@@ -35,7 +35,7 @@ function createServerQuery(options) {
|
|
|
35
35
|
throw new TypeError("createServerQuery requires a key function");
|
|
36
36
|
}
|
|
37
37
|
const staleTime = normalizeServerQueryStaleTime(options.staleTime);
|
|
38
|
-
const execute =
|
|
38
|
+
const execute = _chunk5OKBARDNcjs.createServerFn.call(void 0, {
|
|
39
39
|
input: options.input,
|
|
40
40
|
middleware: options.middleware,
|
|
41
41
|
handler: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (context) => {
|
|
@@ -45,7 +45,7 @@ function createServerQuery(options) {
|
|
|
45
45
|
const cacheKey = _chunkNYJMY3JAcjs.createFarmCacheKey.call(void 0, ["route-data", routeKey]);
|
|
46
46
|
const producer = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => {
|
|
47
47
|
const value = await options.handler(context);
|
|
48
|
-
return
|
|
48
|
+
return _chunk5OKBARDNcjs._parseServerFnSchema.call(void 0, options.output, value, "output", "createServerQuery");
|
|
49
49
|
}, "producer");
|
|
50
50
|
let data;
|
|
51
51
|
let updatedAt;
|
|
@@ -90,10 +90,10 @@ function createServerQuery(options) {
|
|
|
90
90
|
enumerable: false
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
|
-
|
|
93
|
+
_chunk5OKBARDNcjs._attachServerFunctionDescriptor.call(void 0,
|
|
94
94
|
query,
|
|
95
|
-
|
|
96
|
-
const result = await
|
|
95
|
+
_chunk5OKBARDNcjs.createServerFunctionDescriptor.call(void 0, "query", options, async (value) => {
|
|
96
|
+
const result = await _chunk5OKBARDNcjs._runServerFunctionForCaller.call(void 0,
|
|
97
97
|
execute,
|
|
98
98
|
value
|
|
99
99
|
);
|
|
@@ -9,7 +9,7 @@ var _chunk7W3CPVXScjs = require('./chunk-7W3CPVXS.cjs');
|
|
|
9
9
|
var _chunkAI7QMY7Ocjs = require('./chunk-AI7QMY7O.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunk6XWDE2P2cjs = require('./chunk-6XWDE2P2.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
@@ -20,12 +20,12 @@ function _setDefaultFarmThemeConfig(config, basePath = "/") {
|
|
|
20
20
|
defaultThemeConfig = _chunkOI6CMLWXcjs.resolveFarmThemeConfig.call(void 0, config, basePath);
|
|
21
21
|
}
|
|
22
22
|
_chunkS3JO3N4Hcjs.__name.call(void 0, _setDefaultFarmThemeConfig, "_setDefaultFarmThemeConfig");
|
|
23
|
-
function getTheme(request =
|
|
23
|
+
function getTheme(request = _chunk6XWDE2P2cjs.getCurrentRequestOrNull.call(void 0, )) {
|
|
24
24
|
if (!request) return defaultThemeConfig.default;
|
|
25
25
|
return readFarmThemePreference(request, defaultThemeConfig);
|
|
26
26
|
}
|
|
27
27
|
_chunkS3JO3N4Hcjs.__name.call(void 0, getTheme, "getTheme");
|
|
28
|
-
function getThemeSnapshot(request =
|
|
28
|
+
function getThemeSnapshot(request = _chunk6XWDE2P2cjs.getCurrentRequestOrNull.call(void 0, )) {
|
|
29
29
|
const theme = request ? readFarmThemePreference(request, defaultThemeConfig) : defaultThemeConfig.default;
|
|
30
30
|
return {
|
|
31
31
|
theme,
|
|
@@ -13,9 +13,12 @@ import {
|
|
|
13
13
|
resolveFarmDocsFontAssets,
|
|
14
14
|
toFarmDocsPublicFontAssets
|
|
15
15
|
} from "./chunk-TVGP4BBZ.mjs";
|
|
16
|
+
import {
|
|
17
|
+
stampFarmCspNonce
|
|
18
|
+
} from "./chunk-U6QLDL3G.mjs";
|
|
16
19
|
import {
|
|
17
20
|
farmAcceptQuality
|
|
18
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-VNGH5MLF.mjs";
|
|
19
22
|
import {
|
|
20
23
|
matchesFarmIfNoneMatch
|
|
21
24
|
} from "./chunk-ZMMBIVQM.mjs";
|
|
@@ -24,7 +27,13 @@ import {
|
|
|
24
27
|
} from "./chunk-LPEX4YW6.mjs";
|
|
25
28
|
|
|
26
29
|
// src/docs/handler.ts
|
|
27
|
-
import {
|
|
30
|
+
import {
|
|
31
|
+
existsSync as existsSync2,
|
|
32
|
+
readdirSync as readdirSync2,
|
|
33
|
+
readFileSync as readFileSync2,
|
|
34
|
+
realpathSync as realpathSync2,
|
|
35
|
+
statSync as statSync2
|
|
36
|
+
} from "fs";
|
|
28
37
|
import path2 from "path";
|
|
29
38
|
import { marked, Renderer } from "marked";
|
|
30
39
|
import { highlight } from "sugar-high";
|
|
@@ -718,15 +727,46 @@ function getRequestSlug(docs, request) {
|
|
|
718
727
|
return normalizeSlug(pathname.slice(entry.length));
|
|
719
728
|
}
|
|
720
729
|
__name(getRequestSlug, "getRequestSlug");
|
|
730
|
+
function isDiscoverableDocsEntryName(name) {
|
|
731
|
+
return Boolean(name) && !name.startsWith(".") && name !== "node_modules";
|
|
732
|
+
}
|
|
733
|
+
__name(isDiscoverableDocsEntryName, "isDiscoverableDocsEntryName");
|
|
734
|
+
function isDiscoverableDocsFile(contentDir, filePath) {
|
|
735
|
+
const segments = path2.relative(contentDir, filePath).split(path2.sep);
|
|
736
|
+
let dir = contentDir;
|
|
737
|
+
for (const [index, name] of segments.entries()) {
|
|
738
|
+
if (!isDiscoverableDocsEntryName(name)) return false;
|
|
739
|
+
let entry;
|
|
740
|
+
try {
|
|
741
|
+
entry = readdirSync2(dir, { withFileTypes: true }).find(
|
|
742
|
+
(candidate) => candidate.name === name
|
|
743
|
+
);
|
|
744
|
+
} catch {
|
|
745
|
+
return false;
|
|
746
|
+
}
|
|
747
|
+
const isLast = index === segments.length - 1;
|
|
748
|
+
if (!entry || !(isLast ? entry.isFile() : entry.isDirectory())) return false;
|
|
749
|
+
dir = path2.join(dir, name);
|
|
750
|
+
}
|
|
751
|
+
return true;
|
|
752
|
+
}
|
|
753
|
+
__name(isDiscoverableDocsFile, "isDiscoverableDocsFile");
|
|
721
754
|
function findDocsPageFile(contentDir, slug) {
|
|
722
|
-
const
|
|
723
|
-
|
|
755
|
+
const canonicalSlug = trimSlashes(slug);
|
|
756
|
+
const segments = canonicalSlug ? canonicalSlug.split("/") : [];
|
|
757
|
+
if (!segments.every((segment) => isSafeSegment(segment) && isDiscoverableDocsEntryName(segment))) {
|
|
758
|
+
return null;
|
|
759
|
+
}
|
|
724
760
|
const slugDir = path2.join(contentDir, ...segments);
|
|
725
761
|
const candidates = segments.length === 0 ? DOCS_FILE_NAMES.map((filename) => path2.join(contentDir, filename)) : [
|
|
726
762
|
...DOCS_FILE_NAMES.map((filename) => path2.join(slugDir, filename)),
|
|
727
|
-
...DOCS_FILE_EXTENSIONS2.map(
|
|
763
|
+
...DOCS_FILE_EXTENSIONS2.map(
|
|
764
|
+
(extension) => path2.join(contentDir, `${canonicalSlug}${extension}`)
|
|
765
|
+
)
|
|
728
766
|
];
|
|
729
767
|
for (const candidate of candidates) {
|
|
768
|
+
if (pathToSlug(contentDir, candidate) !== canonicalSlug) continue;
|
|
769
|
+
if (!isDiscoverableDocsFile(contentDir, candidate)) continue;
|
|
730
770
|
const safePath = resolveExistingFileInside(contentDir, candidate);
|
|
731
771
|
if (safePath) {
|
|
732
772
|
return safePath;
|
|
@@ -784,6 +824,10 @@ function loadFarmDocsPage(contentDir, docs, slug) {
|
|
|
784
824
|
};
|
|
785
825
|
}
|
|
786
826
|
__name(loadFarmDocsPage, "loadFarmDocsPage");
|
|
827
|
+
function getFarmDocsMarkdownPath(href) {
|
|
828
|
+
return href === "/" ? "/.md" : `${href}.md`;
|
|
829
|
+
}
|
|
830
|
+
__name(getFarmDocsMarkdownPath, "getFarmDocsMarkdownPath");
|
|
787
831
|
function createDocsHref(entry, slug) {
|
|
788
832
|
const normalizedEntry = normalizeEntry2(entry);
|
|
789
833
|
const normalizedSlug = trimSlashes(slug);
|
|
@@ -861,8 +905,8 @@ function getDocsDescription(docs) {
|
|
|
861
905
|
return docs.config.metadata?.description;
|
|
862
906
|
}
|
|
863
907
|
__name(getDocsDescription, "getDocsDescription");
|
|
864
|
-
function getLoadedDocsPages(contentDir, docs) {
|
|
865
|
-
return discoverFarmDocsPages(contentDir, docs).map((page) => loadFarmDocsPage(contentDir, docs, page.slug)).filter((page) => Boolean(page));
|
|
908
|
+
function getLoadedDocsPages(contentDir, docs, isPathGuarded) {
|
|
909
|
+
return discoverFarmDocsPages(contentDir, docs).filter((page) => !isPathGuarded?.(page.href)).map((page) => loadFarmDocsPage(contentDir, docs, page.slug)).filter((page) => Boolean(page));
|
|
866
910
|
}
|
|
867
911
|
__name(getLoadedDocsPages, "getLoadedDocsPages");
|
|
868
912
|
function toDocsLlmsPage(page) {
|
|
@@ -1057,10 +1101,10 @@ function getDocsDiscoveryOptions(docs, request) {
|
|
|
1057
1101
|
};
|
|
1058
1102
|
}
|
|
1059
1103
|
__name(getDocsDiscoveryOptions, "getDocsDiscoveryOptions");
|
|
1060
|
-
function createFarmDocsPublicResponse(contentDir, docs, request) {
|
|
1104
|
+
function createFarmDocsPublicResponse(contentDir, docs, request, isPathGuarded) {
|
|
1061
1105
|
const url = new URL(request.url);
|
|
1062
1106
|
let loadedPages;
|
|
1063
|
-
const getPages = /* @__PURE__ */ __name(() => loadedPages ?? (loadedPages = getLoadedDocsPages(contentDir, docs)), "getPages");
|
|
1107
|
+
const getPages = /* @__PURE__ */ __name(() => loadedPages ?? (loadedPages = getLoadedDocsPages(contentDir, docs, isPathGuarded)), "getPages");
|
|
1064
1108
|
const sitemapManifest = /* @__PURE__ */ __name(() => docsEngine().buildDocsSitemapManifest({
|
|
1065
1109
|
pages: getPages().map(toDocsSitemapPage),
|
|
1066
1110
|
entry: docs.entry,
|
|
@@ -1786,11 +1830,11 @@ function renderDocsSearchTrigger(showIcon = true, className = "") {
|
|
|
1786
1830
|
__name(renderDocsSearchTrigger, "renderDocsSearchTrigger");
|
|
1787
1831
|
function renderDocsSearchMount(clientEntry) {
|
|
1788
1832
|
return `<div id="farm-docs-search-root" data-farm-docs-search-root data-api="/api/docs"></div>
|
|
1789
|
-
|
|
1833
|
+
${stampFarmCspNonce(`<script type="module" src="${escapeAttribute(clientEntry)}"></script>`)}`;
|
|
1790
1834
|
}
|
|
1791
1835
|
__name(renderDocsSearchMount, "renderDocsSearchMount");
|
|
1792
1836
|
function renderDocsSearchBootstrapScript() {
|
|
1793
|
-
return `<script>${generateFarmDocsSearchBootstrapRuntime()}</script
|
|
1837
|
+
return stampFarmCspNonce(`<script>${generateFarmDocsSearchBootstrapRuntime()}</script>`);
|
|
1794
1838
|
}
|
|
1795
1839
|
__name(renderDocsSearchBootstrapScript, "renderDocsSearchBootstrapScript");
|
|
1796
1840
|
function renderPixelToc(items) {
|
|
@@ -1820,9 +1864,9 @@ function renderDocsHashRuntimeScript() {
|
|
|
1820
1864
|
}
|
|
1821
1865
|
__name(renderDocsHashRuntimeScript, "renderDocsHashRuntimeScript");
|
|
1822
1866
|
function renderDocsRuntimeScripts(docs) {
|
|
1823
|
-
return `${renderDocsRuntimeScript(docs)}
|
|
1867
|
+
return stampFarmCspNonce(`${renderDocsRuntimeScript(docs)}
|
|
1824
1868
|
${renderDocsHashRuntimeScript()}
|
|
1825
|
-
${renderDocsPageActionsRuntimeScript()}
|
|
1869
|
+
${renderDocsPageActionsRuntimeScript()}`);
|
|
1826
1870
|
}
|
|
1827
1871
|
__name(renderDocsRuntimeScripts, "renderDocsRuntimeScripts");
|
|
1828
1872
|
function renderFarmDocsFontPreloads(fontAssets) {
|
|
@@ -1934,7 +1978,9 @@ function createFarmDocsHandler(docs, options) {
|
|
|
1934
1978
|
const socialImageSlug = getFarmDocsSocialImageSlug(docs, requestUrl);
|
|
1935
1979
|
if (socialImageSlug !== null) {
|
|
1936
1980
|
const socialImagePage = loadFarmDocsPage(contentDir, docs, socialImageSlug);
|
|
1937
|
-
if (!socialImagePage ||
|
|
1981
|
+
if (!socialImagePage || // The image sits outside the page's URL, where its guard does not reach, and
|
|
1982
|
+
// draws the page's title.
|
|
1983
|
+
options.isPathGuarded?.(socialImagePage.href) || !isFarmDocsSocialImageEnabled(socialImagePage, docs) || getFarmDocsCustomSocialImage(socialImagePage)) {
|
|
1938
1984
|
return null;
|
|
1939
1985
|
}
|
|
1940
1986
|
const descriptor = createFarmDocsSocialImageDescriptor(socialImagePage, docs, requestUrl);
|
|
@@ -1953,12 +1999,20 @@ function createFarmDocsHandler(docs, options) {
|
|
|
1953
1999
|
if (request.method === "HEAD") return new Response(null, { status: 200, headers });
|
|
1954
2000
|
return new Response(renderFarmDocsSocialImageSvg(descriptor), { status: 200, headers });
|
|
1955
2001
|
}
|
|
1956
|
-
const publicResponse = createFarmDocsPublicResponse(
|
|
2002
|
+
const publicResponse = createFarmDocsPublicResponse(
|
|
2003
|
+
contentDir,
|
|
2004
|
+
docs,
|
|
2005
|
+
request,
|
|
2006
|
+
options.isPathGuarded
|
|
2007
|
+
);
|
|
1957
2008
|
if (publicResponse) return omitFarmDocsHeadBody(request, publicResponse);
|
|
1958
2009
|
if (!isFarmDocsRequest(docs, request)) return null;
|
|
1959
2010
|
const page = loadPage(contentDir, docs, request);
|
|
1960
2011
|
if (!page) return null;
|
|
1961
2012
|
const negotiatesAccept = !requestUrl.pathname.endsWith(".md");
|
|
2013
|
+
if (!negotiatesAccept && options.isPathGuarded?.(page.href) && !options.isPathGuarded(getFarmDocsMarkdownPath(page.href))) {
|
|
2014
|
+
return null;
|
|
2015
|
+
}
|
|
1962
2016
|
if (shouldReturnMarkdown(request)) {
|
|
1963
2017
|
const origin = new URL(request.url).origin;
|
|
1964
2018
|
return omitFarmDocsHeadBody(
|
|
@@ -2022,6 +2076,7 @@ export {
|
|
|
2022
2076
|
getFarmDocsRouteTypeEntries,
|
|
2023
2077
|
getFarmDocsDocumentNavigationMatchers,
|
|
2024
2078
|
loadFarmDocsPage,
|
|
2079
|
+
getFarmDocsMarkdownPath,
|
|
2025
2080
|
discoverFarmDocsPages,
|
|
2026
2081
|
toFarmDocsMarkdownPage,
|
|
2027
2082
|
createFarmDocsHandler
|
|
@@ -13,7 +13,7 @@ var _chunkYWN746UScjs = require('./chunk-YWN746US.cjs');
|
|
|
13
13
|
var _chunkOX6O6WVAcjs = require('./chunk-OX6O6WVA.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkULASELLAcjs = require('./chunk-ULASELLA.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
@@ -118,7 +118,7 @@ function createServerFn(options) {
|
|
|
118
118
|
throw labelInputErrors && isSchemaValidationFailure(cause) ? new ServerFnInputError(cause) : cause;
|
|
119
119
|
}
|
|
120
120
|
const executionContext = _chunkT5OJPTVNcjs.getServerActionExecutionContext.call(void 0, );
|
|
121
|
-
const request = _nullishCoalesce(_optionalChain([executionContext, 'optionalAccess', _ => _.request]), () => (
|
|
121
|
+
const request = _nullishCoalesce(_optionalChain([executionContext, 'optionalAccess', _ => _.request]), () => ( _chunkULASELLAcjs._resolveCurrentRequestForApp.call(void 0, )));
|
|
122
122
|
const signal = _nullishCoalesce(_nullishCoalesce(_optionalChain([executionContext, 'optionalAccess', _2 => _2.signal]), () => ( _optionalChain([request, 'optionalAccess', _3 => _3.signal]))), () => ( _chunkT5OJPTVNcjs.getServerActionSignal.call(void 0, )));
|
|
123
123
|
const handlerContext = {
|
|
124
124
|
input,
|
|
@@ -9,7 +9,7 @@ var _chunk4PPEPOZZcjs = require('./chunk-4PPEPOZZ.cjs');
|
|
|
9
9
|
var _chunkMQ3H6LT5cjs = require('./chunk-MQ3H6LT5.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkRWFLWR5Jcjs = require('./chunk-RWFLWR5J.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
var _chunkFUCSUGDMcjs = require('./chunk-FUCSUGDM.cjs');
|
|
@@ -23,7 +23,7 @@ var _chunk2CQ74SP6cjs = require('./chunk-2CQ74SP6.cjs');
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _chunkXKG2BLFNcjs = require('./chunk-XKG2BLFN.cjs');
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
var _chunk6V4TDWECcjs = require('./chunk-6V4TDWEC.cjs');
|
|
@@ -47,7 +47,7 @@ var _chunk5QIKR7RRcjs = require('./chunk-5QIKR7RR.cjs');
|
|
|
47
47
|
var _chunkUQZ4AYTHcjs = require('./chunk-UQZ4AYTH.cjs');
|
|
48
48
|
|
|
49
49
|
|
|
50
|
-
var
|
|
50
|
+
var _chunk6XWDE2P2cjs = require('./chunk-6XWDE2P2.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, _chunkRWFLWR5Jcjs.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
|
+
_chunkXKG2BLFNcjs.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 = _chunkXKG2BLFNcjs.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 = _chunkXKG2BLFNcjs.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: _chunkXKG2BLFNcjs.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 _chunkXKG2BLFNcjs.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 _chunkSHLXACIOcjs.loadFarmDevModule.call(void 0, server, filePath);
|
|
279
279
|
const endpoints = {};
|
|
280
280
|
const availableMethods = [];
|
|
281
|
-
for (const method of
|
|
281
|
+
for (const method of _chunkXKG2BLFNcjs.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 _chunkRWFLWR5Jcjs.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 _chunkRWFLWR5Jcjs.APIRouteConflictError || e instanceof _chunkNO3WWW3Ncjs.AmbiguousRouteError) throw e;
|
|
322
322
|
log(`Root routes.ts load failed: ${e.message}`);
|
|
323
323
|
}
|
|
324
324
|
break;
|
|
@@ -349,7 +349,7 @@ function farmApiPlugin(options = {}) {
|
|
|
349
349
|
}
|
|
350
350
|
}
|
|
351
351
|
} catch (e) {
|
|
352
|
-
if (e instanceof
|
|
352
|
+
if (e instanceof _chunkRWFLWR5Jcjs.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 (!_chunkXKG2BLFNcjs.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 && !_chunkXKG2BLFNcjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), currentPathname, basePath)) {
|
|
426
426
|
return next();
|
|
427
427
|
}
|
|
428
|
-
const fullUrl =
|
|
428
|
+
const fullUrl = _chunk6XWDE2P2cjs.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 _chunkRWFLWR5Jcjs.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 _chunkSHLXACIOcjs.loadFarmDevModule.call(void 0, server, file);
|
|
555
555
|
removeEndpointsFromFile(file);
|
|
556
556
|
const availableMethods = [];
|
|
557
|
-
for (const method of
|
|
557
|
+
for (const method of _chunkXKG2BLFNcjs.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 _chunkRWFLWR5Jcjs.APIRouteConflictError || e instanceof _chunkNO3WWW3Ncjs.AmbiguousRouteError) throw e;
|
|
568
568
|
log(`API route HMR failed: ${e.message}`);
|
|
569
569
|
}
|
|
570
570
|
return [];
|
|
@@ -7,7 +7,7 @@ var _chunkPCOTGFSMcjs = require('./chunk-PCOTGFSM.cjs');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkRVXFINNScjs = require('./chunk-RVXFINNS.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
@@ -59,7 +59,7 @@ function createFarmLayoutSelector(layouts, resolveRouteDirectory) {
|
|
|
59
59
|
return {
|
|
60
60
|
layout,
|
|
61
61
|
segments: segments.length === 0 ? null : segments,
|
|
62
|
-
groupScope:
|
|
62
|
+
groupScope: _chunkRVXFINNScjs.getRouteGroupScope.call(void 0, layout.pattern)
|
|
63
63
|
};
|
|
64
64
|
});
|
|
65
65
|
return (pathname, routeDirectory) => {
|
|
@@ -73,7 +73,7 @@ function createFarmLayoutSelector(layouts, resolveRouteDirectory) {
|
|
|
73
73
|
}
|
|
74
74
|
if (groupScope !== null) {
|
|
75
75
|
if (directory === void 0) directory = _nullishCoalesce(_optionalChain([resolveRouteDirectory, 'optionalCall', _2 => _2(pathname)]), () => ( null));
|
|
76
|
-
if (!
|
|
76
|
+
if (!_chunkRVXFINNScjs.isInRouteGroupScope.call(void 0, directory, groupScope)) continue;
|
|
77
77
|
}
|
|
78
78
|
applicable.push(layout);
|
|
79
79
|
}
|
|
@@ -82,9 +82,9 @@ function createFarmLayoutSelector(layouts, resolveRouteDirectory) {
|
|
|
82
82
|
}
|
|
83
83
|
_chunkS3JO3N4Hcjs.__name.call(void 0, createFarmLayoutSelector, "createFarmLayoutSelector");
|
|
84
84
|
function layoutsCanCoverSamePage(a, b) {
|
|
85
|
-
const scopeA =
|
|
86
|
-
const scopeB =
|
|
87
|
-
if (scopeA !== null && scopeB !== null && !
|
|
85
|
+
const scopeA = _chunkRVXFINNScjs.getRouteGroupScope.call(void 0, a);
|
|
86
|
+
const scopeB = _chunkRVXFINNScjs.getRouteGroupScope.call(void 0, b);
|
|
87
|
+
if (scopeA !== null && scopeB !== null && !_chunkRVXFINNScjs.isInRouteGroupScope.call(void 0, scopeA, scopeB) && !_chunkRVXFINNScjs.isInRouteGroupScope.call(void 0, scopeB, scopeA)) {
|
|
88
88
|
return false;
|
|
89
89
|
}
|
|
90
90
|
const segmentsA = a === "/" ? [] : _chunkPCOTGFSMcjs.parseRoutePattern.call(void 0, a);
|