@elench/testkit 0.1.65 → 0.1.67

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 (324) hide show
  1. package/README.md +37 -62
  2. package/lib/app/browser-bridge.mjs +66 -0
  3. package/lib/app/configs.mjs +81 -0
  4. package/lib/app/configs.test.mjs +34 -0
  5. package/lib/app/doctor.mjs +139 -0
  6. package/lib/app/typecheck.mjs +203 -0
  7. package/lib/cli/command-helpers.mjs +2 -10
  8. package/lib/cli/commands/browser/serve.mjs +3 -62
  9. package/lib/cli/commands/doctor.mjs +39 -0
  10. package/lib/cli/commands/typecheck.mjs +28 -0
  11. package/lib/cli/db.mjs +3 -68
  12. package/lib/cli/entrypoint.mjs +2 -0
  13. package/lib/config/binaries.mjs +34 -0
  14. package/lib/config/database.mjs +9 -6
  15. package/lib/config/index.mjs +13 -31
  16. package/lib/config/runtime.mjs +35 -96
  17. package/lib/config/runtime.test.mjs +26 -0
  18. package/lib/config/validation.mjs +18 -62
  19. package/lib/coverage/backend-discovery.mjs +68 -85
  20. package/lib/coverage/backend-discovery.test.mjs +55 -46
  21. package/lib/coverage/graph-builder.mjs +5 -5
  22. package/lib/coverage/index.test.mjs +4 -2
  23. package/lib/coverage/next-ir-to-graph.mjs +0 -1
  24. package/lib/coverage/routing.mjs +2 -29
  25. package/lib/coverage/routing.test.mjs +0 -16
  26. package/lib/coverage/shared.mjs +22 -82
  27. package/lib/database/fingerprint.mjs +1 -1
  28. package/lib/discovery/file-metadata.mjs +122 -0
  29. package/lib/discovery/file-metadata.test.mjs +51 -0
  30. package/lib/discovery/index.mjs +10 -2
  31. package/lib/discovery/index.test.mjs +19 -19
  32. package/lib/known-failures/github-cache.mjs +159 -0
  33. package/lib/known-failures/github-transport.mjs +174 -0
  34. package/lib/known-failures/github.mjs +17 -325
  35. package/lib/runner/default-runtime-runner.mjs +4 -10
  36. package/lib/runner/execution-config.mjs +12 -83
  37. package/lib/runner/live-run.mjs +45 -0
  38. package/lib/runner/managed-processes.mjs +29 -0
  39. package/lib/runner/orchestrator.mjs +57 -188
  40. package/lib/runner/planning.mjs +10 -3
  41. package/lib/runner/planning.test.mjs +26 -0
  42. package/lib/runner/playwright-runner.mjs +4 -11
  43. package/lib/runner/run-finalization.mjs +132 -0
  44. package/lib/runner/run-guards.mjs +45 -0
  45. package/lib/runner/runtime-preparation.mjs +1 -1
  46. package/lib/runner/services.mjs +3 -4
  47. package/lib/runner/template-steps.mjs +8 -45
  48. package/lib/runner/template.mjs +7 -28
  49. package/lib/setup/index.d.ts +88 -21
  50. package/lib/setup/index.mjs +177 -50
  51. package/lib/setup/index.test.mjs +194 -64
  52. package/lib/shared/build-config.mjs +144 -0
  53. package/lib/shared/build-config.test.mjs +81 -0
  54. package/lib/shared/configured-steps.mjs +178 -0
  55. package/lib/shared/configured-steps.test.mjs +73 -0
  56. package/lib/shared/execution-schema.mjs +74 -0
  57. package/lib/shared/execution-schema.test.mjs +26 -0
  58. package/node_modules/@elench/next-analysis/dist/api-routes.d.ts +7 -0
  59. package/node_modules/@elench/next-analysis/dist/api-routes.d.ts.map +1 -0
  60. package/node_modules/@elench/next-analysis/dist/api-routes.js +66 -0
  61. package/node_modules/@elench/next-analysis/dist/api-routes.js.map +1 -0
  62. package/node_modules/@elench/next-analysis/dist/app-root.d.ts +2 -0
  63. package/node_modules/@elench/next-analysis/dist/app-root.d.ts.map +1 -0
  64. package/node_modules/@elench/next-analysis/dist/app-root.js +7 -0
  65. package/node_modules/@elench/next-analysis/dist/app-root.js.map +1 -0
  66. package/node_modules/@elench/next-analysis/dist/backend-links.d.ts +8 -0
  67. package/node_modules/@elench/next-analysis/dist/backend-links.d.ts.map +1 -0
  68. package/node_modules/@elench/next-analysis/dist/backend-links.js +30 -0
  69. package/node_modules/@elench/next-analysis/dist/backend-links.js.map +1 -0
  70. package/node_modules/@elench/next-analysis/dist/index.d.ts +11 -0
  71. package/node_modules/@elench/next-analysis/dist/index.d.ts.map +1 -0
  72. package/node_modules/@elench/next-analysis/dist/index.js +10 -0
  73. package/node_modules/@elench/next-analysis/dist/index.js.map +1 -0
  74. package/node_modules/@elench/next-analysis/dist/pages.d.ts +7 -0
  75. package/node_modules/@elench/next-analysis/dist/pages.d.ts.map +1 -0
  76. package/node_modules/@elench/next-analysis/dist/pages.js +47 -0
  77. package/node_modules/@elench/next-analysis/dist/pages.js.map +1 -0
  78. package/node_modules/@elench/next-analysis/dist/project.d.ts +3 -0
  79. package/node_modules/@elench/next-analysis/dist/project.d.ts.map +1 -0
  80. package/node_modules/@elench/next-analysis/dist/project.js +102 -0
  81. package/node_modules/@elench/next-analysis/dist/project.js.map +1 -0
  82. package/node_modules/@elench/next-analysis/dist/route-tree.d.ts +7 -0
  83. package/node_modules/@elench/next-analysis/dist/route-tree.d.ts.map +1 -0
  84. package/node_modules/@elench/next-analysis/dist/route-tree.js +575 -0
  85. package/node_modules/@elench/next-analysis/dist/route-tree.js.map +1 -0
  86. package/node_modules/@elench/next-analysis/dist/routes.d.ts +6 -0
  87. package/node_modules/@elench/next-analysis/dist/routes.d.ts.map +1 -0
  88. package/node_modules/@elench/next-analysis/dist/routes.js +41 -0
  89. package/node_modules/@elench/next-analysis/dist/routes.js.map +1 -0
  90. package/node_modules/@elench/next-analysis/dist/server-actions.d.ts +7 -0
  91. package/node_modules/@elench/next-analysis/dist/server-actions.d.ts.map +1 -0
  92. package/node_modules/@elench/next-analysis/dist/server-actions.js +37 -0
  93. package/node_modules/@elench/next-analysis/dist/server-actions.js.map +1 -0
  94. package/node_modules/@elench/next-analysis/dist/shared.d.ts +57 -0
  95. package/node_modules/@elench/next-analysis/dist/shared.d.ts.map +1 -0
  96. package/node_modules/@elench/next-analysis/dist/shared.js +229 -0
  97. package/node_modules/@elench/next-analysis/dist/shared.js.map +1 -0
  98. package/node_modules/@elench/next-analysis/dist/swc.d.ts +53 -0
  99. package/node_modules/@elench/next-analysis/dist/swc.d.ts.map +1 -0
  100. package/node_modules/@elench/next-analysis/dist/swc.js +387 -0
  101. package/node_modules/@elench/next-analysis/dist/swc.js.map +1 -0
  102. package/node_modules/@elench/next-analysis/dist/types.d.ts +125 -0
  103. package/node_modules/@elench/next-analysis/dist/types.d.ts.map +1 -0
  104. package/node_modules/@elench/next-analysis/dist/types.js +2 -0
  105. package/node_modules/@elench/next-analysis/dist/types.js.map +1 -0
  106. package/node_modules/@elench/next-analysis/package.json +15 -2
  107. package/node_modules/@elench/testkit-bridge/dist/index.d.ts +36 -0
  108. package/node_modules/@elench/testkit-bridge/dist/index.d.ts.map +1 -0
  109. package/node_modules/@elench/testkit-bridge/dist/index.js +538 -0
  110. package/node_modules/@elench/testkit-bridge/dist/index.js.map +1 -0
  111. package/node_modules/@elench/testkit-bridge/package.json +16 -5
  112. package/node_modules/@elench/testkit-protocol/dist/index.d.ts +190 -0
  113. package/node_modules/@elench/testkit-protocol/dist/index.d.ts.map +1 -0
  114. package/node_modules/@elench/testkit-protocol/dist/index.js +296 -0
  115. package/node_modules/@elench/testkit-protocol/dist/index.js.map +1 -0
  116. package/node_modules/@elench/testkit-protocol/package.json +14 -7
  117. package/node_modules/@elench/ts-analysis/dist/callables.d.ts +8 -0
  118. package/node_modules/@elench/ts-analysis/dist/callables.d.ts.map +1 -0
  119. package/node_modules/@elench/ts-analysis/dist/callables.js +126 -0
  120. package/node_modules/@elench/ts-analysis/dist/callables.js.map +1 -0
  121. package/node_modules/@elench/ts-analysis/dist/exports.d.ts +6 -0
  122. package/node_modules/@elench/ts-analysis/dist/exports.d.ts.map +1 -0
  123. package/node_modules/@elench/ts-analysis/dist/exports.js +70 -0
  124. package/node_modules/@elench/ts-analysis/dist/exports.js.map +1 -0
  125. package/node_modules/@elench/ts-analysis/dist/index.d.ts +10 -0
  126. package/node_modules/@elench/ts-analysis/dist/index.d.ts.map +1 -0
  127. package/node_modules/@elench/ts-analysis/{src/index.mjs → dist/index.js} +9 -14
  128. package/node_modules/@elench/ts-analysis/dist/index.js.map +1 -0
  129. package/node_modules/@elench/ts-analysis/dist/jsx.d.ts +9 -0
  130. package/node_modules/@elench/ts-analysis/dist/jsx.d.ts.map +1 -0
  131. package/node_modules/@elench/ts-analysis/dist/jsx.js +68 -0
  132. package/node_modules/@elench/ts-analysis/dist/jsx.js.map +1 -0
  133. package/node_modules/@elench/ts-analysis/dist/project.d.ts +5 -0
  134. package/node_modules/@elench/ts-analysis/dist/project.d.ts.map +1 -0
  135. package/node_modules/@elench/ts-analysis/dist/project.js +90 -0
  136. package/node_modules/@elench/ts-analysis/dist/project.js.map +1 -0
  137. package/node_modules/@elench/ts-analysis/dist/requests.d.ts +6 -0
  138. package/node_modules/@elench/ts-analysis/dist/requests.d.ts.map +1 -0
  139. package/node_modules/@elench/ts-analysis/dist/requests.js +140 -0
  140. package/node_modules/@elench/ts-analysis/dist/requests.js.map +1 -0
  141. package/node_modules/@elench/ts-analysis/dist/resolution.d.ts +4 -0
  142. package/node_modules/@elench/ts-analysis/dist/resolution.d.ts.map +1 -0
  143. package/node_modules/@elench/ts-analysis/dist/resolution.js +53 -0
  144. package/node_modules/@elench/ts-analysis/dist/resolution.js.map +1 -0
  145. package/node_modules/@elench/ts-analysis/dist/shared.d.ts +6 -0
  146. package/node_modules/@elench/ts-analysis/dist/shared.d.ts.map +1 -0
  147. package/node_modules/@elench/ts-analysis/dist/shared.js +31 -0
  148. package/node_modules/@elench/ts-analysis/dist/shared.js.map +1 -0
  149. package/node_modules/@elench/ts-analysis/dist/syntax.d.ts +7 -0
  150. package/node_modules/@elench/ts-analysis/dist/syntax.d.ts.map +1 -0
  151. package/node_modules/@elench/ts-analysis/dist/syntax.js +27 -0
  152. package/node_modules/@elench/ts-analysis/dist/syntax.js.map +1 -0
  153. package/node_modules/@elench/ts-analysis/dist/types.d.ts +58 -0
  154. package/node_modules/@elench/ts-analysis/dist/types.d.ts.map +1 -0
  155. package/node_modules/@elench/ts-analysis/dist/types.js +2 -0
  156. package/node_modules/@elench/ts-analysis/dist/types.js.map +1 -0
  157. package/node_modules/@elench/ts-analysis/package.json +18 -2
  158. package/node_modules/typescript/LICENSE.txt +55 -0
  159. package/node_modules/typescript/README.md +50 -0
  160. package/node_modules/typescript/SECURITY.md +41 -0
  161. package/node_modules/typescript/ThirdPartyNoticeText.txt +193 -0
  162. package/node_modules/typescript/bin/tsc +2 -0
  163. package/node_modules/typescript/bin/tsserver +2 -0
  164. package/node_modules/typescript/lib/_tsc.js +133818 -0
  165. package/node_modules/typescript/lib/_tsserver.js +659 -0
  166. package/node_modules/typescript/lib/_typingsInstaller.js +222 -0
  167. package/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +2122 -0
  168. package/node_modules/typescript/lib/de/diagnosticMessages.generated.json +2122 -0
  169. package/node_modules/typescript/lib/es/diagnosticMessages.generated.json +2122 -0
  170. package/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +2122 -0
  171. package/node_modules/typescript/lib/it/diagnosticMessages.generated.json +2122 -0
  172. package/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +2122 -0
  173. package/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +2122 -0
  174. package/node_modules/typescript/lib/lib.d.ts +22 -0
  175. package/node_modules/typescript/lib/lib.decorators.d.ts +384 -0
  176. package/node_modules/typescript/lib/lib.decorators.legacy.d.ts +22 -0
  177. package/node_modules/typescript/lib/lib.dom.asynciterable.d.ts +41 -0
  178. package/node_modules/typescript/lib/lib.dom.d.ts +39429 -0
  179. package/node_modules/typescript/lib/lib.dom.iterable.d.ts +571 -0
  180. package/node_modules/typescript/lib/lib.es2015.collection.d.ts +147 -0
  181. package/node_modules/typescript/lib/lib.es2015.core.d.ts +597 -0
  182. package/node_modules/typescript/lib/lib.es2015.d.ts +28 -0
  183. package/node_modules/typescript/lib/lib.es2015.generator.d.ts +77 -0
  184. package/node_modules/typescript/lib/lib.es2015.iterable.d.ts +605 -0
  185. package/node_modules/typescript/lib/lib.es2015.promise.d.ts +81 -0
  186. package/node_modules/typescript/lib/lib.es2015.proxy.d.ts +128 -0
  187. package/node_modules/typescript/lib/lib.es2015.reflect.d.ts +144 -0
  188. package/node_modules/typescript/lib/lib.es2015.symbol.d.ts +46 -0
  189. package/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +326 -0
  190. package/node_modules/typescript/lib/lib.es2016.array.include.d.ts +116 -0
  191. package/node_modules/typescript/lib/lib.es2016.d.ts +21 -0
  192. package/node_modules/typescript/lib/lib.es2016.full.d.ts +23 -0
  193. package/node_modules/typescript/lib/lib.es2016.intl.d.ts +31 -0
  194. package/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts +21 -0
  195. package/node_modules/typescript/lib/lib.es2017.d.ts +26 -0
  196. package/node_modules/typescript/lib/lib.es2017.date.d.ts +31 -0
  197. package/node_modules/typescript/lib/lib.es2017.full.d.ts +23 -0
  198. package/node_modules/typescript/lib/lib.es2017.intl.d.ts +44 -0
  199. package/node_modules/typescript/lib/lib.es2017.object.d.ts +49 -0
  200. package/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +135 -0
  201. package/node_modules/typescript/lib/lib.es2017.string.d.ts +45 -0
  202. package/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts +53 -0
  203. package/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts +77 -0
  204. package/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts +53 -0
  205. package/node_modules/typescript/lib/lib.es2018.d.ts +24 -0
  206. package/node_modules/typescript/lib/lib.es2018.full.d.ts +24 -0
  207. package/node_modules/typescript/lib/lib.es2018.intl.d.ts +83 -0
  208. package/node_modules/typescript/lib/lib.es2018.promise.d.ts +30 -0
  209. package/node_modules/typescript/lib/lib.es2018.regexp.d.ts +37 -0
  210. package/node_modules/typescript/lib/lib.es2019.array.d.ts +79 -0
  211. package/node_modules/typescript/lib/lib.es2019.d.ts +24 -0
  212. package/node_modules/typescript/lib/lib.es2019.full.d.ts +24 -0
  213. package/node_modules/typescript/lib/lib.es2019.intl.d.ts +23 -0
  214. package/node_modules/typescript/lib/lib.es2019.object.d.ts +33 -0
  215. package/node_modules/typescript/lib/lib.es2019.string.d.ts +37 -0
  216. package/node_modules/typescript/lib/lib.es2019.symbol.d.ts +24 -0
  217. package/node_modules/typescript/lib/lib.es2020.bigint.d.ts +765 -0
  218. package/node_modules/typescript/lib/lib.es2020.d.ts +27 -0
  219. package/node_modules/typescript/lib/lib.es2020.date.d.ts +42 -0
  220. package/node_modules/typescript/lib/lib.es2020.full.d.ts +24 -0
  221. package/node_modules/typescript/lib/lib.es2020.intl.d.ts +474 -0
  222. package/node_modules/typescript/lib/lib.es2020.number.d.ts +28 -0
  223. package/node_modules/typescript/lib/lib.es2020.promise.d.ts +47 -0
  224. package/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts +99 -0
  225. package/node_modules/typescript/lib/lib.es2020.string.d.ts +44 -0
  226. package/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts +41 -0
  227. package/node_modules/typescript/lib/lib.es2021.d.ts +23 -0
  228. package/node_modules/typescript/lib/lib.es2021.full.d.ts +24 -0
  229. package/node_modules/typescript/lib/lib.es2021.intl.d.ts +166 -0
  230. package/node_modules/typescript/lib/lib.es2021.promise.d.ts +48 -0
  231. package/node_modules/typescript/lib/lib.es2021.string.d.ts +33 -0
  232. package/node_modules/typescript/lib/lib.es2021.weakref.d.ts +78 -0
  233. package/node_modules/typescript/lib/lib.es2022.array.d.ts +121 -0
  234. package/node_modules/typescript/lib/lib.es2022.d.ts +25 -0
  235. package/node_modules/typescript/lib/lib.es2022.error.d.ts +75 -0
  236. package/node_modules/typescript/lib/lib.es2022.full.d.ts +24 -0
  237. package/node_modules/typescript/lib/lib.es2022.intl.d.ts +145 -0
  238. package/node_modules/typescript/lib/lib.es2022.object.d.ts +26 -0
  239. package/node_modules/typescript/lib/lib.es2022.regexp.d.ts +39 -0
  240. package/node_modules/typescript/lib/lib.es2022.string.d.ts +25 -0
  241. package/node_modules/typescript/lib/lib.es2023.array.d.ts +924 -0
  242. package/node_modules/typescript/lib/lib.es2023.collection.d.ts +21 -0
  243. package/node_modules/typescript/lib/lib.es2023.d.ts +22 -0
  244. package/node_modules/typescript/lib/lib.es2023.full.d.ts +24 -0
  245. package/node_modules/typescript/lib/lib.es2023.intl.d.ts +56 -0
  246. package/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts +65 -0
  247. package/node_modules/typescript/lib/lib.es2024.collection.d.ts +29 -0
  248. package/node_modules/typescript/lib/lib.es2024.d.ts +26 -0
  249. package/node_modules/typescript/lib/lib.es2024.full.d.ts +24 -0
  250. package/node_modules/typescript/lib/lib.es2024.object.d.ts +29 -0
  251. package/node_modules/typescript/lib/lib.es2024.promise.d.ts +35 -0
  252. package/node_modules/typescript/lib/lib.es2024.regexp.d.ts +25 -0
  253. package/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts +68 -0
  254. package/node_modules/typescript/lib/lib.es2024.string.d.ts +29 -0
  255. package/node_modules/typescript/lib/lib.es5.d.ts +4601 -0
  256. package/node_modules/typescript/lib/lib.es6.d.ts +23 -0
  257. package/node_modules/typescript/lib/lib.esnext.array.d.ts +35 -0
  258. package/node_modules/typescript/lib/lib.esnext.collection.d.ts +96 -0
  259. package/node_modules/typescript/lib/lib.esnext.d.ts +29 -0
  260. package/node_modules/typescript/lib/lib.esnext.decorators.d.ts +28 -0
  261. package/node_modules/typescript/lib/lib.esnext.disposable.d.ts +193 -0
  262. package/node_modules/typescript/lib/lib.esnext.error.d.ts +24 -0
  263. package/node_modules/typescript/lib/lib.esnext.float16.d.ts +445 -0
  264. package/node_modules/typescript/lib/lib.esnext.full.d.ts +24 -0
  265. package/node_modules/typescript/lib/lib.esnext.intl.d.ts +21 -0
  266. package/node_modules/typescript/lib/lib.esnext.iterator.d.ts +148 -0
  267. package/node_modules/typescript/lib/lib.esnext.promise.d.ts +34 -0
  268. package/node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts +25 -0
  269. package/node_modules/typescript/lib/lib.scripthost.d.ts +322 -0
  270. package/node_modules/typescript/lib/lib.webworker.asynciterable.d.ts +41 -0
  271. package/node_modules/typescript/lib/lib.webworker.d.ts +13150 -0
  272. package/node_modules/typescript/lib/lib.webworker.importscripts.d.ts +23 -0
  273. package/node_modules/typescript/lib/lib.webworker.iterable.d.ts +340 -0
  274. package/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +2122 -0
  275. package/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +2122 -0
  276. package/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +2122 -0
  277. package/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +2122 -0
  278. package/node_modules/typescript/lib/tsc.js +8 -0
  279. package/node_modules/typescript/lib/tsserver.js +8 -0
  280. package/node_modules/typescript/lib/tsserverlibrary.d.ts +17 -0
  281. package/node_modules/typescript/lib/tsserverlibrary.js +21 -0
  282. package/node_modules/typescript/lib/typesMap.json +497 -0
  283. package/node_modules/typescript/lib/typescript.d.ts +11437 -0
  284. package/node_modules/typescript/lib/typescript.js +200276 -0
  285. package/node_modules/typescript/lib/typingsInstaller.js +8 -0
  286. package/node_modules/typescript/lib/watchGuard.js +53 -0
  287. package/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +2122 -0
  288. package/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +2122 -0
  289. package/node_modules/typescript/package.json +120 -0
  290. package/package.json +12 -9
  291. package/lib/coverage/fs-walk.mjs +0 -64
  292. package/node_modules/@elench/next-analysis/src/api-routes.mjs +0 -81
  293. package/node_modules/@elench/next-analysis/src/api-routes.test.mjs +0 -22
  294. package/node_modules/@elench/next-analysis/src/app-root.mjs +0 -7
  295. package/node_modules/@elench/next-analysis/src/backend-links.mjs +0 -31
  296. package/node_modules/@elench/next-analysis/src/index.mjs +0 -21
  297. package/node_modules/@elench/next-analysis/src/pages.mjs +0 -68
  298. package/node_modules/@elench/next-analysis/src/project.mjs +0 -94
  299. package/node_modules/@elench/next-analysis/src/project.test.mjs +0 -35
  300. package/node_modules/@elench/next-analysis/src/route-tree.mjs +0 -621
  301. package/node_modules/@elench/next-analysis/src/routes.mjs +0 -41
  302. package/node_modules/@elench/next-analysis/src/routes.test.mjs +0 -25
  303. package/node_modules/@elench/next-analysis/src/server-actions.mjs +0 -53
  304. package/node_modules/@elench/next-analysis/src/server-actions.test.mjs +0 -37
  305. package/node_modules/@elench/next-analysis/src/shared.mjs +0 -209
  306. package/node_modules/@elench/next-analysis/src/swc.mjs +0 -388
  307. package/node_modules/@elench/testkit-bridge/src/index.mjs +0 -583
  308. package/node_modules/@elench/testkit-bridge/src/index.test.mjs +0 -409
  309. package/node_modules/@elench/testkit-protocol/src/index.d.ts +0 -231
  310. package/node_modules/@elench/testkit-protocol/src/index.mjs +0 -265
  311. package/node_modules/@elench/testkit-protocol/src/index.test.mjs +0 -242
  312. package/node_modules/@elench/ts-analysis/src/callables.mjs +0 -135
  313. package/node_modules/@elench/ts-analysis/src/callables.test.mjs +0 -55
  314. package/node_modules/@elench/ts-analysis/src/exports.mjs +0 -69
  315. package/node_modules/@elench/ts-analysis/src/exports.test.mjs +0 -50
  316. package/node_modules/@elench/ts-analysis/src/jsx.mjs +0 -69
  317. package/node_modules/@elench/ts-analysis/src/jsx.test.mjs +0 -43
  318. package/node_modules/@elench/ts-analysis/src/project.mjs +0 -100
  319. package/node_modules/@elench/ts-analysis/src/project.test.mjs +0 -54
  320. package/node_modules/@elench/ts-analysis/src/requests.mjs +0 -141
  321. package/node_modules/@elench/ts-analysis/src/requests.test.mjs +0 -35
  322. package/node_modules/@elench/ts-analysis/src/resolution.mjs +0 -53
  323. package/node_modules/@elench/ts-analysis/src/shared.mjs +0 -32
  324. package/node_modules/@elench/ts-analysis/src/syntax.mjs +0 -27
