@farm.js/core 0.1.87 → 0.2.0-beta.1

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 (146) hide show
  1. package/dist/analyzer-IIWSUXSQ.cjs +17 -0
  2. package/dist/{analyzer-W4EB7DHL.mjs → analyzer-RYSF2BM3.mjs} +2 -2
  3. package/dist/api/route-manager.cjs +3 -3
  4. package/dist/api/route-manager.mjs +2 -2
  5. package/dist/api.cjs +4 -4
  6. package/dist/api.mjs +3 -3
  7. package/dist/{app.d-b3A4cca5.d.ts → app.d-CoY-zsJt.d.ts} +1 -1
  8. package/dist/{app.d-AVZXCfcO.d.mts → app.d-DE5KNbmf.d.mts} +1 -1
  9. package/dist/{chunk-B7L24VPX.cjs → chunk-22KXTL3I.cjs} +6 -4
  10. package/dist/{chunk-4SJ22WTT.mjs → chunk-23BZ7ZH6.mjs} +1 -1
  11. package/dist/{chunk-33WR5XV5.cjs → chunk-27ESPHQA.cjs} +4 -4
  12. package/dist/{chunk-FULX5RYX.cjs → chunk-2OR5WAD5.cjs} +19 -13
  13. package/dist/{chunk-3F55K4MC.mjs → chunk-2U2GRXP5.mjs} +1 -1
  14. package/dist/{chunk-K5FLQJW5.mjs → chunk-4A6A6P4T.mjs} +6 -4
  15. package/dist/chunk-65LZRVCZ.mjs +18 -0
  16. package/dist/{chunk-XFUPWRKT.cjs → chunk-6BMAGVDI.cjs} +4 -4
  17. package/dist/{chunk-VCZ4EM5K.cjs → chunk-6ETHVRFO.cjs} +143 -136
  18. package/dist/{chunk-LBJOHMTB.mjs → chunk-AMMFRXFW.mjs} +1 -1
  19. package/dist/{chunk-HQ2VAJLW.mjs → chunk-ANKMAGFJ.mjs} +1 -1
  20. package/dist/{chunk-EZYNIADW.mjs → chunk-CIQCJ72N.mjs} +45 -29
  21. package/dist/{chunk-A2PPQ5LB.mjs → chunk-CPMK7EFR.mjs} +1 -1
  22. package/dist/{chunk-B5QRNCIE.mjs → chunk-DATICPTO.mjs} +1 -1
  23. package/dist/{chunk-QLRI2BX5.mjs → chunk-DZC2XGK4.mjs} +24 -18
  24. package/dist/{chunk-O7K4HMAQ.mjs → chunk-EBKYRP2P.mjs} +1 -1
  25. package/dist/{chunk-IM422XKU.cjs → chunk-FJGA3XWL.cjs} +2 -2
  26. package/dist/{chunk-FLMALEY2.mjs → chunk-GGD57DJA.mjs} +3 -25
  27. package/dist/chunk-GTHBWZUK.mjs +17 -0
  28. package/dist/{chunk-CXHVRHM2.cjs → chunk-HENPVGZC.cjs} +2 -2
  29. package/dist/{chunk-N3VMHPIY.mjs → chunk-HZY63K5C.mjs} +2 -2
  30. package/dist/{chunk-5D73SKF3.mjs → chunk-ISSFWEPY.mjs} +1 -1
  31. package/dist/chunk-JIGWHFA5.mjs +32 -0
  32. package/dist/{chunk-YBXIVQCE.cjs → chunk-JP5TWUK2.cjs} +4 -4
  33. package/dist/{chunk-TI4BZV6M.cjs → chunk-KBIM7PFQ.cjs} +73 -67
  34. package/dist/{chunk-UGD53SNO.cjs → chunk-KQ6TYQU7.cjs} +16 -12
  35. package/dist/{chunk-XMVZXZ32.cjs → chunk-KRU3XPOW.cjs} +2 -2
  36. package/dist/{chunk-SDNYULFS.cjs → chunk-L4B7PB3H.cjs} +157 -141
  37. package/dist/{chunk-7BNVUIGL.cjs → chunk-M3JYBZO2.cjs} +2 -2
  38. package/dist/{chunk-VCI776NG.cjs → chunk-N2ZMSSPP.cjs} +12 -10
  39. package/dist/{chunk-2UYYXSUS.mjs → chunk-N5NRXLCX.mjs} +4 -2
  40. package/dist/{chunk-ZCX2XJPY.cjs → chunk-ND65INFS.cjs} +2 -2
  41. package/dist/{chunk-26HESRBL.mjs → chunk-NVXU5BEG.mjs} +47 -28
  42. package/dist/{chunk-OBVBII5K.cjs → chunk-NZRAUCUL.cjs} +2 -2
  43. package/dist/{chunk-U3A46QFD.cjs → chunk-OIPPISQ6.cjs} +81 -62
  44. package/dist/{chunk-6MZSTPD2.mjs → chunk-OQOII62L.mjs} +1 -1
  45. package/dist/{chunk-2PJVEL56.cjs → chunk-PCAEJNQF.cjs} +5 -27
  46. package/dist/{chunk-Q73LRKLP.mjs → chunk-PKV3JGMS.mjs} +1 -1
  47. package/dist/{chunk-3AV4DCXY.mjs → chunk-PWTBXYJY.mjs} +12 -6
  48. package/dist/{chunk-PO5MZIWK.mjs → chunk-QBXS4TNG.mjs} +6 -2
  49. package/dist/chunk-QZUCVJZJ.cjs +18 -0
  50. package/dist/chunk-SIECKBNK.cjs +17 -0
  51. package/dist/{chunk-HFRG2IQS.mjs → chunk-SPKZCFPH.mjs} +5 -4
  52. package/dist/{chunk-CN2JOTRO.cjs → chunk-THGSPDFD.cjs} +7 -7
  53. package/dist/{chunk-WSQ3S3NV.cjs → chunk-TWFJJPE7.cjs} +13 -12
  54. package/dist/{chunk-HYL372GW.cjs → chunk-V3Y3R3JJ.cjs} +1 -1
  55. package/dist/{chunk-QSDIJ45N.mjs → chunk-VZWAXQME.mjs} +1 -1
  56. package/dist/{chunk-A4WWKG2B.cjs → chunk-WEZTGM7N.cjs} +2 -2
  57. package/dist/{chunk-JB4BHRFK.cjs → chunk-WP77JDKI.cjs} +16 -16
  58. package/dist/{chunk-VPGEYX5Y.mjs → chunk-WX752VMN.mjs} +2 -2
  59. package/dist/chunk-YIGUFJMR.cjs +32 -0
  60. package/dist/{chunk-4FGTNYHE.mjs → chunk-YPAOC3FO.mjs} +2 -2
  61. package/dist/{chunk-LIWVPE72.mjs → chunk-Z7ZRBCAB.mjs} +23 -16
  62. package/dist/{chunk-RGYS5OPL.cjs → chunk-ZPQY7O64.cjs} +3 -3
  63. package/dist/client.cjs +8 -6
  64. package/dist/client.d.mts +5 -5
  65. package/dist/client.d.ts +5 -5
  66. package/dist/client.mjs +7 -5
  67. package/dist/{devtools-GWJZPWIW.mjs → devtools-5DBTT2DI.mjs} +1 -1
  68. package/dist/{devtools-GPIKZ5AV.cjs → devtools-JTJA2KIZ.cjs} +2 -2
  69. package/dist/docs.cjs +3 -3
  70. package/dist/docs.mjs +2 -2
  71. package/dist/environment/vite.cjs +3 -3
  72. package/dist/environment/vite.mjs +2 -2
  73. package/dist/i18n/client.cjs +11 -10
  74. package/dist/i18n/client.mjs +3 -2
  75. package/dist/index.cjs +30 -28
  76. package/dist/index.d.mts +5 -5
  77. package/dist/index.d.ts +5 -5
  78. package/dist/index.mjs +25 -23
  79. package/dist/internal/build-runtime.cjs +17 -17
  80. package/dist/internal/build-runtime.mjs +16 -16
  81. package/dist/internal/cli-runtime.cjs +5 -5
  82. package/dist/internal/cli-runtime.mjs +4 -4
  83. package/dist/internal/client-error-overlay.cjs +4 -4
  84. package/dist/internal/client-error-overlay.mjs +1 -1
  85. package/dist/internal/client-runtime.cjs +11 -12
  86. package/dist/internal/client-runtime.d.mts +6 -4
  87. package/dist/internal/client-runtime.d.ts +6 -4
  88. package/dist/internal/client-runtime.mjs +11 -12
  89. package/dist/internal/config-runtime.cjs +3 -3
  90. package/dist/internal/config-runtime.mjs +2 -2
  91. package/dist/internal/infra-analytics-runtime.cjs +6 -6
  92. package/dist/internal/infra-analytics-runtime.mjs +4 -4
  93. package/dist/internal/islands-boot.cjs +20 -15
  94. package/dist/internal/islands-boot.mjs +6 -1
  95. package/dist/internal/native-server-fns.cjs +4 -4
  96. package/dist/internal/native-server-fns.mjs +3 -3
  97. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  98. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  99. package/dist/internal/production-runtime.cjs +4 -4
  100. package/dist/internal/production-runtime.mjs +3 -3
  101. package/dist/internal/spa-router.cjs +4 -3
  102. package/dist/internal/spa-router.d.mts +1 -1
  103. package/dist/internal/spa-router.d.ts +1 -1
  104. package/dist/internal/spa-router.mjs +3 -2
  105. package/dist/{manager-PX4QN4HK.cjs → manager-37UJPUN4.cjs} +4 -4
  106. package/dist/{manager-OMTC5FOJ.mjs → manager-7BNSJKME.mjs} +3 -3
  107. package/dist/{navigation-delegate.d-ChfinbWB.d.mts → navigation-delegate.d-B9GjWbov.d.mts} +1 -1
  108. package/dist/{navigation-delegate.d-fMgELdAe.d.ts → navigation-delegate.d-BbW1_pf_.d.ts} +1 -1
  109. package/dist/navigation.cjs +6 -5
  110. package/dist/navigation.d.mts +2 -2
  111. package/dist/navigation.d.ts +2 -2
  112. package/dist/navigation.mjs +5 -4
  113. package/dist/plugin.cjs +12 -12
  114. package/dist/plugin.mjs +11 -11
  115. package/dist/query/client.cjs +8 -7
  116. package/dist/query/client.mjs +3 -2
  117. package/dist/renderer-client.cjs +14 -13
  118. package/dist/renderer-client.d.mts +3 -3
  119. package/dist/renderer-client.d.ts +3 -3
  120. package/dist/renderer-client.mjs +5 -4
  121. package/dist/{router.d-D5Mp7bpO.d.ts → router.d-Bm9FNSu3.d.ts} +1 -1
  122. package/dist/{router.d-DrQ1QDFk.d.mts → router.d-YKVirmj4.d.mts} +1 -1
  123. package/dist/{rsc-pipeline-TQOSDWOU.cjs → rsc-pipeline-LGXJGGMW.cjs} +3 -3
  124. package/dist/{rsc-pipeline-KLMQU3YP.mjs → rsc-pipeline-W5DSWDHD.mjs} +2 -2
  125. package/dist/{runtime-BDPBO65S.mjs → runtime-UOZKSM5S.mjs} +2 -2
  126. package/dist/{runtime-CQSCRVZ7.cjs → runtime-YV4X5FAK.cjs} +4 -4
  127. package/dist/server.cjs +48 -33
  128. package/dist/server.d.mts +1 -1
  129. package/dist/server.d.ts +1 -1
  130. package/dist/server.mjs +28 -13
  131. package/dist/{spa-router.d-CXgvy-7L.d.mts → spa-router.d-DGmropfK.d.mts} +3 -1
  132. package/dist/{spa-router.d-BXxoU3Cv.d.ts → spa-router.d-nE1jHNGt.d.ts} +3 -1
  133. package/dist/{store-core.d-D00BsbnO.d.ts → store-core.d-B5cwOd8g.d.ts} +2 -2
  134. package/dist/{store-core.d-CDbVAbTn.d.mts → store-core.d-C-gATBwd.d.mts} +2 -2
  135. package/dist/testing.cjs +2 -2
  136. package/dist/testing.mjs +2 -2
  137. package/dist/version.cjs +2 -2
  138. package/dist/version.mjs +1 -1
  139. package/dist/vite.cjs +12 -12
  140. package/dist/vite.mjs +11 -11
  141. package/package.json +3 -3
  142. package/dist/analyzer-LLU2Z6I4.cjs +0 -17
  143. package/dist/chunk-SBDWCDS6.cjs +0 -8
  144. package/dist/chunk-YX6AFPXC.mjs +0 -8
  145. /package/dist/{chunk-MZR22RAC.cjs → chunk-FLKG2PYH.cjs} +0 -0
  146. /package/dist/{chunk-ALOFMAFA.mjs → chunk-OOOUYA6L.mjs} +0 -0
