@opensip-cli/graph-typescript 0.1.0

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 (344) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +8 -0
  3. package/README.md +31 -0
  4. package/dist/__tests__/_pipeline.d.ts +40 -0
  5. package/dist/__tests__/_pipeline.d.ts.map +1 -0
  6. package/dist/__tests__/_pipeline.js +67 -0
  7. package/dist/__tests__/_pipeline.js.map +1 -0
  8. package/dist/__tests__/acceptance/_fixture-runner.d.ts +13 -0
  9. package/dist/__tests__/acceptance/_fixture-runner.d.ts.map +1 -0
  10. package/dist/__tests__/acceptance/_fixture-runner.js +55 -0
  11. package/dist/__tests__/acceptance/_fixture-runner.js.map +1 -0
  12. package/dist/__tests__/acceptance/alias-resolution.test.d.ts +8 -0
  13. package/dist/__tests__/acceptance/alias-resolution.test.d.ts.map +1 -0
  14. package/dist/__tests__/acceptance/alias-resolution.test.js +39 -0
  15. package/dist/__tests__/acceptance/alias-resolution.test.js.map +1 -0
  16. package/dist/__tests__/acceptance/arrow-callback-resolution.test.d.ts +8 -0
  17. package/dist/__tests__/acceptance/arrow-callback-resolution.test.d.ts.map +1 -0
  18. package/dist/__tests__/acceptance/arrow-callback-resolution.test.js +33 -0
  19. package/dist/__tests__/acceptance/arrow-callback-resolution.test.js.map +1 -0
  20. package/dist/__tests__/acceptance/constructor-calls.test.d.ts +7 -0
  21. package/dist/__tests__/acceptance/constructor-calls.test.d.ts.map +1 -0
  22. package/dist/__tests__/acceptance/constructor-calls.test.js +36 -0
  23. package/dist/__tests__/acceptance/constructor-calls.test.js.map +1 -0
  24. package/dist/__tests__/acceptance/interface-dispatch.test.d.ts +8 -0
  25. package/dist/__tests__/acceptance/interface-dispatch.test.d.ts.map +1 -0
  26. package/dist/__tests__/acceptance/interface-dispatch.test.js +44 -0
  27. package/dist/__tests__/acceptance/interface-dispatch.test.js.map +1 -0
  28. package/dist/__tests__/acceptance/inventory-completeness.test.d.ts +9 -0
  29. package/dist/__tests__/acceptance/inventory-completeness.test.d.ts.map +1 -0
  30. package/dist/__tests__/acceptance/inventory-completeness.test.js +72 -0
  31. package/dist/__tests__/acceptance/inventory-completeness.test.js.map +1 -0
  32. package/dist/__tests__/acceptance/jsx-resolution.test.d.ts +7 -0
  33. package/dist/__tests__/acceptance/jsx-resolution.test.d.ts.map +1 -0
  34. package/dist/__tests__/acceptance/jsx-resolution.test.js +46 -0
  35. package/dist/__tests__/acceptance/jsx-resolution.test.js.map +1 -0
  36. package/dist/__tests__/acceptance/module-init.test.d.ts +10 -0
  37. package/dist/__tests__/acceptance/module-init.test.d.ts.map +1 -0
  38. package/dist/__tests__/acceptance/module-init.test.js +40 -0
  39. package/dist/__tests__/acceptance/module-init.test.js.map +1 -0
  40. package/dist/__tests__/acceptance/projectdir-normalization.test.d.ts +7 -0
  41. package/dist/__tests__/acceptance/projectdir-normalization.test.d.ts.map +1 -0
  42. package/dist/__tests__/acceptance/projectdir-normalization.test.js +51 -0
  43. package/dist/__tests__/acceptance/projectdir-normalization.test.js.map +1 -0
  44. package/dist/__tests__/body-twin-edges.test.d.ts +12 -0
  45. package/dist/__tests__/body-twin-edges.test.d.ts.map +1 -0
  46. package/dist/__tests__/body-twin-edges.test.js +85 -0
  47. package/dist/__tests__/body-twin-edges.test.js.map +1 -0
  48. package/dist/__tests__/cache-key.test.d.ts +8 -0
  49. package/dist/__tests__/cache-key.test.d.ts.map +1 -0
  50. package/dist/__tests__/cache-key.test.js +86 -0
  51. package/dist/__tests__/cache-key.test.js.map +1 -0
  52. package/dist/__tests__/depends-on-emission.test.d.ts +19 -0
  53. package/dist/__tests__/depends-on-emission.test.d.ts.map +1 -0
  54. package/dist/__tests__/depends-on-emission.test.js +165 -0
  55. package/dist/__tests__/depends-on-emission.test.js.map +1 -0
  56. package/dist/__tests__/discover.test.d.ts +9 -0
  57. package/dist/__tests__/discover.test.d.ts.map +1 -0
  58. package/dist/__tests__/discover.test.js +72 -0
  59. package/dist/__tests__/discover.test.js.map +1 -0
  60. package/dist/__tests__/edge-helpers/method-target.test.d.ts +8 -0
  61. package/dist/__tests__/edge-helpers/method-target.test.d.ts.map +1 -0
  62. package/dist/__tests__/edge-helpers/method-target.test.js +96 -0
  63. package/dist/__tests__/edge-helpers/method-target.test.js.map +1 -0
  64. package/dist/__tests__/edge-helpers/resolve-decl.test.d.ts +13 -0
  65. package/dist/__tests__/edge-helpers/resolve-decl.test.d.ts.map +1 -0
  66. package/dist/__tests__/edge-helpers/resolve-decl.test.js +176 -0
  67. package/dist/__tests__/edge-helpers/resolve-decl.test.js.map +1 -0
  68. package/dist/__tests__/edge-resolvers/branches.test.d.ts +11 -0
  69. package/dist/__tests__/edge-resolvers/branches.test.d.ts.map +1 -0
  70. package/dist/__tests__/edge-resolvers/branches.test.js +305 -0
  71. package/dist/__tests__/edge-resolvers/branches.test.js.map +1 -0
  72. package/dist/__tests__/edge-resolvers/contract.test.d.ts +8 -0
  73. package/dist/__tests__/edge-resolvers/contract.test.d.ts.map +1 -0
  74. package/dist/__tests__/edge-resolvers/contract.test.js +30 -0
  75. package/dist/__tests__/edge-resolvers/contract.test.js.map +1 -0
  76. package/dist/__tests__/edge-resolvers/resolver-units.test.d.ts +17 -0
  77. package/dist/__tests__/edge-resolvers/resolver-units.test.d.ts.map +1 -0
  78. package/dist/__tests__/edge-resolvers/resolver-units.test.js +286 -0
  79. package/dist/__tests__/edge-resolvers/resolver-units.test.js.map +1 -0
  80. package/dist/__tests__/fast-vs-exact.test.d.ts +16 -0
  81. package/dist/__tests__/fast-vs-exact.test.d.ts.map +1 -0
  82. package/dist/__tests__/fast-vs-exact.test.js +116 -0
  83. package/dist/__tests__/fast-vs-exact.test.js.map +1 -0
  84. package/dist/__tests__/graph-cli.test.d.ts +9 -0
  85. package/dist/__tests__/graph-cli.test.d.ts.map +1 -0
  86. package/dist/__tests__/graph-cli.test.js +417 -0
  87. package/dist/__tests__/graph-cli.test.js.map +1 -0
  88. package/dist/__tests__/heap-preflight.test.d.ts +10 -0
  89. package/dist/__tests__/heap-preflight.test.d.ts.map +1 -0
  90. package/dist/__tests__/heap-preflight.test.js +166 -0
  91. package/dist/__tests__/heap-preflight.test.js.map +1 -0
  92. package/dist/__tests__/inventory-differential.test.d.ts +15 -0
  93. package/dist/__tests__/inventory-differential.test.d.ts.map +1 -0
  94. package/dist/__tests__/inventory-differential.test.js +319 -0
  95. package/dist/__tests__/inventory-differential.test.js.map +1 -0
  96. package/dist/__tests__/inventory-helpers/hash-body.test.d.ts +11 -0
  97. package/dist/__tests__/inventory-helpers/hash-body.test.d.ts.map +1 -0
  98. package/dist/__tests__/inventory-helpers/hash-body.test.js +34 -0
  99. package/dist/__tests__/inventory-helpers/hash-body.test.js.map +1 -0
  100. package/dist/__tests__/inventory-helpers/synthesize-name.test.d.ts +9 -0
  101. package/dist/__tests__/inventory-helpers/synthesize-name.test.d.ts.map +1 -0
  102. package/dist/__tests__/inventory-helpers/synthesize-name.test.js +30 -0
  103. package/dist/__tests__/inventory-helpers/synthesize-name.test.js.map +1 -0
  104. package/dist/__tests__/inventory-property-tests.test.d.ts +24 -0
  105. package/dist/__tests__/inventory-property-tests.test.d.ts.map +1 -0
  106. package/dist/__tests__/inventory-property-tests.test.js +521 -0
  107. package/dist/__tests__/inventory-property-tests.test.js.map +1 -0
  108. package/dist/__tests__/inventory-shape-coverage.test.d.ts +16 -0
  109. package/dist/__tests__/inventory-shape-coverage.test.d.ts.map +1 -0
  110. package/dist/__tests__/inventory-shape-coverage.test.js +586 -0
  111. package/dist/__tests__/inventory-shape-coverage.test.js.map +1 -0
  112. package/dist/__tests__/inventory-visitors/contract.test.d.ts +9 -0
  113. package/dist/__tests__/inventory-visitors/contract.test.d.ts.map +1 -0
  114. package/dist/__tests__/inventory-visitors/contract.test.js +33 -0
  115. package/dist/__tests__/inventory-visitors/contract.test.js.map +1 -0
  116. package/dist/__tests__/lang-adapter-contract.test.d.ts +19 -0
  117. package/dist/__tests__/lang-adapter-contract.test.d.ts.map +1 -0
  118. package/dist/__tests__/lang-adapter-contract.test.js +880 -0
  119. package/dist/__tests__/lang-adapter-contract.test.js.map +1 -0
  120. package/dist/__tests__/lang-adapter-registry.test.d.ts +10 -0
  121. package/dist/__tests__/lang-adapter-registry.test.d.ts.map +1 -0
  122. package/dist/__tests__/lang-adapter-registry.test.js +151 -0
  123. package/dist/__tests__/lang-adapter-registry.test.js.map +1 -0
  124. package/dist/__tests__/normalize-project-dir.test.d.ts +5 -0
  125. package/dist/__tests__/normalize-project-dir.test.d.ts.map +1 -0
  126. package/dist/__tests__/normalize-project-dir.test.js +47 -0
  127. package/dist/__tests__/normalize-project-dir.test.js.map +1 -0
  128. package/dist/__tests__/orchestrate.test.d.ts +8 -0
  129. package/dist/__tests__/orchestrate.test.d.ts.map +1 -0
  130. package/dist/__tests__/orchestrate.test.js +213 -0
  131. package/dist/__tests__/orchestrate.test.js.map +1 -0
  132. package/dist/__tests__/parse-fast.test.d.ts +9 -0
  133. package/dist/__tests__/parse-fast.test.d.ts.map +1 -0
  134. package/dist/__tests__/parse-fast.test.js +114 -0
  135. package/dist/__tests__/parse-fast.test.js.map +1 -0
  136. package/dist/__tests__/rules/_helpers.d.ts +18 -0
  137. package/dist/__tests__/rules/_helpers.d.ts.map +1 -0
  138. package/dist/__tests__/rules/_helpers.js +62 -0
  139. package/dist/__tests__/rules/_helpers.js.map +1 -0
  140. package/dist/__tests__/rules/duplicated-function-body.test.d.ts +5 -0
  141. package/dist/__tests__/rules/duplicated-function-body.test.d.ts.map +1 -0
  142. package/dist/__tests__/rules/duplicated-function-body.test.js +39 -0
  143. package/dist/__tests__/rules/duplicated-function-body.test.js.map +1 -0
  144. package/dist/__tests__/rules/orphan-subtree.test.d.ts +5 -0
  145. package/dist/__tests__/rules/orphan-subtree.test.d.ts.map +1 -0
  146. package/dist/__tests__/rules/orphan-subtree.test.js +75 -0
  147. package/dist/__tests__/rules/orphan-subtree.test.js.map +1 -0
  148. package/dist/__tests__/rules/rule-hints-integration.test.d.ts +20 -0
  149. package/dist/__tests__/rules/rule-hints-integration.test.d.ts.map +1 -0
  150. package/dist/__tests__/rules/rule-hints-integration.test.js +279 -0
  151. package/dist/__tests__/rules/rule-hints-integration.test.js.map +1 -0
  152. package/dist/__tests__/tool-register.test.d.ts +16 -0
  153. package/dist/__tests__/tool-register.test.d.ts.map +1 -0
  154. package/dist/__tests__/tool-register.test.js +210 -0
  155. package/dist/__tests__/tool-register.test.js.map +1 -0
  156. package/dist/__tests__/value-reference-unit.test.d.ts +13 -0
  157. package/dist/__tests__/value-reference-unit.test.d.ts.map +1 -0
  158. package/dist/__tests__/value-reference-unit.test.js +226 -0
  159. package/dist/__tests__/value-reference-unit.test.js.map +1 -0
  160. package/dist/__tests__/value-reference.test.d.ts +15 -0
  161. package/dist/__tests__/value-reference.test.d.ts.map +1 -0
  162. package/dist/__tests__/value-reference.test.js +115 -0
  163. package/dist/__tests__/value-reference.test.js.map +1 -0
  164. package/dist/__tests__/walk-fast.test.d.ts +8 -0
  165. package/dist/__tests__/walk-fast.test.d.ts.map +1 -0
  166. package/dist/__tests__/walk-fast.test.js +51 -0
  167. package/dist/__tests__/walk-fast.test.js.map +1 -0
  168. package/dist/__tests__/walk-reexports.test.d.ts +7 -0
  169. package/dist/__tests__/walk-reexports.test.d.ts.map +1 -0
  170. package/dist/__tests__/walk-reexports.test.js +79 -0
  171. package/dist/__tests__/walk-reexports.test.js.map +1 -0
  172. package/dist/cache-key.d.ts +41 -0
  173. package/dist/cache-key.d.ts.map +1 -0
  174. package/dist/cache-key.js +94 -0
  175. package/dist/cache-key.js.map +1 -0
  176. package/dist/discover.d.ts +25 -0
  177. package/dist/discover.d.ts.map +1 -0
  178. package/dist/discover.js +124 -0
  179. package/dist/discover.js.map +1 -0
  180. package/dist/edge-helpers/cross-package-context.d.ts +34 -0
  181. package/dist/edge-helpers/cross-package-context.d.ts.map +1 -0
  182. package/dist/edge-helpers/cross-package-context.js +97 -0
  183. package/dist/edge-helpers/cross-package-context.js.map +1 -0
  184. package/dist/edge-helpers/declaration-to-node.d.ts +58 -0
  185. package/dist/edge-helpers/declaration-to-node.d.ts.map +1 -0
  186. package/dist/edge-helpers/declaration-to-node.js +93 -0
  187. package/dist/edge-helpers/declaration-to-node.js.map +1 -0
  188. package/dist/edge-helpers/find-catalog-entry.d.ts +24 -0
  189. package/dist/edge-helpers/find-catalog-entry.d.ts.map +1 -0
  190. package/dist/edge-helpers/find-catalog-entry.js +45 -0
  191. package/dist/edge-helpers/find-catalog-entry.js.map +1 -0
  192. package/dist/edge-helpers/method-target.d.ts +22 -0
  193. package/dist/edge-helpers/method-target.d.ts.map +1 -0
  194. package/dist/edge-helpers/method-target.js +46 -0
  195. package/dist/edge-helpers/method-target.js.map +1 -0
  196. package/dist/edge-helpers/resolution-trace.d.ts +24 -0
  197. package/dist/edge-helpers/resolution-trace.d.ts.map +1 -0
  198. package/dist/edge-helpers/resolution-trace.js +38 -0
  199. package/dist/edge-helpers/resolution-trace.js.map +1 -0
  200. package/dist/edge-helpers/resolve-decl.d.ts +44 -0
  201. package/dist/edge-helpers/resolve-decl.d.ts.map +1 -0
  202. package/dist/edge-helpers/resolve-decl.js +170 -0
  203. package/dist/edge-helpers/resolve-decl.js.map +1 -0
  204. package/dist/edge-helpers/unalias-symbol.d.ts +10 -0
  205. package/dist/edge-helpers/unalias-symbol.d.ts.map +1 -0
  206. package/dist/edge-helpers/unalias-symbol.js +29 -0
  207. package/dist/edge-helpers/unalias-symbol.js.map +1 -0
  208. package/dist/edge-resolvers/__tests__/boundary.test.d.ts +15 -0
  209. package/dist/edge-resolvers/__tests__/boundary.test.d.ts.map +1 -0
  210. package/dist/edge-resolvers/__tests__/boundary.test.js +227 -0
  211. package/dist/edge-resolvers/__tests__/boundary.test.js.map +1 -0
  212. package/dist/edge-resolvers/__tests__/callee-anchor.test.d.ts +10 -0
  213. package/dist/edge-resolvers/__tests__/callee-anchor.test.d.ts.map +1 -0
  214. package/dist/edge-resolvers/__tests__/callee-anchor.test.js +63 -0
  215. package/dist/edge-resolvers/__tests__/callee-anchor.test.js.map +1 -0
  216. package/dist/edge-resolvers/__tests__/syntactic.test.d.ts +12 -0
  217. package/dist/edge-resolvers/__tests__/syntactic.test.d.ts.map +1 -0
  218. package/dist/edge-resolvers/__tests__/syntactic.test.js +215 -0
  219. package/dist/edge-resolvers/__tests__/syntactic.test.js.map +1 -0
  220. package/dist/edge-resolvers/boundary.d.ts +41 -0
  221. package/dist/edge-resolvers/boundary.d.ts.map +1 -0
  222. package/dist/edge-resolvers/boundary.js +130 -0
  223. package/dist/edge-resolvers/boundary.js.map +1 -0
  224. package/dist/edge-resolvers/catalog-fallback.d.ts +13 -0
  225. package/dist/edge-resolvers/catalog-fallback.d.ts.map +1 -0
  226. package/dist/edge-resolvers/catalog-fallback.js +30 -0
  227. package/dist/edge-resolvers/catalog-fallback.js.map +1 -0
  228. package/dist/edge-resolvers/direct-call.d.ts +10 -0
  229. package/dist/edge-resolvers/direct-call.d.ts.map +1 -0
  230. package/dist/edge-resolvers/direct-call.js +45 -0
  231. package/dist/edge-resolvers/direct-call.js.map +1 -0
  232. package/dist/edge-resolvers/jsx-element.d.ts +16 -0
  233. package/dist/edge-resolvers/jsx-element.d.ts.map +1 -0
  234. package/dist/edge-resolvers/jsx-element.js +67 -0
  235. package/dist/edge-resolvers/jsx-element.js.map +1 -0
  236. package/dist/edge-resolvers/new-expression.d.ts +11 -0
  237. package/dist/edge-resolvers/new-expression.d.ts.map +1 -0
  238. package/dist/edge-resolvers/new-expression.js +56 -0
  239. package/dist/edge-resolvers/new-expression.js.map +1 -0
  240. package/dist/edge-resolvers/polymorphic.d.ts +8 -0
  241. package/dist/edge-resolvers/polymorphic.d.ts.map +1 -0
  242. package/dist/edge-resolvers/polymorphic.js +57 -0
  243. package/dist/edge-resolvers/polymorphic.js.map +1 -0
  244. package/dist/edge-resolvers/property-access.d.ts +10 -0
  245. package/dist/edge-resolvers/property-access.d.ts.map +1 -0
  246. package/dist/edge-resolvers/property-access.js +56 -0
  247. package/dist/edge-resolvers/property-access.js.map +1 -0
  248. package/dist/edge-resolvers/syntactic.d.ts +105 -0
  249. package/dist/edge-resolvers/syntactic.d.ts.map +1 -0
  250. package/dist/edge-resolvers/syntactic.js +294 -0
  251. package/dist/edge-resolvers/syntactic.js.map +1 -0
  252. package/dist/edge-resolvers/types.d.ts +37 -0
  253. package/dist/edge-resolvers/types.d.ts.map +1 -0
  254. package/dist/edge-resolvers/types.js +10 -0
  255. package/dist/edge-resolvers/types.js.map +1 -0
  256. package/dist/edges-value-reference.d.ts +26 -0
  257. package/dist/edges-value-reference.d.ts.map +1 -0
  258. package/dist/edges-value-reference.js +138 -0
  259. package/dist/edges-value-reference.js.map +1 -0
  260. package/dist/edges.d.ts +65 -0
  261. package/dist/edges.d.ts.map +1 -0
  262. package/dist/edges.js +392 -0
  263. package/dist/edges.js.map +1 -0
  264. package/dist/index.d.ts +47 -0
  265. package/dist/index.d.ts.map +1 -0
  266. package/dist/index.js +346 -0
  267. package/dist/index.js.map +1 -0
  268. package/dist/inventory-helpers/classify-visibility.d.ts +13 -0
  269. package/dist/inventory-helpers/classify-visibility.d.ts.map +1 -0
  270. package/dist/inventory-helpers/classify-visibility.js +56 -0
  271. package/dist/inventory-helpers/classify-visibility.js.map +1 -0
  272. package/dist/inventory-helpers/extract-decorators.d.ts +6 -0
  273. package/dist/inventory-helpers/extract-decorators.d.ts.map +1 -0
  274. package/dist/inventory-helpers/extract-decorators.js +33 -0
  275. package/dist/inventory-helpers/extract-decorators.js.map +1 -0
  276. package/dist/inventory-helpers/extract-params.d.ts +7 -0
  277. package/dist/inventory-helpers/extract-params.d.ts.map +1 -0
  278. package/dist/inventory-helpers/extract-params.js +28 -0
  279. package/dist/inventory-helpers/extract-params.js.map +1 -0
  280. package/dist/inventory-helpers/hash-body.d.ts +43 -0
  281. package/dist/inventory-helpers/hash-body.d.ts.map +1 -0
  282. package/dist/inventory-helpers/hash-body.js +52 -0
  283. package/dist/inventory-helpers/hash-body.js.map +1 -0
  284. package/dist/inventory-helpers/synthesize-name.d.ts +16 -0
  285. package/dist/inventory-helpers/synthesize-name.d.ts.map +1 -0
  286. package/dist/inventory-helpers/synthesize-name.js +17 -0
  287. package/dist/inventory-helpers/synthesize-name.js.map +1 -0
  288. package/dist/inventory-visitors/arrow-function.d.ts +8 -0
  289. package/dist/inventory-visitors/arrow-function.d.ts.map +1 -0
  290. package/dist/inventory-visitors/arrow-function.js +55 -0
  291. package/dist/inventory-visitors/arrow-function.js.map +1 -0
  292. package/dist/inventory-visitors/class-static-init.d.ts +17 -0
  293. package/dist/inventory-visitors/class-static-init.d.ts.map +1 -0
  294. package/dist/inventory-visitors/class-static-init.js +45 -0
  295. package/dist/inventory-visitors/class-static-init.js.map +1 -0
  296. package/dist/inventory-visitors/constructor-declaration.d.ts +7 -0
  297. package/dist/inventory-visitors/constructor-declaration.d.ts.map +1 -0
  298. package/dist/inventory-visitors/constructor-declaration.js +47 -0
  299. package/dist/inventory-visitors/constructor-declaration.js.map +1 -0
  300. package/dist/inventory-visitors/function-declaration.d.ts +7 -0
  301. package/dist/inventory-visitors/function-declaration.d.ts.map +1 -0
  302. package/dist/inventory-visitors/function-declaration.js +59 -0
  303. package/dist/inventory-visitors/function-declaration.js.map +1 -0
  304. package/dist/inventory-visitors/function-expression.d.ts +7 -0
  305. package/dist/inventory-visitors/function-expression.d.ts.map +1 -0
  306. package/dist/inventory-visitors/function-expression.js +56 -0
  307. package/dist/inventory-visitors/function-expression.js.map +1 -0
  308. package/dist/inventory-visitors/getter-setter.d.ts +7 -0
  309. package/dist/inventory-visitors/getter-setter.d.ts.map +1 -0
  310. package/dist/inventory-visitors/getter-setter.js +63 -0
  311. package/dist/inventory-visitors/getter-setter.js.map +1 -0
  312. package/dist/inventory-visitors/method-declaration.d.ts +7 -0
  313. package/dist/inventory-visitors/method-declaration.d.ts.map +1 -0
  314. package/dist/inventory-visitors/method-declaration.js +75 -0
  315. package/dist/inventory-visitors/method-declaration.js.map +1 -0
  316. package/dist/inventory-visitors/module-init.d.ts +15 -0
  317. package/dist/inventory-visitors/module-init.d.ts.map +1 -0
  318. package/dist/inventory-visitors/module-init.js +40 -0
  319. package/dist/inventory-visitors/module-init.js.map +1 -0
  320. package/dist/inventory-visitors/types.d.ts +26 -0
  321. package/dist/inventory-visitors/types.d.ts.map +1 -0
  322. package/dist/inventory-visitors/types.js +14 -0
  323. package/dist/inventory-visitors/types.js.map +1 -0
  324. package/dist/normalize-project-dir.d.ts +14 -0
  325. package/dist/normalize-project-dir.d.ts.map +1 -0
  326. package/dist/normalize-project-dir.js +36 -0
  327. package/dist/normalize-project-dir.js.map +1 -0
  328. package/dist/parse-fast.d.ts +41 -0
  329. package/dist/parse-fast.d.ts.map +1 -0
  330. package/dist/parse-fast.js +91 -0
  331. package/dist/parse-fast.js.map +1 -0
  332. package/dist/parse.d.ts +42 -0
  333. package/dist/parse.d.ts.map +1 -0
  334. package/dist/parse.js +75 -0
  335. package/dist/parse.js.map +1 -0
  336. package/dist/test-file.d.ts +7 -0
  337. package/dist/test-file.d.ts.map +1 -0
  338. package/dist/test-file.js +42 -0
  339. package/dist/test-file.js.map +1 -0
  340. package/dist/walk.d.ts +125 -0
  341. package/dist/walk.d.ts.map +1 -0
  342. package/dist/walk.js +393 -0
  343. package/dist/walk.js.map +1 -0
  344. package/package.json +57 -0
