@elench/testkit 0.1.64 → 0.1.66

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 (342) hide show
  1. package/lib/app/browser-bridge.mjs +66 -0
  2. package/lib/app/configs.mjs +81 -0
  3. package/lib/app/configs.test.mjs +34 -0
  4. package/lib/cli/command-helpers.mjs +2 -10
  5. package/lib/cli/commands/browser/serve.mjs +3 -62
  6. package/lib/cli/db.mjs +3 -68
  7. package/lib/config/binaries.mjs +34 -0
  8. package/lib/config/database.mjs +9 -6
  9. package/lib/config/index.mjs +2 -31
  10. package/lib/config/runtime.mjs +24 -95
  11. package/lib/config/validation.mjs +18 -62
  12. package/lib/coverage/backend-discovery.mjs +68 -85
  13. package/lib/coverage/backend-discovery.test.mjs +55 -46
  14. package/lib/coverage/evidence.mjs +15 -3
  15. package/lib/coverage/evidence.test.mjs +13 -4
  16. package/lib/coverage/graph-builder.mjs +25 -26
  17. package/lib/coverage/next-ir-to-graph.mjs +239 -0
  18. package/lib/coverage/routing.mjs +2 -29
  19. package/lib/coverage/routing.test.mjs +0 -16
  20. package/lib/coverage/shared.mjs +22 -82
  21. package/lib/database/fingerprint.mjs +1 -1
  22. package/lib/known-failures/github-cache.mjs +159 -0
  23. package/lib/known-failures/github-transport.mjs +174 -0
  24. package/lib/known-failures/github.mjs +17 -325
  25. package/lib/runner/default-runtime-runner.mjs +4 -10
  26. package/lib/runner/execution-config.mjs +12 -83
  27. package/lib/runner/live-run.mjs +45 -0
  28. package/lib/runner/managed-processes.mjs +29 -0
  29. package/lib/runner/orchestrator.mjs +57 -188
  30. package/lib/runner/playwright-runner.mjs +4 -11
  31. package/lib/runner/run-finalization.mjs +132 -0
  32. package/lib/runner/run-guards.mjs +45 -0
  33. package/lib/runner/runtime-preparation.mjs +1 -1
  34. package/lib/runner/services.mjs +3 -4
  35. package/lib/runner/template-steps.mjs +8 -45
  36. package/lib/runner/template.mjs +7 -28
  37. package/lib/shared/configured-steps.mjs +178 -0
  38. package/lib/shared/configured-steps.test.mjs +73 -0
  39. package/lib/shared/execution-schema.mjs +74 -0
  40. package/lib/shared/execution-schema.test.mjs +26 -0
  41. package/node_modules/@elench/next-analysis/dist/api-routes.d.ts +7 -0
  42. package/node_modules/@elench/next-analysis/dist/api-routes.d.ts.map +1 -0
  43. package/node_modules/@elench/next-analysis/dist/api-routes.js +66 -0
  44. package/node_modules/@elench/next-analysis/dist/api-routes.js.map +1 -0
  45. package/node_modules/@elench/next-analysis/dist/app-root.d.ts +2 -0
  46. package/node_modules/@elench/next-analysis/dist/app-root.d.ts.map +1 -0
  47. package/node_modules/@elench/next-analysis/dist/app-root.js +7 -0
  48. package/node_modules/@elench/next-analysis/dist/app-root.js.map +1 -0
  49. package/node_modules/@elench/next-analysis/dist/backend-links.d.ts +8 -0
  50. package/node_modules/@elench/next-analysis/dist/backend-links.d.ts.map +1 -0
  51. package/node_modules/@elench/next-analysis/dist/backend-links.js +30 -0
  52. package/node_modules/@elench/next-analysis/dist/backend-links.js.map +1 -0
  53. package/node_modules/@elench/next-analysis/dist/index.d.ts +11 -0
  54. package/node_modules/@elench/next-analysis/dist/index.d.ts.map +1 -0
  55. package/node_modules/@elench/next-analysis/dist/index.js +10 -0
  56. package/node_modules/@elench/next-analysis/dist/index.js.map +1 -0
  57. package/node_modules/@elench/next-analysis/dist/pages.d.ts +7 -0
  58. package/node_modules/@elench/next-analysis/dist/pages.d.ts.map +1 -0
  59. package/node_modules/@elench/next-analysis/dist/pages.js +47 -0
  60. package/node_modules/@elench/next-analysis/dist/pages.js.map +1 -0
  61. package/node_modules/@elench/next-analysis/dist/project.d.ts +3 -0
  62. package/node_modules/@elench/next-analysis/dist/project.d.ts.map +1 -0
  63. package/node_modules/@elench/next-analysis/dist/project.js +102 -0
  64. package/node_modules/@elench/next-analysis/dist/project.js.map +1 -0
  65. package/node_modules/@elench/next-analysis/dist/route-tree.d.ts +7 -0
  66. package/node_modules/@elench/next-analysis/dist/route-tree.d.ts.map +1 -0
  67. package/node_modules/@elench/next-analysis/dist/route-tree.js +575 -0
  68. package/node_modules/@elench/next-analysis/dist/route-tree.js.map +1 -0
  69. package/node_modules/@elench/next-analysis/dist/routes.d.ts +6 -0
  70. package/node_modules/@elench/next-analysis/dist/routes.d.ts.map +1 -0
  71. package/node_modules/@elench/next-analysis/dist/routes.js +41 -0
  72. package/node_modules/@elench/next-analysis/dist/routes.js.map +1 -0
  73. package/node_modules/@elench/next-analysis/dist/server-actions.d.ts +7 -0
  74. package/node_modules/@elench/next-analysis/dist/server-actions.d.ts.map +1 -0
  75. package/node_modules/@elench/next-analysis/dist/server-actions.js +37 -0
  76. package/node_modules/@elench/next-analysis/dist/server-actions.js.map +1 -0
  77. package/node_modules/@elench/next-analysis/dist/shared.d.ts +57 -0
  78. package/node_modules/@elench/next-analysis/dist/shared.d.ts.map +1 -0
  79. package/node_modules/@elench/next-analysis/dist/shared.js +229 -0
  80. package/node_modules/@elench/next-analysis/dist/shared.js.map +1 -0
  81. package/node_modules/@elench/next-analysis/dist/swc.d.ts +53 -0
  82. package/node_modules/@elench/next-analysis/dist/swc.d.ts.map +1 -0
  83. package/node_modules/@elench/next-analysis/dist/swc.js +387 -0
  84. package/node_modules/@elench/next-analysis/dist/swc.js.map +1 -0
  85. package/node_modules/@elench/next-analysis/dist/types.d.ts +125 -0
  86. package/node_modules/@elench/next-analysis/dist/types.d.ts.map +1 -0
  87. package/node_modules/@elench/next-analysis/dist/types.js +2 -0
  88. package/node_modules/@elench/next-analysis/dist/types.js.map +1 -0
  89. package/node_modules/@elench/next-analysis/package.json +27 -0
  90. package/node_modules/@elench/testkit-bridge/dist/index.d.ts +36 -0
  91. package/node_modules/@elench/testkit-bridge/dist/index.d.ts.map +1 -0
  92. package/node_modules/@elench/testkit-bridge/dist/index.js +538 -0
  93. package/node_modules/@elench/testkit-bridge/dist/index.js.map +1 -0
  94. package/node_modules/@elench/testkit-bridge/package.json +16 -5
  95. package/node_modules/@elench/testkit-protocol/dist/index.d.ts +190 -0
  96. package/node_modules/@elench/testkit-protocol/dist/index.d.ts.map +1 -0
  97. package/node_modules/@elench/testkit-protocol/dist/index.js +296 -0
  98. package/node_modules/@elench/testkit-protocol/dist/index.js.map +1 -0
  99. package/node_modules/@elench/testkit-protocol/package.json +14 -7
  100. package/node_modules/@elench/ts-analysis/dist/callables.d.ts +8 -0
  101. package/node_modules/@elench/ts-analysis/dist/callables.d.ts.map +1 -0
  102. package/node_modules/@elench/ts-analysis/dist/callables.js +126 -0
  103. package/node_modules/@elench/ts-analysis/dist/callables.js.map +1 -0
  104. package/node_modules/@elench/ts-analysis/dist/exports.d.ts +6 -0
  105. package/node_modules/@elench/ts-analysis/dist/exports.d.ts.map +1 -0
  106. package/node_modules/@elench/ts-analysis/dist/exports.js +70 -0
  107. package/node_modules/@elench/ts-analysis/dist/exports.js.map +1 -0
  108. package/node_modules/@elench/ts-analysis/dist/index.d.ts +10 -0
  109. package/node_modules/@elench/ts-analysis/dist/index.d.ts.map +1 -0
  110. package/node_modules/@elench/ts-analysis/{src/index.mjs → dist/index.js} +9 -14
  111. package/node_modules/@elench/ts-analysis/dist/index.js.map +1 -0
  112. package/node_modules/@elench/ts-analysis/dist/jsx.d.ts +9 -0
  113. package/node_modules/@elench/ts-analysis/dist/jsx.d.ts.map +1 -0
  114. package/node_modules/@elench/ts-analysis/dist/jsx.js +68 -0
  115. package/node_modules/@elench/ts-analysis/dist/jsx.js.map +1 -0
  116. package/node_modules/@elench/ts-analysis/dist/project.d.ts +5 -0
  117. package/node_modules/@elench/ts-analysis/dist/project.d.ts.map +1 -0
  118. package/node_modules/@elench/ts-analysis/dist/project.js +90 -0
  119. package/node_modules/@elench/ts-analysis/dist/project.js.map +1 -0
  120. package/node_modules/@elench/ts-analysis/dist/requests.d.ts +6 -0
  121. package/node_modules/@elench/ts-analysis/dist/requests.d.ts.map +1 -0
  122. package/node_modules/@elench/ts-analysis/dist/requests.js +140 -0
  123. package/node_modules/@elench/ts-analysis/dist/requests.js.map +1 -0
  124. package/node_modules/@elench/ts-analysis/dist/resolution.d.ts +4 -0
  125. package/node_modules/@elench/ts-analysis/dist/resolution.d.ts.map +1 -0
  126. package/node_modules/@elench/ts-analysis/dist/resolution.js +53 -0
  127. package/node_modules/@elench/ts-analysis/dist/resolution.js.map +1 -0
  128. package/node_modules/@elench/ts-analysis/dist/shared.d.ts +6 -0
  129. package/node_modules/@elench/ts-analysis/dist/shared.d.ts.map +1 -0
  130. package/node_modules/@elench/ts-analysis/dist/shared.js +31 -0
  131. package/node_modules/@elench/ts-analysis/dist/shared.js.map +1 -0
  132. package/node_modules/@elench/ts-analysis/dist/syntax.d.ts +7 -0
  133. package/node_modules/@elench/ts-analysis/dist/syntax.d.ts.map +1 -0
  134. package/node_modules/@elench/ts-analysis/dist/syntax.js +27 -0
  135. package/node_modules/@elench/ts-analysis/dist/syntax.js.map +1 -0
  136. package/node_modules/@elench/ts-analysis/dist/types.d.ts +58 -0
  137. package/node_modules/@elench/ts-analysis/dist/types.d.ts.map +1 -0
  138. package/node_modules/@elench/ts-analysis/dist/types.js +2 -0
  139. package/node_modules/@elench/ts-analysis/dist/types.js.map +1 -0
  140. package/node_modules/@elench/ts-analysis/package.json +18 -2
  141. package/node_modules/@next/routing/README.md +91 -0
  142. package/node_modules/@next/routing/dist/__tests__/captures.test.d.ts +1 -0
  143. package/node_modules/@next/routing/dist/__tests__/conditions.test.d.ts +1 -0
  144. package/node_modules/@next/routing/dist/__tests__/dynamic-after-rewrites.test.d.ts +1 -0
  145. package/node_modules/@next/routing/dist/__tests__/i18n-resolve-routes.test.d.ts +1 -0
  146. package/node_modules/@next/routing/dist/__tests__/i18n.test.d.ts +1 -0
  147. package/node_modules/@next/routing/dist/__tests__/middleware.test.d.ts +1 -0
  148. package/node_modules/@next/routing/dist/__tests__/normalize-next-data.test.d.ts +1 -0
  149. package/node_modules/@next/routing/dist/__tests__/redirects.test.d.ts +1 -0
  150. package/node_modules/@next/routing/dist/__tests__/resolve-routes.test.d.ts +1 -0
  151. package/node_modules/@next/routing/dist/__tests__/rewrites.test.d.ts +1 -0
  152. package/node_modules/@next/routing/dist/destination.d.ts +22 -0
  153. package/node_modules/@next/routing/dist/i18n.d.ts +48 -0
  154. package/node_modules/@next/routing/dist/index.d.ts +5 -0
  155. package/node_modules/@next/routing/dist/index.js +1 -0
  156. package/node_modules/@next/routing/dist/matchers.d.ts +12 -0
  157. package/node_modules/@next/routing/dist/middleware.d.ts +12 -0
  158. package/node_modules/@next/routing/dist/next-data.d.ts +10 -0
  159. package/node_modules/@next/routing/dist/resolve-routes.d.ts +2 -0
  160. package/node_modules/@next/routing/dist/types.d.ts +97 -0
  161. package/node_modules/@next/routing/package.json +39 -0
  162. package/node_modules/@swc/core/README.md +100 -0
  163. package/node_modules/@swc/core/Visitor.d.ts +218 -0
  164. package/node_modules/@swc/core/Visitor.js +1399 -0
  165. package/node_modules/@swc/core/binding.d.ts +59 -0
  166. package/node_modules/@swc/core/binding.js +368 -0
  167. package/node_modules/@swc/core/index.d.ts +120 -0
  168. package/node_modules/@swc/core/index.js +443 -0
  169. package/node_modules/@swc/core/package.json +120 -0
  170. package/node_modules/@swc/core/postinstall.js +148 -0
  171. package/node_modules/@swc/core/spack.d.ts +51 -0
  172. package/node_modules/@swc/core/spack.js +87 -0
  173. package/node_modules/@swc/core/util.d.ts +1 -0
  174. package/node_modules/@swc/core/util.js +104 -0
  175. package/node_modules/@swc/core-linux-x64-gnu/README.md +3 -0
  176. package/node_modules/@swc/core-linux-x64-gnu/package.json +46 -0
  177. package/node_modules/@swc/core-linux-x64-gnu/swc.linux-x64-gnu.node +0 -0
  178. package/node_modules/@swc/counter/CHANGELOG.md +7 -0
  179. package/node_modules/@swc/counter/README.md +7 -0
  180. package/node_modules/@swc/counter/index.js +1 -0
  181. package/node_modules/@swc/counter/package.json +27 -0
  182. package/node_modules/@swc/types/LICENSE +201 -0
  183. package/node_modules/@swc/types/README.md +4 -0
  184. package/node_modules/@swc/types/assumptions.d.ts +92 -0
  185. package/node_modules/@swc/types/assumptions.js +2 -0
  186. package/node_modules/@swc/types/index.d.ts +2049 -0
  187. package/node_modules/@swc/types/index.js +2 -0
  188. package/node_modules/@swc/types/package.json +40 -0
  189. package/node_modules/typescript/LICENSE.txt +55 -0
  190. package/node_modules/typescript/README.md +50 -0
  191. package/node_modules/typescript/SECURITY.md +41 -0
  192. package/node_modules/typescript/ThirdPartyNoticeText.txt +193 -0
  193. package/node_modules/typescript/bin/tsc +2 -0
  194. package/node_modules/typescript/bin/tsserver +2 -0
  195. package/node_modules/typescript/lib/_tsc.js +133818 -0
  196. package/node_modules/typescript/lib/_tsserver.js +659 -0
  197. package/node_modules/typescript/lib/_typingsInstaller.js +222 -0
  198. package/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +2122 -0
  199. package/node_modules/typescript/lib/de/diagnosticMessages.generated.json +2122 -0
  200. package/node_modules/typescript/lib/es/diagnosticMessages.generated.json +2122 -0
  201. package/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +2122 -0
  202. package/node_modules/typescript/lib/it/diagnosticMessages.generated.json +2122 -0
  203. package/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +2122 -0
  204. package/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +2122 -0
  205. package/node_modules/typescript/lib/lib.d.ts +22 -0
  206. package/node_modules/typescript/lib/lib.decorators.d.ts +384 -0
  207. package/node_modules/typescript/lib/lib.decorators.legacy.d.ts +22 -0
  208. package/node_modules/typescript/lib/lib.dom.asynciterable.d.ts +41 -0
  209. package/node_modules/typescript/lib/lib.dom.d.ts +39429 -0
  210. package/node_modules/typescript/lib/lib.dom.iterable.d.ts +571 -0
  211. package/node_modules/typescript/lib/lib.es2015.collection.d.ts +147 -0
  212. package/node_modules/typescript/lib/lib.es2015.core.d.ts +597 -0
  213. package/node_modules/typescript/lib/lib.es2015.d.ts +28 -0
  214. package/node_modules/typescript/lib/lib.es2015.generator.d.ts +77 -0
  215. package/node_modules/typescript/lib/lib.es2015.iterable.d.ts +605 -0
  216. package/node_modules/typescript/lib/lib.es2015.promise.d.ts +81 -0
  217. package/node_modules/typescript/lib/lib.es2015.proxy.d.ts +128 -0
  218. package/node_modules/typescript/lib/lib.es2015.reflect.d.ts +144 -0
  219. package/node_modules/typescript/lib/lib.es2015.symbol.d.ts +46 -0
  220. package/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +326 -0
  221. package/node_modules/typescript/lib/lib.es2016.array.include.d.ts +116 -0
  222. package/node_modules/typescript/lib/lib.es2016.d.ts +21 -0
  223. package/node_modules/typescript/lib/lib.es2016.full.d.ts +23 -0
  224. package/node_modules/typescript/lib/lib.es2016.intl.d.ts +31 -0
  225. package/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts +21 -0
  226. package/node_modules/typescript/lib/lib.es2017.d.ts +26 -0
  227. package/node_modules/typescript/lib/lib.es2017.date.d.ts +31 -0
  228. package/node_modules/typescript/lib/lib.es2017.full.d.ts +23 -0
  229. package/node_modules/typescript/lib/lib.es2017.intl.d.ts +44 -0
  230. package/node_modules/typescript/lib/lib.es2017.object.d.ts +49 -0
  231. package/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +135 -0
  232. package/node_modules/typescript/lib/lib.es2017.string.d.ts +45 -0
  233. package/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts +53 -0
  234. package/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts +77 -0
  235. package/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts +53 -0
  236. package/node_modules/typescript/lib/lib.es2018.d.ts +24 -0
  237. package/node_modules/typescript/lib/lib.es2018.full.d.ts +24 -0
  238. package/node_modules/typescript/lib/lib.es2018.intl.d.ts +83 -0
  239. package/node_modules/typescript/lib/lib.es2018.promise.d.ts +30 -0
  240. package/node_modules/typescript/lib/lib.es2018.regexp.d.ts +37 -0
  241. package/node_modules/typescript/lib/lib.es2019.array.d.ts +79 -0
  242. package/node_modules/typescript/lib/lib.es2019.d.ts +24 -0
  243. package/node_modules/typescript/lib/lib.es2019.full.d.ts +24 -0
  244. package/node_modules/typescript/lib/lib.es2019.intl.d.ts +23 -0
  245. package/node_modules/typescript/lib/lib.es2019.object.d.ts +33 -0
  246. package/node_modules/typescript/lib/lib.es2019.string.d.ts +37 -0
  247. package/node_modules/typescript/lib/lib.es2019.symbol.d.ts +24 -0
  248. package/node_modules/typescript/lib/lib.es2020.bigint.d.ts +765 -0
  249. package/node_modules/typescript/lib/lib.es2020.d.ts +27 -0
  250. package/node_modules/typescript/lib/lib.es2020.date.d.ts +42 -0
  251. package/node_modules/typescript/lib/lib.es2020.full.d.ts +24 -0
  252. package/node_modules/typescript/lib/lib.es2020.intl.d.ts +474 -0
  253. package/node_modules/typescript/lib/lib.es2020.number.d.ts +28 -0
  254. package/node_modules/typescript/lib/lib.es2020.promise.d.ts +47 -0
  255. package/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts +99 -0
  256. package/node_modules/typescript/lib/lib.es2020.string.d.ts +44 -0
  257. package/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts +41 -0
  258. package/node_modules/typescript/lib/lib.es2021.d.ts +23 -0
  259. package/node_modules/typescript/lib/lib.es2021.full.d.ts +24 -0
  260. package/node_modules/typescript/lib/lib.es2021.intl.d.ts +166 -0
  261. package/node_modules/typescript/lib/lib.es2021.promise.d.ts +48 -0
  262. package/node_modules/typescript/lib/lib.es2021.string.d.ts +33 -0
  263. package/node_modules/typescript/lib/lib.es2021.weakref.d.ts +78 -0
  264. package/node_modules/typescript/lib/lib.es2022.array.d.ts +121 -0
  265. package/node_modules/typescript/lib/lib.es2022.d.ts +25 -0
  266. package/node_modules/typescript/lib/lib.es2022.error.d.ts +75 -0
  267. package/node_modules/typescript/lib/lib.es2022.full.d.ts +24 -0
  268. package/node_modules/typescript/lib/lib.es2022.intl.d.ts +145 -0
  269. package/node_modules/typescript/lib/lib.es2022.object.d.ts +26 -0
  270. package/node_modules/typescript/lib/lib.es2022.regexp.d.ts +39 -0
  271. package/node_modules/typescript/lib/lib.es2022.string.d.ts +25 -0
  272. package/node_modules/typescript/lib/lib.es2023.array.d.ts +924 -0
  273. package/node_modules/typescript/lib/lib.es2023.collection.d.ts +21 -0
  274. package/node_modules/typescript/lib/lib.es2023.d.ts +22 -0
  275. package/node_modules/typescript/lib/lib.es2023.full.d.ts +24 -0
  276. package/node_modules/typescript/lib/lib.es2023.intl.d.ts +56 -0
  277. package/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts +65 -0
  278. package/node_modules/typescript/lib/lib.es2024.collection.d.ts +29 -0
  279. package/node_modules/typescript/lib/lib.es2024.d.ts +26 -0
  280. package/node_modules/typescript/lib/lib.es2024.full.d.ts +24 -0
  281. package/node_modules/typescript/lib/lib.es2024.object.d.ts +29 -0
  282. package/node_modules/typescript/lib/lib.es2024.promise.d.ts +35 -0
  283. package/node_modules/typescript/lib/lib.es2024.regexp.d.ts +25 -0
  284. package/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts +68 -0
  285. package/node_modules/typescript/lib/lib.es2024.string.d.ts +29 -0
  286. package/node_modules/typescript/lib/lib.es5.d.ts +4601 -0
  287. package/node_modules/typescript/lib/lib.es6.d.ts +23 -0
  288. package/node_modules/typescript/lib/lib.esnext.array.d.ts +35 -0
  289. package/node_modules/typescript/lib/lib.esnext.collection.d.ts +96 -0
  290. package/node_modules/typescript/lib/lib.esnext.d.ts +29 -0
  291. package/node_modules/typescript/lib/lib.esnext.decorators.d.ts +28 -0
  292. package/node_modules/typescript/lib/lib.esnext.disposable.d.ts +193 -0
  293. package/node_modules/typescript/lib/lib.esnext.error.d.ts +24 -0
  294. package/node_modules/typescript/lib/lib.esnext.float16.d.ts +445 -0
  295. package/node_modules/typescript/lib/lib.esnext.full.d.ts +24 -0
  296. package/node_modules/typescript/lib/lib.esnext.intl.d.ts +21 -0
  297. package/node_modules/typescript/lib/lib.esnext.iterator.d.ts +148 -0
  298. package/node_modules/typescript/lib/lib.esnext.promise.d.ts +34 -0
  299. package/node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts +25 -0
  300. package/node_modules/typescript/lib/lib.scripthost.d.ts +322 -0
  301. package/node_modules/typescript/lib/lib.webworker.asynciterable.d.ts +41 -0
  302. package/node_modules/typescript/lib/lib.webworker.d.ts +13150 -0
  303. package/node_modules/typescript/lib/lib.webworker.importscripts.d.ts +23 -0
  304. package/node_modules/typescript/lib/lib.webworker.iterable.d.ts +340 -0
  305. package/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +2122 -0
  306. package/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +2122 -0
  307. package/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +2122 -0
  308. package/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +2122 -0
  309. package/node_modules/typescript/lib/tsc.js +8 -0
  310. package/node_modules/typescript/lib/tsserver.js +8 -0
  311. package/node_modules/typescript/lib/tsserverlibrary.d.ts +17 -0
  312. package/node_modules/typescript/lib/tsserverlibrary.js +21 -0
  313. package/node_modules/typescript/lib/typesMap.json +497 -0
  314. package/node_modules/typescript/lib/typescript.d.ts +11437 -0
  315. package/node_modules/typescript/lib/typescript.js +200276 -0
  316. package/node_modules/typescript/lib/typingsInstaller.js +8 -0
  317. package/node_modules/typescript/lib/watchGuard.js +53 -0
  318. package/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +2122 -0
  319. package/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +2122 -0
  320. package/node_modules/typescript/package.json +120 -0
  321. package/package.json +13 -8
  322. package/lib/coverage/fs-walk.mjs +0 -64
  323. package/lib/coverage/next-discovery.mjs +0 -205
  324. package/lib/coverage/next-static-analysis.mjs +0 -1045
  325. package/node_modules/@elench/testkit-bridge/src/index.mjs +0 -583
  326. package/node_modules/@elench/testkit-bridge/src/index.test.mjs +0 -409
  327. package/node_modules/@elench/testkit-protocol/src/index.d.ts +0 -231
  328. package/node_modules/@elench/testkit-protocol/src/index.mjs +0 -265
  329. package/node_modules/@elench/testkit-protocol/src/index.test.mjs +0 -242
  330. package/node_modules/@elench/ts-analysis/src/callables.mjs +0 -135
  331. package/node_modules/@elench/ts-analysis/src/callables.test.mjs +0 -55
  332. package/node_modules/@elench/ts-analysis/src/exports.mjs +0 -69
  333. package/node_modules/@elench/ts-analysis/src/exports.test.mjs +0 -50
  334. package/node_modules/@elench/ts-analysis/src/jsx.mjs +0 -69
  335. package/node_modules/@elench/ts-analysis/src/jsx.test.mjs +0 -43
  336. package/node_modules/@elench/ts-analysis/src/project.mjs +0 -100
  337. package/node_modules/@elench/ts-analysis/src/project.test.mjs +0 -54
  338. package/node_modules/@elench/ts-analysis/src/requests.mjs +0 -141
  339. package/node_modules/@elench/ts-analysis/src/requests.test.mjs +0 -35
  340. package/node_modules/@elench/ts-analysis/src/resolution.mjs +0 -53
  341. package/node_modules/@elench/ts-analysis/src/shared.mjs +0 -32
  342. package/node_modules/@elench/ts-analysis/src/syntax.mjs +0 -27