@@ -18,14 +18,14 @@ var _chunkCCAUIBIScjs = require('./chunk-CCAUIBIS.cjs');
18
18
  var _chunkWMRGIQTAcjs = require('./chunk-WMRGIQTA.cjs');
19
19
 
20
20
 
21
- var _chunkHYL372GWcjs = require('./chunk-HYL372GW.cjs');
21
+ var _chunkV3Y3R3JJcjs = require('./chunk-V3Y3R3JJ.cjs');
22
22
 
23
23
  // src/mobile/analyzer.ts
24
24
  var _crypto = require('crypto');
25
25
  var _fs = require('fs');
26
26
  var _promises = require('fs/promises');
27
27
  var _path = require('path'); var path = _interopRequireWildcard(_path);
28
- var ANALYZER_VERSION = `8:${_chunkHYL372GWcjs.FARM_VERSION}`;
28
+ var ANALYZER_VERSION = `8:${_chunkV3Y3R3JJcjs.FARM_VERSION}`;
29
29
  var INTRINSIC_KINDS = {};
30
30
  for (const tag of "div section main article header footer nav aside figure hr li".split(" ")) {
31
31
  INTRINSIC_KINDS[tag] = "View";
@@ -9,13 +9,14 @@ var _chunkKBGZ5FD6cjs = require('./chunk-KBGZ5FD6.cjs');
9
9
  var _chunkP2355C6Ecjs = require('./chunk-P2355C6E.cjs');
10
10
 
11
11
 
12
- var _chunkWSQ3S3NVcjs = require('./chunk-WSQ3S3NV.cjs');
12
+ var _chunkTWFJJPE7cjs = require('./chunk-TWFJJPE7.cjs');
13
13
 
14
14
 
15
15
  var _chunkHS4JPIGRcjs = require('./chunk-HS4JPIGR.cjs');
16
16
 
17
17
 
18
- var _chunkSBDWCDS6cjs = require('./chunk-SBDWCDS6.cjs');
18
+
19
+ var _chunkSIECKBNKcjs = require('./chunk-SIECKBNK.cjs');
19
20
 
20
21
 
21
22
 
@@ -148,7 +149,7 @@ function farmApiPlugin(options = {}) {
148
149
  const existing = apiRoutesCache.get(routePath);
149
150
  const existingFile = _optionalChain([endpointSources, 'access', _4 => _4.get, 'call', _5 => _5(routePath), 'optionalAccess', _6 => _6.get, 'call', _7 => _7(normalizedMethod)]);
150
151
  if (existingFile) {
151
- throw new (0, _chunkWSQ3S3NVcjs.APIRouteConflictError)(routePath, normalizedMethod, existingFile, filePath);
152
+ throw new (0, _chunkTWFJJPE7cjs.APIRouteConflictError)(routePath, normalizedMethod, existingFile, filePath);
152
153
  }
153
154
  if (existing) {
154
155
  if (!existing.methods.includes(normalizedMethod)) {
@@ -276,6 +277,7 @@ function farmApiPlugin(options = {}) {
276
277
  name: "@farm.js/core:api",
277
278
  enforce: "pre",
278
279
  configureServer(server) {
280
+ const polyroute = _chunkSIECKBNKcjs.hasPolyroutePlugin.call(void 0, server.config.plugins);
279
281
  projectRoot = server.config.root;
280
282
  devServer = server;
281
283
  const discoverFileRoutes = async (apiDir) => {
@@ -293,7 +295,7 @@ function farmApiPlugin(options = {}) {
293
295
  const fullPath = path.join(dir, entry.name);
294
296
  if (entry.isDirectory()) {
295
297
  files.push(...findRouteFiles(fullPath));
296
- } else if (_chunkSBDWCDS6cjs.isFarmAPIRouteFileName.call(void 0, entry.name)) {
298
+ } else if (_chunkSIECKBNKcjs.isFarmAPIRouteFileName.call(void 0, entry.name, polyroute)) {
297
299
  files.push(fullPath);
298
300
  }
299
301
  }
@@ -323,7 +325,7 @@ function farmApiPlugin(options = {}) {
323
325
  log(`API route discovered: ${availableMethods.join(", ")} ${routePath}`);
324
326
  }
325
327
  } catch (e) {
326
- if (e instanceof _chunkWSQ3S3NVcjs.APIRouteConflictError || e instanceof _chunkML4TOUZPcjs.AmbiguousRouteError) throw e;
328
+ if (e instanceof _chunkTWFJJPE7cjs.APIRouteConflictError || e instanceof _chunkML4TOUZPcjs.AmbiguousRouteError) throw e;
327
329
  log(`API route load failed at ${filePath}: ${e.message}`);
328
330
  }
329
331
  }
@@ -350,7 +352,7 @@ function farmApiPlugin(options = {}) {
350
352
  }
351
353
  }
352
354
  } catch (e) {
353
- if (e instanceof _chunkWSQ3S3NVcjs.APIRouteConflictError || e instanceof _chunkML4TOUZPcjs.AmbiguousRouteError) throw e;
355
+ if (e instanceof _chunkTWFJJPE7cjs.APIRouteConflictError || e instanceof _chunkML4TOUZPcjs.AmbiguousRouteError) throw e;
354
356
  log(`Root routes.ts load failed: ${e.message}`);
355
357
  }
356
358
  break;
@@ -381,7 +383,7 @@ function farmApiPlugin(options = {}) {
381
383
  }
382
384
  }
383
385
  } catch (e) {
384
- if (e instanceof _chunkWSQ3S3NVcjs.APIRouteConflictError || e instanceof _chunkML4TOUZPcjs.AmbiguousRouteError) throw e;
386
+ if (e instanceof _chunkTWFJJPE7cjs.APIRouteConflictError || e instanceof _chunkML4TOUZPcjs.AmbiguousRouteError) throw e;
385
387
  log(`Programmatic routes file load failed at ${routeFile}: ${e.message}`);
386
388
  }
387
389
  }
