@farm.js/core 0.1.27 → 0.1.29

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.
Files changed (235) hide show
  1. package/dist/agent-runtime.d.mts +3 -2
  2. package/dist/agent-runtime.d.ts +3 -2
  3. package/dist/api/client.cjs +4 -6
  4. package/dist/api/client.d.mts +1 -0
  5. package/dist/api/client.d.ts +1 -0
  6. package/dist/api/client.mjs +3 -5
  7. package/dist/api/route-manager.cjs +9 -8
  8. package/dist/api/route-manager.d.mts +2 -1
  9. package/dist/api/route-manager.d.ts +2 -1
  10. package/dist/api/route-manager.mjs +8 -7
  11. package/dist/api/runtime.cjs +7 -6
  12. package/dist/api/runtime.d.mts +3 -2
  13. package/dist/api/runtime.d.ts +3 -2
  14. package/dist/api/runtime.mjs +6 -5
  15. package/dist/api.cjs +12 -11
  16. package/dist/api.d.mts +19 -4
  17. package/dist/api.d.ts +19 -4
  18. package/dist/api.mjs +11 -10
  19. package/dist/{app-BfzZdjgX.d.mts → app-DAuUTIZf.d.mts} +3 -3
  20. package/dist/app-markdown.cjs +6 -5
  21. package/dist/app-markdown.d.mts +4 -3
  22. package/dist/app-markdown.d.ts +4 -3
  23. package/dist/app-markdown.mjs +5 -4
  24. package/dist/{app-CXK7Prrt.d.ts → app-sUJ3jnTZ.d.ts} +3 -3
  25. package/dist/cache-invalidation-BD0z_lfu.d.mts +4 -0
  26. package/dist/cache-invalidation-BD0z_lfu.d.ts +4 -0
  27. package/dist/cache.cjs +6 -4
  28. package/dist/cache.d.mts +11 -6
  29. package/dist/cache.d.ts +11 -6
  30. package/dist/cache.mjs +7 -5
  31. package/dist/{chunk-N6UROPT7.mjs → chunk-2FQHH5SC.mjs} +12 -13
  32. package/dist/{chunk-UUYF3CHN.mjs → chunk-2N5PX3LS.mjs} +2 -2
  33. package/dist/{chunk-H6G5INWM.cjs → chunk-2SDO73HK.cjs} +14 -156
  34. package/dist/{chunk-4FHDV7VM.mjs → chunk-2UABTL3Y.mjs} +2 -2
  35. package/dist/{chunk-LAHZ7LZA.cjs → chunk-3FCFQP5V.cjs} +32 -20
  36. package/dist/{chunk-3TQWUUNP.cjs → chunk-3LUF2PE2.cjs} +10 -5
  37. package/dist/{chunk-SYGGPS4A.mjs → chunk-4IEPYMHF.mjs} +3 -3
  38. package/dist/{chunk-WD5PNSOB.mjs → chunk-4V7GIE2U.mjs} +6 -4
  39. package/dist/{chunk-UWTQTZFN.mjs → chunk-5KDPVSS3.mjs} +271 -155
  40. package/dist/{chunk-I7PUUDGY.cjs → chunk-63H6BKXG.cjs} +2 -2
  41. package/dist/{chunk-ZSO5GWGD.cjs → chunk-6CNX6Q3K.cjs} +168 -51
  42. package/dist/{chunk-3PTVHMLD.mjs → chunk-6G3ZZ2IE.mjs} +1 -1
  43. package/dist/{chunk-QBPXNZGV.cjs → chunk-6MVFL3R5.cjs} +25 -6
  44. package/dist/{chunk-FG5H2VCJ.mjs → chunk-6ZCMSZ5U.mjs} +2 -2
  45. package/dist/{chunk-YZBV7733.cjs → chunk-74T3CEA7.cjs} +397 -281
  46. package/dist/{chunk-ZMN3H73H.cjs → chunk-75DYEVXI.cjs} +13 -11
  47. package/dist/{chunk-WIVTGKLY.mjs → chunk-7CXKSRKL.mjs} +18 -11
  48. package/dist/{chunk-POXI72VV.mjs → chunk-ATXI6LGT.mjs} +148 -31
  49. package/dist/{chunk-NL3ZSMZB.cjs → chunk-BJPBQNIE.cjs} +12 -12
  50. package/dist/{chunk-Q4BHBO6V.mjs → chunk-BXFWA23T.mjs} +2 -2
  51. package/dist/{chunk-MBFURXAC.mjs → chunk-BZ3CHOFX.mjs} +1 -1
  52. package/dist/{chunk-TDWFCC2T.cjs → chunk-BZAGKCKB.cjs} +2 -2
  53. package/dist/chunk-CNOQY6Z7.mjs +156 -0
  54. package/dist/{chunk-DW34V5SM.cjs → chunk-CTV2TTNP.cjs} +4 -4
  55. package/dist/{chunk-HG237IEY.mjs → chunk-D234YWNA.mjs} +1 -1
  56. package/dist/{chunk-YXM74XOW.cjs → chunk-D4JE5NNV.cjs} +12 -12
  57. package/dist/{chunk-O2LV5XDG.mjs → chunk-DGXN3L4D.mjs} +20 -8
  58. package/dist/{chunk-4UNKCNSL.mjs → chunk-E76XC6ZG.mjs} +2 -2
  59. package/dist/{chunk-QQQNJS2E.mjs → chunk-E7UN576T.mjs} +1 -1
  60. package/dist/{chunk-G3HRIVEY.cjs → chunk-ES4B2IXW.cjs} +2 -2
  61. package/dist/{chunk-JQGDQO2I.cjs → chunk-EXLKRR4U.cjs} +10 -10
  62. package/dist/chunk-FJ3M4CUX.cjs +46 -0
  63. package/dist/chunk-FXEF4PPL.mjs +47 -0
  64. package/dist/{chunk-WD4YXVLV.mjs → chunk-GZYH4OER.mjs} +1 -1
  65. package/dist/{chunk-DX4VKYAJ.cjs → chunk-I26CZYPV.cjs} +6 -4
  66. package/dist/{chunk-F6SJAKFJ.mjs → chunk-IV6CQY7O.mjs} +12 -154
  67. package/dist/{chunk-6D242YGO.mjs → chunk-JATSG2ZO.mjs} +1 -1
  68. package/dist/{chunk-KAERLFD3.cjs → chunk-JFHKNFEO.cjs} +30 -23
  69. package/dist/{chunk-U74A3P2P.cjs → chunk-JLRDISQL.cjs} +7 -7
  70. package/dist/{chunk-BYODCJD6.cjs → chunk-K7CELQLK.cjs} +12 -13
  71. package/dist/{chunk-Y4YWHNKU.cjs → chunk-KH7BN726.cjs} +9 -9
  72. package/dist/{chunk-3IL5UC5I.cjs → chunk-KZLND3D2.cjs} +2 -2
  73. package/dist/{chunk-TKDY6AJP.mjs → chunk-MKMBQSNQ.mjs} +1 -1
  74. package/dist/{chunk-OCE65DDM.mjs → chunk-MNUGPHLN.mjs} +1 -1
  75. package/dist/{chunk-WJKVTJJR.cjs → chunk-NPPL5YDT.cjs} +2 -2
  76. package/dist/{chunk-HF5SIACK.cjs → chunk-NXG66MR7.cjs} +3 -3
  77. package/dist/chunk-NYJMY3JA.cjs +156 -0
  78. package/dist/{chunk-VVJCWBIE.mjs → chunk-O3DTUAX2.mjs} +2 -2
  79. package/dist/{chunk-R6AIILII.cjs → chunk-OZVEHHMA.cjs} +15 -14
  80. package/dist/{chunk-FPW4W3VW.mjs → chunk-PQD2AI3B.mjs} +1 -1
  81. package/dist/{chunk-C7OUJ6JI.cjs → chunk-PZNCMPJF.cjs} +3 -3
  82. package/dist/{chunk-QI7WQSMI.cjs → chunk-Q5JFU33Q.cjs} +4 -4
  83. package/dist/{chunk-52SH7TKB.mjs → chunk-QG5HNS7P.mjs} +2 -2
  84. package/dist/{chunk-CEYUWDWA.mjs → chunk-QZCT2CQ4.mjs} +10 -5
  85. package/dist/{chunk-FZC7EEPM.mjs → chunk-RSOJ7DRT.mjs} +26 -7
  86. package/dist/{chunk-QMV4QELL.mjs → chunk-S5GDHOE4.mjs} +4 -2
  87. package/dist/{chunk-CRQPYWLK.cjs → chunk-SORB3MAR.cjs} +14 -14
  88. package/dist/{chunk-I4J452B7.cjs → chunk-VHJGDMCG.cjs} +3 -3
  89. package/dist/{chunk-B6ZCT36X.cjs → chunk-WNLBF77X.cjs} +4 -4
  90. package/dist/{chunk-FOT7LZEO.cjs → chunk-WPPX4G7Q.cjs} +1 -1
  91. package/dist/{chunk-UNSKL6BI.cjs → chunk-X4ZV4QC5.cjs} +266 -228
  92. package/dist/{chunk-6EG7U4NF.mjs → chunk-X7WVQMIB.mjs} +1 -1
  93. package/dist/chunk-XD32KALF.cjs +47 -0
  94. package/dist/{chunk-RDV44SED.mjs → chunk-XJJVLDM6.mjs} +15 -14
  95. package/dist/{chunk-DQMTHWPI.cjs → chunk-XLTV4VOG.cjs} +21 -16
  96. package/dist/{chunk-5SPPCN5J.mjs → chunk-XNPDONUH.mjs} +1 -1
  97. package/dist/{chunk-UOXGA6TO.mjs → chunk-YDQZGSDS.mjs} +1 -1
  98. package/dist/{chunk-JT25KHDI.mjs → chunk-YMUE7L3D.mjs} +18 -13
  99. package/dist/chunk-Z3HATSKO.mjs +46 -0
  100. package/dist/{chunk-C3VRMB6H.cjs → chunk-ZCU4NZ3M.cjs} +6 -6
  101. package/dist/{chunk-NPFGGBM5.cjs → chunk-ZDILFMWN.cjs} +13 -13
  102. package/dist/{chunk-OGHTEYXS.mjs → chunk-ZYVFAOBT.mjs} +72 -34
  103. package/dist/{client-plugins-1GS4zubE.d.mts → client-plugins-BX2ptm4H.d.mts} +42 -34
  104. package/dist/{client-plugins-B1Za6F5x.d.ts → client-plugins-BmxM5KW_.d.ts} +42 -34
  105. package/dist/client-plugins.d.mts +3 -2
  106. package/dist/client-plugins.d.ts +3 -2
  107. package/dist/client.cjs +11 -12
  108. package/dist/client.d.mts +6 -5
  109. package/dist/client.d.ts +6 -5
  110. package/dist/client.mjs +10 -11
  111. package/dist/config.d.mts +3 -2
  112. package/dist/config.d.ts +3 -2
  113. package/dist/{devtools-CQJ3H6MX.cjs → devtools-GGVPZHJX.cjs} +96 -21
  114. package/dist/{devtools-6RN6KHTW.mjs → devtools-THVNPI2M.mjs} +80 -5
  115. package/dist/{devtools-client-4WAPJY5L.cjs → devtools-client-CXQ6PXI6.cjs} +1 -1
  116. package/dist/{devtools-client-LEUIHHAS.mjs → devtools-client-HJS2T34Y.mjs} +1 -1
  117. package/dist/docs.cjs +9 -8
  118. package/dist/docs.mjs +8 -7
  119. package/dist/index.cjs +61 -57
  120. package/dist/index.d.mts +26 -15
  121. package/dist/index.d.ts +26 -15
  122. package/dist/index.mjs +69 -65
  123. package/dist/integrations.d.mts +3 -2
  124. package/dist/integrations.d.ts +3 -2
  125. package/dist/internal/app-markdown-runtime.cjs +5 -4
  126. package/dist/internal/app-markdown-runtime.d.mts +4 -3
  127. package/dist/internal/app-markdown-runtime.d.ts +4 -3
  128. package/dist/internal/app-markdown-runtime.mjs +4 -3
  129. package/dist/internal/build-runtime.cjs +26 -23
  130. package/dist/internal/build-runtime.d.mts +5 -4
  131. package/dist/internal/build-runtime.d.ts +5 -4
  132. package/dist/internal/build-runtime.mjs +25 -22
  133. package/dist/internal/cli-runtime.cjs +15 -13
  134. package/dist/internal/cli-runtime.mjs +14 -12
  135. package/dist/internal/client-error-overlay.cjs +4 -4
  136. package/dist/internal/client-error-overlay.mjs +1 -1
  137. package/dist/internal/client-runtime.cjs +5 -1
  138. package/dist/internal/client-runtime.d.mts +1 -0
  139. package/dist/internal/client-runtime.d.ts +1 -0
  140. package/dist/internal/client-runtime.mjs +4 -0
  141. package/dist/internal/compression-runtime.cjs +3 -2
  142. package/dist/internal/compression-runtime.d.mts +6 -3
  143. package/dist/internal/compression-runtime.d.ts +6 -3
  144. package/dist/internal/compression-runtime.mjs +2 -1
  145. package/dist/internal/config-runtime.cjs +7 -6
  146. package/dist/internal/config-runtime.d.mts +4 -3
  147. package/dist/internal/config-runtime.d.ts +4 -3
  148. package/dist/internal/config-runtime.mjs +6 -5
  149. package/dist/internal/product-telemetry-runtime.cjs +10 -6
  150. package/dist/internal/product-telemetry-runtime.mjs +9 -5
  151. package/dist/internal/production-runtime.cjs +29 -13
  152. package/dist/internal/production-runtime.d.mts +36 -8
  153. package/dist/internal/production-runtime.d.ts +36 -8
  154. package/dist/internal/production-runtime.mjs +32 -16
  155. package/dist/markdown.cjs +4 -3
  156. package/dist/markdown.d.mts +3 -2
  157. package/dist/markdown.d.ts +3 -2
  158. package/dist/markdown.mjs +3 -2
  159. package/dist/{metadata-B9mCxKgp.d.mts → metadata-DsEaK7mQ.d.mts} +1 -1
  160. package/dist/{metadata-7LKgQEWF.d.ts → metadata-fwZ3gfG6.d.ts} +1 -1
  161. package/dist/middleware.cjs +6 -5
  162. package/dist/middleware.d.mts +4 -3
  163. package/dist/middleware.d.ts +4 -3
  164. package/dist/middleware.mjs +5 -4
  165. package/dist/navigation.cjs +5 -5
  166. package/dist/navigation.d.mts +5 -4
  167. package/dist/navigation.d.ts +5 -4
  168. package/dist/navigation.mjs +4 -4
  169. package/dist/plugin.cjs +25 -20
  170. package/dist/plugin.d.mts +3 -2
  171. package/dist/plugin.d.ts +3 -2
  172. package/dist/plugin.mjs +25 -20
  173. package/dist/{production-runtime-DramhI0c.d.mts → production-runtime-Baqgwtvc.d.mts} +1 -1
  174. package/dist/{production-runtime-B3xnY6fI.d.ts → production-runtime-DNkpFnmg.d.ts} +1 -1
  175. package/dist/query/client.cjs +6 -6
  176. package/dist/query/client.mjs +2 -2
  177. package/dist/{render-plan-CtQB-zHS.d.mts → render-plan-DhwQnmmX.d.mts} +1 -1
  178. package/dist/{render-plan-CpW32tOL.d.ts → render-plan-rkIK9wd9.d.ts} +1 -1
  179. package/dist/renderer-client.cjs +13 -14
  180. package/dist/renderer-client.d.mts +4 -3
  181. package/dist/renderer-client.d.ts +4 -3
  182. package/dist/renderer-client.mjs +6 -7
  183. package/dist/{request-BVGGeQv4.d.ts → request-BcY4RYPC.d.ts} +1 -1
  184. package/dist/{request-DlLVBKe3.d.mts → request-CFy1BltJ.d.mts} +1 -1
  185. package/dist/request.d.mts +4 -3
  186. package/dist/request.d.ts +4 -3
  187. package/dist/{route-rendering-DChYLNdh.d.mts → route-rendering-BkS0TBlB.d.mts} +1 -1
  188. package/dist/{route-rendering-BdEldajn.d.ts → route-rendering-D4XpMjam.d.ts} +1 -1
  189. package/dist/{router-D5htHn_M.d.mts → router-C4zPlC3V.d.mts} +1 -1
  190. package/dist/{router-D0Az-1Nu.d.ts → router-Cq7BcZxg.d.ts} +1 -1
  191. package/dist/routes.cjs +6 -5
  192. package/dist/routes.d.mts +3 -2
  193. package/dist/routes.d.ts +3 -2
  194. package/dist/routes.mjs +5 -4
  195. package/dist/server-fn-client.d.mts +1 -0
  196. package/dist/server-fn-client.d.ts +1 -0
  197. package/dist/server-fn.cjs +6 -5
  198. package/dist/server-fn.d.mts +1 -0
  199. package/dist/server-fn.d.ts +1 -0
  200. package/dist/server-fn.mjs +5 -4
  201. package/dist/server-plugins.cjs +3 -2
  202. package/dist/server-plugins.d.mts +3 -2
  203. package/dist/server-plugins.d.ts +3 -2
  204. package/dist/server-plugins.mjs +2 -1
  205. package/dist/server-query-client.cjs +5 -7
  206. package/dist/server-query-client.d.mts +1 -0
  207. package/dist/server-query-client.d.ts +1 -0
  208. package/dist/server-query-client.mjs +4 -6
  209. package/dist/server-query.cjs +7 -6
  210. package/dist/server-query.d.mts +1 -0
  211. package/dist/server-query.d.ts +1 -0
  212. package/dist/server-query.mjs +6 -5
  213. package/dist/server.cjs +72 -57
  214. package/dist/server.d.mts +10 -9
  215. package/dist/server.d.ts +10 -9
  216. package/dist/server.mjs +56 -41
  217. package/dist/{spa-router-DmwP_7QL.d.ts → spa-router-B1HI3X9k.d.ts} +2 -2
  218. package/dist/{spa-router-DVfSJZ5o.d.mts → spa-router-DzPZH-AO.d.mts} +2 -2
  219. package/dist/testing.cjs +14 -13
  220. package/dist/testing.d.mts +2 -1
  221. package/dist/testing.d.ts +2 -1
  222. package/dist/testing.mjs +11 -10
  223. package/dist/{utils-B_Rmr0-n.d.mts → utils-CEBktlBG.d.mts} +1 -1
  224. package/dist/{utils-Dv0OuLtF.d.ts → utils-DMD1Hzta.d.ts} +1 -1
  225. package/dist/version.cjs +2 -2
  226. package/dist/version.mjs +1 -1
  227. package/dist/vite.cjs +21 -19
  228. package/dist/vite.d.mts +3 -2
  229. package/dist/vite.d.ts +3 -2
  230. package/dist/vite.mjs +20 -18
  231. package/package.json +1 -1
  232. package/dist/{chunk-YOYF2E4U.mjs → chunk-LNZ7JZUS.mjs} +0 -0
  233. package/dist/{chunk-N4RLRSWW.cjs → chunk-SUIBNSNO.cjs} +0 -0
  234. package/dist/{chunk-TIKNUAU7.mjs → chunk-VUMAE7NC.mjs} +3 -3
  235. package/dist/{chunk-WM6HL7E7.cjs → chunk-ZHVYQL3H.cjs} +2 -2