@@ -1,5 +1,5 @@
1
- import { ensureExistingPath, resolveServiceCwd } from "./paths.mjs";
2
- import { parseModuleSpecifier } from "./runtime.mjs";
1
+ import { ensureExistingPath } from "./paths.mjs";
2
+ import { validateConfiguredCollection } from "../shared/configured-steps.mjs";
3
3
 
4
4
  export function validateConfigCoverage(configs) {
5
5
  const names = new Set(configs.map((config) => config.name));
@@ -60,65 +60,21 @@ export function validateServiceConfig({
60
60
  }
61
61
  for (const [stageName, steps] of Object.entries(database?.template || {})) {
62
62
  if (stageName === "inputs") continue;
63
- for (const step of steps || []) {
64
- if (step.cwd) {
65
- ensureExistingPath(productDir, step.cwd, `Service "${name}" database.template.${stageName} step cwd`);
66
- }
67
- if (step.kind === "sql-file") {
68
- ensureExistingPath(
69
- resolveServiceCwd(productDir, step.cwd || "."),
70
- step.path,
71
- `Service "${name}" database.template.${stageName} sql file`
72
- );
73
- }
74
- if (step.kind === "module") {
75
- const { modulePath } = parseModuleSpecifier(step.specifier);
76
- ensureExistingPath(
77
- resolveServiceCwd(productDir, step.cwd || "."),
78
- modulePath,
79
- `Service "${name}" database.template.${stageName} module`
80
- );
81
- }
82
- for (const input of step.inputs || []) {
83
- ensureExistingPath(
84
- resolveServiceCwd(productDir, step.cwd || "."),
85
- input,
86
- `Service "${name}" database.template.${stageName} step input`
87
- );
88
- }
89
- }
90
- }
91
- for (const input of database?.template?.inputs || []) {
92
- ensureExistingPath(productDir, input, `Service "${name}" database.template input`);
93
- }
94
- for (const step of runtime.prepare?.steps || []) {
95
- if (step.cwd) {
96
- ensureExistingPath(productDir, step.cwd, `Service "${name}" runtime.prepare step cwd`);
97
- }
98
- if (step.kind === "sql-file") {
99
- ensureExistingPath(
100
- resolveServiceCwd(productDir, step.cwd || "."),
101
- step.path,
102
- `Service "${name}" runtime.prepare sql file`
103
- );
104
- }
105
- if (step.kind === "module") {
106
- const { modulePath } = parseModuleSpecifier(step.specifier);
107
- ensureExistingPath(
108
- resolveServiceCwd(productDir, step.cwd || "."),
109
- modulePath,
110
- `Service "${name}" runtime.prepare module`
111
- );
112
- }
113
- for (const input of step.inputs || []) {
114
- ensureExistingPath(
115
- resolveServiceCwd(productDir, step.cwd || "."),
116
- input,
117
- `Service "${name}" runtime.prepare step input`
118
- );
119
- }
120
- }
121
- for (const input of runtime.prepare?.inputs || []) {
122
- ensureExistingPath(productDir, input, `Service "${name}" runtime.prepare input`);
63
+ validateConfiguredCollection({
64
+ productDir,
65
+ label: `Service "${name}" database.template.${stageName}`,
66
+ steps,
67
+ });
123
68
  }
69
+ validateConfiguredCollection({
70
+ productDir,
71
+ label: `Service "${name}" database.template`,
72
+ inputs: database?.template?.inputs || [],
73
+ });
74
+ validateConfiguredCollection({
75
+ productDir,
76
+ label: `Service "${name}" runtime.prepare`,
77
+ inputs: runtime.prepare?.inputs || [],
78
+ steps: runtime.prepare?.steps || [],
79
+ });
124
80
  }
@@ -1,13 +1,12 @@
1
1
  import fs from "fs";
2
2
  import path from "path";
3
3
  import {
4
+ collectImports,
5
+ createSourceFile,
4
6
  extractExportedFunctionBody,
5
- extractExportedFunctions,
6
- extractExportedMethodBodies,
7
+ resolveImportToSourceFile,
7
8
  } from "@elench/ts-analysis";
8
9
  import {
9
- dedupeBackendImports,
10
- dedupeDataImports,
11
10
  dedupeEdges,
12
11
  dedupeNodes,
13
12
  hasWord,
@@ -15,7 +14,6 @@ import {
15
14
  isDataSpecifier,
16
15
  modulePathKey,
17
16
  } from "./shared.mjs";
18
- import { resolveImportToSourceFile } from "./fs-walk.mjs";
19
17
 
20
18
  export function extractBackendImports({
21
19
  serviceName,
@@ -26,34 +24,15 @@ export function extractBackendImports({
26
24
  resolveImportToSourceFile: resolveImportAlias,
27
25
  }) {
28
26
  const resolveImportFn = resolveImportAlias || resolveImport;
29
- const imports = [];
30
- const importRegex = /import\s+\{([^}]+)\}\s+from\s+["'`]([^"'`]+)["'`]/gu;
31
- for (const match of content.matchAll(importRegex)) {
32
- const rawNames = match[1]
33
- .split(",")
34
- .map((entry) => entry.trim())
35
- .map((entry) => entry.split(/\s+as\s+/u)[0]?.trim())
36
- .filter(Boolean);
37
- const specifier = match[2].trim();
38
- if (!isBackendSpecifier(specifier)) continue;
39
- const resolvedFilePath = resolveImportFn(serviceRoot, filePath, specifier);
40
- for (const importName of rawNames) {
41
- imports.push({
42
- importName,
43
- node: {
44
- id: `server_capability:${modulePathKey(resolvedFilePath || filePath)}#${importName}`,
45
- kind: "server_capability",
46
- service: serviceName,
47
- label: importName,
48
- filePath: resolvedFilePath || null,
49
- metadata: {
50
- specifier,
51
- },
52
- },
53
- });
54
- }
55
- }
56
- return dedupeBackendImports(imports);
27
+ return collectCapabilityImports({
28
+ serviceName,
29
+ serviceRoot,
30
+ filePath,
31
+ content,
32
+ resolveImportFn,
33
+ matchesSpecifier: isBackendSpecifier,
34
+ kind: "server_capability",
35
+ });
57
36
  }
