@md-code/follow-architecture 0.3.0 → 0.3.3

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 (382) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +1341 -472
  3. package/dist/args.d.ts +4 -0
  4. package/dist/args.js +18 -1
  5. package/dist/bin/follow-architecture.js +3 -3
  6. package/dist/closure-project.d.ts +4 -0
  7. package/dist/closure-project.js +122 -0
  8. package/dist/code-entities/classify.d.ts +11 -0
  9. package/dist/code-entities/classify.js +45 -0
  10. package/dist/code-entities/connector.d.ts +8 -0
  11. package/dist/code-entities/connector.js +119 -0
  12. package/dist/code-entities/entities.d.ts +9 -0
  13. package/dist/{code-roles/roles.js → code-entities/entities.js} +81 -54
  14. package/dist/code-entities/project.d.ts +21 -0
  15. package/dist/code-entities/project.js +249 -0
  16. package/dist/code-entities/walk.d.ts +31 -0
  17. package/dist/code-entities/walk.js +95 -0
  18. package/dist/config-options.d.ts +23 -0
  19. package/dist/config-options.js +18 -1
  20. package/dist/config-project.js +10 -2
  21. package/dist/config-report.d.ts +1 -1
  22. package/dist/config-report.js +20 -3
  23. package/dist/config-rule.d.ts +25 -0
  24. package/dist/config-rule.js +89 -6
  25. package/dist/config-state.d.ts +14 -3
  26. package/dist/config-state.js +180 -17
  27. package/dist/config.d.ts +25 -0
  28. package/dist/css/index.d.ts +11 -7
  29. package/dist/css/index.js +124 -23
  30. package/dist/css/syntax/css/gate.js +5 -5
  31. package/dist/css/syntax/css/index.d.ts +1 -1
  32. package/dist/css/syntax/css/index.js +1 -1
  33. package/dist/css/syntax/css/reference.d.ts +1 -1
  34. package/dist/css/syntax/css/reference.js +15 -3
  35. package/dist/css/syntax/language.d.ts +1 -1
  36. package/dist/css/syntax/language.js +4 -2
  37. package/dist/css/syntax/scss/index.d.ts +2 -2
  38. package/dist/css/syntax/scss/index.js +1 -1
  39. package/dist/css/syntax/scss/reference.d.ts +1 -1
  40. package/dist/css/syntax/scss/reference.js +7 -1
  41. package/dist/css/syntax/styled/document.d.ts +3 -3
  42. package/dist/css/syntax/styled/document.js +17 -7
  43. package/dist/css/syntax/styled/markup.d.ts +1 -1
  44. package/dist/css/syntax/styled/markup.js +22 -14
  45. package/dist/css/syntax/styled/tags.d.ts +2 -0
  46. package/dist/css/syntax/styled/tags.js +22 -0
  47. package/dist/css/syntax/styled/template.js +10 -4
  48. package/dist/css/syntax/tailwind/tailwind.js +4 -4
  49. package/dist/css/value/check.d.ts +1 -1
  50. package/dist/css/value/check.js +1 -1
  51. package/dist/css/value/expression/arithmetic.d.ts +2 -2
  52. package/dist/css/value/expression/arithmetic.js +7 -3
  53. package/dist/css/value/expression/block.d.ts +2 -2
  54. package/dist/css/value/expression/block.js +4 -3
  55. package/dist/css/value/expression/conditional.d.ts +2 -2
  56. package/dist/css/value/expression/conditional.js +1 -1
  57. package/dist/css/value/expression/index.d.ts +2 -2
  58. package/dist/css/value/expression/index.js +10 -6
  59. package/dist/css/value/expression/map.d.ts +2 -2
  60. package/dist/css/value/expression/map.js +2 -2
  61. package/dist/css/value/object/index.d.ts +2 -2
  62. package/dist/css/value/object/index.js +14 -4
  63. package/dist/css/value/object/members.d.ts +2 -2
  64. package/dist/css/value/object/node.js +9 -4
  65. package/dist/css/value/object/path.d.ts +3 -3
  66. package/dist/css/value/object/path.js +10 -4
  67. package/dist/css/value/pieces.d.ts +3 -3
  68. package/dist/css/value/pieces.js +14 -4
  69. package/dist/css/value/resolve.js +15 -5
  70. package/dist/css/value/scope.d.ts +3 -2
  71. package/dist/css/value/scope.js +25 -7
  72. package/dist/css/value/substitute.js +43 -11
  73. package/dist/entities/architecture.d.ts +28 -25
  74. package/dist/entities/ast/assignments-raw.d.ts +1 -1
  75. package/dist/entities/ast/assignments-raw.js +61 -8
  76. package/dist/entities/ast/assignments-tagged.d.ts +1 -1
  77. package/dist/entities/ast/assignments-tagged.js +22 -7
  78. package/dist/entities/ast/assignments.d.ts +1 -1
  79. package/dist/entities/ast/assignments.js +6 -4
  80. package/dist/entities/ast/branches.d.ts +1 -1
  81. package/dist/entities/ast/calls.d.ts +1 -1
  82. package/dist/entities/ast/calls.js +19 -3
  83. package/dist/entities/ast/classes.d.ts +1 -1
  84. package/dist/entities/ast/classes.js +5 -1
  85. package/dist/entities/ast/comments.d.ts +3 -2
  86. package/dist/entities/ast/comments.js +47 -17
  87. package/dist/entities/ast/declaration.d.ts +1 -1
  88. package/dist/entities/ast/depth.d.ts +2 -2
  89. package/dist/entities/ast/depth.js +15 -8
  90. package/dist/entities/ast/enums.d.ts +1 -1
  91. package/dist/entities/ast/export-chain.d.ts +15 -0
  92. package/dist/entities/ast/export-chain.js +171 -0
  93. package/dist/entities/ast/file-exports.d.ts +1 -1
  94. package/dist/entities/ast/file-exports.js +26 -3
  95. package/dist/entities/ast/file-facts.d.ts +6 -3
  96. package/dist/entities/ast/file-facts.js +33 -4
  97. package/dist/entities/ast/file-imports.d.ts +1 -1
  98. package/dist/entities/ast/file-imports.js +26 -3
  99. package/dist/entities/ast/file.d.ts +2 -2
  100. package/dist/entities/ast/file.js +2 -1
  101. package/dist/entities/ast/functions.d.ts +1 -1
  102. package/dist/entities/ast/functions.js +13 -4
  103. package/dist/entities/ast/heritage.d.ts +1 -1
  104. package/dist/entities/ast/heritage.js +9 -1
  105. package/dist/entities/ast/index.d.ts +6 -3
  106. package/dist/entities/ast/index.js +82 -26
  107. package/dist/entities/ast/kind.d.ts +1 -1
  108. package/dist/entities/ast/kind.js +7 -1
  109. package/dist/entities/ast/modifiers.d.ts +1 -1
  110. package/dist/entities/ast/modifiers.js +4 -4
  111. package/dist/entities/ast/project.js +33 -2
  112. package/dist/entities/ast/properties.d.ts +1 -1
  113. package/dist/entities/ast/properties.js +10 -5
  114. package/dist/entities/ast/resolve.d.ts +1 -1
  115. package/dist/entities/ast/resolve.js +4 -4
  116. package/dist/entities/ast/tree.d.ts +4 -2
  117. package/dist/entities/ast/tree.js +184 -17
  118. package/dist/entities/ast/types.d.ts +1 -1
  119. package/dist/entities/ast/types.js +2 -1
  120. package/dist/entities/ast/usage.d.ts +1 -1
  121. package/dist/entities/ast/usage.js +1 -1
  122. package/dist/entities/ast/variables.d.ts +1 -1
  123. package/dist/entities/context.d.ts +4 -4
  124. package/dist/entities/facts.d.ts +36 -13
  125. package/dist/entities/findings.d.ts +3 -3
  126. package/dist/entities/kinds.d.ts +1 -1
  127. package/dist/entities/kinds.js +131 -30
  128. package/dist/entities/location/homes.d.ts +10 -10
  129. package/dist/entities/location/homes.js +74 -48
  130. package/dist/entities/location/place.d.ts +1 -1
  131. package/dist/entities/location/place.js +10 -3
  132. package/dist/entities/location/where.d.ts +8 -6
  133. package/dist/entities/location/where.js +79 -30
  134. package/dist/entities/location.d.ts +3 -3
  135. package/dist/entities/location.js +17 -17
  136. package/dist/entities/operators.js +1 -1
  137. package/dist/entities/overview/data.d.ts +6 -6
  138. package/dist/entities/overview/decision.d.ts +11 -11
  139. package/dist/entities/overview/finding.d.ts +10 -10
  140. package/dist/entities/overview/graph.d.ts +28 -11
  141. package/dist/entities/overview/input.d.ts +2 -2
  142. package/dist/entities/overview/summaries.d.ts +17 -15
  143. package/dist/entities/queries.d.ts +1 -1
  144. package/dist/entities/queries.js +72 -12
  145. package/dist/entities/repair.d.ts +1 -1
  146. package/dist/entities/repair.js +8 -2
  147. package/dist/entities/schema.d.ts +17 -3
  148. package/dist/entities/schema.js +74 -16
  149. package/dist/entities/story.d.ts +5 -5
  150. package/dist/entities/structure-facts.d.ts +1 -1
  151. package/dist/entities/token.d.ts +4 -4
  152. package/dist/entities/tree/build.d.ts +4 -3
  153. package/dist/entities/tree/build.js +95 -44
  154. package/dist/entities/tree/entries.d.ts +3 -3
  155. package/dist/entities/tree/entries.js +41 -16
  156. package/dist/entities/tree/index.d.ts +2 -2
  157. package/dist/entities/tree/index.js +1 -1
  158. package/dist/entities/tree/match.d.ts +2 -2
  159. package/dist/entities/tree/match.js +9 -5
  160. package/dist/fa-index.d.ts +16 -0
  161. package/dist/fa-index.js +165 -0
  162. package/dist/fa-open.d.ts +51 -0
  163. package/dist/fa-open.js +232 -0
  164. package/dist/fa-store.d.ts +22 -0
  165. package/dist/fa-store.js +222 -0
  166. package/dist/fa-values.d.ts +37 -0
  167. package/dist/fa-values.js +104 -0
  168. package/dist/facts-record.d.ts +45 -0
  169. package/dist/facts-record.js +287 -0
  170. package/dist/frameworks/angular/index.d.ts +2 -2
  171. package/dist/frameworks/angular/index.js +2 -1
  172. package/dist/frameworks/facet.d.ts +3 -1
  173. package/dist/frameworks/facet.js +13 -0
  174. package/dist/frameworks/index.d.ts +1 -1
  175. package/dist/frameworks/index.js +8 -4
  176. package/dist/frameworks/react/index.d.ts +2 -2
  177. package/dist/frameworks/react/index.js +33 -10
  178. package/dist/frameworks/test/index.d.ts +6 -0
  179. package/dist/frameworks/test/index.js +157 -0
  180. package/dist/frameworks/vue/index.d.ts +2 -2
  181. package/dist/frameworks/vue/index.js +2 -1
  182. package/dist/ignore.d.ts +3 -0
  183. package/dist/ignore.js +48 -0
  184. package/dist/index-file.d.ts +43 -0
  185. package/dist/index-file.js +218 -0
  186. package/dist/index-run.d.ts +39 -0
  187. package/dist/index-run.js +217 -0
  188. package/dist/index-zone.d.ts +25 -0
  189. package/dist/index-zone.js +209 -0
  190. package/dist/main.d.ts +5 -2
  191. package/dist/main.js +207 -34
  192. package/dist/nodes/child-entities.d.ts +3 -0
  193. package/dist/nodes/child-entities.js +12 -0
  194. package/dist/nodes/children.d.ts +4 -4
  195. package/dist/nodes/children.js +54 -11
  196. package/dist/nodes/finally/emit.d.ts +3 -3
  197. package/dist/nodes/finally/emit.js +26 -10
  198. package/dist/nodes/finally/entities.d.ts +13 -0
  199. package/dist/nodes/finally/entities.js +42 -0
  200. package/dist/nodes/finally/index.d.ts +6 -6
  201. package/dist/nodes/finally/index.js +8 -8
  202. package/dist/nodes/finally/queries.d.ts +2 -2
  203. package/dist/nodes/finally/queries.js +7 -4
  204. package/dist/nodes/finally/relations-access.d.ts +2 -2
  205. package/dist/nodes/finally/relations-access.js +22 -18
  206. package/dist/nodes/finally/relations-edge.d.ts +5 -5
  207. package/dist/nodes/finally/relations-edge.js +67 -44
  208. package/dist/nodes/finally/relations-group.d.ts +7 -7
  209. package/dist/nodes/finally/relations-group.js +28 -25
  210. package/dist/nodes/finally/relations.d.ts +2 -2
  211. package/dist/nodes/finally/relations.js +16 -12
  212. package/dist/nodes/finally/required.d.ts +3 -3
  213. package/dist/nodes/finally/required.js +9 -7
  214. package/dist/nodes/finally/violation.d.ts +2 -2
  215. package/dist/nodes/similar.d.ts +3 -3
  216. package/dist/nodes/similar.js +61 -49
  217. package/dist/piece-forms.d.ts +9 -0
  218. package/dist/piece-forms.js +68 -0
  219. package/dist/{pipeline-roles.d.ts → pipeline-entities.d.ts} +2 -2
  220. package/dist/{pipeline-roles.js → pipeline-entities.js} +32 -28
  221. package/dist/pipeline-facts.d.ts +4 -3
  222. package/dist/pipeline-facts.js +47 -55
  223. package/dist/{pipeline-unroled.d.ts → pipeline-unclassified.d.ts} +2 -2
  224. package/dist/{pipeline-unroled.js → pipeline-unclassified.js} +58 -63
  225. package/dist/pipeline.js +19 -64
  226. package/dist/release-file.d.ts +3 -0
  227. package/dist/release-file.js +13 -0
  228. package/dist/report/asks.d.ts +3 -3
  229. package/dist/report/asks.js +16 -6
  230. package/dist/report/configErrors.d.ts +55 -27
  231. package/dist/report/configErrors.js +81 -35
  232. package/dist/report/errorTypes/codes/structure.d.ts +1 -1
  233. package/dist/report/errorTypes/codes/structure.js +9 -9
  234. package/dist/report/errorTypes/decision-maker.d.ts +5 -5
  235. package/dist/report/errorTypes/decision-maker.js +4 -4
  236. package/dist/report/errorTypes/destinations.d.ts +5 -5
  237. package/dist/report/errorTypes/destinations.js +52 -34
  238. package/dist/report/errorTypes/finding-type.d.ts +3 -3
  239. package/dist/report/errorTypes/index.d.ts +1 -1
  240. package/dist/report/errorTypes/types/fileContents.d.ts +4 -4
  241. package/dist/report/errorTypes/types/fileContents.js +11 -5
  242. package/dist/report/errorTypes/types/unknownEntity.d.ts +9 -0
  243. package/dist/report/errorTypes/types/{unknownRole.js → unknownEntity.js} +12 -7
  244. package/dist/report/errorTypes/types/wrongAction.d.ts +5 -5
  245. package/dist/report/errorTypes/types/wrongAction.js +18 -13
  246. package/dist/report/errorTypes/types/wrongPlacement.d.ts +4 -4
  247. package/dist/report/errorTypes/types/wrongPlacement.js +19 -9
  248. package/dist/report/errorTypes/vocabulary/ids.d.ts +2 -2
  249. package/dist/report/errorTypes/vocabulary/ids.js +3 -3
  250. package/dist/report/errorTypes/vocabulary/phrases.d.ts +2 -2
  251. package/dist/report/errorTypes/vocabulary/phrases.js +39 -26
  252. package/dist/report/errorTypes/vocabulary/places.d.ts +3 -3
  253. package/dist/report/errorTypes/vocabulary/places.js +13 -13
  254. package/dist/report/finding-from.d.ts +3 -3
  255. package/dist/report/finding-from.js +14 -9
  256. package/dist/report/notices.d.ts +6 -1
  257. package/dist/report/notices.js +46 -20
  258. package/dist/report/observed.d.ts +19 -0
  259. package/dist/report/observed.js +87 -0
  260. package/dist/report/render-report.d.ts +1 -1
  261. package/dist/report/render-report.js +33 -30
  262. package/dist/report/user-report/build/bundle.js +9 -0
  263. package/dist/report/user-report/build/bundle.prebuilt.js +799 -297
  264. package/dist/report/user-report/data/collect.d.ts +2 -2
  265. package/dist/report/user-report/data/collect.js +15 -12
  266. package/dist/report/user-report/data/entities.d.ts +7 -0
  267. package/dist/report/user-report/data/{roles.js → entities.js} +27 -22
  268. package/dist/report/user-report/data/{role-examples.d.ts → entity-examples.d.ts} +3 -3
  269. package/dist/report/user-report/data/entity-examples.js +126 -0
  270. package/dist/report/user-report/data/{role-filters.d.ts → entity-filters.d.ts} +2 -2
  271. package/dist/report/user-report/data/{role-filters.js → entity-filters.js} +7 -7
  272. package/dist/report/user-report/data/entity-marks.d.ts +5 -0
  273. package/dist/report/user-report/data/{role-marks.js → entity-marks.js} +11 -11
  274. package/dist/report/user-report/data/file-tree.d.ts +3 -3
  275. package/dist/report/user-report/data/file-tree.js +13 -5
  276. package/dist/report/user-report/data/finding-boundary.d.ts +4 -4
  277. package/dist/report/user-report/data/finding-boundary.js +2 -2
  278. package/dist/report/user-report/data/finding-plan.d.ts +5 -5
  279. package/dist/report/user-report/data/finding-plan.js +10 -10
  280. package/dist/report/user-report/data/finding-title.d.ts +2 -2
  281. package/dist/report/user-report/data/finding-title.js +8 -8
  282. package/dist/report/user-report/data/findings.d.ts +4 -4
  283. package/dist/report/user-report/data/findings.js +30 -20
  284. package/dist/report/user-report/data/graph-edges.d.ts +4 -4
  285. package/dist/report/user-report/data/graph-edges.js +19 -19
  286. package/dist/report/user-report/data/graph-entities.d.ts +6 -0
  287. package/dist/report/user-report/data/graph-entities.js +158 -0
  288. package/dist/report/user-report/data/graph-helpers.d.ts +5 -5
  289. package/dist/report/user-report/data/graph-helpers.js +15 -15
  290. package/dist/report/user-report/data/graph.d.ts +5 -4
  291. package/dist/report/user-report/data/graph.js +28 -21
  292. package/dist/report/user-report/data/nodes.d.ts +2 -2
  293. package/dist/report/user-report/data/nodes.js +16 -16
  294. package/dist/report/user-report/data/rules.d.ts +7 -0
  295. package/dist/report/user-report/data/{invariants.js → rules.js} +13 -13
  296. package/dist/report/user-report/data/scan.d.ts +1 -1
  297. package/dist/report/user-report/data/scan.js +2 -2
  298. package/dist/report/user-report/html/shell.d.ts +1 -1
  299. package/dist/report/user-report/html/shell.js +1 -1
  300. package/dist/report/user-report/index.d.ts +1 -1
  301. package/dist/report/user-report/shared/describe.d.ts +1 -1
  302. package/dist/report/user-report/shared/describe.js +6 -6
  303. package/dist/rules/index.d.ts +7 -0
  304. package/dist/{invariants → rules}/index.js +85 -57
  305. package/dist/{invariants → rules}/list-vars.d.ts +2 -2
  306. package/dist/{invariants → rules}/list-vars.js +9 -3
  307. package/dist/{invariants → rules}/name.js +2 -2
  308. package/dist/rules/normalize.d.ts +5 -0
  309. package/dist/{invariants → rules}/normalize.js +35 -32
  310. package/dist/{invariants → rules}/vars.d.ts +9 -7
  311. package/dist/{invariants → rules}/vars.js +5 -5
  312. package/dist/scan-run.d.ts +20 -0
  313. package/dist/scan-run.js +130 -0
  314. package/dist/scripts/audit-report.js +2 -2
  315. package/dist/usage-index.d.ts +4 -0
  316. package/dist/usage-index.js +272 -0
  317. package/dist/usage-mode.d.ts +7 -0
  318. package/dist/usage-mode.js +16 -0
  319. package/dist/usage-pass.d.ts +19 -0
  320. package/dist/usage-pass.js +136 -0
  321. package/dist/usage-prepare.d.ts +2 -0
  322. package/dist/usage-prepare.js +22 -0
  323. package/dist/usage-sweep.d.ts +10 -0
  324. package/dist/usage-sweep.js +254 -0
  325. package/dist/utils/aliases.d.ts +22 -0
  326. package/dist/utils/aliases.js +163 -0
  327. package/dist/utils/classify.d.ts +2 -2
  328. package/dist/utils/classify.js +4 -4
  329. package/dist/utils/distinct.js +4 -2
  330. package/dist/utils/files.js +24 -30
  331. package/dist/utils/fixpoint.js +2 -2
  332. package/dist/utils/host.d.ts +1 -1
  333. package/dist/utils/host.js +4 -1
  334. package/dist/utils/imports.js +66 -12
  335. package/dist/utils/keyed.js +2 -2
  336. package/dist/utils/map-record.js +2 -2
  337. package/dist/utils/packages.d.ts +15 -0
  338. package/dist/utils/packages.js +197 -0
  339. package/dist/utils/path-label.js +3 -1
  340. package/dist/utils/pattern.d.ts +5 -4
  341. package/dist/utils/pattern.js +38 -8
  342. package/dist/utils/permission.d.ts +3 -3
  343. package/dist/utils/permission.js +4 -2
  344. package/dist/utils/plural.js +2 -2
  345. package/dist/utils/qualified.js +4 -4
  346. package/dist/utils/rank.js +2 -2
  347. package/dist/utils/record.js +1 -1
  348. package/dist/utils/search.js +7 -2
  349. package/dist/utils/speak.js +1 -1
  350. package/dist/utils/split.js +14 -1
  351. package/dist/utils/template.d.ts +1 -1
  352. package/dist/utils/template.js +1 -1
  353. package/dist/utils/tokenize.js +6 -1
  354. package/dist/utils/typed-field.js +2 -2
  355. package/dist/utils/verdicts.js +1 -1
  356. package/entities/operators.ts +1 -1
  357. package/package.json +101 -90
  358. package/report/errorTypes/vocabulary/ids.ts +7 -2
  359. package/report/errorTypes/vocabulary/phrases.ts +47 -27
  360. package/report/errorTypes/vocabulary/places.ts +21 -16
  361. package/report/user-report/shared/describe.ts +7 -7
  362. package/dist/code-roles/classify.d.ts +0 -11
  363. package/dist/code-roles/classify.js +0 -43
  364. package/dist/code-roles/connector.d.ts +0 -5
  365. package/dist/code-roles/connector.js +0 -114
  366. package/dist/code-roles/project.d.ts +0 -12
  367. package/dist/code-roles/project.js +0 -122
  368. package/dist/code-roles/roles.d.ts +0 -8
  369. package/dist/invariants/index.d.ts +0 -6
  370. package/dist/invariants/normalize.d.ts +0 -4
  371. package/dist/nodes/child-roles.d.ts +0 -3
  372. package/dist/nodes/child-roles.js +0 -12
  373. package/dist/nodes/finally/roles.d.ts +0 -13
  374. package/dist/nodes/finally/roles.js +0 -41
  375. package/dist/report/errorTypes/types/unknownRole.d.ts +0 -9
  376. package/dist/report/user-report/data/graph-roles.d.ts +0 -5
  377. package/dist/report/user-report/data/graph-roles.js +0 -71
  378. package/dist/report/user-report/data/invariants.d.ts +0 -7
  379. package/dist/report/user-report/data/role-examples.js +0 -94
  380. package/dist/report/user-report/data/role-marks.d.ts +0 -5
  381. package/dist/report/user-report/data/roles.d.ts +0 -7
  382. /package/dist/{invariants → rules}/name.d.ts +0 -0
