@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,105 @@
1
+ /**
2
+ * Syntactic (checker-free) edge resolver — the fast-tier resolver.
3
+ *
4
+ * Resolves a call site from two signals only, never the type checker:
5
+ * 1. the callee's simple name (`foo` in `foo()`, the rightmost name in
6
+ * `a.b.c()`, the tag in `<Foo/>`, etc.), extracted syntactically;
7
+ * 2. the importing file's import graph — which module each name was
8
+ * imported from — used to disambiguate same-named functions across
9
+ * files.
10
+ *
11
+ * This generalizes the exact resolver's already-name-based
12
+ * `resolveByCatalogFallback`: that seed resolves a unique name with no
13
+ * file context; this adds import/same-file *pinning* to pick the right
14
+ * occurrence when a name is ambiguous.
15
+ *
16
+ * Honest approximation (the core invariant in code): every verdict is
17
+ * tagged `resolution: 'syntactic'` and confidence is CAPPED — `'medium'`
18
+ * when the import graph (or a same-file definition) pinned the target
19
+ * file, `'low'` otherwise. The fast path NEVER emits `'high'`; high
20
+ * confidence is reserved for semantic resolution.
21
+ */
22
+ import ts from 'typescript';
23
+ import type { Catalog, ResolverVerdict } from '@opensip-cli/graph';
24
+ /**
25
+ * Per-file import index: imported binding name → resolved target file
26
+ * (project-relative POSIX path), or `null` when the import resolves
27
+ * outside the catalog (external/bare package, unresolvable relative
28
+ * path). Built once per source file by {@link buildImportIndex}.
29
+ */
30
+ export type ImportIndex = ReadonlyMap<string, string | null>;
31
+ /** Context for a single syntactic resolution — all checker-free. */
32
+ export interface SyntacticContext {
33
+ readonly catalog: Catalog;
34
+ /** Project-relative POSIX path of the file containing the call site. */
35
+ readonly currentFileRel: string;
36
+ /** Import index for {@link currentFileRel}. */
37
+ readonly importIndex: ImportIndex;
38
+ }
39
+ /**
40
+ * Collect the set of project-relative file paths the catalog knows about
41
+ * (every occurrence carries one). Used to decide whether a resolved
42
+ * import specifier lands inside the catalog.
43
+ */
44
+ export declare function collectKnownFiles(catalog: Catalog): ReadonlySet<string>;
45
+ /**
46
+ * Resolve a single walked call/new/jsx/value-reference node to a verdict
47
+ * using only the callee name and the file's import graph.
48
+ *
49
+ * Returns `null` for a bare value reference / shorthand that resolves to
50
+ * nothing (mirrors the exact resolver, which suppresses empty
51
+ * value-reference verdicts rather than emitting a useless edge). A real
52
+ * call/new/jsx site that doesn't resolve still returns a verdict (with
53
+ * `to: []`) so it is counted as an unresolved call site.
54
+ */
55
+ export declare function resolveSyntactic(node: ts.Node, ctx: SyntacticContext): ResolverVerdict | null;
56
+ export interface Callee {
57
+ readonly name: string;
58
+ /** 'call' = call/new/jsx (a real invocation); 'ref' = bare value reference. */
59
+ readonly shape: 'call' | 'ref';
60
+ }
61
+ /**
62
+ * Extract the callee's simple name from a walked resolver-candidate node,
63
+ * purely syntactically. Returns `null` when no simple name is available
64
+ * (e.g. an element-access call `a[b]()` or a computed tag).
65
+ *
66
+ * Exported so the cross-shard boundary extractor can identify a call
67
+ * site's callee name without re-implementing the per-node-kind logic.
68
+ */
69
+ export declare function calleeSimpleName(node: ts.Node): Callee | null;
70
+ /**
71
+ * The node whose start position anchors a call/new edge's `(line, column)`
72
+ * identity — the CALLEE token, not the whole expression's start:
73
+ * - `x.m()` → `m` (the method name)
74
+ * - `f()` → `f` (the callee identifier — unchanged for plain calls)
75
+ * - `new C()` → `C` (the class name, not the `new` keyword)
76
+ * - `new ns.C()` → `C`
77
+ *
78
+ * WHY: a chained call `a().b()` (or `new A().b()`) has its inner CallExpression
79
+ * `a()` and its outer CallExpression `a().b()` BOTH starting at `a`, so keying an
80
+ * edge by the expression start collapses the two DISTINCT, REAL edges onto one
81
+ * `(owner, line, column)` identity — one shadows the other, and the exact and
82
+ * sharded engines keep different members of the pair (a spurious "conflict"
83
+ * divergence; see ADR-0033 follow-up). Anchoring at the callee token gives every
84
+ * call in a chain a distinct column, so both real edges survive in both engines.
85
+ * Non-call/new nodes (JSX elements, identifiers) keep their own start.
86
+ */
87
+ export declare function calleeAnchorNode(node: ts.Node): ts.Node;
88
+ /**
89
+ * Build the per-file import index by reading the file's `import` /
90
+ * `import =` statements and resolving each specifier to a project file
91
+ * (or `null` when it resolves outside the catalog). No type checker, no
92
+ * `ts.Program` — relative specifiers are resolved against the known-file
93
+ * set syntactically; bare specifiers are treated as external.
94
+ */
95
+ export declare function buildImportIndex(sourceFile: ts.SourceFile, projectDirAbs: string, knownFilesRel: ReadonlySet<string>): ImportIndex;
96
+ /**
97
+ * Build a per-file index of imported binding name → the RAW import
98
+ * specifier it came from (`'./x.js'`, `'@scope/pkg'`). Distinct from
99
+ * {@link buildImportIndex} (which resolves to a project file): the
100
+ * cross-shard boundary pass needs the raw specifier to re-resolve against
101
+ * the GLOBAL catalog, where the target file may live in another shard not
102
+ * present in this file's known-file set.
103
+ */
104
+ export declare function buildImportSpecifierIndex(sourceFile: ts.SourceFile): ReadonlyMap<string, string>;
105
+ //# sourceMappingURL=syntactic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"syntactic.d.ts","sourceRoot":"","sources":["../../src/edge-resolvers/syntactic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,KAAK,EAAE,OAAO,EAAsB,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAEvF;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;AAE7D,oEAAoE;AACpE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,wEAAwE;IACxE,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,+CAA+C;IAC/C,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;CACnC;AAID;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW,CAAC,MAAM,CAAC,CAOvE;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,gBAAgB,GAAG,eAAe,GAAG,IAAI,CAmB7F;AAyED,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,+EAA+E;IAC/E,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC;CAChC;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,MAAM,GAAG,IAAI,CAgB7D;AASD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,IAAI,CAMvD;AAWD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,EAAE,CAAC,UAAU,EACzB,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,GACjC,WAAW,CA4Bb;AAsBD;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,GAAG,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAgBhG"}
@@ -0,0 +1,294 @@
1
+ /**
2
+ * Syntactic (checker-free) edge resolver — the fast-tier resolver.
3
+ *
4
+ * Resolves a call site from two signals only, never the type checker:
5
+ * 1. the callee's simple name (`foo` in `foo()`, the rightmost name in
6
+ * `a.b.c()`, the tag in `<Foo/>`, etc.), extracted syntactically;
7
+ * 2. the importing file's import graph — which module each name was
8
+ * imported from — used to disambiguate same-named functions across
9
+ * files.
10
+ *
11
+ * This generalizes the exact resolver's already-name-based
12
+ * `resolveByCatalogFallback`: that seed resolves a unique name with no
13
+ * file context; this adds import/same-file *pinning* to pick the right
14
+ * occurrence when a name is ambiguous.
15
+ *
16
+ * Honest approximation (the core invariant in code): every verdict is
17
+ * tagged `resolution: 'syntactic'` and confidence is CAPPED — `'medium'`
18
+ * when the import graph (or a same-file definition) pinned the target
19
+ * file, `'low'` otherwise. The fast path NEVER emits `'high'`; high
20
+ * confidence is reserved for semantic resolution.
21
+ */
22
+ import { relative, sep, posix } from 'node:path';
23
+ import ts from 'typescript';
24
+ const UNRESOLVED = { to: [], resolution: 'syntactic', confidence: 'low' };
25
+ /**
26
+ * Collect the set of project-relative file paths the catalog knows about
27
+ * (every occurrence carries one). Used to decide whether a resolved
28
+ * import specifier lands inside the catalog.
29
+ */
30
+ export function collectKnownFiles(catalog) {
31
+ const files = new Set();
32
+ for (const occs of Object.values(catalog.functions)) {
33
+ if (!occs)
34
+ continue;
35
+ for (const o of occs)
36
+ files.add(o.filePath);
37
+ }
38
+ return files;
39
+ }
40
+ /**
41
+ * Resolve a single walked call/new/jsx/value-reference node to a verdict
42
+ * using only the callee name and the file's import graph.
43
+ *
44
+ * Returns `null` for a bare value reference / shorthand that resolves to
45
+ * nothing (mirrors the exact resolver, which suppresses empty
46
+ * value-reference verdicts rather than emitting a useless edge). A real
47
+ * call/new/jsx site that doesn't resolve still returns a verdict (with
48
+ * `to: []`) so it is counted as an unresolved call site.
49
+ */
50
+ export function resolveSyntactic(node, ctx) {
51
+ const callee = calleeSimpleName(node);
52
+ if (callee === null)
53
+ return null;
54
+ const candidates = ctx.catalog.functions[callee.name];
55
+ const isCallish = callee.shape === 'call';
56
+ if (!candidates || candidates.length === 0) {
57
+ // No catalog occurrence by this name. Bare references suppress;
58
+ // real call sites count as unresolved.
59
+ return isCallish ? UNRESOLVED : null;
60
+ }
61
+ const pin = resolvePin(callee.name, ctx, candidates);
62
+ const verdict = verdictForPin(pin, candidates);
63
+ // Suppress an empty bare-reference verdict (parity with exact mode).
64
+ if (verdict.to.length === 0 && !isCallish)
65
+ return null;
66
+ return verdict;
67
+ }
68
+ /**
69
+ * Decide which file (if any) the call's target is pinned to:
70
+ * - imported name → the module it was imported from (or `external`
71
+ * when that module is outside the catalog);
72
+ * - not imported but a same-named occurrence lives in this file →
73
+ * pin to this file (a same-file definition is as reliable a
74
+ * syntactic signal as an import);
75
+ * - otherwise → no pin (fall back to a project-wide name lookup).
76
+ */
77
+ function resolvePin(name, ctx, candidates) {
78
+ if (ctx.importIndex.has(name)) {
79
+ const target = ctx.importIndex.get(name) ?? null;
80
+ return target === null ? { kind: 'external' } : { kind: 'file', file: target };
81
+ }
82
+ if (candidates.some((c) => c.filePath === ctx.currentFileRel)) {
83
+ return { kind: 'file', file: ctx.currentFileRel };
84
+ }
85
+ return { kind: 'none' };
86
+ }
87
+ function verdictForPin(pin, candidates) {
88
+ if (pin.kind === 'file') {
89
+ const matches = candidates.filter((c) => c.filePath === pin.file);
90
+ if (matches.length > 0) {
91
+ // Import/same-file pinned — the strongest syntactic signal. Cap at
92
+ // medium. Multiple matches (overloads in one file) all flow through.
93
+ return {
94
+ to: matches.map((m) => m.bodyHash),
95
+ resolution: 'syntactic',
96
+ confidence: 'medium',
97
+ };
98
+ }
99
+ // Imported from a catalog file that has no such occurrence
100
+ // (e.g. a re-export) — degrade to a name-only guess.
101
+ return nameOnlyVerdict(candidates);
102
+ }
103
+ if (pin.kind === 'external') {
104
+ // Imported from outside the catalog: the real target is external, so
105
+ // a same-named project function would be a wrong guess. Stay honest.
106
+ return UNRESOLVED;
107
+ }
108
+ return nameOnlyVerdict(candidates);
109
+ }
110
+ /**
111
+ * No file pin: resolve by name alone. A unique candidate is a low-
112
+ * confidence guess; multiple candidates are genuinely ambiguous without
113
+ * type info, so we decline (empty `to`) rather than emit noise — the same
114
+ * conservative call the exact `resolveByCatalogFallback` makes.
115
+ */
116
+ function nameOnlyVerdict(candidates) {
117
+ if (candidates.length === 1) {
118
+ const only = candidates[0];
119
+ if (only)
120
+ return { to: [only.bodyHash], resolution: 'syntactic', confidence: 'low' };
121
+ }
122
+ return UNRESOLVED;
123
+ }
124
+ /**
125
+ * Extract the callee's simple name from a walked resolver-candidate node,
126
+ * purely syntactically. Returns `null` when no simple name is available
127
+ * (e.g. an element-access call `a[b]()` or a computed tag).
128
+ *
129
+ * Exported so the cross-shard boundary extractor can identify a call
130
+ * site's callee name without re-implementing the per-node-kind logic.
131
+ */
132
+ export function calleeSimpleName(node) {
133
+ if (ts.isCallExpression(node) || ts.isNewExpression(node)) {
134
+ const name = expressionSimpleName(node.expression);
135
+ return name === null ? null : { name, shape: 'call' };
136
+ }
137
+ if (ts.isJsxOpeningElement(node) || ts.isJsxSelfClosingElement(node)) {
138
+ const name = jsxTagSimpleName(node.tagName);
139
+ return name === null ? null : { name, shape: 'call' };
140
+ }
141
+ if (ts.isShorthandPropertyAssignment(node)) {
142
+ return { name: node.name.text, shape: 'ref' };
143
+ }
144
+ if (ts.isIdentifier(node)) {
145
+ return { name: node.text, shape: 'ref' };
146
+ }
147
+ return null;
148
+ }
149
+ /** Rightmost simple name of a call/new target expression. */
150
+ function expressionSimpleName(expr) {
151
+ if (ts.isIdentifier(expr))
152
+ return expr.text;
153
+ if (ts.isPropertyAccessExpression(expr))
154
+ return expr.name.text;
155
+ return null;
156
+ }
157
+ /**
158
+ * The node whose start position anchors a call/new edge's `(line, column)`
159
+ * identity — the CALLEE token, not the whole expression's start:
160
+ * - `x.m()` → `m` (the method name)
161
+ * - `f()` → `f` (the callee identifier — unchanged for plain calls)
162
+ * - `new C()` → `C` (the class name, not the `new` keyword)
163
+ * - `new ns.C()` → `C`
164
+ *
165
+ * WHY: a chained call `a().b()` (or `new A().b()`) has its inner CallExpression
166
+ * `a()` and its outer CallExpression `a().b()` BOTH starting at `a`, so keying an
167
+ * edge by the expression start collapses the two DISTINCT, REAL edges onto one
168
+ * `(owner, line, column)` identity — one shadows the other, and the exact and
169
+ * sharded engines keep different members of the pair (a spurious "conflict"
170
+ * divergence; see ADR-0033 follow-up). Anchoring at the callee token gives every
171
+ * call in a chain a distinct column, so both real edges survive in both engines.
172
+ * Non-call/new nodes (JSX elements, identifiers) keep their own start.
173
+ */
174
+ export function calleeAnchorNode(node) {
175
+ if (ts.isCallExpression(node) || ts.isNewExpression(node)) {
176
+ const callee = node.expression;
177
+ return ts.isPropertyAccessExpression(callee) ? callee.name : callee;
178
+ }
179
+ return node;
180
+ }
181
+ /** Rightmost simple name of a JSX tag (`Foo` or `A.B.Foo`). */
182
+ function jsxTagSimpleName(tag) {
183
+ if (ts.isIdentifier(tag))
184
+ return tag.text;
185
+ if (ts.isPropertyAccessExpression(tag))
186
+ return tag.name.text;
187
+ return null;
188
+ }
189
+ // ── import-index construction ─────────────────────────────────────
190
+ /**
191
+ * Build the per-file import index by reading the file's `import` /
192
+ * `import =` statements and resolving each specifier to a project file
193
+ * (or `null` when it resolves outside the catalog). No type checker, no
194
+ * `ts.Program` — relative specifiers are resolved against the known-file
195
+ * set syntactically; bare specifiers are treated as external.
196
+ */
197
+ export function buildImportIndex(sourceFile, projectDirAbs, knownFilesRel) {
198
+ const currentFileRel = toProjectRel(projectDirAbs, sourceFile.fileName);
199
+ const index = new Map();
200
+ for (const stmt of sourceFile.statements) {
201
+ if (ts.isImportDeclaration(stmt)) {
202
+ if (!ts.isStringLiteral(stmt.moduleSpecifier))
203
+ continue;
204
+ const target = resolveSpecifierToFile(stmt.moduleSpecifier.text, currentFileRel, knownFilesRel);
205
+ indexImportClause(stmt.importClause, target, index);
206
+ }
207
+ else if (ts.isImportEqualsDeclaration(stmt) &&
208
+ ts.isExternalModuleReference(stmt.moduleReference) &&
209
+ stmt.moduleReference.expression !== undefined &&
210
+ ts.isStringLiteral(stmt.moduleReference.expression)) {
211
+ const target = resolveSpecifierToFile(stmt.moduleReference.expression.text, currentFileRel, knownFilesRel);
212
+ index.set(stmt.name.text, target);
213
+ }
214
+ }
215
+ return index;
216
+ }
217
+ /** Record every binding name an import clause introduces → `value`. */
218
+ function indexImportClause(clause, value, index) {
219
+ if (clause === undefined)
220
+ return;
221
+ // `import Foo from '…'`
222
+ if (clause.name !== undefined)
223
+ index.set(clause.name.text, value);
224
+ const bindings = clause.namedBindings;
225
+ if (bindings === undefined)
226
+ return;
227
+ if (ts.isNamespaceImport(bindings)) {
228
+ // `import * as ns from '…'`
229
+ index.set(bindings.name.text, value);
230
+ }
231
+ else {
232
+ // `import { a, b as c } from '…'`
233
+ for (const el of bindings.elements)
234
+ index.set(el.name.text, value);
235
+ }
236
+ }
237
+ /**
238
+ * Build a per-file index of imported binding name → the RAW import
239
+ * specifier it came from (`'./x.js'`, `'@scope/pkg'`). Distinct from
240
+ * {@link buildImportIndex} (which resolves to a project file): the
241
+ * cross-shard boundary pass needs the raw specifier to re-resolve against
242
+ * the GLOBAL catalog, where the target file may live in another shard not
243
+ * present in this file's known-file set.
244
+ */
245
+ export function buildImportSpecifierIndex(sourceFile) {
246
+ const index = new Map();
247
+ for (const stmt of sourceFile.statements) {
248
+ if (ts.isImportDeclaration(stmt)) {
249
+ if (!ts.isStringLiteral(stmt.moduleSpecifier))
250
+ continue;
251
+ indexImportClause(stmt.importClause, stmt.moduleSpecifier.text, index);
252
+ }
253
+ else if (ts.isImportEqualsDeclaration(stmt) &&
254
+ ts.isExternalModuleReference(stmt.moduleReference) &&
255
+ stmt.moduleReference.expression !== undefined &&
256
+ ts.isStringLiteral(stmt.moduleReference.expression)) {
257
+ index.set(stmt.name.text, stmt.moduleReference.expression.text);
258
+ }
259
+ }
260
+ return index;
261
+ }
262
+ /**
263
+ * Resolve a relative import specifier to a known project file. Bare
264
+ * specifiers (`@scope/pkg`, `node:fs`) resolve to `null` (external).
265
+ * Relative specifiers are joined against the importing file's directory
266
+ * and matched against the catalog's known files, trying the standard TS
267
+ * extension and index-file candidates — no filesystem access, no tsc.
268
+ */
269
+ function resolveSpecifierToFile(specifier, currentFileRel, knownFilesRel) {
270
+ if (!specifier.startsWith('.'))
271
+ return null; // bare/external
272
+ const baseDir = posix.dirname(currentFileRel);
273
+ const joined = posix.normalize(posix.join(baseDir, specifier));
274
+ const stripped = joined.replace(/\.(?:ts|tsx|js|jsx|mjs|cjs|mts|cts)$/, '');
275
+ const candidates = [
276
+ joined,
277
+ `${stripped}.ts`,
278
+ `${stripped}.tsx`,
279
+ `${stripped}.mts`,
280
+ `${stripped}.cts`,
281
+ `${stripped}/index.ts`,
282
+ `${stripped}/index.tsx`,
283
+ ];
284
+ for (const candidate of candidates) {
285
+ if (knownFilesRel.has(candidate))
286
+ return candidate;
287
+ }
288
+ return null;
289
+ }
290
+ /** Absolute file path → project-relative POSIX path (catalog filePath shape). */
291
+ function toProjectRel(projectDirAbs, fileNameAbs) {
292
+ return relative(projectDirAbs, fileNameAbs).split(sep).join('/');
293
+ }
294
+ //# sourceMappingURL=syntactic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"syntactic.js","sourceRoot":"","sources":["../../src/edge-resolvers/syntactic.ts"],"names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IAAI,CAAC;AACd,CAAC;AAED,iFAAiF;AACjF,SAAS,YAAY,CAAC,aAAqB,EAAE,WAAmB;IAC9D,OAAO,QAAQ,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACnE,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * EdgeResolver signature alias (PR-4).
3
+ *
4
+ * Six resolvers (direct-call, property-access, jsx-element,
5
+ * new-expression, polymorphic, catalog-fallback) all share this shape.
6
+ * Declaring each resolver `: EdgeResolver<...>` makes drift a
7
+ * typecheck error.
8
+ */
9
+ import type { CrossPackageContext } from '../edge-helpers/cross-package-context.js';
10
+ import type { Catalog, ResolverVerdict } from '@opensip-cli/graph';
11
+ import type ts from 'typescript';
12
+ /** Shared context handed to each edge resolver: catalog, TS program, and project root. */
13
+ export interface ResolverContext {
14
+ readonly catalog: Catalog;
15
+ readonly program: ts.Program;
16
+ readonly typeChecker: ts.TypeChecker;
17
+ readonly sourceFile: ts.SourceFile;
18
+ readonly projectDirAbs: string;
19
+ /**
20
+ * Cross-package resolution context (export index + manifest index) — the
21
+ * SAME (import specifier + callee name) → unique exported SOURCE occurrence
22
+ * model the sharded linker uses. Resolvers consult it when the type checker
23
+ * leads them into a workspace package's bodiless `dist/*.d.ts` instead of the
24
+ * source body the catalog holds. Built once per resolve stage.
25
+ */
26
+ readonly crossPackage: CrossPackageContext;
27
+ /**
28
+ * The call site's file: imported binding name → its RAW import specifier
29
+ * (`@scope/pkg`, `./x.js`). Lets a resolver tie a callee name to the package
30
+ * it was imported from, so the export-index lookup is binding-required (no
31
+ * phantom name matches). One index per source file, lazily built + cached by
32
+ * the resolve loop.
33
+ */
34
+ readonly importSpecifiers: ReadonlyMap<string, string>;
35
+ }
36
+ export type EdgeResolver<N extends ts.Node = ts.Node> = (node: N, ctx: ResolverContext) => ResolverVerdict;
37
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/edge-resolvers/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,0FAA0F;AAC1F,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC;IACrC,QAAQ,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC;IACnC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B;;;;;;OAMG;IACH,QAAQ,CAAC,YAAY,EAAE,mBAAmB,CAAC;IAC3C;;;;;;OAMG;IACH,QAAQ,CAAC,gBAAgB,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxD;AAED,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,IAAI,IAAI,CACtD,IAAI,EAAE,CAAC,EACP,GAAG,EAAE,eAAe,KACjB,eAAe,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * EdgeResolver signature alias (PR-4).
3
+ *
4
+ * Six resolvers (direct-call, property-access, jsx-element,
5
+ * new-expression, polymorphic, catalog-fallback) all share this shape.
6
+ * Declaring each resolver `: EdgeResolver<...>` makes drift a
7
+ * typecheck error.
8
+ */
9
+ export {};
10
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/edge-resolvers/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @fileoverview Value-reference and shorthand-assignment resolution.
3
+ *
4
+ * Extracted from `edges.ts` so the main edge-resolution module stays
5
+ * focused on the orchestrator + dispatch table. This file owns:
6
+ *
7
+ * - The AST predicates that classify an Identifier as a *value*
8
+ * reference (i.e. not a declaration name, not a structural slot,
9
+ * not the target of a call/new/JSX).
10
+ * - The symbol-to-bodyHash resolution shared by both the
11
+ * `Identifier`-as-value-reference and `ShorthandPropertyAssignment`
12
+ * resolvers.
13
+ */
14
+ import ts from 'typescript';
15
+ import type { ResolverContext } from './edge-resolvers/types.js';
16
+ import type { ResolverVerdict } from '@opensip-cli/graph';
17
+ /**
18
+ * Identifier appears in a value position — not as a call target, not as
19
+ * a binding name, not as the property name of a property access. We
20
+ * want to capture handoff cases: function passed as argument, shorthand
21
+ * property assignment, default value, return value.
22
+ */
23
+ export declare function isValueReference(node: ts.Identifier): boolean;
24
+ export declare function resolveValueReference(node: ts.Identifier, ctx: ResolverContext): ResolverVerdict;
25
+ export declare function resolveShorthandAssignment(node: ts.ShorthandPropertyAssignment, ctx: ResolverContext): ResolverVerdict;
26
+ //# sourceMappingURL=edges-value-reference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edges-value-reference.d.ts","sourceRoot":"","sources":["../src/edges-value-reference.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAC;AAI5B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,GAAG,OAAO,CAI7D;AAmDD,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,EAAE,GAAG,EAAE,eAAe,GAAG,eAAe,CAGhG;AAED,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,EAAE,CAAC,2BAA2B,EACpC,GAAG,EAAE,eAAe,GACnB,eAAe,CAGjB"}
@@ -0,0 +1,138 @@
1
+ /**
2
+ * @fileoverview Value-reference and shorthand-assignment resolution.
3
+ *
4
+ * Extracted from `edges.ts` so the main edge-resolution module stays
5
+ * focused on the orchestrator + dispatch table. This file owns:
6
+ *
7
+ * - The AST predicates that classify an Identifier as a *value*
8
+ * reference (i.e. not a declaration name, not a structural slot,
9
+ * not the target of a call/new/JSX).
10
+ * - The symbol-to-bodyHash resolution shared by both the
11
+ * `Identifier`-as-value-reference and `ShorthandPropertyAssignment`
12
+ * resolvers.
13
+ */
14
+ import ts from 'typescript';
15
+ import { resolveDeclToHash } from './edge-helpers/resolve-decl.js';
16
+ /**
17
+ * Identifier appears in a value position — not as a call target, not as
18
+ * a binding name, not as the property name of a property access. We
19
+ * want to capture handoff cases: function passed as argument, shorthand
20
+ * property assignment, default value, return value.
21
+ */
22
+ export function isValueReference(node) {
23
+ const parent = node.parent;
24
+ if (!parent)
25
+ return false;
26
+ return !isStructuralName(node, parent) && !isCallSiteTarget(node, parent);
27
+ }
28
+ /**
29
+ * Identifier is the *name* of some declaration / property, or part of
30
+ * a type / import / export. Not a value use.
31
+ */
32
+ function isStructuralName(node, parent) {
33
+ return isParentNamePosition(node, parent) || isUnconditionallyStructural(parent);
34
+ }
35
+ function isParentNamePosition(node, parent) {
36
+ // Each entry: matcher for the parent kind + the property whose value
37
+ // we compare with `node` to decide whether the identifier is the
38
+ // structural name slot.
39
+ const slot = readNamedSlot(parent);
40
+ return slot === node;
41
+ }
42
+ function readNamedSlot(parent) {
43
+ if (ts.isVariableDeclaration(parent))
44
+ return parent.name;
45
+ if (ts.isParameter(parent))
46
+ return parent.name;
47
+ if (ts.isFunctionDeclaration(parent))
48
+ return parent.name;
49
+ if (ts.isClassDeclaration(parent))
50
+ return parent.name;
51
+ if (ts.isMethodDeclaration(parent))
52
+ return parent.name;
53
+ if (ts.isPropertyDeclaration(parent))
54
+ return parent.name;
55
+ if (ts.isPropertyAssignment(parent))
56
+ return parent.name;
57
+ if (ts.isPropertyAccessExpression(parent))
58
+ return parent.name;
59
+ if (ts.isLabeledStatement(parent))
60
+ return parent.label;
61
+ if (ts.isBindingElement(parent))
62
+ return parent.name;
63
+ return undefined;
64
+ }
65
+ function isUnconditionallyStructural(parent) {
66
+ return (ts.isQualifiedName(parent) ||
67
+ ts.isImportSpecifier(parent) ||
68
+ ts.isImportClause(parent) ||
69
+ ts.isExportSpecifier(parent) ||
70
+ ts.isTypeReferenceNode(parent));
71
+ }
72
+ /** Identifier is the call target / new target / JSX tag — we handle those elsewhere. */
73
+ function isCallSiteTarget(node, parent) {
74
+ if (ts.isCallExpression(parent) && parent.expression === node)
75
+ return true;
76
+ if (ts.isNewExpression(parent) && parent.expression === node)
77
+ return true;
78
+ if (ts.isJsxOpeningElement(parent) && parent.tagName === node)
79
+ return true;
80
+ if (ts.isJsxSelfClosingElement(parent) && parent.tagName === node)
81
+ return true;
82
+ return false;
83
+ }
84
+ export function resolveValueReference(node, ctx) {
85
+ const symbol = ctx.typeChecker.getSymbolAtLocation(node);
86
+ return resolveSymbolToHash(symbol, node.text, ctx);
87
+ }
88
+ export function resolveShorthandAssignment(node, ctx) {
89
+ const symbol = ctx.typeChecker.getShorthandAssignmentValueSymbol(node);
90
+ return resolveSymbolToHash(symbol, node.name.text, ctx);
91
+ }
92
+ /**
93
+ * Resolve any symbol whose declarations might be a function-shaped
94
+ * node to its catalog bodyHash. Used by value-reference and shorthand
95
+ * resolvers — they share this lookup logic.
96
+ */
97
+ function resolveSymbolToHash(symbol, fallbackName, ctx) {
98
+ if (!symbol)
99
+ return { to: [], resolution: 'unknown', confidence: 'low' };
100
+ for (const d of symbol.getDeclarations() ?? []) {
101
+ const hash = hashFromDeclaration(d, fallbackName, ctx);
102
+ if (hash)
103
+ return { to: [hash], resolution: 'static', confidence: 'medium' };
104
+ }
105
+ return { to: [], resolution: 'unknown', confidence: 'low' };
106
+ }
107
+ function hashFromDeclaration(d, fallbackName, ctx) {
108
+ if (ts.isClassDeclaration(d) || ts.isClassExpression(d)) {
109
+ const ctor = findClassConstructor(d);
110
+ if (!ctor)
111
+ return null;
112
+ const className = d.name?.text;
113
+ return resolveDeclToHash(ctor, d.getSourceFile(), className ? [className] : [], ctx);
114
+ }
115
+ if (ts.isFunctionDeclaration(d) ||
116
+ ts.isArrowFunction(d) ||
117
+ ts.isFunctionExpression(d) ||
118
+ ts.isMethodDeclaration(d)) {
119
+ return resolveDeclToHash(d, d.getSourceFile(), [fallbackName], ctx);
120
+ }
121
+ if (ts.isVariableDeclaration(d) && d.initializer) {
122
+ const init = d.initializer;
123
+ if (ts.isArrowFunction(init) || ts.isFunctionExpression(init)) {
124
+ return resolveDeclToHash(init, d.getSourceFile(), [fallbackName], ctx);
125
+ }
126
+ }
127
+ return null;
128
+ }
129
+ /* v8 ignore start */
130
+ function findClassConstructor(cls) {
131
+ for (const m of cls.members) {
132
+ if (ts.isConstructorDeclaration(m))
133
+ return m;
134
+ }
135
+ return null;
136
+ }
137
+ /* v8 ignore stop */
138
+ //# sourceMappingURL=edges-value-reference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edges-value-reference.js","sourceRoot":"","sources":["../src/edges-value-reference.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAKnE;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAmB;IAClD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IAC3B,IAAI,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAC1B,OAAO,CAAC,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC5E,CAAC;AAED;;;GAGG;AAC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