@@ -0,0 +1,178 @@
1
+ import fs from "fs";
2
+ import path from "path";
3
+
4
+ export function normalizeOptionalString(value) {
5
+ if (typeof value !== "string") return null;
6
+ const normalized = value.trim();
7
+ return normalized.length > 0 ? normalized : null;
8
+ }
9
+
10
+ export function normalizeConfiguredInputs(value, label) {
11
+ if (value == null) return [];
12
+ if (!Array.isArray(value)) {
13
+ throw new Error(`${label}.inputs must be an array`);
14
+ }
15
+
16
+ return value.map((entry, index) => {
17
+ const normalized = normalizeOptionalString(entry);
18
+ if (!normalized) {
19
+ throw new Error(`${label}.inputs[${index}] must be a non-empty string`);
20
+ }
21
+ return normalized;
22
+ });
23
+ }
24
+
25
+ export function normalizeConfiguredStepInputs(value, label) {
26
+ if (value == null) return [];
27
+ if (!Array.isArray(value)) {
28
+ throw new Error(`${label}.inputs must be an array`);
29
+ }
30
+
31
+ return value.map((entry, index) => {
32
+ const normalized = normalizeOptionalString(entry);
33
+ if (!normalized) {
34
+ throw new Error(`${label}.inputs[${index}] must be a non-empty string`);
35
+ }
36
+ return normalized;
37
+ });
38
+ }
39
+
40
+ export function normalizeConfiguredSteps(value, label) {
41
+ if (value == null) return [];
42
+ if (!Array.isArray(value)) {
43
+ throw new Error(`${label} must be an array`);
44
+ }
45
+
46
+ return value.map((step, index) => normalizeConfiguredStep(step, `${label}[${index}]`));
47
+ }
48
+
49
+ export function normalizeConfiguredStep(step, label) {
50
+ if (!step || typeof step !== "object") {
51
+ throw new Error(`${label} must be an object`);
52
+ }
53
+
54
+ const kind = normalizeOptionalString(step.kind);
55
+ if (kind === "command") {
56
+ const cmd = normalizeOptionalString(step.cmd);
57
+ if (!cmd) throw new Error(`${label}.cmd must be a non-empty string`);
58
+ return {
59
+ kind,
60
+ cmd,
61
+ cwd: normalizeOptionalString(step.cwd),
62
+ inputs: normalizeConfiguredStepInputs(step.inputs, label),
63
+ };
64
+ }
65
+ if (kind === "sql-file") {
66
+ const filePath = normalizeOptionalString(step.path);
67
+ if (!filePath) throw new Error(`${label}.path must be a non-empty string`);
68
+ return {
69
+ kind,
70
+ path: filePath,
71
+ cwd: normalizeOptionalString(step.cwd),
72
+ inputs: normalizeConfiguredStepInputs(step.inputs, label),
73
+ };
74
+ }
75
+ if (kind === "module") {
76
+ const specifier = normalizeOptionalString(step.specifier);
77
+ if (!specifier) throw new Error(`${label}.specifier must be a non-empty string`);
78
+ return {
79
+ kind,
80
+ specifier,
81
+ cwd: normalizeOptionalString(step.cwd),
82
+ inputs: normalizeConfiguredStepInputs(step.inputs, label),
83
+ };
84
+ }
85
+
86
+ throw new Error(`${label}.kind must be one of: command, sql-file, module`);
87
+ }
88
+
89
+ export function parseModuleSpecifier(specifier) {
90
+ const [modulePath, exportName] = String(specifier).split("#", 2);
91
+ return {
92
+ modulePath,
93
+ exportName: exportName || "default",
94
+ };
95
+ }
96
+
97
+ export function resolveConfiguredCwd(productDir, stepCwd) {
98
+ return path.resolve(productDir, stepCwd || ".");
99
+ }
100
+
101
+ export function resolveConfiguredPath(productDir, stepCwd, targetPath) {
102
+ return path.resolve(resolveConfiguredCwd(productDir, stepCwd), targetPath);
103
+ }
104
+
105
+ export function collectConfiguredInputs(productDir, { inputs = [], steps = [] } = {}) {
106
+ const collected = new Set();
107
+ for (const input of inputs) {
108
+ collected.add(resolveConfiguredPath(productDir, null, input));
109
+ }
110
+ for (const step of steps) {
111
+ if (step.kind === "sql-file") {
112
+ collected.add(resolveConfiguredPath(productDir, step.cwd, step.path));
113
+ }
114
+ if (step.kind === "module") {
115
+ collected.add(resolveConfiguredPath(productDir, step.cwd, parseModuleSpecifier(step.specifier).modulePath));
116
+ }
117
+ for (const input of step.inputs || []) {
118
+ collected.add(resolveConfiguredPath(productDir, step.cwd, input));
119
+ }
120
+ }
121
+ return [...collected].sort();
122
+ }
123
+
124
+ export function summarizeConfiguredStep(step) {
125
+ if (step.kind === "command") return `command: ${String(step.cmd).trim()}`;
126
+ if (step.kind === "sql-file") return `sql: ${step.path}`;
127
+ if (step.kind === "module") return `module: ${step.specifier}`;
128
+ return step.kind;
129
+ }
130
+
131
+ export function finalizeConfiguredInputs(inputs = [], transform) {
132
+ return inputs.map((input) => transform(input));
133
+ }
134
+
135
+ export function finalizeConfiguredStep(step, transform) {
136
+ return {
137
+ ...step,
138
+ ...(typeof step.cmd === "string" ? { cmd: transform(step.cmd) } : {}),
139
+ ...(typeof step.cwd === "string" ? { cwd: transform(step.cwd) } : {}),
140
+ ...(typeof step.path === "string" ? { path: transform(step.path) } : {}),
141
+ ...(typeof step.specifier === "string" ? { specifier: transform(step.specifier) } : {}),
142
+ inputs: finalizeConfiguredInputs(step.inputs || [], transform),
143
+ };
144
+ }
145
+
146
+ export function finalizeConfiguredSteps(steps = [], transform) {
147
+ return steps.map((step) => finalizeConfiguredStep(step, transform));
148
+ }
149
+
150
+ export function validateConfiguredCollection({ productDir, label, inputs = [], steps = [] }) {
151
+ for (const input of inputs) {
152
+ ensureExistingPath(resolveConfiguredPath(productDir, null, input), `${label} input`);
153
+ }
154
+
155
+ for (const step of steps) {
156
+ if (step.cwd) {
157
+ ensureExistingPath(resolveConfiguredCwd(productDir, step.cwd), `${label} step cwd`);
158
+ }
159
+ if (step.kind === "sql-file") {
160
+ ensureExistingPath(resolveConfiguredPath(productDir, step.cwd, step.path), `${label} sql file`);
161
+ }
162
+ if (step.kind === "module") {
163
+ ensureExistingPath(
164
+ resolveConfiguredPath(productDir, step.cwd, parseModuleSpecifier(step.specifier).modulePath),
165
+ `${label} module`
166
+ );
167
+ }
168
+ for (const input of step.inputs || []) {
169
+ ensureExistingPath(resolveConfiguredPath(productDir, step.cwd, input), `${label} step input`);
170
+ }
171
+ }
172
+ }
173
+
174
+ function ensureExistingPath(absolutePath, label) {
175
+ if (!fs.existsSync(absolutePath)) {
176
+ throw new Error(`${label} does not exist: ${absolutePath}`);
177
+ }
178
+ }
@@ -0,0 +1,73 @@
1
+ import fs from "fs";
2
+ import os from "os";
3
+ import path from "path";
4
+ import { afterEach, describe, expect, it } from "vitest";
5
+ import {
6
+ collectConfiguredInputs,
7
+ finalizeConfiguredStep,
8
+ normalizeConfiguredStep,
9
+ parseModuleSpecifier,
10
+ validateConfiguredCollection,
11
+ } from "./configured-steps.mjs";
12
+
13
+ const tempDirs = [];
14
+
15
+ afterEach(() => {
16
+ for (const dir of tempDirs.splice(0)) {
17
+ fs.rmSync(dir, { recursive: true, force: true });
18
+ }
19
+ });
20
+
21
+ describe("shared configured steps", () => {
22
+ it("normalizes and finalizes configured steps", () => {
23
+ const normalized = normalizeConfiguredStep(
24
+ { kind: "module", specifier: "./seed.mjs#run", cwd: "db", inputs: ["schema.sql"] },
25
+ 'Service "api" database.template.seed[0]'
26
+ );
27
+
28
+ expect(normalized).toEqual({
29
+ kind: "module",
30
+ specifier: "./seed.mjs#run",
31
+ cwd: "db",
32
+ inputs: ["schema.sql"],
33
+ });
34
+ expect(parseModuleSpecifier(normalized.specifier)).toEqual({
35
+ modulePath: "./seed.mjs",
36
+ exportName: "run",
37
+ });
38
+ expect(finalizeConfiguredStep(normalized, (value) => value.toUpperCase())).toEqual({
39
+ kind: "module",
40
+ specifier: "./SEED.MJS#RUN",
41
+ cwd: "DB",
42
+ inputs: ["SCHEMA.SQL"],
43
+ });
44
+ });
45
+
46
+ it("collects and validates configured input paths", () => {
47
+ const productDir = fs.mkdtempSync(path.join(os.tmpdir(), "testkit-configured-steps-"));
48
+ tempDirs.push(productDir);
49
+ fs.mkdirSync(path.join(productDir, "db"), { recursive: true });
50
+ fs.writeFileSync(path.join(productDir, "db", "schema.sql"), "-- schema\n");
51
+ fs.writeFileSync(path.join(productDir, "db", "seed.mjs"), "export default async function run() {}\n");
52
+
53
+ const collection = {
54
+ inputs: ["db/schema.sql"],
55
+ steps: [
56
+ { kind: "sql-file", path: "schema.sql", cwd: "db", inputs: [] },
57
+ { kind: "module", specifier: "./seed.mjs#run", cwd: "db", inputs: [] },
58
+ ],
59
+ };
60
+
61
+ expect(collectConfiguredInputs(productDir, collection)).toEqual([
62
+ path.join(productDir, "db", "schema.sql"),
63
+ path.join(productDir, "db", "seed.mjs"),
64
+ ]);
65
+ expect(() =>
66
+ validateConfiguredCollection({
67
+ productDir,
68
+ label: 'Service "api" runtime.prepare',
69
+ ...collection,
70
+ })
71
+ ).not.toThrow();
72
+ });
73
+ });
@@ -0,0 +1,74 @@
1
+ import {
2
+ DEFAULT_FILE_TIMEOUT_SECONDS,
3
+ normalizeFileTimeoutSeconds,
4
+ parseFileTimeoutOption,
5
+ } from "./file-timeout.mjs";
6
+
7
+ export const DATABASE_BINDINGS = new Set(["shared", "per-runtime"]);
8
+
9
+ export { DEFAULT_FILE_TIMEOUT_SECONDS, parseFileTimeoutOption };
10
+
11
+ export function parseWorkersOption(value) {
12
+ return parsePositiveInteger(value, "--workers");
13
+ }
14
+
15
+ export function parseRuntimeInstancesOption(value, label = "runtime.instances") {
16
+ return parsePositiveInteger(value, label);
17
+ }
18
+
19
+ export function normalizeRuntimeInstances(value, label = "runtime.instances") {
20
+ return normalizePositiveInteger(value, label);
21
+ }
22
+
23
+ export function parseRuntimeMaxConcurrentTasksOption(value, label = "runtime.maxConcurrentTasks") {
24
+ return parsePositiveInteger(value, label);
25
+ }
26
+
27
+ export function normalizeRuntimeMaxConcurrentTasks(value, label = "runtime.maxConcurrentTasks") {
28
+ if (value === undefined || value === null) {
29
+ return Number.POSITIVE_INFINITY;
30
+ }
31
+ return normalizePositiveInteger(value, label);
32
+ }
33
+
34
+ export function normalizeDatabaseBinding(value, label = "database.binding") {
35
+ const normalized = String(value || "").trim();
36
+ if (!DATABASE_BINDINGS.has(normalized)) {
37
+ throw new Error(`Invalid ${label} value "${value}". Expected one of: shared, per-runtime.`);
38
+ }
39
+ return normalized;
40
+ }
41
+
42
+ export function resolveExecutionConfig({ cli = {}, repo = {} } = {}) {
43
+ return normalizeExecutionConfig({
44
+ workers: cli.workers ?? repo.workers ?? 1,
45
+ fileTimeoutSeconds: cli.fileTimeoutSeconds ?? repo.fileTimeoutSeconds ?? DEFAULT_FILE_TIMEOUT_SECONDS,
46
+ });
47
+ }
48
+
49
+ export function normalizeExecutionConfig(input = {}) {
50
+ return {
51
+ workers: normalizePositiveInteger(input.workers ?? 1, "execution.workers"),
52
+ fileTimeoutSeconds: normalizeFileTimeoutSeconds(input.fileTimeoutSeconds ?? DEFAULT_FILE_TIMEOUT_SECONDS),
53
+ };
54
+ }
55
+
56
+ export function buildRuntimeIds(count) {
57
+ return Array.from({ length: count }, (_unused, index) => `runtime-${index + 1}`);
58
+ }
59
+
60
+ function parsePositiveInteger(value, label) {
61
+ const parsed = Number.parseInt(String(value), 10);
62
+ if (!Number.isInteger(parsed) || parsed <= 0) {
63
+ throw new Error(`Invalid ${label} value "${value}". Expected a positive integer.`);
64
+ }
65
+ return parsed;
66
+ }
67
+
68
+ function normalizePositiveInteger(value, label) {
69
+ const parsed = Number(value);
70
+ if (!Number.isInteger(parsed) || parsed <= 0) {
71
+ throw new Error(`${label} must be a positive integer.`);
72
+ }
73
+ return parsed;
74
+ }
@@ -0,0 +1,26 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import {
3
+ normalizeDatabaseBinding,
4
+ normalizeExecutionConfig,
5
+ normalizeRuntimeMaxConcurrentTasks,
6
+ resolveExecutionConfig,
7
+ } from "./execution-schema.mjs";
8
+
9
+ describe("shared execution schema", () => {
10
+ it("normalizes execution config and repo/cli overrides", () => {
11
+ expect(normalizeExecutionConfig({ workers: 2, fileTimeoutSeconds: 30 })).toEqual({
12
+ workers: 2,
13
+ fileTimeoutSeconds: 30,
14
+ });
15
+ expect(resolveExecutionConfig({ cli: { workers: 3 }, repo: { workers: 2, fileTimeoutSeconds: 45 } })).toEqual({
16
+ workers: 3,
17
+ fileTimeoutSeconds: 45,
18
+ });
19
+ });
20
+
21
+ it("validates runtime concurrency and database binding", () => {
22
+ expect(normalizeRuntimeMaxConcurrentTasks(undefined)).toBe(Number.POSITIVE_INFINITY);
23
+ expect(normalizeDatabaseBinding("shared")).toBe("shared");
24
+ expect(() => normalizeDatabaseBinding("legacy")).toThrow('Invalid database.binding value "legacy"');
25
+ });
26
+ });
@@ -0,0 +1,7 @@
1
+ import type { NextApiRouteEntry } from "./types.js";
2
+ export declare function discoverApiRoutes({ rootDir, appRoot, exclude }: {
3
+ rootDir: string;
4
+ appRoot: string;
5
+ exclude?: string[];
6
+ }): NextApiRouteEntry[];
7
+ //# sourceMappingURL=api-routes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-routes.d.ts","sourceRoot":"","sources":["../src/api-routes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAcpD,wBAAgB,iBAAiB,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,OAAY,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,iBAAiB,EAAE,CAqCnJ"}
@@ -0,0 +1,66 @@
1
+ import * as path from "node:path";
2
+ import { extractBackendRefs } from "./backend-links.js";
3
+ import { routeFromApiFile } from "./routes.js";
4
+ import { directoryExists, HTTP_METHODS, isRouteHandlerFile, normalizePath, readFileIfExists, toApiRequestPath, walkFiles, } from "./shared.js";
5
+ import { parseModule } from "./swc.js";
6
+ export function discoverApiRoutes({ rootDir, appRoot, exclude = [] }) {
7
+ const apiRoot = path.join(appRoot, "api");
8
+ if (!directoryExists(apiRoot))
9
+ return [];
10
+ const routeFiles = walkFiles(apiRoot, { baseDir: rootDir, exclude }).filter(isRouteHandlerFile);
11
+ const entries = [];
12
+ for (const absolutePath of routeFiles) {
13
+ const filePath = normalizePath(path.relative(rootDir, absolutePath));
14
+ const route = routeFromApiFile(appRoot, absolutePath);
15
+ const requestPath = toApiRequestPath(route);
16
+ const content = readFileIfExists(absolutePath);
17
+ if (!content)
18
+ continue;
19
+ const ast = parseModule(content, filePath);
20
+ const backendRefs = extractBackendRefs({
21
+ ast,
22
+ rootDir,
23
+ filePath,
24
+ readSourceFile: (targetPath) => readFileIfExists(targetPath),
25
+ });
26
+ const exportedMethods = extractExportedMethods(ast);
27
+ for (const method of exportedMethods) {
28
+ entries.push({
29
+ id: `api:${method}:${requestPath}`,
30
+ kind: "api_route",
31
+ route,
32
+ requestPath,
33
+ method,
34
+ filePath,
35
+ backendRefs,
36
+ });
37
+ }
38
+ }
39
+ return entries.sort((left, right) => {
40
+ return left.requestPath.localeCompare(right.requestPath) || left.method.localeCompare(right.method);
41
+ });
42
+ }
43
+ function extractExportedMethods(ast) {
44
+ const methods = [];
45
+ for (const statement of ast.body || []) {
46
+ if (statement.type !== "ExportDeclaration")
47
+ continue;
48
+ const declaration = statement.declaration;
49
+ if (declaration?.type === "FunctionDeclaration" && declaration.identifier) {
50
+ const name = declaration.identifier.value.toUpperCase();
51
+ if (HTTP_METHODS.includes(name))
52
+ methods.push(name);
53
+ }
54
+ else if (declaration?.type === "VariableDeclaration") {
55
+ for (const declarator of declaration.declarations || []) {
56
+ if (declarator.id?.type !== "Identifier")
57
+ continue;
58
+ const name = declarator.id.value.toUpperCase();
59
+ if (HTTP_METHODS.includes(name))
60
+ methods.push(name);
61
+ }
62
+ }
63
+ }
64
+ return [...new Set(methods)];
65
+ }
66
+ //# sourceMappingURL=api-routes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-routes.js","sourceRoot":"","sources":["../src/api-routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EACL,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,SAAS,GACV,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,MAAM,UAAU,iBAAiB,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,EAA4D;IAC5H,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC1C,IAAI,C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sourceMappingURL=app-root.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-root.d.ts","sourceRoot":"","sources":["../src/app-root.ts"],"names":[],"mappings":"AAGA,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAG9D"}
@@ -0,0 +1,7 @@
1
+ import * as path from "node:path";
2
+ import { directoryExists } from "./shared.js";
3
+ export function findNextAppRoot(rootDir) {
4
+ const candidates = [path.join(rootDir, "app"), path.join(rootDir, "src", "app")];
5
+ return candidates.find((candidate) => directoryExists(candidate)) || null;
6
+ }
7
+ //# sourceMappingURL=app-root.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-root.js","sourceRoot":"","sources":["../src/app-root.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,UAAU,eAAe,CAAC,OAAe;IAC7C,MAAM,UAAU,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;IACjF,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,IAAI,IAAI,CAAC;AAC5E,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { BackendRef } from "./types.js";
2
+ export declare function extractBackendRefs({ ast, rootDir, filePath, readSourceFile, }: {
3
+ ast: any;
4
+ rootDir: string;
5
+ filePath: string;
6
+ readSourceFile: (filePath: string) => string | null;
7
+ }): BackendRef[];
8
+ //# sourceMappingURL=backend-links.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"backend-links.d.ts","sourceRoot":"","sources":["../src/backend-links.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAI7C,wBAAgB,kBAAkB,CAAC,EACjC,GAAG,EACH,OAAO,EACP,QAAQ,EACR,cAAc,GACf,EAAE;IACD,GAAG,EAAE,GAAG,CAAC;IACT,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CACrD,GAAG,UAAU,EAAE,CAiBf"}
@@ -0,0 +1,30 @@
1
+ import { isBackendSpecifier, modulePathKey, normalizePath } from "./shared.js";
2
+ import { collectImports } from "./swc.js";
3
+ export function extractBackendRefs({ ast, rootDir, filePath, readSourceFile, }) {
4
+ const imports = collectImports(ast, { rootDir, filePath, readSourceFile });
5
+ const refs = [];
6
+ for (const [localName, imported] of imports.entries()) {
7
+ if (!isBackendSpecifier(imported.specifier))
8
+ continue;
9
+ refs.push({
10
+ id: `server_ref:${modulePathKey(imported.resolvedFilePath || filePath)}#${imported.importedName}`,
11
+ kind: "server_capability",
12
+ importName: localName,
13
+ exportName: imported.importedName,
14
+ modulePath: normalizePath(imported.resolvedFilePath || filePath),
15
+ specifier: imported.specifier,
16
+ });
17
+ }
18
+ return dedupeBackendRefs(refs);
19
+ }
20
+ function dedupeBackendRefs(entries) {
21
+ const seen = new Set();
22
+ return entries.filter((entry) => {
23
+ const key = `${entry.modulePath}#${entry.exportName}`;
24
+ if (seen.has(key))
25
+ return false;
26
+ seen.add(key);
27
+ return true;
28
+ });
29
+ }
30
+ //# sourceMappingURL=backend-links.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"backend-links.js","sourceRoot":"","sources":["../src/backend-links.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,MAAM,UAAU,kBAAkB,CAAC,EACjC,GAAG,EACH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extAnalysisProjectOptions, NextApiRouteEntry, NextDiagnostic, NextPageEntry, NextRequestEntry, NextRouteTree, NextServerActionEntry, NextServerActionRef, NextSurfaceEntry, TargetHint, } from "./types.js";
2
+ export { createNextAnalysisProject } from "./project.js";
3
+ export { findNextAppRoot } from "./app-root.js";
4
+ export { discoverPages } from "./pages.js";
5
+ export { discoverApiRoutes } from "./api-routes.js";
6
+ export { discoverServerActions } from "./server-actions.js";
7
+ export { analyzeRouteTree } from "./route-tree.js";
8
+ export { normalizePath, normalizeRoute, normalizeRouteSegments, pageLabelFromRoute, toApiRequestPath, HTTP_METHODS, DYNAMIC_SEGMENT_TOKEN, isBackendSpecifier, isDataSpecifier, modulePathKey, shouldExcludePath, walkFiles, } from "./shared.js";
9
+ export { routeFromAppFile, routeFromApiFile, routePatternMatches, requestPathPatternFromLiteral, } from "./routes.js";
10
+ export { parseModule, extractHttpRequests, extractPlaywrightVisitedRoutes } from "./swc.js";
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,0BAA0B,EAC1B,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,UAAU,GACX,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EACL,aAAa,EACb,cAAc,EACd,sBAAsB,EACtB,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,SAAS,GACV,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,6BAA6B,GAC9B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,8BAA8B,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,10 @@
1
+ export { createNextAnalysisProject } from "./project.js";
2
+ export { findNextAppRoot } from "./app-root.js";
3
+ export { discoverPages } from "./pages.js";
4
+ export { discoverApiRoutes } from "./api-routes.js";
5
+ export { discoverServerActions } from "./server-actions.js";
6
+ export { analyzeRouteTree } from "./route-tree.js";
7
+ export { normalizePath, normalizeRoute, normalizeRouteSegments, pageLabelFromRoute, toApiRequestPath, HTTP_METHODS, DYNAMIC_SEGMENT_TOKEN, isBackendSpecifier, isDataSpecifier, modulePathKey, shouldExcludePath, walkFiles, } from "./shared.js";
8
+ export { routeFromAppFile, routeFromApiFile, routePatternMatches, requestPathPatternFromLiteral, } from "./routes.js";
9
+ export { parseModule, extractHttpRequests, extractPlaywrightVisitedRoutes } from "./swc.js";
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EACL,aAAa,EACb,cAAc,EACd,sBAAsB,EACtB,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,SAAS,GACV,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,6BAA6B,GAC9B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,8BAA8B,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { NextPageEntry } from "./types.js";
2
+ export declare function discoverPages({ rootDir, appRoot, exclude }: {
3
+ rootDir: string;
4
+ appRoot: string;
5
+ exclude?: string[];
6
+ }): NextPageEntry[];
7
+ //# sourceMappingURL=pages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pages.d.ts","sourceRoot":"","sources":["../src/pages.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAWhD,wBAAgB,aAAa,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,OAAY,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,aAAa,EAAE,CAmB3I"}
@@ -0,0 +1,47 @@
1
+ import * as path from "node:path";
2
+ import { compareByRoute, fileExists, isPageFile, normalizePath, pageLabelFromRoute, walkFiles, } from "./shared.js";
3
+ import { routeFromAppFile } from "./routes.js";
4
+ export function discoverPages({ rootDir, appRoot, exclude = [] }) {
5
+ const pageFiles = walkFiles(appRoot, { baseDir: rootDir, exclude }).filter(isPageFile);
6
+ return pageFiles
7
+ .map((absolutePath) => {
8
+ const filePath = normalizePath(path.relative(rootDir, absolutePath));
9
+ const route = routeFromAppFile(appRoot, absolutePath);
10
+ const layoutFiles = collectLayoutFiles(rootDir, appRoot, absolutePath);
11
+ const rootFiles = [...layoutFiles, filePath];
12
+ return {
13
+ id: `page:${route}`,
14
+ kind: "page",
15
+ route,
16
+ label: pageLabelFromRoute(route),
17
+ filePath,
18
+ layoutFiles,
19
+ rootFiles,
20
+ };
21
+ })
22
+ .sort(compareByRoute);
23
+ }
24
+ function collectLayoutFiles(rootDir, appRoot, pageAbsolutePath) {
25
+ const rootFiles = [];
26
+ let currentDir = path.dirname(pageAbsolutePath);
27
+ const absoluteAppRoot = path.resolve(appRoot);
28
+ while (currentDir.startsWith(absoluteAppRoot)) {
29
+ const layoutFile = resolveRouteCompanion(currentDir, "layout");
30
+ if (layoutFile)
31
+ rootFiles.push(normalizePath(path.relative(rootDir, layoutFile)));
32
+ if (currentDir === absoluteAppRoot)
33
+ break;
34
+ currentDir = path.dirname(currentDir);
35
+ }
36
+ return [...new Set(rootFiles.reverse())];
37
+ }
38
+ function resolveRouteCompanion(directoryPath, baseName) {
39
+ const candidates = [
40
+ path.join(directoryPath, `${baseName}.tsx`),
41
+ path.join(directoryPath, `${baseName}.ts`),
42
+ path.join(directoryPath, `${baseName}.jsx`),
43
+ path.join(directoryPath, `${baseName}.js`),
44
+ ];
45
+ return candidates.find((candidate) => fileExists(candidate)) || null;
46
+ }
47
+ //# sourceMappingURL=pages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pages.js","sourceRoot":"","sources":["../src/pages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EACL,cAAc,EACd,UAAU,EACV,UAAU,EACV,aAAa,EACb,kBAAkB,EAClB,SAAS,GACV,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,UAAU,aAAa,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,EAA4D;IACxH,MAAM,SAAS,GA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AU,KAAK,eAAe;YAAE,MAAM;QAC1C,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC;IAED,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED,SAAS,qBAAqB,CAAC,aAAqB,EAAE,QAAgB;IACpE,MAAM,UAAU,GAAG;QACjB,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,GAAG,QAAQ,MAAM,CAAC;QAC3C,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,GAAG,QAAQ,KAAK,CAAC;QAC1C,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,GAAG,QAAQ,MAAM,CAAC;QAC3C,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,GAAG,QAAQ,KAAK,CAAC;KAC3C,CAAC;IACF,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,IAAI,IAAI,CAAC;AACvE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { NextAnalysisProject, NextAnalysisProjectOptions } from "./types.js";
2
+ export declare function createNextAnalysisProject({ rootDir, buildDir, nextConfigPath, exclude, }?: NextAnalysisProjectOptions): NextAnalysisProject;
3
+ //# sourceMappingURL=project.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../src/project.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,mBAAmB,EACnB,0BAA0B,EAM3B,MAAM,YAAY,CAAC;AAgBpB,wBAAgB,yBAAyB,CAAC,EACxC,OAAO,EACP,QAAe,EACf,cAAqB,EACrB,OAAY,GACb,GAAE,0BAA+B,GAAG,mBAAmB,CAwFvD"}