@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,44 @@
1
+ /**
2
+ * Acceptance fixture: interface dispatch.
3
+ *
4
+ * `config.method()` on an interface type resolves to the value
5
+ * declaration that implements the method.
6
+ */
7
+ import { mkdtempSync, rmSync } from 'node:fs';
8
+ import { tmpdir } from 'node:os';
9
+ import { join } from 'node:path';
10
+ import { afterAll, beforeAll, describe, expect, it } from 'vitest';
11
+ import { findOccurrence, runFixture, writeFixture } from './_fixture-runner.js';
12
+ describe('interface-dispatch acceptance fixture', () => {
13
+ const fixtureDir = mkdtempSync(join(tmpdir(), 'graph-iface-'));
14
+ afterAll(() => {
15
+ rmSync(fixtureDir, { recursive: true, force: true });
16
+ });
17
+ writeFixture(fixtureDir, {
18
+ 'iface.ts': `export interface Greeter { greet(): string; }\nexport const englishGreeter: Greeter = {\n greet(): string { return 'hello'; }\n};\n`,
19
+ 'caller.ts': `import { englishGreeter } from './iface.js';\nimport type { Greeter } from './iface.js';\nexport function callGreet(g: Greeter): string {\n return g.greet();\n}\nexport function callConcrete(): string {\n return englishGreeter.greet();\n}\n`,
20
+ });
21
+ let catalog;
22
+ beforeAll(async () => {
23
+ catalog = await runFixture(fixtureDir);
24
+ });
25
+ it('records a method-dispatch edge for g.greet()', () => {
26
+ const callGreetOcc = findOccurrence(catalog, (o) => o.simpleName === 'callGreet');
27
+ expect(callGreetOcc).toBeDefined();
28
+ const greetEdge = callGreetOcc.calls.find((e) => e.text.includes('greet'));
29
+ expect(greetEdge).toBeDefined();
30
+ // Acceptance: SOME edge resolution shape is recorded. 'method-dispatch'
31
+ // is the ideal verdict; 'unknown' (from catalog-fallback) is acceptable
32
+ // when there's exactly one greet occurrence in the project.
33
+ expect(['method-dispatch', 'static', 'unknown']).toContain(greetEdge.resolution);
34
+ expect(greetEdge.to.length).toBeGreaterThan(0);
35
+ });
36
+ it('resolves englishGreeter.greet() to the implementation', () => {
37
+ const callConcreteOcc = findOccurrence(catalog, (o) => o.simpleName === 'callConcrete');
38
+ expect(callConcreteOcc).toBeDefined();
39
+ const greetEdge = callConcreteOcc.calls.find((e) => e.text.includes('greet'));
40
+ expect(greetEdge).toBeDefined();
41
+ expect(greetEdge.to.length).toBeGreaterThan(0);
42
+ });
43
+ });
44
+ //# sourceMappingURL=interface-dispatch.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interface-dispatch.test.js","sourceRoot":"","sources":["../../../src/__tests__/acceptance/interface-dispatch.test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE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E,wEAAwE;QACxE,4DAA4D;QAC5D,MAAM,CAAC,CAAC,iBAAiB,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,SAAU,CAAC,UAAU,CAAC,CAAC;QAClF,MAAM,CAAC,SAAU,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uDAAuD,EAAE,GAAG,EAAE;QAC/D,MAAM,eAAe,GAAG,cAAc,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,cAAc,CAAC,CAAC;QACxF,MAAM,CAAC,eAAe,CAAC,CAAC,WAAW,EAAE,CAAC;QACtC,MAAM,SAAS,GAAG,eAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;QAC/E,MAAM,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,CAAC;QAChC,MAAM,CAAC,SAAU,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Inventory completeness gate (§8.1).
3
+ *
4
+ * Asserts the catalog produced by stage 0 + stage 1 against
5
+ * packages/fitness/engine has the required scale plus the
6
+ * spot-check assertions for src/gate.ts and src/framework/define-check.ts.
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=inventory-completeness.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inventory-completeness.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/acceptance/inventory-completeness.test.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Inventory completeness gate (§8.1).
3
+ *
4
+ * Asserts the catalog produced by stage 0 + stage 1 against
5
+ * packages/fitness/engine has the required scale plus the
6
+ * spot-check assertions for src/gate.ts and src/framework/define-check.ts.
7
+ */
8
+ import { dirname, resolve } from 'node:path';
9
+ import { fileURLToPath } from 'node:url';
10
+ import { describe, expect, it } from 'vitest';
11
+ const HERE = dirname(fileURLToPath(import.meta.url));
12
+ import { discoverFiles } from '../../discover.js';
13
+ import { buildCatalog } from '../_pipeline.js';
14
+ function loadFitnessCatalog() {
15
+ const projectDir = resolve(HERE, '../../../../../fitness/engine');
16
+ const discovery = discoverFiles({ projectDir });
17
+ const inventory = buildCatalog({
18
+ projectDirAbs: discovery.projectDirAbs,
19
+ files: discovery.files,
20
+ compilerOptions: discovery.compilerOptions,
21
+ tsConfigPathAbs: discovery.tsConfigPathAbs,
22
+ });
23
+ return inventory.catalog;
24
+ }
25
+ function namesInFile(catalog, filePath) {
26
+ const out = [];
27
+ for (const occs of Object.values(catalog.functions)) {
28
+ for (const o of occs) {
29
+ if (o.filePath === filePath)
30
+ out.push(o.simpleName);
31
+ }
32
+ }
33
+ return out;
34
+ }
35
+ describe('inventory completeness (§8.1) against fitness/engine', () => {
36
+ const catalog = loadFitnessCatalog();
37
+ const fileSet = new Set();
38
+ let occurrenceCount = 0;
39
+ for (const occs of Object.values(catalog.functions)) {
40
+ for (const o of occs) {
41
+ fileSet.add(o.filePath);
42
+ occurrenceCount++;
43
+ }
44
+ }
45
+ it('contains at least 91 files', () => {
46
+ expect(fileSet.size).toBeGreaterThanOrEqual(91);
47
+ });
48
+ it('contains at least 200 function occurrences', () => {
49
+ expect(occurrenceCount).toBeGreaterThanOrEqual(200);
50
+ });
51
+ it('captures the renderGateCompareOutput function in src/cli/fit/gate-compare-render.ts', () => {
52
+ // (Was src/gate.ts's saveBaseline/compareToBaseline — gate.ts was deleted when
53
+ // fitness moved onto the host baseline plane, ADR-0036. This file's exported
54
+ // function declarations demonstrate the same inventory-completeness property.)
55
+ const names = namesInFile(catalog, 'src/cli/fit/gate-compare-render.ts');
56
+ expect(names).toContain('renderGateCompareOutput');
57
+ });
58
+ it('captures the defineCheck function in src/framework/define-check.ts', () => {
59
+ const names = namesInFile(catalog, 'src/framework/define-check.ts');
60
+ expect(names).toContain('defineCheck');
61
+ });
62
+ it('synthesizes a module-init occurrence for every file', () => {
63
+ let modInits = 0;
64
+ for (const occs of Object.values(catalog.functions)) {
65
+ for (const o of occs)
66
+ if (o.kind === 'module-init')
67
+ modInits++;
68
+ }
69
+ expect(modInits).toBe(fileSet.size);
70
+ });
71
+ });
72
+ //# sourceMappingURL=inventory-completeness.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inventory-completeness.test.js","sourceRoot":"","sources":["../../../src/__tests__/acceptance/inventory-completeness.test.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAErD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAI/C,SAAS,kBAAkB;IACzB,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,EAAE,+BAA+B,CAAC,CAAC;IAClE,MAAM,SAAS,GAAG,aAAa,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC;IAChD,MAAM,SAAS,GAAG,YAAY,CAAC;QAC7B,aAAa,EAAE,SAAS,CAAC,aAAa;QACtC,KAAK,EAAE,SAAS,CAAC,KAAK;QACtB,eAAe,EAAE,SAAS,CAAC,eAAe;QAC1C,eAAe,EAAE,SAAS,C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EAA6E;QAC7E,+EAA+E;QAC/E,MAAM,KAAK,GAAG,WAAW,CAAC,OAAO,EAAE,oCAAoC,CAAC,CAAC;QACzE,MAAM,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,yBAAyB,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oEAAoE,EAAE,GAAG,EAAE;QAC5E,MAAM,KAAK,GAAG,WAAW,CAAC,OAAO,EAAE,+BAA+B,CAAC,CAAC;QACpE,MAAM,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qDAAqD,EAAE,GAAG,EAAE;QAC7D,IAAI,QAAQ,GAAG,CAAC,CAAC;QACjB,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;YACpD,KAAK,MAAM,CAAC,IAAI,IAAI;gBAAE,IAAI,CAAC,CAAC,IAAI,KAAK,aAAa;oBAAE,QAAQ,EAAE,CAAC;QACjE,CAAC;QACD,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Acceptance fixture: JSX element resolution.
3
+ *
4
+ * `<Foo />` resolves to the Foo declaration; `<div />` is ignored.
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=jsx-resolution.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsx-resolution.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/acceptance/jsx-resolution.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Acceptance fixture: JSX element resolution.
3
+ *
4
+ * `<Foo />` resolves to the Foo declaration; `<div />` is ignored.
5
+ */
6
+ import { mkdtempSync, rmSync } from 'node:fs';
7
+ import { tmpdir } from 'node:os';
8
+ import { join } from 'node:path';
9
+ import { afterAll, beforeAll, describe, expect, it } from 'vitest';
10
+ import { findOccurrence, runFixture, writeFixture } from './_fixture-runner.js';
11
+ describe('jsx-resolution acceptance fixture', () => {
12
+ const fixtureDir = mkdtempSync(join(tmpdir(), 'graph-jsx-'));
13
+ afterAll(() => {
14
+ rmSync(fixtureDir, { recursive: true, force: true });
15
+ });
16
+ writeFixture(fixtureDir, {
17
+ 'foo.tsx': `export function Foo(): JSX.Element { return <span>foo</span>; }\n`,
18
+ 'caller.tsx': `import { Foo } from './foo.js';\nexport function Caller(): JSX.Element {\n return <div><Foo /></div>;\n}\n`,
19
+ });
20
+ let catalog;
21
+ beforeAll(async () => {
22
+ catalog = await runFixture(fixtureDir);
23
+ });
24
+ it('resolves <Foo /> to the Foo function declaration', () => {
25
+ const callerOcc = findOccurrence(catalog, (o) => o.simpleName === 'Caller');
26
+ expect(callerOcc).toBeDefined();
27
+ const fooEdge = callerOcc.calls.find((e) => e.text.includes('<Foo'));
28
+ expect(fooEdge).toBeDefined();
29
+ expect(fooEdge.resolution).toBe('jsx');
30
+ expect(fooEdge.to.length).toBe(1);
31
+ const fooOcc = findOccurrence(catalog, (o) => o.simpleName === 'Foo' && o.kind === 'function-declaration');
32
+ expect(fooOcc).toBeDefined();
33
+ expect(fooEdge.to[0]).toBe(fooOcc.bodyHash);
34
+ });
35
+ it('does not record <div /> as a JSX edge', () => {
36
+ const callerOcc = findOccurrence(catalog, (o) => o.simpleName === 'Caller');
37
+ expect(callerOcc).toBeDefined();
38
+ const divEdges = callerOcc.calls.filter((e) => e.text.includes('<div'));
39
+ // <div> is intrinsic; the resolver should return UNRESOLVED but the
40
+ // call site IS recorded as an edge with `to: []`. The acceptance
41
+ // shape is: no resolved entry pointing at any catalog occurrence.
42
+ for (const e of divEdges)
43
+ expect(e.to.length).toBe(0);
44
+ });
45
+ });
46
+ //# sourceMappingURL=jsx-resolution.test.js.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AI,CAAC,CAAC,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Acceptance fixture: module-init synthesis.
3
+ *
4
+ * Top-level statements in a file are owned by a synthesized
5
+ * <module-init> pseudo-occurrence. Calls inside top-level
6
+ * variable initializers and side-effect statements show up
7
+ * as edges on this occurrence.
8
+ */
9
+ export {};
10
+ //# sourceMappingURL=module-init.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module-init.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/acceptance/module-init.test.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Acceptance fixture: module-init synthesis.
3
+ *
4
+ * Top-level statements in a file are owned by a synthesized
5
+ * <module-init> pseudo-occurrence. Calls inside top-level
6
+ * variable initializers and side-effect statements show up
7
+ * as edges on this occurrence.
8
+ */
9
+ import { mkdtempSync, rmSync } from 'node:fs';
10
+ import { tmpdir } from 'node:os';
11
+ import { join } from 'node:path';
12
+ import { afterAll, beforeAll, describe, expect, it } from 'vitest';
13
+ import { findOccurrence, runFixture, writeFixture } from './_fixture-runner.js';
14
+ describe('module-init acceptance fixture', () => {
15
+ const fixtureDir = mkdtempSync(join(tmpdir(), 'graph-modinit-'));
16
+ afterAll(() => {
17
+ rmSync(fixtureDir, { recursive: true, force: true });
18
+ });
19
+ writeFixture(fixtureDir, {
20
+ 'lib.ts': `export function helper(): number { return 1; }\n`,
21
+ 'init.ts': `import { helper } from './lib.js';\nexport const result = helper();\nhelper();\n`,
22
+ });
23
+ let catalog;
24
+ beforeAll(async () => {
25
+ catalog = await runFixture(fixtureDir);
26
+ });
27
+ it('synthesizes a <module-init> occurrence for init.ts', () => {
28
+ const modInit = findOccurrence(catalog, (o) => o.kind === 'module-init' && o.filePath === 'init.ts');
29
+ expect(modInit).toBeDefined();
30
+ expect(modInit.simpleName).toBe('<module-init:init.ts>');
31
+ });
32
+ it('records helper() calls on the module-init occurrence', () => {
33
+ const modInit = findOccurrence(catalog, (o) => o.kind === 'module-init' && o.filePath === 'init.ts');
34
+ expect(modInit).toBeDefined();
35
+ const helperEdges = modInit.calls.filter((e) => e.text.includes('helper'));
36
+ expect(helperEdges.length).toBeGreaterThanOrEqual(1);
37
+ expect(helperEdges[0].to.length).toBe(1);
38
+ });
39
+ });
40
+ //# sourceMappingURL=module-init.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module-init.test.js","sourceRoot":"","sources":["../../../src/__tests__/acceptance/module-init.test.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAEnE,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAIhF,QAAQ,CAAC,gCAAgC,EAAE,GAAG,EAAE;IAC9C,MAAM,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,gBAAgB,CAAC,CAAC,CAAC;IACjE,QAAQ,CAAC,GAAG,EAAE;QACZ,MAAM,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;IAEH,YAAY,CAAC,UAAU,EAAE;QACvB,QAAQ,EAAE,kDAAkD;QAC5D,SAAS,EAAE,kFAAkF;KAC9F,CAAC,CAAC;IACH,IAAI,OAAiB,CAAC;IACtB,SAAS,CAAC,KAAK,IAAI,EAAE;QACnB,OAAO,GAAG,MAAM,UAAU,CAAC,UAAU,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oDAAoD,EAAE,GAAG,EAAE;QAC5D,MAAM,OAAO,GAAG,cAAc,CAC5B,OAAO,EACP,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,aAAa,IAAI,CAAC,CAAC,QAAQ,KAAK,SAAS,CAC5D,CAAC;QACF,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;QAC9B,MAAM,CAAC,OAAQ,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sDAAsD,EAAE,GAAG,EAAE;QAC9D,MAAM,OAAO,GAAG,cAAc,CAC5B,OAAO,EACP,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,aAAa,IAAI,CAAC,CAAC,QAAQ,KAAK,SAAS,CAC5D,CAAC;QACF,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;QAC9B,MAAM,WAAW,GAAG,OAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC5E,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC;QACrD,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Acceptance fixture: projectdir normalization.
3
+ *
4
+ * Relative cwd resolves to the realpath'd absolute project dir.
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=projectdir-normalization.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projectdir-normalization.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/acceptance/projectdir-normalization.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Acceptance fixture: projectdir normalization.
3
+ *
4
+ * Relative cwd resolves to the realpath'd absolute project dir.
5
+ */
6
+ import { mkdtempSync, realpathSync, rmSync, symlinkSync } from 'node:fs';
7
+ import { tmpdir } from 'node:os';
8
+ import { join } from 'node:path';
9
+ import { afterAll, describe, expect, it } from 'vitest';
10
+ import { discoverFiles } from '../../discover.js';
11
+ import { writeFixture } from './_fixture-runner.js';
12
+ describe('projectdir-normalization acceptance fixture', () => {
13
+ // realpathSync collapses /var → /private/var on macOS; we compare the
14
+ // canonical form so the test passes on every platform.
15
+ const realDir = realpathSync(mkdtempSync(join(tmpdir(), 'graph-realdir-')));
16
+ const linkPath = `${realDir}-link`;
17
+ afterAll(() => {
18
+ try {
19
+ rmSync(linkPath, { recursive: true, force: true });
20
+ }
21
+ catch {
22
+ /* ignore */
23
+ }
24
+ rmSync(realDir, { recursive: true, force: true });
25
+ });
26
+ writeFixture(realDir, {
27
+ 'a.ts': `export const x = 1;\n`,
28
+ });
29
+ it('resolves relative paths to absolute', () => {
30
+ const out = discoverFiles({ projectDir: realDir });
31
+ expect(out.projectDirAbs.startsWith('/')).toBe(true);
32
+ expect(out.files.length).toBeGreaterThan(0);
33
+ });
34
+ it('follows symlinks via realpath', () => {
35
+ try {
36
+ symlinkSync(realDir, linkPath, 'dir');
37
+ }
38
+ catch {
39
+ // Some sandboxes disallow symlinks; skip the assertion in that
40
+ // case rather than fail the whole suite.
41
+ return;
42
+ }
43
+ const out = discoverFiles({ projectDir: linkPath });
44
+ // realpath should collapse the link to the realDir.
45
+ expect(out.projectDirAbs).toBe(realDir);
46
+ });
47
+ it('throws ConfigurationError on a missing directory', () => {
48
+ expect(() => discoverFiles({ projectDir: `${realDir}-missing` })).toThrow(/does not exist/);
49
+ });
50
+ });
51
+ //# sourceMappingURL=projectdir-normalization.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projectdir-normalization.test.js","sourceRoot":"","sources":["../../../src/__tests__/acceptance/projectdir-normalization.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAExD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,QAAQ,CAAC,6CAA6C,EAAE,GAAG,EAAE;IAC3D,sEAAsE;IACtE,uDAAuD;IACvD,MAAM,OAAO,GAAG,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAC5E,MAAM,QAAQ,GAAG,GAAG,OAAO,OAAO,CAAC;IACnC,QAAQ,CAAC,GAAG,EAAE;QACZ,IAAI,CAAC;YACH,MAAM,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACrD,CAAC;QAAC,MAAM,CAAC;YACP,YAAY;QACd,CAAC;QACD,MAAM,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;IAEH,YAAY,CAAC,OAAO,EAAE;QACpB,MAAM,EAAE,uBAAuB;KAChC,CAAC,CAAC;IAEH,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE;QAC7C,MAAM,GAAG,GAAG,aAAa,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC;QACnD,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrD,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+BAA+B,EAAE,GAAG,EAAE;QACvC,IAAI,CAAC;YACH,WAAW,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;QACxC,CAAC;QAAC,MAAM,CAAC;YACP,+DAA+D;YAC/D,yCAAyC;YACzC,OAAO;QACT,CAAC;QACD,MAAM,GAAG,GAAG,aAAa,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAC;QACpD,oDAAoD;QACpD,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kDAAkD,EAAE,GAAG,EAAE;QAC1D,MAAM,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,EAAE,UAAU,EAAE,GAAG,OAAO,UAAU,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC9F,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Regression: call edges must not be unioned across body-twins.
3
+ *
4
+ * Two files define a `work()` with an IDENTICAL body (same bodyHash) that each
5
+ * calls a local `helper()` with a DIFFERENT body (distinct hashes). Edges are
6
+ * bucketed per owner occurrence (bodyHash + filePath), so each `work` keeps an
7
+ * edge to its OWN file's helper — not the union of both. Before the per-occurrence
8
+ * keying this produced phantom cross-file edges (the `stripStrings`/`scan`
9
+ * artifact across the language adapters).
10
+ */
11
+ export {};
12
+ //# sourceMappingURL=body-twin-edges.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"body-twin-edges.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/body-twin-edges.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Regression: call edges must not be unioned across body-twins.
3
+ *
4
+ * Two files define a `work()` with an IDENTICAL body (same bodyHash) that each
5
+ * calls a local `helper()` with a DIFFERENT body (distinct hashes). Edges are
6
+ * bucketed per owner occurrence (bodyHash + filePath), so each `work` keeps an
7
+ * edge to its OWN file's helper — not the union of both. Before the per-occurrence
8
+ * keying this produced phantom cross-file edges (the `stripStrings`/`scan`
9
+ * artifact across the language adapters).
10
+ */
11
+ import { mkdtempSync, mkdirSync, writeFileSync, rmSync } from 'node:fs';
12
+ import { tmpdir } from 'node:os';
13
+ import { join } from 'node:path';
14
+ import { ownerEdgeKey } from '@opensip-cli/graph';
15
+ import { afterEach, beforeEach, describe, expect, it } from 'vitest';
16
+ import { typescriptGraphAdapter } from '../index.js';
17
+ let root;
18
+ beforeEach(() => {
19
+ root = mkdtempSync(join(tmpdir(), 'graph-ts-body-twin-'));
20
+ mkdirSync(join(root, 'src'), { recursive: true });
21
+ writeFileSync(join(root, 'tsconfig.json'), JSON.stringify({
22
+ compilerOptions: {
23
+ target: 'ES2022',
24
+ module: 'Node16',
25
+ moduleResolution: 'Node16',
26
+ strict: true,
27
+ },
28
+ include: ['**/*.ts'],
29
+ }), 'utf8');
30
+ // `work` bodies are identical (body-twin); `helper` bodies differ per file.
31
+ writeFileSync(join(root, 'src/a.ts'), 'function helper(): number { return 1; }\nexport function work(): number { return helper(); }\n', 'utf8');
32
+ writeFileSync(join(root, 'src/b.ts'), 'function helper(): number { return 22; }\nexport function work(): number { return helper(); }\n', 'utf8');
33
+ });
34
+ afterEach(() => rmSync(root, { recursive: true, force: true }));
35
+ function findOcc(catalog, name, filePath) {
36
+ return catalog.functions[name]?.find((o) => o.filePath === filePath);
37
+ }
38
+ describe('body-twin edge keying', () => {
39
+ it('keeps each twin occurrence’s edges to its own file, not the union', async () => {
40
+ const discovery = typescriptGraphAdapter.discoverFiles({ cwd: root });
41
+ const parsed = typescriptGraphAdapter.parseProject({
42
+ projectDirAbs: discovery.projectDirAbs,
43
+ files: discovery.files,
44
+ compilerOptions: discovery.compilerOptions,
45
+ resolutionMode: 'exact',
46
+ });
47
+ const walked = typescriptGraphAdapter.walkProject({
48
+ project: parsed.project,
49
+ projectDirAbs: discovery.projectDirAbs,
50
+ files: discovery.files,
51
+ });
52
+ const catalog = {
53
+ version: '3.0',
54
+ tool: 'graph',
55
+ language: 'typescript',
56
+ builtAt: 'x',
57
+ cacheKey: 't',
58
+ functions: walked.occurrences,
59
+ };
60
+ const { edgesByOwner } = await typescriptGraphAdapter.resolveCallSites({
61
+ project: parsed.project,
62
+ catalog,
63
+ callSites: walked.callSites,
64
+ dependencySites: walked.dependencySites,
65
+ projectDirAbs: discovery.projectDirAbs,
66
+ resolutionMode: 'exact',
67
+ });
68
+ const workA = findOcc(catalog, 'work', 'src/a.ts');
69
+ const workB = findOcc(catalog, 'work', 'src/b.ts');
70
+ const helperA = findOcc(catalog, 'helper', 'src/a.ts');
71
+ const helperB = findOcc(catalog, 'helper', 'src/b.ts');
72
+ // The two work occurrences are genuinely body-twins (same hash, different file).
73
+ expect(workA?.bodyHash).toBe(workB?.bodyHash);
74
+ expect(helperA?.bodyHash).not.toBe(helperB?.bodyHash);
75
+ const edgesA = edgesByOwner.get(ownerEdgeKey(workA.bodyHash, 'src/a.ts')) ?? [];
76
+ const edgesB = edgesByOwner.get(ownerEdgeKey(workB.bodyHash, 'src/b.ts')) ?? [];
77
+ const targetsA = edgesA.flatMap((e) => e.to);
78
+ const targetsB = edgesB.flatMap((e) => e.to);
79
+ expect(targetsA).toContain(helperA.bodyHash);
80
+ expect(targetsA).not.toContain(helperB.bodyHash); // no phantom edge into b's helper
81
+ expect(targetsB).toContain(helperB.bodyHash);
82
+ expect(targetsB).not.toContain(helperA.bodyHash);
83
+ });
84
+ });
85
+ //# sourceMappingURL=body-twin-edges.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"body-twin-edges.test.js","sourceRoot":"","sources":["../../src/__tests__/body-twin-edges.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAErE,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAIrD,IAAI,IAAY,CAAC;AAEjB,UAAU,CAAC,GAAG,EAAE;IACd,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,qBAAqB,CAAC,CAAC,CAAC;IAC1D,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAClD,aAAa,CACX,IAAI,CAAC,IAAI,EAAE,eAAe,CAAC,EAC3B,IAAI,CAAC,SAAS,CAAC;QACb,eAAe,EAAE;YACf,MAAM,EAAE,QAAQ;YAChB,MAAM,EAAE,QAAQ;YAChB,gBAAgB,EAAE,QAAQ;YAC1B,MAAM,EAAE,IAAI;SACb;QACD,OAAO,EAAE,CAAC,SAAS,CAAC;KACrB,CAAC,EACF,MAAM,CACP,CAAC;IACF,4EAA4E;IAC5E,aAAa,CACX,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,EACtB,gGAAgG,E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C,CAAC,CAAC,EAAE,CAAC,CAAC;QAE7C,MAAM,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,OAAQ,CAAC,QAAQ,CAAC,CAAC;QAC9C,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,OAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,kCAAkC;QACrF,MAAM,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,OAAQ,CAAC,QAAQ,CAAC,CAAC;QAC9C,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,OAAQ,CAAC,QAAQ,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Branch-coverage tests for lang-typescript/cache-key.ts.
3
+ *
4
+ * Exercises the four config-path branches and verifies the
5
+ * deterministic output for the same input.
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=cache-key.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache-key.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/cache-key.test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Branch-coverage tests for lang-typescript/cache-key.ts.
3
+ *
4
+ * Exercises the four config-path branches and verifies the
5
+ * deterministic output for the same input.
6
+ */
7
+ import { mkdtempSync, rmSync, writeFileSync } from 'node:fs';
8
+ import { tmpdir } from 'node:os';
9
+ import { join } from 'node:path';
10
+ import { afterEach, beforeEach, describe, expect, it } from 'vitest';
11
+ import { cacheKey } from '../cache-key.js';
12
+ describe('lang-typescript cacheKey — branches', () => {
13
+ let dir;
14
+ beforeEach(() => {
15
+ dir = mkdtempSync(join(tmpdir(), 'graph-ts-cachekey-'));
16
+ });
17
+ afterEach(() => {
18
+ rmSync(dir, { recursive: true, force: true });
19
+ });
20
+ it('returns ts-<version>-no-tsconfig when configPathAbs is undefined', () => {
21
+ const out = cacheKey({ projectDirAbs: dir, resolutionMode: 'exact' });
22
+ expect(out).toContain('-no-tsconfig');
23
+ expect(out.startsWith('ts-')).toBe(true);
24
+ });
25
+ it('returns ts-<version>-no-tsconfig when configPathAbs is empty', () => {
26
+ const out = cacheKey({ projectDirAbs: dir, configPathAbs: '', resolutionMode: 'exact' });
27
+ expect(out).toContain('-no-tsconfig');
28
+ });
29
+ it('returns ts-<version>-missing:<path> when the tsconfig does not exist', () => {
30
+ const fake = join(dir, 'tsconfig.json');
31
+ const out = cacheKey({ projectDirAbs: dir, configPathAbs: fake, resolutionMode: 'exact' });
32
+ expect(out).toContain('missing:');
33
+ });
34
+ it('returns a stable ts-<version>-<hash> when the tsconfig is readable', () => {
35
+ const file = join(dir, 'tsconfig.json');
36
+ writeFileSync(file, '{"compilerOptions": {"target": "ES2022"}}', 'utf8');
37
+ const a = cacheKey({ projectDirAbs: dir, configPathAbs: file, resolutionMode: 'exact' });
38
+ const b = cacheKey({ projectDirAbs: dir, configPathAbs: file, resolutionMode: 'exact' });
39
+ expect(a).toBe(b);
40
+ expect(a.startsWith('ts-')).toBe(true);
41
+ expect(a).not.toContain('no-tsconfig');
42
+ });
43
+ it('folds the adapter package version into the key (F5)', () => {
44
+ const file = join(dir, 'tsconfig.json');
45
+ writeFileSync(file, '{"compilerOptions": {"target": "ES2022"}}', 'utf8');
46
+ const out = cacheKey({ projectDirAbs: dir, configPathAbs: file, resolutionMode: 'exact' });
47
+ // ts-<tsVersion>-adapter-<adapterVersion>-<mode>-<hash>
48
+ expect(out).toMatch(/-adapter-\d+\.\d+\.\d+-/);
49
+ });
50
+ it('changes the key when an extends-base edit changes resolution (F2)', () => {
51
+ // base + extending config; editing the base's compilerOptions must change
52
+ // the RESOLVED options the key hashes — even though the named file is byte-
53
+ // identical across the two reads.
54
+ const base = join(dir, 'tsconfig.base.json');
55
+ const file = join(dir, 'tsconfig.json');
56
+ writeFileSync(file, `{"extends": "./tsconfig.base.json", "compilerOptions": {}}`, 'utf8');
57
+ writeFileSync(base, `{"compilerOptions": {"baseUrl": ".", "paths": {"@a/*": ["a/*"]}}}`, 'utf8');
58
+ const before = cacheKey({ projectDirAbs: dir, configPathAbs: file, resolutionMode: 'exact' });
59
+ writeFileSync(base, `{"compilerOptions": {"baseUrl": ".", "paths": {"@a/*": ["DIFFERENT/*"]}}}`, 'utf8');
60
+ const after = cacheKey({ projectDirAbs: dir, configPathAbs: file, resolutionMode: 'exact' });
61
+ expect(after).not.toBe(before);
62
+ });
63
+ it('is location-independent (same resolved options under a different root ⇒ same key)', () => {
64
+ const file = join(dir, 'tsconfig.json');
65
+ writeFileSync(file, '{"compilerOptions": {"target": "ES2022", "strict": true}}', 'utf8');
66
+ const a = cacheKey({ projectDirAbs: dir, configPathAbs: file, resolutionMode: 'exact' });
67
+ const dir2 = mkdtempSync(join(tmpdir(), 'graph-ts-cachekey2-'));
68
+ try {
69
+ const file2 = join(dir2, 'tsconfig.json');
70
+ writeFileSync(file2, '{"compilerOptions": {"target": "ES2022", "strict": true}}', 'utf8');
71
+ const b = cacheKey({ projectDirAbs: dir2, configPathAbs: file2, resolutionMode: 'exact' });
72
+ expect(b).toBe(a);
73
+ }
74
+ finally {
75
+ rmSync(dir2, { recursive: true, force: true });
76
+ }
77
+ });
78
+ it('distinguishes resolution modes (fast vs exact ⇒ distinct keys)', () => {
79
+ const file = join(dir, 'tsconfig.json');
80
+ writeFileSync(file, '{"compilerOptions": {"target": "ES2022"}}', 'utf8');
81
+ const exact = cacheKey({ projectDirAbs: dir, configPathAbs: file, resolutionMode: 'exact' });
82
+ const fast = cacheKey({ projectDirAbs: dir, configPathAbs: file, resolutionMode: 'fast' });
83
+ expect(exact).not.toBe(fast);
84
+ });
85
+ });
86
+ //# sourceMappingURL=cache-key.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache-key.test.js","sourceRoot":"","sources":["../../src/__tests__/cache-key.test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO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
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Tests for the TypeScript adapter's module-level depends_on edge
3
+ * emission. Phase 4 Task 4.2 of opensip's substrate consolidation
4
+ * (opensip DEC-498).
5
+ *
6
+ * Exercises the full adapter contract surface (discoverFiles →
7
+ * parseProject → walkProject → resolveCallSites) against a small
8
+ * fixture with internal + external imports, then asserts:
9
+ *
10
+ * 1. walkProject returns dependencySites populated with the right
11
+ * specifier + line + owner module-init bodyHash.
12
+ * 2. resolveCallSites returns dependenciesByOwner with a resolved
13
+ * target bodyHash for internal imports.
14
+ * 3. External package imports resolve to `to: []` (unresolved).
15
+ * 4. The specifier is preserved on every edge regardless of
16
+ * resolution.
17
+ */
18
+ export {};
19
+ //# sourceMappingURL=depends-on-emission.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"depends-on-emission.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/depends-on-emission.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG"}