58
37
 
59
38
  export function discoverDataCapabilities({ serviceName, serviceRoot, nodes, readFile = defaultReadFile }) {
@@ -97,63 +76,67 @@ export function extractDataImports({
97
76
  resolveImportToSourceFile: resolveImportAlias,
98
77
  }) {
99
78
  const resolveImportFn = resolveImportAlias || resolveImport;
100
- const imports = [];
101
- const importRegex = /import\s+\{([^}]+)\}\s+from\s+["'`]([^"'`]+)["'`]/gu;
102
- for (const match of content.matchAll(importRegex)) {
103
- const rawNames = match[1]
104
- .split(",")
105
- .map((entry) => entry.trim())
106
- .map((entry) => entry.split(/\s+as\s+/u)[0]?.trim())
107
- .filter(Boolean);
108
- const specifier = match[2].trim();
109
- if (!isDataSpecifier(specifier)) continue;
110
- const resolvedFilePath = resolveImportFn(serviceRoot, filePath, specifier);
111
- for (const importName of rawNames) {
112
- imports.push({
113
- importName,
114
- node: {
115
- id: `data_capability:${modulePathKey(resolvedFilePath || filePath)}#${importName}`,
116
- kind: "data_capability",
117
- service: serviceName,
118
- label: importName,
119
- filePath: resolvedFilePath || null,
120
- metadata: {
121
- specifier,
122
- },
123
- },
124
- });
125
- }
126
- }
127
- return dedupeDataImports(imports);
79
+ return collectCapabilityImports({
80
+ serviceName,
81
+ serviceRoot,
82
+ filePath,
83
+ content,
84
+ resolveImportFn,
85
+ matchesSpecifier: isDataSpecifier,
86
+ kind: "data_capability",
87
+ });
128
88
  }