@@ -1,20 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.kindFact = exports.descendantsOf = exports.descendantFact = exports.descriptor = exports.depthOf = exports.isMutable = exports.isExported = exports.rangeLines = exports.linesOf = exports.selfOf = exports.startLine = exports.isMeaningful = exports.memberFacts = exports.typeText = exports.unwrapParens = exports.inThisPiece = exports.isClassNode = exports.isCallNode = exports.isFunctionNode = exports.nodeText = exports.nameOfNode = exports.isImportDecl = exports.kindName = exports.SK = void 0;
3
+ exports.kindFact = exports.descendantsOf = exports.descendantFact = exports.descriptor = exports.depthOf = exports.isMutable = exports.isExported = exports.rangeLines = exports.linesOf = exports.selfOf = exports.startLine = exports.isMeaningful = exports.memberFacts = exports.typeText = exports.unwrapParens = exports.inThisPiece = exports.isClassNode = exports.isCallNode = exports.isFunctionNode = exports.nodeText = exports.nameOfNode = exports.isImportDecl = exports.releaseTree = exports.fileDescendants = exports.kindName = exports.SK = void 0;
4
4
  // The syntax tree: what a node IS, what it is called, and where it sits.
5
- // Everything here is a question about ONE node — never about a project, a role
5
+ // Everything here is a question about ONE node — never about a project, an entity
6
6
  // or a folder. Names come from ts-morph itself (`getKindName`), so the engine