@@ -0,0 +1,130 @@
1
+ /**
2
+ * Cross-shard boundary-call extraction (plan #2 — sharded build).
3
+ *
4
+ * When a shard worker resolves a shard's call sites, the calls that DON'T
5
+ * land on one of the shard's own occurrences are candidate cross-package
6
+ * edges — the target lives in another shard. This module identifies them
7
+ * syntactically (callee name + the raw import specifier the name came
8
+ * from) so the engine's cross-shard pass can re-resolve them against the
9
+ * global merged catalog, where the target is present.
10
+ *
11
+ * Detection is by RESOLUTION OUTCOME, not by name: a site is a boundary
12
+ * candidate when its callee name is IMPORTED (carries an import specifier) AND
13
+ * the in-shard resolver did NOT resolve THIS call site to a target. Keying on
14
+ * the per-site outcome (not "does the callee name exist among the shard's
15
+ * occurrences?") is what fixes the name-collision class: a name imported from
16
+ * another package is a cross-shard call even when a DIFFERENT local function in
17
+ * this shard happens to share the name (e.g. checks-universal has a local
18
+ * `isTestFile`, but a call to the IMPORTED `@opensip-cli/fitness` `isTestFile`
19
+ * still crosses the boundary). Conversely, a site the in-shard resolver already
20
+ * resolved is skipped, so a recovered boundary edge never double-counts.
21
+ */
22
+ import { relative, sep } from 'node:path';
23
+ import { ownerEdgeKey } from '@opensip-cli/graph';
24
+ import ts from 'typescript';
25
+ import { isReturnValueDiscarded } from '../edges.js';
26
+ import { calleeAnchorNode, calleeSimpleName, buildImportSpecifierIndex } from './syntactic.js';
27
+ /** Max length of the descriptor's display text — the CallEdge.text contract. */
28
+ const TEXT_MAX = 80;
29
+ /**
30
+ * Extract cross-boundary call descriptors from a shard's walked call sites. A
31
+ * site is a boundary candidate when the in-shard resolver left it unresolved AND
32
+ * either (a) its callee name is IMPORTED (a cross-package FUNCTION), or (b) it is
33
+ * a METHOD call `recv.m()` whose callee the checker resolves to a workspace
34
+ * `dist/*.d.ts` (`resolveMethodTarget` attests the target file — a cross-package
35
+ * METHOD). Both route through the same post-merge linker. Keyed on the resolution
36
+ * outcome (`resolvedEdgesByOwner`) — see the module doc.
37
+ */
38
+ export function extractBoundaryCalls(callSites, resolvedEdgesByOwner, projectDirAbs, resolveMethodTarget) {
39
+ const out = [];
40
+ // One import-specifier index per source file, built lazily and cached.
41
+ const specifierIndexBySf = new Map();
42
+ // Owner-file derivation is per source file; cache it so each boundary call on
43
+ // the same file doesn't re-run the relative/posix math.
44
+ const ownerFileBySf = new Map();
45
+ for (const r of callSites) {
46
+ if (r.kind !== 'call')
47
+ continue; // 'creation' edges are always intra-shard
48
+ const callee = calleeSimpleName(r.node);
49
+ if (callee === null)
50
+ continue;
51
+ let specifierIndex = specifierIndexBySf.get(r.sourceFile);
52
+ if (specifierIndex === undefined) {
53
+ specifierIndex = buildImportSpecifierIndex(r.sourceFile);
54
+ specifierIndexBySf.set(r.sourceFile, specifierIndex);
55
+ }
56
+ const importSpecifier = specifierIndex.get(callee.name);
57
+ const methodEligible = resolveMethodTarget !== undefined &&
58
+ ts.isCallExpression(r.node) &&
59
+ ts.isPropertyAccessExpression(r.node.expression);
60
+ // Candidate iff IMPORTED (function) or a METHOD call we can type-resolve.
61
+ // Everything else (globals/locals/intra) is skipped before the position math.
62
+ if (importSpecifier === undefined && !methodEligible)
63
+ continue;
64
+ let ownerFile = ownerFileBySf.get(r.sourceFile);
65
+ if (ownerFile === undefined) {
66
+ // Byte-identical to FunctionOccurrence.filePath (walk.ts) so the merge's
67
+ // ownerEdgeKey(ownerHash, ownerFile) lookup hits and relative-import
68
+ // pinning resolves against the owner's REAL directory.
69
+ ownerFile = relative(projectDirAbs, r.sourceFile.fileName).split(sep).join('/');
70
+ ownerFileBySf.set(r.sourceFile, ownerFile);
71
+ }
72
+ const bc = boundaryCallFor(r, callee.name, importSpecifier, ownerFile, {
73
+ resolvedEdgesByOwner,
74
+ resolveMethodTarget,
75
+ });
76
+ if (bc !== null)
77
+ out.push(bc);
78
+ }
79
+ return out;
80
+ }
81
+ /**
82
+ * Finish classifying a candidate call site — its callee name, import specifier,
83
+ * and owner file already resolved by the caller — into a boundary descriptor, or
84
+ * `null` when the in-shard pass already resolved the site or it is not a
85
+ * cross-package method. Extracted from the loop to keep each piece simple.
86
+ */
87
+ function boundaryCallFor(r, calleeName, importSpecifier, ownerFile, deps) {
88
+ const pos = positionOf(r.node, r.sourceFile);
89
+ // Skip a site the in-shard resolver already RESOLVED to a real target —
90
+ // emitting a boundary call for it would double the edge. (A `to: []`
91
+ // placeholder is NOT a resolution.) Keyed on the outcome at THIS site, so a
92
+ // local same-name occurrence elsewhere in the shard no longer suppresses it.
93
+ const resolvedHere = (deps.resolvedEdgesByOwner.get(ownerEdgeKey(r.ownerHash, ownerFile)) ?? []).some((e) => e.line === pos.line && e.column === pos.column && e.to.length > 0);
94
+ if (resolvedHere)
95
+ return null;
96
+ // For a non-imported (method) candidate, attest the target only NOW (after the
97
+ // cheap resolvedHere gate) to bound the checker calls. A method whose callee
98
+ // resolves to SOURCE / node_modules / a non-dist `.d.ts` declines.
99
+ const targetFile = importSpecifier === undefined ? (deps.resolveMethodTarget?.(r.node) ?? undefined) : undefined;
100
+ if (importSpecifier === undefined && targetFile === undefined)
101
+ return null;
102
+ return {
103
+ ownerHash: r.ownerHash,
104
+ ownerFile,
105
+ calleeName,
106
+ ...(importSpecifier === undefined ? {} : { importSpecifier }),
107
+ ...(targetFile === undefined ? {} : { targetFile }),
108
+ line: pos.line,
109
+ column: pos.column,
110
+ text: pos.text,
111
+ discarded: isReturnValueDiscarded(r.node),
112
+ };
113
+ }
114
+ /* `isReturnValueDiscarded` is imported from `../edges.js` so recovered
115
+ * boundary edges carry the same `discarded` semantics as edges resolved
116
+ * inline by the main Stage 2 pass. */
117
+ function positionOf(node, sourceFile) {
118
+ // Anchor at the CALLEE token (see edges.ts tsPosition + syntactic.calleeAnchorNode)
119
+ // so the cross-shard edge identity matches the in-shard pass for the SAME call
120
+ // and chained calls don't collide. TEXT stays the whole expression.
121
+ const anchor = calleeAnchorNode(node).getStart(sourceFile);
122
+ const lc = sourceFile.getLineAndCharacterOfPosition(anchor);
123
+ const raw = sourceFile.text.slice(node.getStart(sourceFile), node.getEnd());
124
+ return {
125
+ line: lc.line + 1,
126
+ column: lc.character,
127
+ text: raw.length > TEXT_MAX ? `${raw.slice(0, TEXT_MAX - 3)}...` : raw,
128
+ };
129
+ }
130
+ //# sourceMappingURL=boundary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boundary.js","sourceRoot":"","sources":["../../src/edge-resolvers/boundary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,YAAY,EAAE,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IAC5D,MAAM,GAAG,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IAC5E,OAAO;QACL,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC;QACjB,MAAM,EAAE,EAAE,CAAC,SAAS;QACpB,IAAI,EAAE,GAAG,CAAC,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG;KACvE,CAAC;AACJ,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * catalog-fallback resolver — last-resort name lookup.
3
+ *
4
+ * When TypeScript's resolver returns no symbol (or returns one with
5
+ * no usable declaration — common for cross-package `dist/*.d.ts`
6
+ * cases), we fall back to a simpleName lookup against the catalog.
7
+ *
8
+ * Returns 'unknown'/'medium' for an unambiguous single-candidate
9
+ * match; otherwise UNRESOLVED.
10
+ */
11
+ import type { Catalog, ResolverVerdict } from '@opensip-cli/graph';
12
+ export declare function resolveByCatalogFallback(simpleName: string, catalog: Catalog): ResolverVerdict;
13
+ //# sourceMappingURL=catalog-fallback.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog-fallback.d.ts","sourceRoot":"","sources":["../../src/edge-resolvers/catalog-fallback.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAsB,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAQvF,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,eAAe,CAW9F"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * catalog-fallback resolver — last-resort name lookup.
3
+ *
4
+ * When TypeScript's resolver returns no symbol (or returns one with
5
+ * no usable declaration — common for cross-package `dist/*.d.ts`
6
+ * cases), we fall back to a simpleName lookup against the catalog.
7
+ *
8
+ * Returns 'unknown'/'medium' for an unambiguous single-candidate
9
+ * match; otherwise UNRESOLVED.
10
+ */
11
+ const UNRESOLVED = {
12
+ to: [],
13
+ resolution: 'unknown',
14
+ confidence: 'low',
15
+ };
16
+ export function resolveByCatalogFallback(simpleName, catalog) {
17
+ if (!Object.hasOwn(catalog.functions, simpleName))
18
+ return UNRESOLVED;
19
+ const candidates = catalog.functions[simpleName];
20
+ if (!candidates || candidates.length === 0)
21
+ return UNRESOLVED;
22
+ if (candidates.length === 1) {
23
+ const only = candidates[0];
24
+ if (only) {
25
+ return { to: [only.bodyHash], resolution: 'unknown', confidence: 'medium' };
26
+ }
27
+ }
28
+ return UNRESOLVED;
29
+ }
30
+ //# sourceMappingURL=catalog-fallback.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog-fallback.js","sourceRoot":"","sources":["../../src/edge-resolvers/catalog-fallback.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,MAAM,UAAU,GAAoB;IAClC,EAAE,EAAE,EAAE;IACN,UAAU,EAAE,SAAS;IACrB,UAAU,EAAE,KAAK;CAClB,CAAC;AAEF,MAAM,UAAU,wBAAwB,CAAC,UAAkB,EAAE,OAAgB;IAC3E,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,UAAU,CAAC;QAAE,OAAO,UAAU,CAAC;IACrE,MAAM,UAAU,GAA8C,OAAO,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAC5F,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,UAAU,CAAC;IAC9D,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;QAC3B,IAAI,IAAI,EAAE,CAAC;YACT,OAAO,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC;QAC9E,CAAC;IACH,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Resolve direct identifier calls: `foo()`.
3
+ *
4
+ * Walks `getAliasedSymbol` to follow imports, then matches the
5
+ * declaration against the catalog by bodyHash.
6
+ */
7
+ import ts from 'typescript';
8
+ import type { EdgeResolver } from './types.js';
9
+ export declare const resolveDirectCall: EdgeResolver<ts.CallExpression>;
10
+ //# sourceMappingURL=direct-call.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"direct-call.d.ts","sourceRoot":"","sources":["../../src/edge-resolvers/direct-call.ts"],"names":[],"mappings":"AACA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAC;AAM5B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAiB/C,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAAC,EAAE,CAAC,cAAc,CAkB7D,CAAC"}
@@ -0,0 +1,45 @@
1
+ // @fitness-ignore-file batch-operation-limits -- iterates bounded collection (import bindings + matching catalog entries per call site)
2
+ /**
3
+ * Resolve direct identifier calls: `foo()`.
4
+ *
5
+ * Walks `getAliasedSymbol` to follow imports, then matches the
6
+ * declaration against the catalog by bodyHash.
7
+ */
8
+ import ts from 'typescript';
9
+ import { DeclShape, functionLikeFromDeclaration } from '../edge-helpers/declaration-to-node.js';
10
+ import { resolveDeclToHash } from '../edge-helpers/resolve-decl.js';
11
+ import { unaliasSymbol } from '../edge-helpers/unalias-symbol.js';
12
+ const UNRESOLVED = {
13
+ to: [],
14
+ resolution: 'unknown',
15
+ confidence: 'low',
16
+ };
17
+ const ACCEPT = DeclShape.FunctionDeclaration |
18
+ DeclShape.ArrowFunction |
19
+ DeclShape.FunctionExpression |
20
+ DeclShape.MethodDeclaration |
21
+ DeclShape.ConstructorDeclaration |
22
+ DeclShape.Accessor |
23
+ DeclShape.VariableInitializer;
24
+ export const resolveDirectCall = (node, ctx) => {
25
+ if (!ts.isIdentifier(node.expression))
26
+ return UNRESOLVED;
27
+ const name = node.expression.text;
28
+ const symbol = ctx.typeChecker.getSymbolAtLocation(node.expression);
29
+ if (!symbol)
30
+ return UNRESOLVED;
31
+ const real = unaliasSymbol(symbol, ctx.typeChecker);
32
+ const decls = real.getDeclarations() ?? [];
33
+ for (const d of decls) {
34
+ const sf = d.getSourceFile();
35
+ const declNode = functionLikeFromDeclaration(d, ACCEPT);
36
+ if (!declNode)
37
+ continue;
38
+ const hash = resolveDeclToHash(declNode, sf, [name], ctx);
39
+ if (hash) {
40
+ return { to: [hash], resolution: 'static', confidence: 'high' };
41
+ }
42
+ }
43
+ return UNRESOLVED;
44
+ };
45
+ //# sourceMappingURL=direct-call.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"direct-call.js","sourceRoot":"","sources":["../../src/edge-resolvers/direct-call.ts"],"names":[],"mappings":"AAAA,wIAAwI;AACxI;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,EAAE,SAAS,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AAChG,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAIlE,MAAM,UAAU,GAAG;IACjB,EAAE,EAAE,EAAuB;IAC3B,UAAU,EAAE,SAAkB;IAC9B,UAAU,EAAE,KAAc;CAC3B,CAAC;AAEF,MAAM,MAAM,GACV,SAAS,CAAC,mBAAmB;IAC7B,SAAS,CAAC,aAAa;IACvB,SAAS,CAAC,kBAAkB;IAC5B,SAAS,CAAC,iBAAiB;IAC3B,SAAS,CAAC,sBAAsB;IAChC,SAAS,CAAC,QAAQ;IAClB,SAAS,CAAC,mBAAmB,CAAC;AAEhC,MAAM,CAAC,MAAM,iBAAiB,GAAoC,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;IAC9E,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC;QAAE,OAAO,UAAU,CAAC;IACzD,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;IAClC,MAAM,MAAM,GAAG,GAAG,CAAC,WAAW,CAAC,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACpE,IAAI,CAAC,MAAM;QAAE,OAAO,UAAU,CAAC;IAE/B,MAAM,IAAI,GAAG,aAAa,CAAC,MAAM,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;IACpD,MAAM,KAAK,GAAG,IAAI,CAAC,eAAe,EAAE,IAAI,EAAE,CAAC;IAC3C,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACtB,MAAM,EAAE,GAAG,CAAC,CAAC,aAAa,EAAE,CAAC;QAC7B,MAAM,QAAQ,GAAG,2BAA2B,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;QACxD,IAAI,CAAC,QAAQ;YAAE,SAAS;QACxB,MAAM,IAAI,GAAG,iBAAiB,CAAC,QAAQ,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QAC1D,IAAI,IAAI,EAAE,CAAC;YACT,OAAO,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;QAClE,CAAC;IACH,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Resolve JSX elements: `<Foo />` / `<Foo>...</Foo>`.
3
+ *
4
+ * Component identifiers (PascalCase) resolve to their declarations
5
+ * via the type checker. Lower-cased intrinsic elements (`<div />`)
6
+ * are ignored — they have no catalog entry.
7
+ *
8
+ * Returns `UNRESOLVED` only when the JSX tag is intrinsic or the type checker
9
+ * cannot connect the component tag back to a cataloged declaration.
10
+ */
11
+ import ts from 'typescript';
12
+ import type { EdgeResolver } from './types.js';
13
+ type JsxOpeningLike = ts.JsxOpeningElement | ts.JsxSelfClosingElement;
14
+ export declare const resolveJsxElement: EdgeResolver<JsxOpeningLike>;
15
+ export {};
16
+ //# sourceMappingURL=jsx-element.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsx-element.d.ts","sourceRoot":"","sources":["../../src/edge-resolvers/jsx-element.ts"],"names":[],"mappings":"AACA;;;;;;;;;GASG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAC;AAM5B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAc/C,KAAK,cAAc,GAAG,EAAE,CAAC,iBAAiB,GAAG,EAAE,CAAC,qBAAqB,CAAC;AAEtE,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAAC,cAAc,CAyB1D,CAAC"}
@@ -0,0 +1,67 @@
1
+ // @fitness-ignore-file batch-operation-limits -- iterates bounded collection (catalog entries for a single JSX element resolution)
2
+ /**
3
+ * Resolve JSX elements: `<Foo />` / `<Foo>...</Foo>`.
4
+ *
5
+ * Component identifiers (PascalCase) resolve to their declarations
6
+ * via the type checker. Lower-cased intrinsic elements (`<div />`)
7
+ * are ignored — they have no catalog entry.
8
+ *
9
+ * Returns `UNRESOLVED` only when the JSX tag is intrinsic or the type checker
10
+ * cannot connect the component tag back to a cataloged declaration.
11
+ */
12
+ import ts from 'typescript';
13
+ import { DeclShape, functionLikeFromDeclaration } from '../edge-helpers/declaration-to-node.js';
14
+ import { resolveDeclToHash } from '../edge-helpers/resolve-decl.js';
15
+ import { unaliasSymbol } from '../edge-helpers/unalias-symbol.js';
16
+ const UNRESOLVED = {
17
+ to: [],
18
+ resolution: 'unknown',
19
+ confidence: 'low',
20
+ };
21
+ const ACCEPT = DeclShape.FunctionDeclaration |
22
+ DeclShape.ArrowFunction |
23
+ DeclShape.FunctionExpression |
24
+ DeclShape.VariableInitializer;
25
+ export const resolveJsxElement = (node, ctx) => {
26
+ const tagName = node.tagName;
27
+ // Intrinsic elements (`<div />`) are never tracked.
28
+ if (ts.isIdentifier(tagName) && /^[a-z]/.test(tagName.text))
29
+ return UNRESOLVED;
30
+ // Identifier or PropertyAccessExpression — both resolvable via the type checker.
31
+ const symbol = ctx.typeChecker.getSymbolAtLocation(tagName);
32
+ if (!symbol)
33
+ return UNRESOLVED;
34
+ const real = unaliasSymbol(symbol, ctx.typeChecker);
35
+ const decls = real.getDeclarations() ?? [];
36
+ const candidateName = ts.isIdentifier(tagName) ? tagName.text : tagName.getText();
37
+ // Cross-package binding name: `<Foo/>` binds `Foo`; `<A.B/>` binds the leftmost
38
+ // identifier `A` (the namespace import). The exported callee name to look up
39
+ // stays `candidateName`.
40
+ const bindingNames = jsxBindingNames(tagName, candidateName);
41
+ for (const d of decls) {
42
+ const sf = d.getSourceFile();
43
+ const declNode = functionLikeFromDeclaration(d, ACCEPT);
44
+ if (!declNode)
45
+ continue;
46
+ const hash = resolveDeclToHash(declNode, sf, [candidateName], ctx, bindingNames);
47
+ if (hash) {
48
+ return { to: [hash], resolution: 'jsx', confidence: 'high' };
49
+ }
50
+ }
51
+ return UNRESOLVED;
52
+ };
53
+ /**
54
+ * The local binding name(s) a JSX tag could be imported under: the tag itself
55
+ * for `<Foo/>`, plus the leftmost identifier for a qualified `<A.B.C/>` tag (the
56
+ * namespace import `A`). Deduped, binding candidates first.
57
+ */
58
+ function jsxBindingNames(tagName, candidateName) {
59
+ const names = new Set([candidateName]);
60
+ let cur = tagName;
61
+ while (ts.isPropertyAccessExpression(cur))
62
+ cur = cur.expression;
63
+ if (ts.isIdentifier(cur))
64
+ names.add(cur.text);
65
+ return [...names];
66
+ }
67
+ //# sourceMappingURL=jsx-element.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsx-element.js","sourceRoot":"","sources":["../../src/edge-resolvers/jsx-element.ts"],"names":[],"mappings":"AAAA,mI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,MAAM,YAAY,GAAG,eAAe,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;IAC7D,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACtB,MAAM,EAAE,GAAG,CAAC,CAAC,aAAa,EAAE,CAAC;QAC7B,MAAM,QAAQ,GAAG,2BAA2B,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;QACxD,IAAI,CAAC,QAAQ;YAAE,SAAS;QACxB,MAAM,IAAI,GAAG,iBAAiB,CAAC,QAAQ,EAAE,EAAE,EAAE,CAAC,aAAa,CAAC,EAAE,GAAG,EAAE,YAAY,CAAC,CAAC;QACjF,IAAI,IAAI,EAAE,CAAC;YACT,OAAO,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;QAC/D,CAAC;IACH,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAEF;;;;GAIG;AACH,SAAS,eAAe,CACtB,OAAgC,EAChC,aAAqB;IAErB,MAAM,KAAK,GAAG,IAAI,GAAG,CAAS,CAAC,aAAa,CAAC,CAAC,CAAC;IAC/C,IAAI,GAAG,GAAY,OAAO,CAAC;IAC3B,OAAO,EAAE,CAAC,0BAA0B,CAAC,GAAG,CAAC;QAAE,GAAG,GAAG,GAAG,CAAC,UAAU,CAAC;IAChE,IAAI,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC;QAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC9C,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC;AACpB,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Resolve `new MyClass(...)` to the constructor's catalog entry.
3
+ *
4
+ * The bodyHash of the constructor is what stage 1 wrote when it
5
+ * visited the `constructor() {}` member; here we find that
6
+ * declaration via the symbol of the class identifier.
7
+ */
8
+ import ts from 'typescript';
9
+ import type { EdgeResolver } from './types.js';
10
+ export declare const resolveNewExpression: EdgeResolver<ts.NewExpression>;
11
+ //# sourceMappingURL=new-expression.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"new-expression.d.ts","sourceRoot":"","sources":["../../src/edge-resolvers/new-expression.ts"],"names":[],"mappings":"AACA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAC;AAK5B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAQ/C,eAAO,MAAM,oBAAoB,EAAE,YAAY,CAAC,EAAE,CAAC,aAAa,CA2B/D,CAAC"}
@@ -0,0 +1,56 @@
1
+ // @fitness-ignore-file batch-operation-limits -- iterates bounded collection (catalog entries for a single new-expression resolution)
2
+ /**
3
+ * Resolve `new MyClass(...)` to the constructor's catalog entry.
4
+ *
5
+ * The bodyHash of the constructor is what stage 1 wrote when it
6
+ * visited the `constructor() {}` member; here we find that
7
+ * declaration via the symbol of the class identifier.
8
+ */
9
+ import ts from 'typescript';
10
+ import { resolveDeclToHash } from '../edge-helpers/resolve-decl.js';
11
+ import { unaliasSymbol } from '../edge-helpers/unalias-symbol.js';
12
+ const UNRESOLVED = {
13
+ to: [],
14
+ resolution: 'unknown',
15
+ confidence: 'low',
16
+ };
17
+ export const resolveNewExpression = (node, ctx) => {
18
+ const expr = node.expression;
19
+ /* v8 ignore next */
20
+ if (!ts.isIdentifier(expr) && !ts.isPropertyAccessExpression(expr))
21
+ return UNRESOLVED;
22
+ const symbol = ctx.typeChecker.getSymbolAtLocation(expr);
23
+ /* v8 ignore next */
24
+ if (!symbol)
25
+ return UNRESOLVED;
26
+ const real = unaliasSymbol(symbol, ctx.typeChecker);
27
+ const decls = real.getDeclarations() ?? [];
28
+ for (const d of decls) {
29
+ /* v8 ignore next */
30
+ if (!ts.isClassDeclaration(d) && !ts.isClassExpression(d))
31
+ continue;
32
+ const ctor = findConstructor(d);
33
+ /* v8 ignore next */
34
+ if (!ctor)
35
+ continue;
36
+ const className = d.name?.text ?? null;
37
+ const sf = d.getSourceFile();
38
+ /* v8 ignore next */
39
+ const candidateNames = className ? [className] : [];
40
+ const hash = resolveDeclToHash(ctor, sf, candidateNames, ctx);
41
+ if (hash) {
42
+ return { to: [hash], resolution: 'constructor', confidence: 'high' };
43
+ }
44
+ }
45
+ /* v8 ignore next */
46
+ return UNRESOLVED;
47
+ };
48
+ function findConstructor(cls) {
49
+ for (const m of cls.members) {
50
+ if (ts.isConstructorDeclaration(m))
51
+ return m;
52
+ }
53
+ /* v8 ignore next */
54
+ return null;
55
+ }
56
+ //# sourceMappingURL=new-expression.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"new-expression.js","sourceRoot":"","sources":["../../src/edge-resolvers/new-expression.ts"],"names":[],"mappings":"AAAA,sIAAsI;AACtI;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAIlE,MAAM,UAAU,GAAG;IACjB,EAAE,EAAE,EAAuB;IAC3B,UAAU,EAAE,SAAkB;IAC9B,UAAU,EAAE,KAAc;CAC3B,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAmC,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;IAChF,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC;IAC7B,oBAAoB;IACpB,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,0BAA0B,CAAC,IAAI,CAAC;QAAE,OAAO,UAAU,CAAC;IACtF,MAAM,MAAM,GAAG,GAAG,CAAC,WAAW,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;IACzD,oBAAoB;IACpB,IAAI,CAAC,MAAM;QAAE,OAAO,UAAU,CAAC;IAE/B,MAAM,IAAI,GAAG,aAAa,CAAC,MAAM,EAAE,GAAG,CAAC,WAAW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from 'typescript';
6
+ import type { EdgeResolver } from './types.js';
7
+ export declare const resolvePolymorphicCall: EdgeResolver<ts.CallExpression>;
8
+ //# sourceMappingURL=polymorphic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"polymorphic.d.ts","sourceRoot":"","sources":["../../src/edge-resolvers/polymorphic.ts"],"names":[],"mappings":"AACA;;;GAGG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAC;AAK5B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAmB/C,eAAO,MAAM,sBAAsB,EAAE,YAAY,CAAC,EAAE,CAAC,cAAc,CAWlE,CAAC"}
@@ -0,0 +1,57 @@
1
+ // @fitness-ignore-file batch-operation-limits -- iterates bounded collection (catalog entries implementing a single interface/abstract class)
2
+ /**
3
+ * Resolve method calls on interfaces / abstract classes to all
4
+ * implementations.
5
+ */
6
+ import ts from 'typescript';
7
+ import { DeclShape, functionLikeFromDeclaration } from '../edge-helpers/declaration-to-node.js';
8
+ import { resolveDeclToHash } from '../edge-helpers/resolve-decl.js';
9
+ const UNRESOLVED = {
10
+ to: [],
11
+ resolution: 'unknown',
12
+ confidence: 'low',
13
+ };
14
+ const ACCEPT = DeclShape.MethodDeclaration |
15
+ DeclShape.MethodSignature |
16
+ DeclShape.FunctionDeclaration |
17
+ DeclShape.ArrowFunction |
18
+ DeclShape.FunctionExpression |
19
+ DeclShape.Accessor |
20
+ DeclShape.PropertyDeclaration |
21
+ DeclShape.VariableInitializer |
22
+ DeclShape.PropertyAssignmentInitializer;
23
+ export const resolvePolymorphicCall = (node, ctx) => {
24
+ if (!ts.isPropertyAccessExpression(node.expression))
25
+ return UNRESOLVED;
26
+ const methodName = node.expression.name.text;
27
+ const receiverType = ctx.typeChecker.getTypeAtLocation(node.expression.expression);
28
+ const candidates = collectMethodHashes(receiverType, methodName, ctx);
29
+ if (candidates.length === 0)
30
+ return UNRESOLVED;
31
+ return {
32
+ to: candidates,
33
+ resolution: 'method-dispatch',
34
+ confidence: candidates.length === 1 ? 'high' : 'medium',
35
+ };
36
+ };
37
+ function collectMethodHashes(receiverType, methodName, ctx) {
38
+ const out = [];
39
+ for (const sym of receiverType.getProperties()) {
40
+ if (sym.getName() !== methodName)
41
+ continue;
42
+ appendHashesForSymbol(sym, methodName, ctx, out);
43
+ }
44
+ return out;
45
+ }
46
+ function appendHashesForSymbol(sym, methodName, ctx, out) {
47
+ const decls = sym.getDeclarations() ?? [];
48
+ for (const d of decls) {
49
+ const declNode = functionLikeFromDeclaration(d, ACCEPT);
50
+ if (!declNode)
51
+ continue;
52
+ const hash = resolveDeclToHash(declNode, d.getSourceFile(), [methodName], ctx);
53
+ if (hash && !out.includes(hash))
54
+ out.push(hash);
55
+ }
56
+ }
57
+ //# sourceMappingURL=polymorphic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"polymorphic.js","sourceRoot":"","sources":["../../src/edge-resolvers/polymorphic.ts"],"names":[],"mappings":"AAAA,8IAA8I;AAC9I;;;GAGG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,EAAE,SAAS,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AAChG,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAIpE,MAAM,UAAU,GAAG;IACjB,EAAE,EAAE,EAAuB;IAC3B,UAAU,EAAE,SAAkB;IAC9B,UAAU,EAAE,KAAc;CAC3B,CAAC;AAEF,MAAM,MAAM,GACV,SAAS,CAAC,iBAAiB;IAC3B,SAAS,CAAC,eAAe;IACzB,SAAS,CAAC,mBAAmB;IAC7B,SAAS,CAAC,aAAa;IACvB,SAAS,CAAC,kBAAkB;IAC5B,SAAS,CAAC,QAAQ;IAClB,SAAS,CAAC,mBAAmB;IAC7B,SAAS,CAAC,mBAAmB;IAC7B,SAAS,CAAC,6BAA6B,CAAC;AAE1C,MAAM,CAAC,MAAM,sBAAsB,GAAoC,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;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Q;YAAE,SAAS;QACxB,MAAM,IAAI,GAAG,iBAAiB,CAAC,QAAQ,EAAE,CAAC,CAAC,aAAa,EAAE,EAAE,CAAC,UAAU,CAAC,EAAE,GAAG,CAAC,CAAC;QAC/E,IAAI,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC;YAAE,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClD,CAAC;AACH,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Resolve `obj.method()` / `Pkg.fn()` calls.
3
+ *
4
+ * Direct symbol resolution handles concrete declarations; the polymorphic
5
+ * resolver handles interface / abstract method dispatch.
6
+ */
7
+ import ts from 'typescript';
8
+ import type { EdgeResolver } from './types.js';
9
+ export declare const resolvePropertyAccessCall: EdgeResolver<ts.CallExpression>;
10
+ //# sourceMappingURL=property-access.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"property-access.d.ts","sourceRoot":"","sources":["../../src/edge-resolvers/property-access.ts"],"names":[],"mappings":"AACA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAC;AAM5B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAkB/C,eAAO,MAAM,yBAAyB,EAAE,YAAY,CAAC,EAAE,CAAC,cAAc,CA6BrE,CAAC"}
@@ -0,0 +1,56 @@
1
+ // @fitness-ignore-file batch-operation-limits -- iterates bounded collection (catalog entries for a single property-access resolution)
2
+ /**
3
+ * Resolve `obj.method()` / `Pkg.fn()` calls.
4
+ *
5
+ * Direct symbol resolution handles concrete declarations; the polymorphic
6
+ * resolver handles interface / abstract method dispatch.
7
+ */
8
+ import ts from 'typescript';
9
+ import { DeclShape, functionLikeFromDeclaration } from '../edge-helpers/declaration-to-node.js';
10
+ import { resolveDeclToHash } from '../edge-helpers/resolve-decl.js';
11
+ import { unaliasSymbol } from '../edge-helpers/unalias-symbol.js';
12
+ const UNRESOLVED = {
13
+ to: [],
14
+ resolution: 'unknown',
15
+ confidence: 'low',
16
+ };
17
+ const ACCEPT = DeclShape.FunctionDeclaration |
18
+ DeclShape.ArrowFunction |
19
+ DeclShape.FunctionExpression |
20
+ DeclShape.MethodDeclaration |
21
+ DeclShape.ConstructorDeclaration |
22
+ DeclShape.Accessor |
23
+ DeclShape.VariableInitializer |
24
+ DeclShape.PropertyAssignmentInitializer;
25
+ export const resolvePropertyAccessCall = (node, ctx) => {
26
+ if (!ts.isPropertyAccessExpression(node.expression))
27
+ return UNRESOLVED;
28
+ const propName = node.expression.name.text;
29
+ const symbol = ctx.typeChecker.getSymbolAtLocation(node.expression);
30
+ if (!symbol)
31
+ return UNRESOLVED;
32
+ // Receiver binding name for `ns.fn()` / `Pkg.fn()` — the local name that
33
+ // carries the workspace import specifier (a namespace/default import). Used by
34
+ // the cross-package boundary path so `ns.fn()` binds to `ns`'s package, while
35
+ // the EXPORTED callee name to look up stays `fn` (`propName`).
36
+ const receiver = node.expression.expression;
37
+ const bindingNames = ts.isIdentifier(receiver) ? [propName, receiver.text] : [propName];
38
+ const real = unaliasSymbol(symbol, ctx.typeChecker);
39
+ const decls = real.getDeclarations() ?? [];
40
+ for (const d of decls) {
41
+ const sf = d.getSourceFile();
42
+ const declNode = functionLikeFromDeclaration(d, ACCEPT);
43
+ if (!declNode)
44
+ continue;
45
+ const hash = resolveDeclToHash(declNode, sf, [propName], ctx, bindingNames);
46
+ if (hash) {
47
+ return {
48
+ to: [hash],
49
+ resolution: 'method-dispatch',
50
+ confidence: 'high',
51
+ };
52
+ }
53
+ }
54
+ return UNRESOLVED;
55
+ };
56
+ //# sourceMappingURL=property-access.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"property-access.js","sourceRoot":"","sources":["../../src/edge-resolvers/property-access.ts"],"names":[],"mappings":"AAAA,uIAAuI;AACvI;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,EAAE,SAAS,EAAE,2BAA2B,EAAE,MAAM,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