129
89
 
130
- export { extractExportedFunctionBody, extractExportedFunctions, extractExportedMethodBodies };
90
+ function defaultReadFile(filePath) {
91
+ if (!fs.existsSync(filePath)) return null;
92
+ return fs.readFileSync(filePath, "utf8");
93
+ }
131
94
 
132
- export function readBalancedBlock(content, startIndex) {
133
- let depth = 0;
134
- let inSingle = false;
135
- let inDouble = false;
136
- let inTemplate = false;
95
+ function collectCapabilityImports({
96
+ serviceName,
97
+ serviceRoot,
98
+ filePath,
99
+ content,
100
+ resolveImportFn,
101
+ matchesSpecifier,
102
+ kind,
103
+ }) {
104
+ const sourceFile = createSourceFile(filePath, content);
105
+ const imports = collectImports(sourceFile, {
106
+ resolveImportPath: (specifier) => resolveImportFn(serviceRoot, filePath, specifier),
107
+ readSourceFile: () => null,
108
+ isServerActionFile: () => false,
109
+ });
137
110
 
138
- for (let index = startIndex; index < content.length; index += 1) {
139
- const char = content[index];
140
- const previous = content[index - 1];
141
- if (char === "'" && !inDouble && !inTemplate && previous !== "\\") inSingle = !inSingle;
142
- if (char === '"' && !inSingle && !inTemplate && previous !== "\\") inDouble = !inDouble;
143
- if (char === "`" && !inSingle && !inDouble && previous !== "\\") inTemplate = !inTemplate;
144
- if (inSingle || inDouble || inTemplate) continue;
145
- if (char === "{") depth += 1;
146
- if (char === "}") {
147
- depth -= 1;
148
- if (depth === 0) {
149
- return content.slice(startIndex, index + 1);
150
- }
151
- }
111
+ const collected = [];
112
+ for (const [localName, imported] of imports.entries()) {
113
+ if (!matchesSpecifier(imported.specifier)) continue;
114
+ const exportName = imported.importedName === "default" ? localName : imported.importedName;
115
+ collected.push({
116
+ importName: localName,
117
+ node: {
118
+ id: `${kind}:${modulePathKey(imported.resolvedFilePath || filePath)}#${exportName}`,
119
+ kind,
120
+ service: serviceName,
121
+ label: exportName,
122
+ filePath: imported.resolvedFilePath || null,
123
+ metadata: {
124
+ specifier: imported.specifier,
125
+ localName,
126
+ },
127
+ },
128
+ });
152
129
  }
153
- return null;
130
+
131
+ return dedupeCapabilityImports(collected);
154
132
  }
155
133
 
156
- function defaultReadFile(filePath) {
157
- if (!fs.existsSync(filePath)) return null;
158
- return fs.readFileSync(filePath, "utf8");
134
+ function dedupeCapabilityImports(entries) {
135
+ const seen = new Set();
136
+ return entries.filter((entry) => {
137
+ const key = `${entry.importName}:${entry.node.id}:${entry.node.filePath || ""}`;
138
+ if (seen.has(key)) return false;
139
+ seen.add(key);
140
+ return true;
141
+ });
159
142
  }
@@ -1,52 +1,61 @@
1
1
  import { describe, expect, it } from "vitest";
2
- import {
3
- extractExportedFunctionBody,
4
- extractExportedFunctions,
5
- extractExportedMethodBodies,
6
- readBalancedBlock,
7
- } from "./backend-discovery.mjs";
8
-
9
- describe("coverage backend discovery helpers", () => {
10
- it("extracts exported HTTP method bodies without being confused by braces in strings", () => {
11
- const content = `
12
- export async function GET() {
13
- const template = "{not a block}";
14
- return template;
15
- }
16
-
17
- export async function POST() {
18
- return { ok: true };
19
- }
20
- `;
21
-
22
- expect(extractExportedMethodBodies(content, ["GET", "POST"])).toEqual([
23
- ["GET", expect.stringContaining('"{not a block}"')],
24
- ["POST", expect.stringContaining("{ ok: true }")],
2
+ import { extractBackendImports, extractDataImports } from "./backend-discovery.mjs";
3
+
4
+ describe("coverage backend discovery", () => {
5
+ it("tracks local import names while anchoring capabilities to exported names", () => {
6
+ const content = [
7
+ 'import { saveSettings as persistSettings } from "@/backend/server/settings";',
8
+ 'import { loadProjects as fetchProjects } from "@/backend/data/projects";',
9
+ ].join("\n");
10
+
11
+ expect(
12
+ extractBackendImports({
13
+ serviceName: "web",
14
+ serviceRoot: "/repo",
15
+ filePath: "src/app/settings/actions.ts",
16
+ content,
17
+ resolveImport: () => "src/backend/server/settings.ts",
18
+ })
19
+ ).toEqual([
20
+ {
21
+ importName: "persistSettings",
22
+ node: {
23
+ id: "server_capability:src/backend/server/settings#saveSettings",
24
+ kind: "server_capability",
25
+ service: "web",
26
+ label: "saveSettings",
27
+ filePath: "src/backend/server/settings.ts",
28
+ metadata: {
29
+ specifier: "@/backend/server/settings",
30
+ localName: "persistSettings",
31
+ },
32
+ },
33
+ },
25
34
  ]);
26
- });
27
-
28
- it("extracts named exported functions and their bodies", () => {
29
- const content = `
30
- export async function saveSettings() {
31
- return updateSettings();
32
- }
33
35
 
34
- export function listSettings() {
35
- return [];
36
- }
37
- `;
38
-
39
- expect(extractExportedFunctions(content)).toEqual([
40
- { name: "saveSettings", body: expect.stringContaining("updateSettings") },
41
- { name: "listSettings", body: expect.stringContaining("return [];") },
36
+ expect(
37
+ extractDataImports({
38
+ serviceName: "web",
39
+ serviceRoot: "/repo",
40
+ filePath: "src/backend/server/settings.ts",
41
+ content,
42
+ resolveImport: () => "src/backend/data/projects.ts",
43
+ })
44
+ ).toEqual([
45
+ {
46
+ importName: "fetchProjects",
47
+ node: {
48
+ id: "data_capability:src/backend/data/projects#loadProjects",
49
+ kind: "data_capability",
50
+ service: "web",
51
+ label: "loadProjects",
52
+ filePath: "src/backend/data/projects.ts",
53
+ metadata: {
54
+ specifier: "@/backend/data/projects",
55
+ localName: "fetchProjects",
56
+ },
57
+ },
58
+ },
42
59
  ]);
43
- expect(extractExportedFunctionBody(content, "saveSettings")).toContain("updateSettings");
44
- });
45
-
46
- it("reads a balanced block from a brace offset", () => {
47
- const content = `before { const tpl = \`{nested}\`; return tpl; } after`;
48
- const startIndex = content.indexOf("{");
49
-
50
- expect(readBalancedBlock(content, startIndex)).toBe("{ const tpl = `{nested}`; return tpl; }");
51
60
  });
52
61
  });
@@ -1,12 +1,14 @@
1
1
  import fs from "fs";
2
2
  import path from "path";
3
- import { extractHttpSuiteRequests, extractPlaywrightVisitedRoutes } from "./next-static-analysis.mjs";
3
+ import { extractHttpRequests, extractPlaywrightVisitedRoutes } from "@elench/ts-analysis";
4
4
  import {
5
5
  apiRouteLookupKey,
6
+ DYNAMIC_SEGMENT_TOKEN,
6
7
  HTTP_METHODS,
7
8
  dedupeTargets,
8
9
  findMatchingApiRouteEntry,
9
10
  findMatchingRouteValue,
11
+ normalizeRoute,
10
12
  toApiRequestPath,
11
13
  toSelectionType,
12
14
  } from "./shared.mjs";
@@ -36,7 +38,13 @@ export function inferCoveredNodeIdsForTest(entry, context) {
36
38
 
37
39
  // Capability: Playwright page routes (content-first, path-fallback)
38
40
  if (entry.framework === "playwright") {
39
- const gotoRoutes = content ? extractPlaywrightVisitedRoutes(content, entry.filePath) : [];
41
+ const gotoRoutes = content
42
+ ? extractPlaywrightVisitedRoutes(content, {
43
+ filePath: entry.filePath,
44
+ normalizeRoute,
45
+ dynamicSegmentToken: DYNAMIC_SEGMENT_TOKEN,
46
+ })
47
+ : [];
40
48
  const routes = gotoRoutes.length > 0
41
49
  ? gotoRoutes
42
50
  : (() => { const r = inferPageRouteFromTestFile(entry.filePath, context.nextAppRoot, context.serviceRoot); return r ? [r] : []; })();
@@ -56,7 +64,11 @@ export function inferCoveredNodeIdsForTest(entry, context) {
56
64
 
57
65
  // Capability: HTTP request extraction (any test type with rawReq/fetch/wrapper calls)
58
66
  if (content) {
59
- const requests = extractHttpSuiteRequests(content, entry.filePath);
67
+ const requests = extractHttpRequests(content, {
68
+ filePath: entry.filePath,
69
+ normalizeRoute,
70
+ dynamicSegmentToken: DYNAMIC_SEGMENT_TOKEN,
71
+ });
60
72
  for (const request of requests) {
61
73
  if (!request.path.startsWith("/api/")) continue;
62
74
  const routeEntry = resolveApiRouteEntry(context, request.method, request.path);
@@ -4,7 +4,7 @@ import {
4
4
  extractPlaywrightTargetsFromContent,
5
5
  inferDataCapabilitiesFromOwner,
6
6
  } from "./evidence.mjs";
7
- import { extractPlaywrightVisitedRoutes } from "./next-static-analysis.mjs";
7
+ import { extractPlaywrightVisitedRoutes } from "@elench/ts-analysis";
8
8
  import { DYNAMIC_SEGMENT_TOKEN } from "./shared.mjs";
9
9
 
10
10
  describe("coverage evidence helpers", () => {
@@ -60,19 +60,28 @@ describe("extractPlaywrightVisitedRoutes", () => {
60
60
  await page.goto("https://external.com/path"); // external
61
61
  await page.goto("http://localhost:3000/events"); // same-origin absolute
62
62
  });
63
- `, "nav.pw.testkit.ts")).toEqual(["/dashboard", "/settings/profile", "/events"]);
63
+ `, {
64
+ filePath: "nav.pw.testkit.ts",
65
+ dynamicSegmentToken: DYNAMIC_SEGMENT_TOKEN,
66
+ })).toEqual(["/dashboard", "/settings/profile", "/events"]);
64
67
  });
65
68
 
66
69
  it("handles property chain: foo.page.goto()", () => {
67
70
  expect(extractPlaywrightVisitedRoutes(`
68
71
  await this.page.goto("/projects");
69
- `, "test.pw.testkit.ts")).toEqual(["/projects"]);
72
+ `, {
73
+ filePath: "test.pw.testkit.ts",
74
+ dynamicSegmentToken: DYNAMIC_SEGMENT_TOKEN,
75
+ })).toEqual(["/projects"]);
70
76
  });
71
77
 
72
78
  it("normalizes dynamic goto expressions into route patterns", () => {
73
79
  expect(extractPlaywrightVisitedRoutes(`
74
80
  await page.goto(\`/projects/\${id}\`);
75
81
  await page.goto(someVar);
76
- `, "test.pw.testkit.ts")).toEqual([`/projects/${DYNAMIC_SEGMENT_TOKEN}`]);
82
+ `, {
83
+ filePath: "test.pw.testkit.ts",
84
+ dynamicSegmentToken: DYNAMIC_SEGMENT_TOKEN,
85
+ })).toEqual([`/projects/${DYNAMIC_SEGMENT_TOKEN}`]);
77
86
  });
78
87
  });
@@ -1,7 +1,6 @@
1
1
  import { discoverDataCapabilities } from "./backend-discovery.mjs";
2
2
  import { buildEvidenceDetails, inferCoveredNodeIdsForTest } from "./evidence.mjs";
3
- import { findNextAppRoot, resolveImportToSourceFile, resolveServiceRoot } from "./fs-walk.mjs";
4
- import { discoverApiRoutes, discoverPageViews, discoverServerActions } from "./next-discovery.mjs";
3
+ import { convertNextAnalysisToGraph } from "./next-ir-to-graph.mjs";
5
4
  import {
6
5
  appendGraph,
7
6
  createEmptyGraph,
@@ -11,6 +10,8 @@ import {
11
10
  toSelectionType,
12
11
  } from "./shared.mjs";
13
12
  import { DEFAULT_DISCOVERY_EXCLUDES, normalizeDiscoveryConfig } from "../discovery/path-policy.mjs";
13
+ import { resolveServiceCwd } from "../config/paths.mjs";
14
+ import { createNextAnalysisProject } from "@elench/next-analysis";
14
15
 
15
16
  export function buildCoverageGraph({ productDir, repoDiscovery = {}, services = {}, discoveryFiles = [] }) {
16
17
  const graph = createEmptyGraph();
@@ -84,9 +85,7 @@ export function buildCoverageGraph({ productDir, repoDiscovery = {}, services =
84
85
  }
85
86
 
86
87
  export function buildServiceCoverageContext(productDir, serviceName, config, repoDiscovery = {}) {
87
- const serviceRoot = resolveServiceRoot(productDir, config);
88
- const nextAppRoot = findNextAppRoot(serviceRoot);
89
- if (!nextAppRoot) return null;
88
+ const serviceRoot = resolveServiceCwd(productDir, config?.local?.cwd || ".");
90
89
  const serviceDiscovery = normalizeDiscoveryConfig(config?.discovery, { allowRoots: true });
91
90
  const exclude = [
92
91
  ...new Set([
@@ -95,42 +94,42 @@ export function buildServiceCoverageContext(productDir, serviceName, config, rep
95
94
  ...((serviceDiscovery.exclude || []).map(normalizePath)),
96
95
  ]),
97
96
  ];
97
+ const nextProject = createNextAnalysisProject({ rootDir: serviceRoot, exclude });
98
+ const nextAppRoot = nextProject.findAppRoot();
99
+ if (!nextAppRoot) return null;
98
100
 
99
101
  const graph = createEmptyGraph();
100
- const discoveryOptions = {
102
+ const pages = nextProject.discoverPages();
103
+ const apiRoutes = nextProject.discoverApiRoutes();
104
+ const serverActions = nextProject.discoverServerActions();
105
+ const routeTrees = pages.map((page) => nextProject.analyzeRouteTree(page.route)).filter(Boolean);
106
+ const converted = convertNextAnalysisToGraph({
101
107
  serviceName,
102
- serviceRoot,
103
- nextAppRoot,
104
- exclude,
105
- resolveImportToSourceFile,
106
- };
107
- const pages = discoverPageViews(discoveryOptions);
108
- const apiRoutes = discoverApiRoutes(discoveryOptions);
109
- const serverActions = discoverServerActions({
110
- serviceName,
111
- serviceRoot,
112
- exclude,
113
- resolveImportToSourceFile,
108
+ pages,
109
+ apiRoutes,
110
+ serverActions,
111
+ routeTrees,
114
112
  });
115
113
 
116
- for (const node of [...pages.nodes, ...apiRoutes.nodes, ...serverActions.nodes]) graph.nodes.push(node);
117
- for (const edge of [...pages.edges, ...apiRoutes.edges, ...serverActions.edges]) graph.edges.push(edge);
114
+ for (const node of converted.nodes) graph.nodes.push(node);
115
+ for (const edge of converted.edges) graph.edges.push(edge);
118
116
 
119
117
  const dataAugmentation = discoverDataCapabilities({ serviceName, serviceRoot, nodes: graph.nodes });
120
118
  for (const node of dataAugmentation.nodes) graph.nodes.push(node);
121
119
  for (const edge of dataAugmentation.edges) graph.edges.push(edge);
120
+ for (const diagnostic of nextProject.getDiagnostics()) graph.diagnostics.push(diagnostic);
122
121
 
123
- const pageByRoute = new Map(pages.pageEntries.map((entry) => [entry.route, entry]));
122
+ const pageByRoute = new Map(converted.pageEntries.map((entry) => [entry.route, entry]));
124
123
  const apiRouteByKey = new Map(
125
- apiRoutes.routeEntries.map((entry) => [`${entry.method}:${entry.requestPath}`, entry])
124
+ converted.routeEntries.map((entry) => [`${entry.method}:${entry.requestPath}`, entry])
126
125
  );
127
126
  const serverActionByExportKey = new Map(
128
- serverActions.actionEntries.map((entry) => [`${entry.sourceFile}#${entry.exportName}`, entry])
127
+ converted.actionEntries.map((entry) => [`${entry.sourceFile}#${entry.exportName}`, entry])
129
128
  );
130
129
 
131
- for (const pageEntry of pages.pageEntries) {
130
+ for (const pageEntry of converted.pageEntries) {
132
131
  for (const request of pageEntry.requests) {
133
- const apiRoute = findMatchingApiRouteEntry(request.method, request.path, apiRoutes.routeEntries);
132
+ const apiRoute = findMatchingApiRouteEntry(request.method, request.path, converted.routeEntries);
134
133
  if (!apiRoute) continue;
135
134
  graph.edges.push({
136
135
  id: `handles:${request.node.id}:${apiRoute.node.id}`,
@@ -161,7 +160,7 @@ export function buildServiceCoverageContext(productDir, serviceName, config, rep
161
160
  graph,
162
161
  pageByRoute,
163
162
  apiRouteByKey,
164
- apiRouteEntries: apiRoutes.routeEntries,
163
+ apiRouteEntries: converted.routeEntries,
165
164
  serverActionByExportKey,
166
165
  dataCapabilities: dataAugmentation.nodes,
167
166
  };