7
7
  // speaks exactly the vocabulary of the parser.
8
8
  const ts_morph_1 = require("ts-morph");
9
9
  Object.defineProperty(exports, "SK", { enumerable: true, get: function () { return ts_morph_1.SyntaxKind; } });
10
- const notices_1 = require("../../report/notices");
10
+ const notices_1 = require("@md-code/follow-architecture/report/notices");
11
11
  // Declarations that ARE an import: the parser's own names for the three forms.
12
12
  // One list, because three passes ask the same question (`file.js` twice,
13
13
  // `assignments.js` once) and an import is recognised the same way in all of them.
14
14
  const IMPORT_DECL_KINDS = new Set(["ImportSpecifier", "ImportClause", "NamespaceImport"]);
15
15
  const isImportDecl = (decl) => IMPORT_DECL_KINDS.has(decl?.getKindName?.());
16
16
  exports.isImportDecl = isImportDecl;
17
- // Function-like nodes — the candidates for any function-shaped role.
17
+ // Function-like nodes — the candidates for any function-shaped entity.
18
18
  const FUNCTION_KINDS = new Set([
19
19
  ts_morph_1.SyntaxKind.FunctionDeclaration,
20
20
  ts_morph_1.SyntaxKind.FunctionExpression,
@@ -30,10 +30,117 @@ const CALL_KINDS = new Set([ts_morph_1.SyntaxKind.CallExpression, ts_morph_1.Syn
30
30
  // The name of a node's kind, as the parser spells it ("FunctionDeclaration").
31
31
  const kindName = (node) => node.getKindName();
32
32
  exports.kindName = kindName;
33
+ // A parsed file's descendants, computed ONCE per SourceFile and shared by every
34
+ // per-file walk in a run (candidate collection, comment spans, docs). A re-parsed
35
+ // file can REUSE the same SourceFile wrapper with new text (ts-morph overwrites in
36
+ // place), so the cache is guarded by the file's current text — a changed file is a
37
+ // new list. `getFullText()` returns the compiler's own text string, so the guard
38
+ // compares references, not bytes. `getDescendants()` is the dominant cost of a
39
+ // scan, so walking the file once instead of once per consumer is what makes the
40
+ // whole-repo run tractable.
41
+ const FILE_DESCENDANTS = new WeakMap();
42
+ const fileDescendants = (sf) => {
43
+ const text = sf.getFullText();
44
+ const cached = FILE_DESCENDANTS.get(sf);
45
+ if (cached && cached.text === text)
46
+ return cached.list;
47
+ const list = sf.getDescendants();
48
+ FILE_DESCENDANTS.set(sf, { text, list });
49
+ return list;
50
+ };
51
+ exports.fileDescendants = fileDescendants;
52
+ // Give back everything this module remembers about ONE file, and hand back the
53
+ // nodes it remembered it for.
54
+ //
55
+ // The descendant list is the only STRONG reference to a file's node wrappers:
56
+ // while it lives, every wrapper stays reachable, and so does every value a
57
+ // node-keyed memo hangs off it (line, text, depth, and through them the
58
+ // candidate facts built for that file). A run that is done with a file's syntax
59
+ // — the project-wide index, once the file's facts are extracted — calls this, so
60
+ // a whole-repo pass holds one file's wrappers, not every file's. The compiler
61
+ // AST itself is untouched: re-reading the file re-creates wrappers on demand.
62
+ const releaseTree = (sf) => {
63
+ const cached = FILE_DESCENDANTS.get(sf);
64
+ FILE_DESCENDANTS.delete(sf);
65
+ FILE_MEMOS.delete(sf);
66
+ LINE_STARTS.delete(sf);
67
+ return cached?.list ?? [];
68
+ };
69
+ exports.releaseTree = releaseTree;
70
+ // The memos belong to the TEXT they were computed from, exactly like the line
71
+ // table below: a SourceFile wrapper is reused when the file is overwritten in
72
+ // place, and a memo answered for the previous text would be a stale number in a
73
+ // long-lived process (the ESLint server). The text is compared by reference with
74
+ // `getFullText()`, which returns the same string for an unchanged file.
75
+ const FILE_MEMOS = new WeakMap();
76
+ const memosOf = (node) => {
77
+ const sf = node.getSourceFile();
78
+ const text = sf.getFullText();
79
+ const known = FILE_MEMOS.get(sf);
80
+ if (known && known.text === text)
81
+ return known.memos;
82
+ const created = {
83
+ startLine: new Map(),
84
+ endLine: new Map(),
85
+ type: new Map(),
86
+ depth: new Map(),
87
+ };
88
+ FILE_MEMOS.set(sf, { text, memos: created });
89
+ return created;
90
+ };
91
+ // Where each line of a file begins, built ONCE per file. The parser's own
92
+ // position lookup (`getLineAndColumnAtPos`) walks the text from the start of the
93
+ // file for every question, twice — once for the line and once for the column —
94
+ // and a whole-repo pass asks it a million times. One scan per file plus a binary
95
+ // search answers the same numbers in a few steps.
96
+ //
97
+ // A file's record is keyed by the text it was built from: the SourceFile wrapper
98
+ // is REUSED when a file is overwritten in place, so a table outliving one version
99
+ // of the text would answer for another.
100
+ const LINE_STARTS = new WeakMap();
101
+ const lineStartsOf = (sf) => {
102
+ const text = sf.getFullText();
103
+ const known = LINE_STARTS.get(sf);
104
+ if (known && known.text === text)
105
+ return known.starts;
106
+ // The five line breaks the parser counts (and `getLineNumberAtPos` counts):
107
+ // `\n`, `\r`, `\r\n` as ONE break, U+2028 and U+2029. A table built from `\n`
108
+ // alone would number the lines of a CRLF file differently from every other
109
+ // reader of the same file.
110
+ const starts = [0];
111
+ for (let i = 0; i < text.length; i += 1) {
112
+ const code = text.charCodeAt(i);
113
+ if (code === 13) {
114
+ const paired = text.charCodeAt(i + 1) === 10;
115
+ starts.push(paired ? i + 2 : i + 1);
116
+ if (paired)
117
+ i += 1;
118
+ }
119
+ else if (code === 10 || code === 0x2028 || code === 0x2029)
120
+ starts.push(i + 1);
121
+ }
122
+ const built = Int32Array.from(starts);
123
+ LINE_STARTS.set(sf, { text, starts: built });
124
+ return built;
125
+ };
126
+ // The 1-based line of a position — the same number the parser reports.
127
+ const lineAt = (sf, pos) => {
128
+ const starts = lineStartsOf(sf);
129
+ let low = 0;
130
+ let high = starts.length - 1;
131
+ while (low < high) {
132
+ const mid = (low + high + 1) >> 1;
133
+ if (starts[mid] <= pos)
134
+ low = mid;
135
+ else
136
+ high = mid - 1;
137
+ }
138
+ return low + 1;
139
+ };
33
140
  // A node's text as an IDENTITY, not as formatting. A fact is compared to what
34
141
  // the architecture writes by hand (`origin: { equals: "t.model" }`,
35
142
  // `source: { equals: "./x" }`), so the source LAYOUT must not leak into it: a
36
- // chain broken across lines is the same callee, and roles silently stopped
143
+ // chain broken across lines is the same callee, and entities silently stopped
37
144
  // matching the moment it was not.
38
145
  //
39
146
  // Two rules, one helper:
@@ -80,11 +187,20 @@ const unwrapParens = (node) => {
80
187
  };
81
188
  exports.unwrapParens = unwrapParens;
82
189
  // ── One node: name, line, depth, members ────────────────────────────────────
83
- // A type as the parser reads it, or "any".
190
+ // A type as the parser reads it, or "any". The CHECKER call (`getType`) is the
191
+ // single most expensive fact a scan produces, and the same member node is
192
+ // reached from more than one walk (a candidate's descendant list, its
193
+ // initializer's members), so the answer is memoised per node for the run.
84
194
  const typeText = (node) => {
195
+ const memos = memosOf(node);
196
+ const cached = memos.type.get(node);
197
+ if (cached !== undefined)
198
+ return cached;
85
199
  try {
86
200
  const t = node.getType();
87
- return t.isAny() ? "any" : t.getText();
201
+ const text = t.isAny() ? "any" : t.getText();
202
+ memos.type.set(node, text);
203
+ return text;
88
204
  }
89
205
  catch (error) {
90
206
  // The checker fails on an import it cannot resolve (a broken path, a package
@@ -94,6 +210,7 @@ const typeText = (node) => {
94
210
  const file = node.getSourceFile?.()?.getFilePath?.() ?? "?";
95
211
  const e = error;
96
212
  (0, notices_1.notice)(`a type could not be read (${file})`, e.message ?? String(e));
213
+ memos.type.set(node, null);
97
214
  return null;
98
215
  }
99
216
  };
@@ -144,7 +261,19 @@ const isMeaningful = (d) => {
144
261
  return true;
145
262
  };
146
263
  exports.isMeaningful = isMeaningful;
147
- const startLine = (n) => n.getSourceFile().getLineAndColumnAtPos(n.getStart()).line;
264
+ const startLine = (n) => {
265
+ // The SourceFile wrapper is REUSED when a file is overwritten in place, so its
266
+ // line span is not cached (its children are new wrappers and cache safely).
267
+ if (n.getKind() === ts_morph_1.SyntaxKind.SourceFile)
268
+ return lineAt(n.getSourceFile(), n.getStart());
269
+ const memos = memosOf(n);
270
+ const cached = memos.startLine.get(n);
271
+ if (cached !== undefined)
272
+ return cached;
273
+ const line = lineAt(n.getSourceFile(), n.getStart());
274
+ memos.startLine.set(n, line);
275
+ return line;
276
+ };
148
277
  exports.startLine = startLine;
149
278
  // A candidate's OWN IDENTITY: where it starts — file, line and column, as one
150
279
  // comparable value. A name is not an identity (three files have a `run`), a line
@@ -152,7 +281,8 @@ exports.startLine = startLine;
152
281
  // fact that points at a piece can point at this instead of at a name that
153
282
  // aliases.
154
283
  const selfOf = (rel, sf, pos) => {
155
- const { line, column } = sf.getLineAndColumnAtPos(pos);
284
+ const line = lineAt(sf, pos);
285
+ const column = pos - lineStartsOf(sf)[line - 1] + 1;
156
286
  return `${rel ?? ""}:${line}:${column}`;
157
287
  };
158
288
  exports.selfOf = selfOf;
@@ -167,6 +297,20 @@ const depthOf = (n, root) => {
167
297
  return depth;
168
298
  };
169
299
  exports.depthOf = depthOf;
300
+ // A node's absolute depth from the SourceFile (the SourceFile itself is 0),
301
+ // memoised per node. For a TRUE descendant of `root`, `depthOf` is the difference
302
+ // of two absolute depths — a subtraction instead of a fresh parent walk per
303
+ // descendant. Only used where the node is known to descend from the root.
304
+ const depthFromFile = (n) => {
305
+ const memos = memosOf(n);
306
+ const cached = memos.depth.get(n);
307
+ if (cached !== undefined)
308
+ return cached;
309
+ const parent = n.getParent();
310
+ const depth = parent ? depthFromFile(parent) + 1 : 0;
311
+ memos.depth.set(n, depth);
312
+ return depth;
313
+ };
170
314
  // A node's own name. `getName()` throws on a destructured parameter
171
315
  // (`({ a, b }) => …`): ts-morph's `getNameNode()` is undefined for a binding
172
316
  // pattern, so the pattern's own text is what names it.
@@ -192,10 +336,7 @@ exports.descriptor = descriptor;
192
336
  // candidate). `nested` is set on function-like / loop nodes: true when another
193
337
  // function-like node sits between the node and `root`.
194
338
  const descendantFact = (d, root, depth = 0) => {
195
- const f = { ...descriptor(d), depth, snippet: d.getText().trim().slice(0, 120) };
196
- // A short, reportable label: the node's name when it has one, otherwise its
197
- // (trimmed) source text. Feeds the `{what}` / `{snippet}` report vars.
198
- f.snippet = d.getText().trim().slice(0, 120);
339
+ const f = { ...descriptor(d), depth };
199
340
  if (d.getKind() === ts_morph_1.SyntaxKind.AsExpression) {
200
341
  // The cast target as written; "is it `unknown`?" is the rule's question.
201
342
  f.type = d.getTypeNode()?.getText() ?? null;
@@ -221,7 +362,17 @@ const isNestedIn = (fn, candidate) => {
221
362
  // The lines a node spans, as ONE fact: `lines[0]` is where it starts,
222
363
  // `lines[lines.length - 1]` where it ends, and everything the node contains is
223
364
  // between them. A line count is `lines.length` — there is no second field for it.
224
- const endLine = (n) => n.getSourceFile().getLineAndColumnAtPos(n.getEnd()).line;
365
+ const endLine = (n) => {
366
+ if (n.getKind() === ts_morph_1.SyntaxKind.SourceFile)
367
+ return lineAt(n.getSourceFile(), n.getEnd());
368
+ const memos = memosOf(n);
369
+ const cached = memos.endLine.get(n);
370
+ if (cached !== undefined)
371
+ return cached;
372
+ const line = lineAt(n.getSourceFile(), n.getEnd());
373
+ memos.endLine.set(n, line);
374
+ return line;
375
+ };
225
376
  // The consecutive lines `first..last` inclusive, as a plain array — the one
226
377
  // spelling of "a span of lines" shared by `linesOf` (a node) and `linesOfRange`
227
378
  // (a comment's trivia range).
@@ -240,7 +391,8 @@ exports.linesOf = linesOf;
240
391
  const isExported = (node) => {
241
392
  let target = node;
242
393
  while (target.getParent) {
243
- if (typeof target.getModifiers === "function" && target.getModifiers().some((m) => m.getKind() === ts_morph_1.SyntaxKind.ExportKeyword))
394
+ if (typeof target.getModifiers === "function" &&
395
+ target.getModifiers().some((m) => m.getKind() === ts_morph_1.SyntaxKind.ExportKeyword))
244
396
  return true;
245
397
  const parent = target.getParent();
246
398
  if (!parent || parent.getKind() === ts_morph_1.SyntaxKind.Block || parent.getKind() === ts_morph_1.SyntaxKind.SourceFile)
@@ -308,8 +460,18 @@ const docsOf = (node) => {
308
460
  // it. A doc block is a node like any other, so "what is written above this
309
461
  // declaration" is a query over the same list, told apart by `is`.
310
462
  const descendantsOf = (node) => {
463
+ const docs = docsOf(node);
464
+ const descendants = node.getDescendants();
465
+ // The common case has no attached docs, and `getDescendants()` already yields
466
+ // each node once — so no seen-set (and no per-node identity string) is built.
467
+ // Every node here is a true descendant of `node`, so its depth is the difference
468
+ // of the (memoised) depth-from-file, not a fresh parent walk.
469
+ if (docs.length === 0) {
470
+ const rootDepth = depthFromFile(node);
471
+ return descendants.filter(isMeaningful).map((d) => descendantFact(d, node, depthFromFile(d) - rootDepth - 1));
472
+ }
311
473
  const seen = new Set();
312
- const nodes = [...docsOf(node), ...node.getDescendants()].filter((d) => {
474
+ const nodes = [...docs, ...descendants].filter((d) => {
313
475
  // Identity is kind + span, not `getPos()`: several nodes start at the same
314
476
  // position (a statement, its declaration list and its first keyword all
315
477
  // begin together), and keying by position dropped the whole statement.
@@ -334,7 +496,12 @@ const ancestorsOf = (n) => {
334
496
  const initializerFact = (initializer) => {
335
497
  if (!initializer)
336
498
  return null;
337
- return { is: initializer.is, origin: initializer.origin, members: initializer.members ?? [], ...(initializer.value !== undefined ? { value: initializer.value } : {}) };
499
+ return {
500
+ is: initializer.is,
501
+ origin: initializer.origin,
502
+ members: initializer.members ?? [],
503
+ ...(initializer.value !== undefined ? { value: initializer.value } : {}),
504
+ };
338
505
  };
339
506
  const kindFact = (n, initializer = null) => {
340
507
  const parent = n.getParent?.() ?? null;
@@ -1,6 +1,6 @@
1
1
  import type { Node } from "ts-morph";
2
2
  import type { LooseNode } from "./loose";
3
- import type { Candidate } from "../facts";
3
+ import type { Candidate } from "@md-code/follow-architecture/entities/facts";
4
4
  declare const isTypeNode: (n: Node) => boolean;
5
5
  declare const typeFact: (node: LooseNode, rel: string) => Candidate;
6
6
  export { typeFact, isTypeNode };
@@ -29,7 +29,8 @@ const membersOf = (node, depth = 0) => {
29
29
  const members = typeof node.getMembers === "function" ? node.getMembers() : [];
30
30
  return members.map((m) => {
31
31
  const name = typeof m.getName === "function" ? (m.getName() ?? null) : null;
32
- const typeNode = (typeof m.getReturnTypeNode === "function" ? m.getReturnTypeNode() : null) ?? (typeof m.getTypeNode === "function" ? m.getTypeNode() : null);
32
+ const typeNode = (typeof m.getReturnTypeNode === "function" ? m.getReturnTypeNode() : null) ??
33
+ (typeof m.getTypeNode === "function" ? m.getTypeNode() : null);
33
34
  const nested = depth < MAX_MEMBER_DEPTH && isInlineShape(typeNode);
34
35
  return {
35
36
  name,
@@ -1,6 +1,6 @@
1
1
  import type { SourceFile } from "ts-morph";
2
2
  import type { LooseNode } from "./loose";
3
- import type { ReferencesFact } from "../facts";
3
+ import type { ReferencesFact } from "@md-code/follow-architecture/entities/facts";
4
4
  declare const usageFact: (node: LooseNode, sf: SourceFile, { exported, relOf }: {
5
5
  exported: boolean;
6
6
  relOf?: (p: string) => string;
@@ -5,7 +5,7 @@ exports.usageFact = void 0;
5
5
  // implements a shape. Both are questions about the whole project, so they are
6
6
  // asked once per named candidate and only where the answer can change a verdict:
7
7
  // a name nothing outside its file mentions is a name nobody needs.
8
- const notices_1 = require("../../report/notices");
8
+ const notices_1 = require("@md-code/follow-architecture/report/notices");
9
9
  const countReferences = (node, sf, relOf) => {
10
10
  if (typeof node.findReferencesAsNodes !== "function")
11
11
  return null;
@@ -1,6 +1,6 @@
1
1
  import { Node } from "ts-morph";
2
2
  import type { LooseNode } from "./loose";
3
- import type { Initializer, Assertion } from "../facts";
3
+ import type { Initializer, Assertion } from "@md-code/follow-architecture/entities/facts";
4
4
  declare const literalTextOf: (n: Node) => string | null;
5
5
  declare const variableInitializer: (node: LooseNode) => Initializer | null;
6
6
  declare const assertionOf: (node: LooseNode) => Assertion | null;
@@ -2,8 +2,8 @@ import type { Project, SourceFile } from "ts-morph";
2
2
  import type { Arch } from "./architecture";
3
3
  import type { FileFacts } from "./facts";
4
4
  import type { Facts } from "./kinds";
5
- import type { ResolveContext } from "../utils/imports";
6
- import type { ObjectLiteral } from "../css/value/scope";
5
+ import type { ResolveContext } from "@md-code/follow-architecture/utils/imports";
6
+ import type { ObjectLiteral } from "@md-code/follow-architecture/css/value/scope";
7
7
  type FileContext = {
8
8
  abs?: string;
9
9
  rel: string;
@@ -13,8 +13,8 @@ type FileContext = {
13
13
  repoRoot?: string;
14
14
  aliases?: Record<string, string>;
15
15
  arch?: Arch;
16
- roles?: string[];
17
- roleCtx?: {
16
+ entities?: string[];
17
+ entityCtx?: {
18
18
  present: string[];
19
19
  candidates: FileFacts["candidates"];
20
20
  } | null;
@@ -1,5 +1,5 @@
1
- import type { FieldValue } from "../utils/field";
2
- import type { ClassFact } from "../css/syntax/tailwind/tailwind";
1
+ import type { FieldValue } from "@md-code/follow-architecture/utils/field";
2
+ import type { ClassFact } from "@md-code/follow-architecture/css/syntax/tailwind/tailwind";
3
3
  type Located = {
4
4
  name?: string | null;
5
5
  line?: number;
@@ -26,11 +26,15 @@ type AnyMember = Omit<Partial<MemberFact>, "members"> & {
26
26
  };
27
27
  type DescendantFact = Descriptor & {
28
28
  depth: number;
29
- snippet: string;
30
29
  type?: string | null;
31
30
  members?: MemberFact[];
32
31
  nested?: boolean;
33
32
  };
33
+ type RecordObject = {
34
+ entity: string;
35
+ name: string;
36
+ start: number;
37
+ };
34
38
  type Initializer = Pick<MemberFact, "is" | "members"> & {
35
39
  origin: string | null;
36
40
  value?: string | number;
@@ -80,7 +84,7 @@ type CallFact = {
80
84
  receiverOnly: boolean;
81
85
  bare: boolean;
82
86
  arguments: ArgumentFact[];
83
- targetRole?: string | null;
87
+ targetEntity?: string | null;
84
88
  };
85
89
  type ReturnFact = {
86
90
  kind: string;
@@ -162,8 +166,19 @@ type CssClassFact = ClassFact & {
162
166
  };
163
167
  type CssFacts = {
164
168
  templates?: CssTemplateFact[];
169
+ };
170
+ type TailwindFacts = {
165
171
  classes?: CssClassFact[];
166
172
  };
173
+ type TestFacts = {
174
+ runner?: string | null;
175
+ cases?: number;
176
+ asserts?: number;
177
+ hooks?: string[];
178
+ snapshots?: number;
179
+ mocks?: number;
180
+ readonly [key: string]: FieldValue;
181
+ };
167
182
  type JsxElementFact = {
168
183
  tag: string | null;
169
184
  line: number | null;
@@ -178,13 +193,16 @@ type Link = {
178
193
  module: string | null;
179
194
  };
180
195
  type FrameworkFacts = {
181
- id: string;
182
- component: boolean;
183
- props: string[];
184
- forwarded: string[];
196
+ id?: string | null;
197
+ component?: boolean;
198
+ props?: string[];
199
+ forwarded?: string[];
185
200
  jsx?: JsxElementFact[];
186
201
  links?: Link[];
187
202
  handler?: boolean;
203
+ css?: CssFacts;
204
+ tailwind?: TailwindFacts;
205
+ test?: TestFacts;
188
206
  };
189
207
  type Candidate = {
190
208
  name?: string | null;
@@ -198,6 +216,8 @@ type Candidate = {
198
216
  parameters?: ParameterFact[];
199
217
  exported?: boolean;
200
218
  mutable?: boolean;
219
+ at?: number;
220
+ len?: number;
201
221
  references?: ReferencesFact | null;
202
222
  implementations?: number | null;
203
223
  members?: AnyMember[];
@@ -207,9 +227,8 @@ type Candidate = {
207
227
  constructorParams?: ConstructorParam[];
208
228
  hasConstructor?: boolean;
209
229
  text?: string;
210
- role?: string | null;
211
- parentRole?: string | null;
212
- css?: CssFacts;
230
+ entity?: string | null;
231
+ parentEntity?: string | null;
213
232
  framework?: FrameworkFacts;
214
233
  file?: FileFacts;
215
234
  };
@@ -229,6 +248,8 @@ type ImportFact = {
229
248
  source: string | null;
230
249
  typeOnly?: boolean;
231
250
  named?: string[];
251
+ imported?: string[];
252
+ declaring?: (string | null)[];
232
253
  line: number;
233
254
  piece?: string | null;
234
255
  resolved?: string | null;
@@ -238,6 +259,8 @@ type ImportFact = {
238
259
  type ExportFact = Pick<ImportFact, "form" | "source" | "line" | "piece" | "named" | "typeOnly"> & {
239
260
  from?: string | null;
240
261
  name?: string | null;
262
+ original?: string[];
263
+ declaring?: (string | null)[];
241
264
  };
242
265
  type ReadFact = {
243
266
  module: string;
@@ -256,6 +279,6 @@ type FileFacts = {
256
279
  descendants: DescendantFact[];
257
280
  };
258
281
  candidates: Candidate[];
259
- roles: string[];
282
+ entities: string[];
260
283
  };
261
- export type { Located, Descriptor, MemberFact, AnyMember, DescendantFact, Initializer, Assertion, DecoratorFact, KindFact, ArgumentFact, CallFact, ReturnFact, BindingFact, ParameterFact, BranchFact, AssignmentFact, ReferencesFact, LocationFact, ConstructorParam, CssTemplateFact, CssClassFact, CssFacts, JsxElementFact, Link, FrameworkFacts, Candidate, Leaf, Place, ImportFact, ExportFact, ReadFact, FileFacts, };
284
+ export type { Located, Descriptor, MemberFact, AnyMember, DescendantFact, RecordObject, Initializer, Assertion, DecoratorFact, KindFact, ArgumentFact, CallFact, ReturnFact, BindingFact, ParameterFact, BranchFact, AssignmentFact, ReferencesFact, LocationFact, ConstructorParam, CssTemplateFact, CssClassFact, CssFacts, TailwindFacts, TestFacts, JsxElementFact, Link, FrameworkFacts, Candidate, Leaf, Place, ImportFact, ExportFact, ReadFact, FileFacts, };
@@ -1,5 +1,5 @@
1
- import type { FieldValue } from "../utils/field";
2
- import type { Span } from "../utils/span";
1
+ import type { FieldValue } from "@md-code/follow-architecture/utils/field";
2
+ import type { Span } from "@md-code/follow-architecture/utils/span";
3
3
  import type { ReportObject } from "./architecture";
4
4
  type Finding = Record<string, FieldValue>;
5
5
  type FindingItem = {
@@ -9,7 +9,7 @@ type FindingItem = {
9
9
  data?: FieldValue;
10
10
  message?: string | null;
11
11
  fix?: string | null;
12
- role?: string | null;
12
+ entity?: string | null;
13
13
  };
14
14
  type FindingFrom = (...args: [item: FindingItem, rule: string, node: string, key: string, vars: Record<string, FieldValue>]) => Finding;
15
15
  type FindingHighlight = Span & {
@@ -30,7 +30,7 @@ type Edge = {
30
30
  external: boolean;
31
31
  fact: QueryFilter;
32
32
  what: string;
33
- role: string | null;
33
+ entity: string | null;
34
34
  action?: string | null;
35
35
  };
36
36
  type EdgeProducer = (facts: Facts) => Edge[];