@@ -1,15 +1,20 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await 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 _chunkE3UK5IIBcjs = require('./chunk-E3UK5IIB.cjs');
3
4
 
4
5
 
6
+ var _chunkLIUGYUX3cjs = require('./chunk-LIUGYUX3.cjs');
5
7
 
6
- var _chunkZEG3OPIBcjs = require('./chunk-ZEG3OPIB.cjs');
7
8
 
8
9
 
9
- var _chunkLIUGYUX3cjs = require('./chunk-LIUGYUX3.cjs');
10
+
11
+ var _chunkNYJMY3JAcjs = require('./chunk-NYJMY3JA.cjs');
10
12
 
11
13
 
12
- var _chunkE3UK5IIBcjs = require('./chunk-E3UK5IIB.cjs');
14
+
15
+
16
+
17
+ var _chunkZEG3OPIBcjs = require('./chunk-ZEG3OPIB.cjs');
13
18
 
14
19
 
15
20
  var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
@@ -727,9 +732,9 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, configureFarmCache, "configureFarmCache");
727
732
  function unstable_cache(fn, keyParts = [], options = {}) {
728
733
  return async (...args) => {
729
734
  const locale = _optionalChain([_chunkLIUGYUX3cjs.getActiveFarmI18nSnapshot.call(void 0, ), 'optionalAccess', _50 => _50.locale]);
730
- const key = createFarmCacheKey([
735
+ const key = _chunkNYJMY3JAcjs.createFarmCacheKey.call(void 0, [
731
736
  "unstable_cache",
732
- getFunctionCacheIdentity(fn),
737
+ _chunkNYJMY3JAcjs.getFunctionCacheIdentity.call(void 0, fn),
733
738
  locale ? ["locale", locale] : null,
734
739
  keyParts,
735
740
  args
@@ -775,7 +780,7 @@ function revalidatePath(routePath) {
775
780
  }
776
781
  _chunkS3JO3N4Hcjs.__name.call(void 0, revalidatePath, "revalidatePath");
777
782
  function invalidate(key) {
778
- const clientKey = createRouteDataCacheKey(key);
783
+ const clientKey = _chunkNYJMY3JAcjs.createRouteDataCacheKey.call(void 0, key);
779
784
  const task = updateTag(createRouteDataCacheTag(key));
780
785
  _chunkZEG3OPIBcjs.notifyFarmCacheInvalidation.call(void 0, clientKey);
781
786
  return task;
@@ -794,7 +799,7 @@ async function applyFarmCacheInvalidationTargets(targets) {
794
799
  assertFarmCacheInvalidationTarget(target);
795
800
  if ("key" in target) {
796
801
  await invalidate(target.key);
797
- clientKeys.push(createRouteDataCacheKey(target.key));
802
+ clientKeys.push(_chunkNYJMY3JAcjs.createRouteDataCacheKey.call(void 0, target.key));
798
803
  } else if ("path" in target) {
799
804
  await revalidatePath(target.path);
800
805
  } else {
@@ -809,13 +814,9 @@ function createPathCacheTag(routePath) {
809
814
  }
810
815
  _chunkS3JO3N4Hcjs.__name.call(void 0, createPathCacheTag, "createPathCacheTag");
811
816
  function createRouteDataCacheTag(key) {
812
- return `route-data:${createRouteDataCacheKey(key)}`;
817
+ return `route-data:${_chunkNYJMY3JAcjs.createRouteDataCacheKey.call(void 0, key)}`;
813
818
  }
814
819
  _chunkS3JO3N4Hcjs.__name.call(void 0, createRouteDataCacheTag, "createRouteDataCacheTag");
815
- function createRouteDataCacheKey(key) {
816
- return createFarmCacheKey(Array.isArray(key) ? key : [key]);
817
- }
818
- _chunkS3JO3N4Hcjs.__name.call(void 0, createRouteDataCacheKey, "createRouteDataCacheKey");
819
820
  function normalizeRevalidatePath(routePath) {
820
821
  if (typeof routePath !== "string") {
821
822
  throw new TypeError("revalidatePath expects a path string.");
@@ -840,10 +841,6 @@ function normalizeRevalidatePath(routePath) {
840
841
  return normalized || "/";
841
842
  }
842
843
  _chunkS3JO3N4Hcjs.__name.call(void 0, normalizeRevalidatePath, "normalizeRevalidatePath");
843
- function createFarmCacheKey(parts) {
844
- return stableSerialize(parts);
845
- }
846
- _chunkS3JO3N4Hcjs.__name.call(void 0, createFarmCacheKey, "createFarmCacheKey");
847
844
  function normalizeRevalidate(revalidate) {
848
845
  if (revalidate === false || revalidate === void 0) {
849
846
  return revalidate;
@@ -934,145 +931,6 @@ function assertFarmCacheInvalidationTarget(target) {
934
931
  throw new TypeError("Cache invalidation targets must contain a string/array key, path, or tag.");
935
932
  }
936
933
  _chunkS3JO3N4Hcjs.__name.call(void 0, assertFarmCacheInvalidationTarget, "assertFarmCacheInvalidationTarget");
937
- function getFunctionCacheIdentity(fn) {
938
- const name = fn.name || "anonymous";
939
- return `${name}:${hashFunctionSource(String(fn))}`;
940
- }
941
- _chunkS3JO3N4Hcjs.__name.call(void 0, getFunctionCacheIdentity, "getFunctionCacheIdentity");
942
- function hashFunctionSource(source) {
943
- let hash = 2166136261;
944
- for (let index = 0; index < source.length; index++) {
945
- hash ^= source.charCodeAt(index);
946
- hash = Math.imul(hash, 16777619);
947
- }
948
- return (hash >>> 0).toString(36);
949
- }
950
- _chunkS3JO3N4Hcjs.__name.call(void 0, hashFunctionSource, "hashFunctionSource");
951
- function compareCodepoint(a, b) {
952
- return a < b ? -1 : a > b ? 1 : 0;
953
- }
954
- _chunkS3JO3N4Hcjs.__name.call(void 0, compareCodepoint, "compareCodepoint");
955
- function serializeBinaryBytes(bytes) {
956
- return Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0")).join("");
957
- }
958
- _chunkS3JO3N4Hcjs.__name.call(void 0, serializeBinaryBytes, "serializeBinaryBytes");
959
- function serializeCanonicalStringEntries(entries, seen) {
960
- const valuesByKey = /* @__PURE__ */ new Map();
961
- for (const [key, item] of entries) {
962
- const values = valuesByKey.get(key);
963
- if (values) values.push(item);
964
- else valuesByKey.set(key, [item]);
965
- }
966
- return Array.from(valuesByKey.keys()).sort(compareCodepoint).flatMap(
967
- (key) => valuesByKey.get(key).map((item) => `[${stableSerialize(key, seen)},${stableSerialize(item, seen)}]`)
968
- ).join(",");
969
- }
970
- _chunkS3JO3N4Hcjs.__name.call(void 0, serializeCanonicalStringEntries, "serializeCanonicalStringEntries");
971
- function isPlainCacheKeyObject(value) {
972
- const prototype = Object.getPrototypeOf(value);
973
- if (prototype === null) return true;
974
- const constructor = _optionalChain([Object, 'access', _51 => _51.getOwnPropertyDescriptor, 'call', _52 => _52(prototype, "constructor"), 'optionalAccess', _53 => _53.value]);
975
- return Object.getPrototypeOf(prototype) === null && typeof constructor === "function" && constructor.name === "Object";
976
- }
977
- _chunkS3JO3N4Hcjs.__name.call(void 0, isPlainCacheKeyObject, "isPlainCacheKeyObject");
978
- function getCacheKeyValueType(value) {
979
- const prototype = Object.getPrototypeOf(value);
980
- const constructor = prototype ? _optionalChain([Object, 'access', _54 => _54.getOwnPropertyDescriptor, 'call', _55 => _55(prototype, "constructor"), 'optionalAccess', _56 => _56.value]) : void 0;
981
- if (typeof constructor === "function" && constructor.name) {
982
- return constructor.name;
983
- }
984
- return Object.prototype.toString.call(value).slice(8, -1) || "object";
985
- }
986
- _chunkS3JO3N4Hcjs.__name.call(void 0, getCacheKeyValueType, "getCacheKeyValueType");
987
- function stableSerialize(value, seen = /* @__PURE__ */ new WeakSet()) {
988
- if (value === null) return "null";
989
- if (value === void 0) return "undefined";
990
- const valueType = typeof value;
991
- if (valueType === "string") return JSON.stringify(value);
992
- if (valueType === "number" || valueType === "boolean" || valueType === "bigint") {
993
- return `${valueType}:${String(value)}`;
994
- }
995
- if (valueType === "symbol") {
996
- return `symbol:${String(value)}`;
997
- }
998
- if (valueType === "function") {
999
- return `function:${getFunctionCacheIdentity(value)}`;
1000
- }
1001
- if (value instanceof Date) {
1002
- return Number.isNaN(value.getTime()) ? "date:invalid" : `date:${value.toISOString()}`;
1003
- }
1004
- if (value instanceof URL) {
1005
- return `url:${value.toString()}`;
1006
- }
1007
- if (value instanceof RegExp) {
1008
- return `regexp:${value.toString()}`;
1009
- }
1010
- if (value instanceof ArrayBuffer) {
1011
- return `arraybuffer:${serializeBinaryBytes(new Uint8Array(value))}`;
1012
- }
1013
- if (typeof SharedArrayBuffer !== "undefined" && value instanceof SharedArrayBuffer) {
1014
- return `sharedarraybuffer:${serializeBinaryBytes(new Uint8Array(value))}`;
1015
- }
1016
- if (ArrayBuffer.isView(value)) {
1017
- const viewType = Object.prototype.toString.call(value).slice(8, -1);
1018
- const bytes = new Uint8Array(value.buffer, value.byteOffset, value.byteLength);
1019
- return `binary:${viewType}:${serializeBinaryBytes(bytes)}`;
1020
- }
1021
- if (value && typeof value === "object") {
1022
- if (seen.has(value)) {
1023
- return "[Circular]";
1024
- }
1025
- seen.add(value);
1026
- if (Array.isArray(value)) {
1027
- const items = [];
1028
- for (let index = 0; index < value.length; index++) {
1029
- items.push(
1030
- Object.prototype.hasOwnProperty.call(value, index) ? stableSerialize(value[index], seen) : "[Hole]"
1031
- );
1032
- }
1033
- seen.delete(value);
1034
- return `[${items.join(",")}]`;
1035
- }
1036
- if (value instanceof Set) {
1037
- const items = Array.from(value, (item) => stableSerialize(item, seen)).sort(compareCodepoint);
1038
- seen.delete(value);
1039
- return `set:[${items.join(",")}]`;
1040
- }
1041
- if (value instanceof Map) {
1042
- const items = Array.from(
1043
- value,
1044
- ([key, item]) => `[${stableSerialize(key, seen)},${stableSerialize(item, seen)}]`
1045
- ).sort(compareCodepoint);
1046
- seen.delete(value);
1047
- return `map:[${items.join(",")}]`;
1048
- }
1049
- if (value instanceof URLSearchParams) {
1050
- const serialized2 = serializeCanonicalStringEntries(value, seen);
1051
- seen.delete(value);
1052
- return `urlsearchparams:[${serialized2}]`;
1053
- }
1054
- if (value instanceof Headers) {
1055
- const serialized2 = serializeCanonicalStringEntries(value, seen);
1056
- seen.delete(value);
1057
- return `headers:[${serialized2}]`;
1058
- }
1059
- if (!isPlainCacheKeyObject(value)) {
1060
- throw new TypeError(
1061
- `Cache keys do not support ${getCacheKeyValueType(value)} values. Convert the value to an explicit stable string or structured key before caching.`
1062
- );
1063
- }
1064
- const entries = Object.entries(value).sort(
1065
- ([a], [b]) => compareCodepoint(a, b)
1066
- );
1067
- const serialized = entries.map(([key, item]) => `${JSON.stringify(key)}:${stableSerialize(item, seen)}`).join(",");
1068
- seen.delete(value);
1069
- return `{${serialized}}`;
1070
- }
1071
- return String(value);
1072
- }
1073
- _chunkS3JO3N4Hcjs.__name.call(void 0, stableSerialize, "stableSerialize");
1074
-
1075
-
1076
934
 
1077
935
 
1078
936
 
@@ -1091,4 +949,4 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, stableSerialize, "stableSerialize");
1091
949
 
1092
950
 
1093
951
 
1094
- exports.createFarmCacheInvalidationStream = createFarmCacheInvalidationStream; exports.defineCacheKey = defineCacheKey; exports.storageCacheAdapter = storageCacheAdapter; exports.FarmDataCache = FarmDataCache; exports.getFarmDataCache = getFarmDataCache; exports.configureFarmCache = configureFarmCache; exports.unstable_cache = unstable_cache; exports.revalidateTag = revalidateTag; exports.updateTag = updateTag; exports.revalidatePath = revalidatePath; exports.invalidate = invalidate; exports.invalidateRouteData = invalidateRouteData; exports.applyFarmCacheInvalidationTargets = applyFarmCacheInvalidationTargets; exports.createPathCacheTag = createPathCacheTag; exports.createRouteDataCacheTag = createRouteDataCacheTag; exports.createRouteDataCacheKey = createRouteDataCacheKey; exports.normalizeRevalidatePath = normalizeRevalidatePath; exports.createFarmCacheKey = createFarmCacheKey;
952
+ exports.createFarmCacheInvalidationStream = createFarmCacheInvalidationStream; exports.defineCacheKey = defineCacheKey; exports.storageCacheAdapter = storageCacheAdapter; exports.FarmDataCache = FarmDataCache; exports.getFarmDataCache = getFarmDataCache; exports.configureFarmCache = configureFarmCache; exports.unstable_cache = unstable_cache; exports.revalidateTag = revalidateTag; exports.updateTag = updateTag; exports.revalidatePath = revalidatePath; exports.invalidate = invalidate; exports.invalidateRouteData = invalidateRouteData; exports.applyFarmCacheInvalidationTargets = applyFarmCacheInvalidationTargets; exports.createPathCacheTag = createPathCacheTag; exports.createRouteDataCacheTag = createRouteDataCacheTag; exports.normalizeRevalidatePath = normalizeRevalidatePath;
@@ -3,14 +3,14 @@ import {
3
3
  loadFarmDocsPage,
4
4
  resolveFarmDocsContentDir,
5
5
  toFarmDocsMarkdownPage
6
- } from "./chunk-FPW4W3VW.mjs";
6
+ } from "./chunk-PQD2AI3B.mjs";
7
7
  import {
8
8
  docsEngine,
9
9
  loadFarmDocsEngine
10
10
  } from "./chunk-2VQKKQ6D.mjs";
11
11
  import {
12
12
  resolveDocsConfig
13
- } from "./chunk-WIVTGKLY.mjs";
13
+ } from "./chunk-7CXKSRKL.mjs";
14
14
  import {
15
15
  getFarmDocsAdapterConfigModule
16
16
  } from "./chunk-VVBO3QH7.mjs";
@@ -6,10 +6,10 @@ var _chunk4PPEPOZZcjs = require('./chunk-4PPEPOZZ.cjs');
6
6
  var _chunkMQ3H6LT5cjs = require('./chunk-MQ3H6LT5.cjs');
7
7
 
8
8
 
9
- var _chunkJQGDQO2Icjs = require('./chunk-JQGDQO2I.cjs');
9
+ var _chunkEXLKRR4Ucjs = require('./chunk-EXLKRR4U.cjs');
10
10
 
11
11
 
12
- var _chunkN4RLRSWWcjs = require('./chunk-N4RLRSWW.cjs');
12
+ var _chunkSUIBNSNOcjs = require('./chunk-SUIBNSNO.cjs');
13
13
 
14
14
 
15
15
  var _chunk2CQ74SP6cjs = require('./chunk-2CQ74SP6.cjs');
@@ -19,7 +19,8 @@ var _chunk2CQ74SP6cjs = require('./chunk-2CQ74SP6.cjs');
19
19
 
20
20
 
21
21
 
22
- var _chunkC7OUJ6JIcjs = require('./chunk-C7OUJ6JI.cjs');
22
+
23
+ var _chunkPZNCMPJFcjs = require('./chunk-PZNCMPJF.cjs');
23
24
 
24
25
 
25
26
  var _chunk6V4TDWECcjs = require('./chunk-6V4TDWEC.cjs');
@@ -63,6 +64,10 @@ function farmApiPlugin(options = {}) {
63
64
  const basePath = options.basePath;
64
65
  let apiRoutesCache = /* @__PURE__ */ new Map();
65
66
  let apiRouterHandler = null;
67
+ let projectRoot = process.cwd();
68
+ let pluginMergedRoutes = null;
69
+ const servedRoutes = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => _nullishCoalesce(pluginMergedRoutes, () => ( apiRoutesCache)), "servedRoutes");
70
+ let routePlugins;
66
71
  let discoveryComplete = false;
67
72
  let discoveryPromise = null;
68
73
  let discoveryError;
@@ -105,7 +110,7 @@ function farmApiPlugin(options = {}) {
105
110
  const existing = apiRoutesCache.get(routePath);
106
111
  const existingFile = _optionalChain([endpointSources, 'access', _ => _.get, 'call', _2 => _2(routePath), 'optionalAccess', _3 => _3.get, 'call', _4 => _4(normalizedMethod)]);
107
112
  if (existingFile) {
108
- throw new (0, _chunkJQGDQO2Icjs.APIRouteConflictError)(routePath, normalizedMethod, existingFile, filePath);
113
+ throw new (0, _chunkEXLKRR4Ucjs.APIRouteConflictError)(routePath, normalizedMethod, existingFile, filePath);
109
114
  }
110
115
  if (existing) {
111
116
  if (!existing.methods.includes(normalizedMethod)) {
@@ -179,7 +184,13 @@ function farmApiPlugin(options = {}) {
179
184
  }
180
185
  }, "restoreRouteState");
181
186
  const createRouter = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => {
182
- const totalEndpoints = Array.from(apiRoutesCache.values()).reduce(
187
+ const plugins = options.plugins ? await (_nullishCoalesce(routePlugins, () => ( (routePlugins = Promise.resolve(options.plugins({ root: projectRoot })))))) : [];
188
+ pluginMergedRoutes = plugins.length ? new Map(
189
+ _chunkPZNCMPJFcjs.mergePluginAPIRoutes.call(void 0, [...apiRoutesCache.values()], plugins, void 0, {
190
+ bodySizeLimit
191
+ }).map((route) => [route.path, route])
192
+ ) : null;
193
+ const totalEndpoints = Array.from(servedRoutes().values()).reduce(
183
194
  (sum, route) => sum + route.methods.length,
184
195
  0
185
196
  );
@@ -189,7 +200,7 @@ function farmApiPlugin(options = {}) {
189
200
  const url = new URL(request.url);
190
201
  const method = request.method.toUpperCase();
191
202
  const pathname = url.pathname;
192
- const match = _chunkC7OUJ6JIcjs.matchAPIRouteAtBasePath.call(void 0, apiRoutesCache, pathname, basePath);
203
+ const match = _chunkPZNCMPJFcjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), pathname, basePath);
193
204
  if (!match) {
194
205
  return new Response(JSON.stringify({ error: "Not Found" }), {
195
206
  status: 404,
@@ -197,18 +208,18 @@ function farmApiPlugin(options = {}) {
197
208
  });
198
209
  }
199
210
  const { route, params } = match;
200
- const endpoint = _chunkC7OUJ6JIcjs.resolveAPIRouteEndpoint.call(void 0, route, method);
211
+ const endpoint = _chunkPZNCMPJFcjs.resolveAPIRouteEndpoint.call(void 0, route, method);
201
212
  if (!endpoint) {
202
213
  return new Response(JSON.stringify({ error: "Method Not Allowed" }), {
203
214
  status: 405,
204
215
  headers: {
205
- Allow: _chunkC7OUJ6JIcjs.getAllowedAPIRouteMethods.call(void 0, route).join(", "),
216
+ Allow: _chunkPZNCMPJFcjs.getAllowedAPIRouteMethods.call(void 0, route).join(", "),
206
217
  "Content-Type": "application/json"
207
218
  }
208
219
  });
209
220
  }
210
221
  try {
211
- return await _chunkC7OUJ6JIcjs.invokeAPIRouteEndpoint.call(void 0, endpoint, request, params, bodySizeLimit);
222
+ return await _chunkPZNCMPJFcjs.invokeAPIRouteEndpoint.call(void 0, endpoint, request, params, bodySizeLimit);
212
223
  } catch (error) {
213
224
  return new Response(JSON.stringify({ error: error.message || "Internal Server Error" }), {
214
225
  status: 500,
@@ -223,6 +234,7 @@ function farmApiPlugin(options = {}) {
223
234
  name: "@farm.js/core:api",
224
235
  enforce: "pre",
225
236
  configureServer(server) {
237
+ projectRoot = server.config.root;
226
238
  const discoverFileRoutes = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (apiDir) => {
227
239
  const fs = await import("fs");
228
240
  const path = await import("path");
@@ -255,7 +267,7 @@ function farmApiPlugin(options = {}) {
255
267
  const routeModule = await _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, server, filePath);
256
268
  const endpoints = {};
257
269
  const availableMethods = [];
258
- for (const method of _chunkC7OUJ6JIcjs.API_ROUTE_METHODS) {
270
+ for (const method of _chunkPZNCMPJFcjs.API_ROUTE_METHODS) {
259
271
  if (routeModule[method]) {
260
272
  availableMethods.push(method);
261
273
  endpoints[method] = routeModule[method];
@@ -268,7 +280,7 @@ function farmApiPlugin(options = {}) {
268
280
  log(`API route discovered: ${availableMethods.join(", ")} ${routePath}`);
269
281
  }
270
282
  } catch (e) {
271
- if (e instanceof _chunkJQGDQO2Icjs.APIRouteConflictError || e instanceof _chunkNO3WWW3Ncjs.AmbiguousRouteError) throw e;
283
+ if (e instanceof _chunkEXLKRR4Ucjs.APIRouteConflictError || e instanceof _chunkNO3WWW3Ncjs.AmbiguousRouteError) throw e;
272
284
  log(`API route load failed at ${filePath}: ${e.message}`);
273
285
  }
274
286
  }
@@ -295,7 +307,7 @@ function farmApiPlugin(options = {}) {
295
307
  }
296
308
  }
297
309
  } catch (e) {
298
- if (e instanceof _chunkJQGDQO2Icjs.APIRouteConflictError || e instanceof _chunkNO3WWW3Ncjs.AmbiguousRouteError) throw e;
310
+ if (e instanceof _chunkEXLKRR4Ucjs.APIRouteConflictError || e instanceof _chunkNO3WWW3Ncjs.AmbiguousRouteError) throw e;
299
311
  log(`Root routes.ts load failed: ${e.message}`);
300
312
  }
301
313
  break;
@@ -305,7 +317,7 @@ function farmApiPlugin(options = {}) {
305
317
  const discoverProgrammaticRoutes = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => {
306
318
  const path = await import("path");
307
319
  const srcRoot = path.join(server.config.root, srcDir);
308
- const routeFiles = _chunkN4RLRSWWcjs.findProgrammaticRouteFilesInDir.call(void 0, srcRoot);
320
+ const routeFiles = _chunkSUIBNSNOcjs.findProgrammaticRouteFilesInDir.call(void 0, srcRoot);
309
321
  if (routeFiles.length === 0) return;
310
322
  const { getProgrammaticRouteManifest } = await import("./routes.cjs");
311
323
  for (const routeFile of routeFiles) {
@@ -326,7 +338,7 @@ function farmApiPlugin(options = {}) {
326
338
  }
327
339
  }
328
340
  } catch (e) {
329
- if (e instanceof _chunkJQGDQO2Icjs.APIRouteConflictError || e instanceof _chunkNO3WWW3Ncjs.AmbiguousRouteError) throw e;
341
+ if (e instanceof _chunkEXLKRR4Ucjs.APIRouteConflictError || e instanceof _chunkNO3WWW3Ncjs.AmbiguousRouteError) throw e;
330
342
  log(`Programmatic routes file load failed at ${routeFile}: ${e.message}`);
331
343
  }
332
344
  }
@@ -368,7 +380,7 @@ function farmApiPlugin(options = {}) {
368
380
  }, "recoverFailedDiscovery");
369
381
  server.__farmApi__ = {
370
382
  getHandler: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => apiRouterHandler, "getHandler"),
371
- getRoutes: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => apiRoutesCache, "getRoutes"),
383
+ getRoutes: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => servedRoutes(), "getRoutes"),
372
384
  isReady: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => discoveryComplete, "isReady"),
373
385
  waitForDiscovery
374
386
  };
@@ -378,7 +390,7 @@ function farmApiPlugin(options = {}) {
378
390
  const pathname = url.split("?")[0];
379
391
  const method = req.method || "GET";
380
392
  if (discoveryPromise) await waitForDiscovery();
381
- if (!_chunkC7OUJ6JIcjs.matchAPIRouteAtBasePath.call(void 0, apiRoutesCache, pathname, basePath)) {
393
+ if (!_chunkPZNCMPJFcjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), pathname, basePath)) {
382
394
  return next();
383
395
  }
384
396
  if (!apiRouterHandler) {
@@ -399,7 +411,7 @@ function farmApiPlugin(options = {}) {
399
411
  }
400
412
  const currentUrl = req.url || url;
401
413
  const currentPathname = currentUrl.split("?")[0];
402
- if (currentPathname !== pathname && !_chunkC7OUJ6JIcjs.matchAPIRouteAtBasePath.call(void 0, apiRoutesCache, currentPathname, basePath)) {
414
+ if (currentPathname !== pathname && !_chunkPZNCMPJFcjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), currentPathname, basePath)) {
403
415
  return next();
404
416
  }
405
417
  const fullUrl = _chunk5ZSWG4UXcjs.resolveFarmRequestURL.call(void 0, req);
@@ -503,7 +515,7 @@ function farmApiPlugin(options = {}) {
503
515
  log(`API router recreated`);
504
516
  } catch (e) {
505
517
  restoreRouteState(previousState);
506
- if (e instanceof _chunkJQGDQO2Icjs.APIRouteConflictError || e instanceof _chunkNO3WWW3Ncjs.AmbiguousRouteError) throw e;
518
+ if (e instanceof _chunkEXLKRR4Ucjs.APIRouteConflictError || e instanceof _chunkNO3WWW3Ncjs.AmbiguousRouteError) throw e;
507
519
  log(`Root routes.ts HMR failed: ${e.message}`);
508
520
  }
509
521
  return [];
@@ -531,7 +543,7 @@ function farmApiPlugin(options = {}) {
531
543
  const routeModule = await _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, server, file);
532
544
  removeEndpointsFromFile(file);
533
545
  const availableMethods = [];
534
- for (const method of _chunkC7OUJ6JIcjs.API_ROUTE_METHODS) {
546
+ for (const method of _chunkPZNCMPJFcjs.API_ROUTE_METHODS) {
535
547
  if (!routeModule[method]) continue;
536
548
  availableMethods.push(method);
537
549
  addEndpoint(routePath, file, method, routeModule[method]);
@@ -541,7 +553,7 @@ function farmApiPlugin(options = {}) {
541
553
  log(`API router recreated`);
542
554
  } catch (e) {
543
555
  restoreRouteState(previousState);
544
- if (e instanceof _chunkJQGDQO2Icjs.APIRouteConflictError || e instanceof _chunkNO3WWW3Ncjs.AmbiguousRouteError) throw e;
556
+ if (e instanceof _chunkEXLKRR4Ucjs.APIRouteConflictError || e instanceof _chunkNO3WWW3Ncjs.AmbiguousRouteError) throw e;
545
557
  log(`API route HMR failed: ${e.message}`);
546
558
  }
547
559
  return [];
@@ -182,7 +182,10 @@ function renderMetadataHead(metadata, options = {}) {
182
182
  );
183
183
  }
184
184
  appendNamedMetaRecord(tags, resolvedMetadata.other);
185
- appendOpenGraph(tags, resolvedMetadata.openGraph, metadataBase);
185
+ appendOpenGraph(tags, resolvedMetadata.openGraph, metadataBase, {
186
+ title: explicitTitle,
187
+ description: resolvedMetadata.description
188
+ });
186
189
  appendTwitter(tags, resolvedMetadata.twitter, metadataBase);
187
190
  appendVerification(tags, resolvedMetadata.verification);
188
191
  if (options.jsonLd) {
@@ -220,10 +223,12 @@ function mergeNestedMetadata(base, next) {
220
223
  return _nullishCoalesce(next, () => ( base));
221
224
  }
222
225
  _chunkS3JO3N4Hcjs.__name.call(void 0, mergeNestedMetadata, "mergeNestedMetadata");
223
- function appendOpenGraph(tags, openGraph, metadataBase) {
224
- if (!isRecord(openGraph)) return;
225
- appendMetaProperty(tags, "og:title", openGraph.title);
226
- appendMetaProperty(tags, "og:description", openGraph.description);
226
+ function appendOpenGraph(tags, input, metadataBase, page) {
227
+ const description = typeof page.description === "string" ? page.description : void 0;
228
+ if (!isRecord(input) && !page.title && !description) return;
229
+ const openGraph = isRecord(input) ? input : {};
230
+ appendMetaProperty(tags, "og:title", _nullishCoalesce(openGraph.title, () => ( page.title)));
231
+ appendMetaProperty(tags, "og:description", _nullishCoalesce(openGraph.description, () => ( description)));
227
232
  appendMetaProperty(tags, "og:url", resolveMetadataUrl(openGraph.url, metadataBase));
228
233
  appendMetaProperty(tags, "og:site_name", openGraph.siteName);
229
234
  appendMetaProperty(tags, "og:type", _nullishCoalesce(openGraph.type, () => ( "website")));
@@ -1,9 +1,9 @@
1
+ import {
2
+ applyFarmCacheInvalidationTargets
3
+ } from "./chunk-IV6CQY7O.mjs";
1
4
  import {
2
5
  isMultipartSchema
3
6
  } from "./chunk-EMLAPBEM.mjs";
4
- import {
5
- applyFarmCacheInvalidationTargets
6
- } from "./chunk-F6SJAKFJ.mjs";
7
7
  import {
8
8
  assertBrowserStableRoutePath,
9
9
  assertUniqueRouteParameters,
@@ -4,7 +4,7 @@ import {
4
4
  _runServerFunctionForCaller,
5
5
  createServerFn,
6
6
  createServerFunctionDescriptor
7
- } from "./chunk-WD4YXVLV.mjs";
7
+ } from "./chunk-GZYH4OER.mjs";
8
8
  import {
9
9
  createFarmServerQueryResult
10
10
  } from "./chunk-KGB5UXJJ.mjs";
@@ -12,11 +12,13 @@ import {
12
12
  getServerActionExecutionContext
13
13
  } from "./chunk-QCFFHV5H.mjs";
14
14
  import {
15
- createFarmCacheKey,
16
- createRouteDataCacheKey,
17
15
  createRouteDataCacheTag,
18
16
  getFarmDataCache
19
- } from "./chunk-F6SJAKFJ.mjs";
17
+ } from "./chunk-IV6CQY7O.mjs";
18
+ import {
19
+ createFarmCacheKey,
20
+ createRouteDataCacheKey
21
+ } from "./chunk-CNOQY6Z7.mjs";
20
22
  import {
21
23
  __name
22
24
  } from "./chunk-LPEX4YW6.mjs";