@@ -606,12 +608,12 @@ function farmApiPlugin(options = {}) {
606
608
  log(`API router recreated`);
607
609
  } catch (e) {
608
610
  restoreRouteState(previousState);
609
- if (e instanceof _chunkWSQ3S3NVcjs.APIRouteConflictError || e instanceof _chunkML4TOUZPcjs.AmbiguousRouteError) throw e;
611
+ if (e instanceof _chunkTWFJJPE7cjs.APIRouteConflictError || e instanceof _chunkML4TOUZPcjs.AmbiguousRouteError) throw e;
610
612
  log(`Root routes.ts HMR failed: ${e.message}`);
611
613
  }
612
614
  return [];
613
615
  }
614
- if (normalizedFile.includes("/api/") && fileName.startsWith("route.")) {
616
+ if (normalizedFile.includes("/api/") && _chunkSIECKBNKcjs.isFarmAPIRouteFileName.call(void 0, fileName, _chunkSIECKBNKcjs.hasPolyroutePlugin.call(void 0, server.config.plugins))) {
615
617
  const shortPath = normalizedFile.split("/api/")[1] || normalizedFile;
616
618
  log(`API route updated: ${shortPath}`);
617
619
  for (const mod of modules) {
@@ -644,7 +646,7 @@ function farmApiPlugin(options = {}) {
644
646
  log(`API router recreated`);
645
647
  } catch (e) {
646
648
  restoreRouteState(previousState);
647
- if (e instanceof _chunkWSQ3S3NVcjs.APIRouteConflictError || e instanceof _chunkML4TOUZPcjs.AmbiguousRouteError) throw e;
649
+ if (e instanceof _chunkTWFJJPE7cjs.APIRouteConflictError || e instanceof _chunkML4TOUZPcjs.AmbiguousRouteError) throw e;
648
650
  log(`API route HMR failed: ${e.message}`);
649
651
  }
650
652
  return [];
@@ -4,11 +4,13 @@ import {
4
4
  import {
5
5
  buildFarmRoutePath
6
6
  } from "./chunk-BRNPLD22.mjs";
7
+ import {
8
+ localizeActiveFarmHref
9
+ } from "./chunk-GGD57DJA.mjs";
7
10
  import {
8
11
  isFarmScriptURL,
9
- localizeActiveFarmHref,
10
12
  resolveFarmNavigationURL
11
- } from "./chunk-FLMALEY2.mjs";
13
+ } from "./chunk-JIGWHFA5.mjs";
12
14
  import {
13
15
  getFarmSearchPreserveRoutes
14
16
  } from "./chunk-VDQZV6BX.mjs";
@@ -3,7 +3,7 @@
3
3
  var _chunkPWMJBCANcjs = require('./chunk-PWMJBCAN.cjs');
4
4
 
5
5
 
6
- var _chunkMZR22RACcjs = require('./chunk-MZR22RAC.cjs');
6
+ var _chunkFLKG2PYHcjs = require('./chunk-FLKG2PYH.cjs');
7
7
 
8
8
 
9
9
 
@@ -163,7 +163,7 @@ async function createFarmRscViteConfig(userConfig, options) {
163
163
  server: { environmentName: "rsc" },
164
164
  config: {
165
165
  preset: options.preset,
166
- outputDir: options.outputDir && _chunkMZR22RACcjs.resolveDeployOutputPath.call(void 0, root, options.outputDir)
166
+ outputDir: options.outputDir && _chunkFLKG2PYHcjs.resolveDeployOutputPath.call(void 0, root, options.outputDir)
167
167
  }
168
168
  })
169
169
  ]
@@ -28,7 +28,7 @@ import {
28
28
  } from "./chunk-U6GMCDRS.mjs";
29
29
  import {
30
30
  FARM_VERSION
31
- } from "./chunk-O7K4HMAQ.mjs";
31
+ } from "./chunk-EBKYRP2P.mjs";
32
32
 
33
33
  // src/environment-vite.ts
34
34
  import { existsSync, readFileSync, realpathSync } from "fs";
@@ -1769,16 +1769,23 @@ function specifierPackage(specifier) {
1769
1769
  return specifier.startsWith("@") ? parts.slice(0, 2).join("/") : parts[0];
1770
1770
  }
1771
1771
  function packageLookup(directory, packageName) {
1772
- for (let current = directory; ; current = path4.dirname(current)) {
1773
- if (path4.basename(current) !== "node_modules") {
1774
- const candidate = path4.join(current, "node_modules", packageName);
1775
- try {
1776
- return { from: current, real: fs3.realpathSync(candidate) };
1777
- } catch {
1772
+ return memoizeInFarmSourceSnapshot(
1773
+ "package-lookup",
1774
+ `${farmSourceSnapshotPathKey(directory)}\0${packageName}`,
1775
+ () => {
1776
+ for (let current = directory; ; current = path4.dirname(current)) {
1777
+ if (path4.basename(current) !== "node_modules") {
1778
+ const candidate = path4.join(current, "node_modules", packageName);
1779
+ try {
1780
+ return { from: current, real: fs3.realpathSync(candidate) };
1781
+ } catch {
1782
+ }
1783
+ }
1784
+ if (path4.dirname(current) === current) return null;
1778
1785
  }
1779
- }
1780
- if (path4.dirname(current) === current) return null;
1781
- }
1786
+ },
1787
+ (result) => result !== null
1788
+ );
1782
1789
  }
1783
1790
  function referenceResolveFrom(root, specifier, importer) {
1784
1791
  const packageName = specifierPackage(specifier);
@@ -3909,9 +3916,12 @@ function scanImportSpecifiers(content, { reexportsOnly = false, dynamic = false
3909
3916
  }
3910
3917
  function isTypeOnlyNamedClause(tokens, startIndex, endIndex) {
3911
3918
  if (tokens[startIndex]?.value !== "{") return false;
3912
- const closingBraceIndex = tokens.findIndex(
3913
- (token, index) => index > startIndex && index < endIndex && token.value === "}"
3914
- );
3919
+ let closingBraceIndex = -1;
3920
+ for (let index = startIndex + 1; index < endIndex; index++) {
3921
+ if (tokens[index].value !== "}") continue;
3922
+ closingBraceIndex = index;
3923
+ break;
3924
+ }
3915
3925
  if (closingBraceIndex === -1) return false;
3916
3926
  let entryStartsAt = startIndex + 1;
3917
3927
  for (let index = entryStartsAt; index <= closingBraceIndex; index++) {
@@ -3986,19 +3996,22 @@ function matchProjectImportAlias(alias, specifier) {
3986
3996
  return specifier.slice(alias.prefix.length, specifier.length - alias.suffix.length);
3987
3997
  }
3988
3998
  function getProjectImportAliases(projectRoot) {
3989
- const stamp = PROJECT_ALIAS_FILES.map((file) => {
3990
- try {
3991
- return String(fs7.statSync(path8.join(projectRoot, file)).mtimeMs);
3992
- } catch {
3993
- return "-";
3994
- }
3995
- }).join(":");
3996
3999
  const sourceDir = getFarmProjectSourceDir(projectRoot);
3997
- const cacheStamp = `${stamp}:${sourceDir}`;
3998
4000
  const cached = projectImportAliasCache.get(projectRoot);
3999
- if (cached?.stamp === cacheStamp) return cached.aliases;
4001
+ const dependencies = new Set(
4002
+ cached?.stamps.keys() ?? PROJECT_ALIAS_FILES.map((file) => path8.join(projectRoot, file))
4003
+ );
4004
+ const stamps = /* @__PURE__ */ new Map();
4005
+ for (const file of dependencies) {
4006
+ noteFarmSourceRead(file);
4007
+ stamps.set(file, getFarmSourceStamp(file));
4008
+ }
4009
+ if (cached?.sourceDir === sourceDir && [...stamps].every(([file, stamp]) => cached.stamps.get(file) === stamp))
4010
+ return cached.aliases;
4011
+ dependencies.clear();
4012
+ for (const file of PROJECT_ALIAS_FILES) dependencies.add(path8.join(projectRoot, file));
4000
4013
  const aliases = [
4001
- ...readTsconfigPathAliases(projectRoot),
4014
+ ...readTsconfigPathAliases(projectRoot, dependencies),
4002
4015
  ...readPackageImportAliases(projectRoot)
4003
4016
  ];
4004
4017
  if (!aliases.some((alias) => alias.prefix === "@/")) {
@@ -4009,14 +4022,19 @@ function getProjectImportAliases(projectRoot) {
4009
4022
  targets: [path8.join(projectRoot, sourceDir, "*")]
4010
4023
  });
4011
4024
  }
4012
- projectImportAliasCache.set(projectRoot, { stamp: cacheStamp, aliases });
4025
+ stamps.clear();
4026
+ for (const file of dependencies) {
4027
+ noteFarmSourceRead(file);
4028
+ stamps.set(file, getFarmSourceStamp(file));
4029
+ }
4030
+ projectImportAliasCache.set(projectRoot, { sourceDir, stamps, aliases });
4013
4031
  return aliases;
4014
4032
  }
4015
- function readTsconfigPathAliases(projectRoot) {
4033
+ function readTsconfigPathAliases(projectRoot, dependencies) {
4016
4034
  for (const name of ["tsconfig.json", "jsconfig.json"]) {
4017
4035
  const configPath = path8.join(projectRoot, name);
4018
4036
  if (!fs7.existsSync(configPath)) continue;
4019
- const resolved = readTsconfigPaths(configPath, /* @__PURE__ */ new Set());
4037
+ const resolved = readTsconfigPaths(configPath, /* @__PURE__ */ new Set(), dependencies);
4020
4038
  if (!resolved?.paths) return [];
4021
4039
  const base2 = resolved.baseUrl ?? resolved.pathsDirectory;
4022
4040
  return Object.entries(resolved.paths).flatMap(([pattern, targets]) => {
@@ -4034,9 +4052,10 @@ function readTsconfigPathAliases(projectRoot) {
4034
4052
  }
4035
4053
  return [];
4036
4054
  }
4037
- function readTsconfigPaths(configPath, visited) {
4055
+ function readTsconfigPaths(configPath, visited, dependencies) {
4038
4056
  if (visited.has(configPath)) return null;
4039
4057
  visited.add(configPath);
4058
+ dependencies.add(configPath);
4040
4059
  const config = readJsonWithComments(configPath);
4041
4060
  if (!config) return null;
4042
4061
  const directory = path8.dirname(configPath);
@@ -4049,7 +4068,7 @@ function readTsconfigPaths(configPath, visited) {
4049
4068
  directory,
4050
4069
  parent.endsWith(".json") ? parent : `${parent}.json`
4051
4070
  );
4052
- inherited = readTsconfigPaths(parentPath, visited) ?? inherited;
4071
+ inherited = readTsconfigPaths(parentPath, visited, dependencies) ?? inherited;
4053
4072
  }
4054
4073
  const options = config.compilerOptions ?? {};
4055
4074
  const baseUrl = typeof options.baseUrl === "string" ? path8.resolve(directory, options.baseUrl) : inherited?.baseUrl;
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _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; } async function _asyncOptionalChain(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 = await fn(value); } else if (op === 'call' || op === 'optionalCall') { value = await fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkA4WWKG2Bcjs = require('./chunk-A4WWKG2B.cjs');
3
+ var _chunkWEZTGM7Ncjs = require('./chunk-WEZTGM7N.cjs');
4
4
 
5
5
 
6
6
  var _chunkVWIW47FWcjs = require('./chunk-VWIW47FW.cjs');
@@ -678,7 +678,7 @@ var OpenAPIManager = class {
678
678
  this.config = config;
679
679
  this.mountedRoutes = context.routes;
680
680
  this.generator = new OpenAPIGenerator(this.appDir, config, context);
681
- this.apiTypeGenerator = new (0, _chunkA4WWKG2Bcjs.APITypeGenerator)(appDirs);
681
+ this.apiTypeGenerator = new (0, _chunkWEZTGM7Ncjs.APITypeGenerator)(appDirs);
682
682
  }
683
683
  getRoutes() {
684
684
  if (!this.mountedRoutes) return this.apiTypeGenerator.scanAPIRoutes();