@md-code/follow-architecture 0.3.0 → 0.3.2

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 (387) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +1310 -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 +132 -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} +98 -61
  14. package/dist/code-entities/project.d.ts +21 -0
  15. package/dist/code-entities/project.js +259 -0
  16. package/dist/code-entities/walk.d.ts +31 -0
  17. package/dist/code-entities/walk.js +105 -0
  18. package/dist/config-options.d.ts +23 -0
  19. package/dist/config-options.js +18 -1
  20. package/dist/config-project.js +27 -9
  21. package/dist/config-report.d.ts +1 -1
  22. package/dist/config-report.js +37 -10
  23. package/dist/config-rule.d.ts +25 -0
  24. package/dist/config-rule.js +106 -13
  25. package/dist/config-state.d.ts +14 -3
  26. package/dist/config-state.js +197 -24
  27. package/dist/config.d.ts +25 -0
  28. package/dist/css/index.d.ts +11 -7
  29. package/dist/css/index.js +141 -30
  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 +18 -8
  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 +21 -9
  37. package/dist/css/syntax/scss/index.d.ts +2 -2
  38. package/dist/css/syntax/scss/index.js +18 -8
  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 +34 -14
  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 +32 -15
  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 +21 -11
  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 +148 -37
  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 +10 -8
  133. package/dist/entities/location/where.js +89 -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 +89 -19
  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 +112 -51
  154. package/dist/entities/tree/entries.d.ts +4 -4
  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 +26 -12
  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 +242 -0
  164. package/dist/fa-store.d.ts +22 -0
  165. package/dist/fa-store.js +232 -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 +297 -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 +25 -11
  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 +62 -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 +219 -0
  190. package/dist/main.d.ts +5 -2
  191. package/dist/main.js +223 -41
  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 +64 -11
  196. package/dist/nodes/finally/emit.d.ts +4 -4
  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 +78 -56
  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 +64 -62
  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.d.ts +1 -1
  226. package/dist/pipeline.js +19 -64
  227. package/dist/release-file.d.ts +3 -0
  228. package/dist/release-file.js +13 -0
  229. package/dist/report/asks.d.ts +3 -3
  230. package/dist/report/asks.js +16 -6
  231. package/dist/report/configErrors.d.ts +55 -27
  232. package/dist/report/configErrors.js +81 -35
  233. package/dist/report/errorTypes/codes/structure.d.ts +1 -1
  234. package/dist/report/errorTypes/codes/structure.js +9 -9
  235. package/dist/report/errorTypes/decision-maker.d.ts +5 -5
  236. package/dist/report/errorTypes/decision-maker.js +21 -11
  237. package/dist/report/errorTypes/destinations.d.ts +5 -5
  238. package/dist/report/errorTypes/destinations.js +52 -34
  239. package/dist/report/errorTypes/finding-type.d.ts +3 -3
  240. package/dist/report/errorTypes/index.d.ts +1 -1
  241. package/dist/report/errorTypes/index.js +17 -7
  242. package/dist/report/errorTypes/types/fileContents.d.ts +4 -4
  243. package/dist/report/errorTypes/types/fileContents.js +11 -5
  244. package/dist/report/errorTypes/types/unknownEntity.d.ts +9 -0
  245. package/dist/report/errorTypes/types/{unknownRole.js → unknownEntity.js} +12 -7
  246. package/dist/report/errorTypes/types/wrongAction.d.ts +5 -5
  247. package/dist/report/errorTypes/types/wrongAction.js +18 -13
  248. package/dist/report/errorTypes/types/wrongPlacement.d.ts +4 -4
  249. package/dist/report/errorTypes/types/wrongPlacement.js +19 -9
  250. package/dist/report/errorTypes/vocabulary/ids.d.ts +2 -2
  251. package/dist/report/errorTypes/vocabulary/ids.js +3 -3
  252. package/dist/report/errorTypes/vocabulary/phrases.d.ts +2 -2
  253. package/dist/report/errorTypes/vocabulary/phrases.js +39 -26
  254. package/dist/report/errorTypes/vocabulary/places.d.ts +3 -3
  255. package/dist/report/errorTypes/vocabulary/places.js +13 -13
  256. package/dist/report/finding-from.d.ts +3 -3
  257. package/dist/report/finding-from.js +14 -9
  258. package/dist/report/notices.d.ts +6 -1
  259. package/dist/report/notices.js +46 -20
  260. package/dist/report/observed.d.ts +19 -0
  261. package/dist/report/observed.js +87 -0
  262. package/dist/report/render-report.d.ts +1 -1
  263. package/dist/report/render-report.js +33 -30
  264. package/dist/report/user-report/build/bundle.js +26 -7
  265. package/dist/report/user-report/build/bundle.prebuilt.js +799 -297
  266. package/dist/report/user-report/data/collect.d.ts +2 -2
  267. package/dist/report/user-report/data/collect.js +32 -19
  268. package/dist/report/user-report/data/entities.d.ts +7 -0
  269. package/dist/report/user-report/data/{roles.js → entities.js} +27 -22
  270. package/dist/report/user-report/data/{role-examples.d.ts → entity-examples.d.ts} +3 -3
  271. package/dist/report/user-report/data/entity-examples.js +136 -0
  272. package/dist/report/user-report/data/{role-filters.d.ts → entity-filters.d.ts} +2 -2
  273. package/dist/report/user-report/data/{role-filters.js → entity-filters.js} +7 -7
  274. package/dist/report/user-report/data/entity-marks.d.ts +5 -0
  275. package/dist/report/user-report/data/{role-marks.js → entity-marks.js} +11 -11
  276. package/dist/report/user-report/data/file-tree.d.ts +3 -3
  277. package/dist/report/user-report/data/file-tree.js +13 -5
  278. package/dist/report/user-report/data/finding-boundary.d.ts +4 -4
  279. package/dist/report/user-report/data/finding-boundary.js +2 -2
  280. package/dist/report/user-report/data/finding-plan.d.ts +5 -5
  281. package/dist/report/user-report/data/finding-plan.js +10 -10
  282. package/dist/report/user-report/data/finding-title.d.ts +2 -2
  283. package/dist/report/user-report/data/finding-title.js +8 -8
  284. package/dist/report/user-report/data/findings.d.ts +4 -4
  285. package/dist/report/user-report/data/findings.js +30 -20
  286. package/dist/report/user-report/data/graph-edges.d.ts +4 -4
  287. package/dist/report/user-report/data/graph-edges.js +19 -19
  288. package/dist/report/user-report/data/graph-entities.d.ts +6 -0
  289. package/dist/report/user-report/data/graph-entities.js +158 -0
  290. package/dist/report/user-report/data/graph-helpers.d.ts +5 -5
  291. package/dist/report/user-report/data/graph-helpers.js +15 -15
  292. package/dist/report/user-report/data/graph.d.ts +5 -4
  293. package/dist/report/user-report/data/graph.js +28 -21
  294. package/dist/report/user-report/data/nodes.d.ts +2 -2
  295. package/dist/report/user-report/data/nodes.js +33 -23
  296. package/dist/report/user-report/data/rules.d.ts +7 -0
  297. package/dist/report/user-report/data/{invariants.js → rules.js} +13 -13
  298. package/dist/report/user-report/data/scan.d.ts +1 -1
  299. package/dist/report/user-report/data/scan.js +19 -9
  300. package/dist/report/user-report/html/shell.d.ts +1 -1
  301. package/dist/report/user-report/html/shell.js +1 -1
  302. package/dist/report/user-report/index.d.ts +1 -1
  303. package/dist/report/user-report/index.js +17 -7
  304. package/dist/report/user-report/shared/describe.d.ts +1 -1
  305. package/dist/report/user-report/shared/describe.js +6 -6
  306. package/dist/rules/index.d.ts +7 -0
  307. package/dist/{invariants → rules}/index.js +85 -57
  308. package/dist/{invariants → rules}/list-vars.d.ts +2 -2
  309. package/dist/{invariants → rules}/list-vars.js +9 -3
  310. package/dist/{invariants → rules}/name.js +2 -2
  311. package/dist/rules/normalize.d.ts +5 -0
  312. package/dist/rules/normalize.js +108 -0
  313. package/dist/{invariants → rules}/vars.d.ts +9 -7
  314. package/dist/{invariants → rules}/vars.js +5 -5
  315. package/dist/scan-run.d.ts +20 -0
  316. package/dist/scan-run.js +130 -0
  317. package/dist/scripts/audit-report.js +19 -9
  318. package/dist/usage-index.d.ts +4 -0
  319. package/dist/usage-index.js +282 -0
  320. package/dist/usage-mode.d.ts +7 -0
  321. package/dist/usage-mode.js +16 -0
  322. package/dist/usage-pass.d.ts +19 -0
  323. package/dist/usage-pass.js +136 -0
  324. package/dist/usage-prepare.d.ts +2 -0
  325. package/dist/usage-prepare.js +22 -0
  326. package/dist/usage-sweep.d.ts +10 -0
  327. package/dist/usage-sweep.js +264 -0
  328. package/dist/utils/aliases.d.ts +22 -0
  329. package/dist/utils/aliases.js +173 -0
  330. package/dist/utils/classify.d.ts +2 -2
  331. package/dist/utils/classify.js +4 -4
  332. package/dist/utils/configs.js +17 -7
  333. package/dist/utils/distinct.js +4 -2
  334. package/dist/utils/files.js +41 -37
  335. package/dist/utils/fixpoint.js +2 -2
  336. package/dist/utils/host.d.ts +1 -1
  337. package/dist/utils/host.js +4 -1
  338. package/dist/utils/imports.js +83 -19
  339. package/dist/utils/keyed.js +2 -2
  340. package/dist/utils/map-record.js +2 -2
  341. package/dist/utils/packages.d.ts +15 -0
  342. package/dist/utils/packages.js +207 -0
  343. package/dist/utils/path-label.js +3 -1
  344. package/dist/utils/pattern.d.ts +5 -4
  345. package/dist/utils/pattern.js +55 -15
  346. package/dist/utils/permission.d.ts +3 -3
  347. package/dist/utils/permission.js +4 -2
  348. package/dist/utils/plural.js +2 -2
  349. package/dist/utils/qualified.js +4 -4
  350. package/dist/utils/rank.js +2 -2
  351. package/dist/utils/record.js +1 -1
  352. package/dist/utils/search.js +7 -2
  353. package/dist/utils/speak.js +1 -1
  354. package/dist/utils/split.js +14 -1
  355. package/dist/utils/template.d.ts +1 -1
  356. package/dist/utils/template.js +1 -1
  357. package/dist/utils/tokenize.js +6 -1
  358. package/dist/utils/typed-field.js +2 -2
  359. package/dist/utils/verdicts.js +1 -1
  360. package/entities/operators.ts +1 -1
  361. package/package.json +101 -90
  362. package/report/errorTypes/vocabulary/ids.ts +7 -2
  363. package/report/errorTypes/vocabulary/phrases.ts +47 -27
  364. package/report/errorTypes/vocabulary/places.ts +21 -16
  365. package/report/user-report/shared/describe.ts +7 -7
  366. package/dist/code-roles/classify.d.ts +0 -11
  367. package/dist/code-roles/classify.js +0 -43
  368. package/dist/code-roles/connector.d.ts +0 -5
  369. package/dist/code-roles/connector.js +0 -114
  370. package/dist/code-roles/project.d.ts +0 -12
  371. package/dist/code-roles/project.js +0 -122
  372. package/dist/code-roles/roles.d.ts +0 -8
  373. package/dist/invariants/index.d.ts +0 -6
  374. package/dist/invariants/normalize.d.ts +0 -4
  375. package/dist/invariants/normalize.js +0 -95
  376. package/dist/nodes/child-roles.d.ts +0 -3
  377. package/dist/nodes/child-roles.js +0 -12
  378. package/dist/nodes/finally/roles.d.ts +0 -13
  379. package/dist/nodes/finally/roles.js +0 -41
  380. package/dist/report/errorTypes/types/unknownRole.d.ts +0 -9
  381. package/dist/report/user-report/data/graph-roles.d.ts +0 -5
  382. package/dist/report/user-report/data/graph-roles.js +0 -71
  383. package/dist/report/user-report/data/invariants.d.ts +0 -7
  384. package/dist/report/user-report/data/role-examples.js +0 -94
  385. package/dist/report/user-report/data/role-marks.d.ts +0 -5
  386. package/dist/report/user-report/data/roles.d.ts +0 -7
  387. /package/dist/{invariants → rules}/name.d.ts +0 -0
@@ -1,43 +1,91 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  Object.defineProperty(exports, "__esModule", { value: true });
3
36
  exports.entryKey = exports.fillTemplate = exports.labelOf = exports.accessorLabel = exports.checkWhere = exports.matchesWhere = exports.parseWhere = exports.parseWhereEntry = exports.toList = void 0;
4
37
  // THE `where` GRAMMAR — one implementation of "here" / "by this code", shared by
5
- // node `role:` homes, codeRole actions and invariant `where`/`except`.
38
+ // node `entity:` homes, entity actions and rule `where`/`except`.
6
39
  //
7
40
  // An entry is one of:
8
- // { role } code that IS that role (its file declares it)
9
- // { role, same } …and in the SAME node instance as the target
41
+ // { entity } code that IS that entity (its file declares it)
42
+ // { entity, same } …and in the SAME node instance as the target
10
43
  // { node } any file under that declared node
11
- // { template } a path built from the tree (role homes)
44
+ // { template } a path built from the tree (entity homes)
12
45
  // "glob" a path pattern
13
46
  // { <filter> } any filter over the file's facts
14
- const pattern_1 = require("../../utils/pattern");
15
- const match_1 = require("../tree/match");
16
- const queries_1 = require("../queries");
47
+ const pattern_1 = require("@md-code/follow-architecture/utils/pattern");
48
+ const aliases_1 = require("@md-code/follow-architecture/utils/aliases");
49
+ const match_1 = require("@md-code/follow-architecture/entities/tree/match");
50
+ const queries_1 = require("@md-code/follow-architecture/entities/queries");
17
51
  const place_1 = require("./place");
18
- const field_1 = require("../../utils/field");
52
+ const configError = __importStar(require("@md-code/follow-architecture/report/configErrors"));
53
+ const field_1 = require("@md-code/follow-architecture/utils/field");
19
54
  Object.defineProperty(exports, "toList", { enumerable: true, get: function () { return field_1.toList; } });
20
55
  const queryMatcher = () => queries_1.matches;
21
56
  const readObjEntry = (entry) => {
22
- if (entry.role != null)
23
- return { type: "role", role: String(entry.role), same: Boolean(entry.same), via: entry.via === "import" ? "import" : null };
57
+ if ("role" in entry)
58
+ throw configError.unknownWhereKey({ key: "role" });
59
+ if (entry.entity != null)
60
+ return {
61
+ type: "entity",
62
+ entity: String(entry.entity),
63
+ same: Boolean(entry.same),
64
+ via: entry.via === "import" ? "import" : null,
65
+ };
24
66
  if (entry.node != null)
25
67
  return { type: "node", node: String(entry.node) };
26
68
  if (entry.template != null)
27
69
  return { type: "template", template: String(entry.template) };
28
70
  return { type: "query", query: entry };
29
71
  };
30
- // Normalize one entry. `roles` (a Set of declared slugs) lets a bare string that
31
- // names a role become a role reference; without it every string is a glob.
32
- const parseWhereEntry = (entry, roles = null) => {
72
+ // Normalize one entry. `entities` (a Set of declared slugs) lets a bare string that
73
+ // names an entity become an entity reference; without it every string is a glob.
74
+ // `aliases` turns a `@`-prefixed glob or a `location` filter into the repo path it
75
+ // names — ONE reading of the alias map, shared with the import resolver and the
76
+ // node tree.
77
+ const parseWhereEntry = (entry, entities = null, aliases = null) => {
33
78
  if (typeof entry === "string")
34
- return roles?.has(entry) && !entry.includes("/") && !entry.includes("*") ? { type: "role", role: entry, same: false } : { type: "glob", glob: entry };
79
+ return entities?.has(entry) && !entry.includes("/") && !entry.includes("*")
80
+ ? { type: "entity", entity: entry, same: false }
81
+ : { type: "glob", glob: (0, aliases_1.expandPattern)(aliases, entry) };
35
82
  if (!(0, queries_1.isObj)(entry))
36
83
  return { type: "query", query: entry };
37
- return readObjEntry(entry);
84
+ const rewritten = (0, aliases_1.expandLocationFilters)(entry, aliases);
85
+ return readObjEntry((0, queries_1.isObj)(rewritten) ? rewritten : entry);
38
86
  };
39
87
  exports.parseWhereEntry = parseWhereEntry;
40
- const parseWhere = (value, roles = null) => (0, field_1.toList)(value).map((e) => parseWhereEntry(e, roles));
88
+ const parseWhere = (value, entities = null, aliases = null) => (0, field_1.toList)(value).map((e) => parseWhereEntry(e, entities, aliases));
41
89
  exports.parseWhere = parseWhere;
42
90
  const patternOf = (entry) => {
43
91
  if (entry.type === "glob")
@@ -67,15 +115,15 @@ const sameCaps = (source, target) => {
67
115
  }
68
116
  return true;
69
117
  };
70
- // `{ role }` — the file declares that role, and (for `same`) in the SAME node.
71
- const matchesRole = (...args) => {
118
+ // `{ entity }` — the file declares that entity, and (for `same`) in the SAME node.
119
+ const matchesEntity = (...args) => {
72
120
  const [entry, rel, arch, facts, targetCaps] = args;
73
- if (!(facts?.roles ?? []).includes(entry.role ?? ""))
121
+ if (!(facts?.entities ?? []).includes(entry.entity ?? ""))
74
122
  return false;
75
123
  if (!entry.same)
76
124
  return true;
77
125
  const nodeM = (0, match_1.deepestMatch)(rel, arch);
78
- return sameCaps(nodeM ? (0, match_1.matchNode)(nodeM.node, rel)?.caps ?? {} : {}, targetCaps);
126
+ return sameCaps(nodeM ? ((0, match_1.matchNode)(nodeM.node, rel)?.caps ?? {}) : {}, targetCaps);
79
127
  };
80
128
  // `{ node }` — the path is inside that declared node.
81
129
  const matchesNodeEntry = (entry, rel, arch) => {
@@ -92,8 +140,8 @@ const matchesWhere = (...args) => {
92
140
  const pattern = patternOf(entry);
93
141
  if (pattern != null)
94
142
  return capsAgree(pattern, rel, targetCaps);
95
- if (entry.type === "role")
96
- return matchesRole(entry, rel, arch, facts, targetCaps);
143
+ if (entry.type === "entity")
144
+ return matchesEntity(entry, rel, arch, facts, targetCaps);
97
145
  if (entry.type === "node")
98
146
  return matchesNodeEntry(entry, rel, arch);
99
147
  // The scope IS the facts (plus the file and the tree), so a `$ref` can compare
@@ -111,13 +159,20 @@ const checkWhere = (...args) => {
111
159
  };
112
160
  exports.checkWhere = checkWhere;
113
161
  // How code is reached through a declared accessor without an import.
114
- const accessorLabel = (e) => (e?.scope === "function" || e?.scope === "method" ? `${(e.segments ?? []).join(".")}(…)` : (e?.segments ?? []).join("."));
162
+ // A typed door is spelled by its parameter: `(value: DefaultTheme)`.
163
+ const typeLabel = (type) => `(value: ${type.slice(type.lastIndexOf(".") + 1)})`;
164
+ const accessorLabel = (e) => {
165
+ const segments = e?.segments ?? [];
166
+ if (!segments.length && e?.type)
167
+ return typeLabel(e.type);
168
+ return e?.scope === "function" || e?.scope === "method" ? `${segments.join(".")}(…)` : segments.join(".");
169
+ };
115
170
  exports.accessorLabel = accessorLabel;
116
171
  const kindOf = (entry) => {
117
172
  if (entry.type)
118
173
  return entry.type;
119
- if (entry.role)
120
- return "role";
174
+ if (entry.entity)
175
+ return "entity";
121
176
  if (entry.node)
122
177
  return "node";
123
178
  if (entry.glob)
@@ -127,15 +182,15 @@ const kindOf = (entry) => {
127
182
  return null;
128
183
  };
129
184
  const orText = (value, fallback) => value ?? fallback;
130
- const roleLabel = (entry) => `role ${orText(entry.role, "")}${entry.same ? " (same instance)" : ""}`;
185
+ const entityLabel = (entry) => `entity ${orText(entry.entity, "")}${entry.same ? " (same instance)" : ""}`;
131
186
  // How one `where` entry reads inside a sentence — the ONE place that knows the
132
187
  // entry vocabulary.
133
188
  const labelOf = (entry) => {
134
189
  if (!entry)
135
190
  return "—";
136
191
  const kind = kindOf(entry);
137
- if (kind === "role")
138
- return roleLabel(entry);
192
+ if (kind === "entity")
193
+ return entityLabel(entry);
139
194
  if (kind === "node")
140
195
  return `node ${orText(entry.node, "")}`;
141
196
  if (kind === "glob")
@@ -183,7 +238,9 @@ const fillTemplate = (template, rel = null, caps = null) => {
183
238
  if (template == null)
184
239
  return null;
185
240
  const segs = String(template).split("/");
186
- const relSegs = String(rel ?? "").split("/").filter(Boolean);
241
+ const relSegs = String(rel ?? "")
242
+ .split("/")
243
+ .filter(Boolean);
187
244
  const out = [];
188
245
  for (let i = 0; i < segs.length; i += 1) {
189
246
  const seg = segs[i];
@@ -210,7 +267,9 @@ const entryKey = (entry, rel, arch, facts) => {
210
267
  return fileDir;
211
268
  // A template that names a FAMILY (`…/actions/*.ts`) designates the folder the
212
269
  // family lives in.
213
- const star = String(template).split("/").findIndex((s) => s.includes("*"));
270
+ const star = String(template)
271
+ .split("/")
272
+ .findIndex((s) => s.includes("*"));
214
273
  if (star === -1)
215
274
  return filled;
216
275
  return filled.split("/").slice(0, star).join("/") || fileDir;
@@ -1,4 +1,4 @@
1
- import type { FieldValue } from "../utils/field";
1
+ import type { FieldValue } from "@md-code/follow-architecture/utils/field";
2
2
  import type { Arch, QueryScope, WhereEntry } from "./architecture";
3
3
  type AsFilter = (loc: FieldValue, entry: FieldValue) => boolean;
4
4
  declare const matchesLocation: (value: FieldValue, entry: FieldValue, scope?: QueryScope, asFilter?: AsFilter | null) => boolean;
@@ -10,7 +10,7 @@ declare const resolveLocation: (arch: Arch, location: WhereEntry | string | (Whe
10
10
  declare const boxOfPlace: (arch: Arch, path: string | null | undefined) => string | null;
11
11
  export { matchesLocation, resolveLocation, boxOfPlace };
12
12
  export { wordsIn, nameOnly, segmentsOf, parentOf, leafOf, placeOf, placeholdersOf, dirOf } from "./location/place";
13
- export { toList, parseWhereEntry, parseWhere, matchesWhere, checkWhere, accessorLabel, labelOf, fillTemplate, entryKey } from "./location/where";
14
- export { homesOf, sharedPrefix, destinationsIn, destinationOf, placeFor, roleFitsAt, rolesAtPath, homeForRole } from "./location/homes";
13
+ export { toList, parseWhereEntry, parseWhere, matchesWhere, checkWhere, accessorLabel, labelOf, fillTemplate, entryKey, } from "./location/where";
14
+ export { homesOf, sharedPrefix, destinationsIn, destinationOf, placeFor, entityFitsAt, entitiesAtPath, homeForEntity, } from "./location/homes";
15
15
  export type { Resolved };
16
16
  export type { Caps } from "./location/where";
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.homeForRole = exports.rolesAtPath = exports.roleFitsAt = exports.placeFor = exports.destinationOf = exports.destinationsIn = exports.sharedPrefix = exports.homesOf = exports.entryKey = exports.fillTemplate = exports.labelOf = exports.accessorLabel = exports.checkWhere = exports.matchesWhere = exports.parseWhere = exports.parseWhereEntry = exports.toList = exports.dirOf = exports.placeholdersOf = exports.placeOf = exports.leafOf = exports.parentOf = exports.segmentsOf = exports.nameOnly = exports.wordsIn = exports.boxOfPlace = exports.resolveLocation = exports.matchesLocation = void 0;
3
+ exports.homeForEntity = exports.entitiesAtPath = exports.entityFitsAt = exports.placeFor = exports.destinationOf = exports.destinationsIn = exports.sharedPrefix = exports.homesOf = exports.entryKey = exports.fillTemplate = exports.labelOf = exports.accessorLabel = exports.checkWhere = exports.matchesWhere = exports.parseWhere = exports.parseWhereEntry = exports.toList = exports.dirOf = exports.placeholdersOf = exports.placeOf = exports.leafOf = exports.parentOf = exports.segmentsOf = exports.nameOnly = exports.wordsIn = exports.boxOfPlace = exports.resolveLocation = exports.matchesLocation = void 0;
4
4
  // WHERE a piece of code is, and WHERE a rule points — one vocabulary, one
5
5
  // implementation, used by both sides:
6
6
  //
7
7
  // • `matchesLocation(value, entry, { arch }, asFilter)` — the `location:`
8
8
  // FILTER: "is this candidate / file / edge at that place?" (`"glob"`,
9
- // `{ node }`, `{ role }`, or a query over the location itself).
9
+ // `{ node }`, `{ entity }`, or a query over the location itself).
10
10
  // • `resolveLocation(arch, location, rel)` — the `fix.location` of a REPAIR:
11
11
  // the place AND the box it is, for this file, asked of the tree.
12
12
  //
@@ -14,9 +14,9 @@ exports.homeForRole = exports.rolesAtPath = exports.roleFitsAt = exports.placeFo
14
14
  // "where" vocabulary live in sibling modules and are re-exported here, so every
15
15
  // consumer keeps importing `entities/location`:
16
16
  // • `./location/place` — ONE PATH, cut into its parts;
17
- // • `./location/where` — the `where` grammar (roles / nodes / globs / filters);
18
- // • `./location/homes` — the role → place answer.
19
- const pattern_1 = require("../utils/pattern");
17
+ // • `./location/where` — the `where` grammar (entities / nodes / globs / filters);
18
+ // • `./location/homes` — the entity → place answer.
19
+ const pattern_1 = require("@md-code/follow-architecture/utils/pattern");
20
20
  const tree_1 = require("./tree");
21
21
  const queries_1 = require("./queries");
22
22
  const place_1 = require("./location/place");
@@ -32,7 +32,7 @@ const pathOf = (loc) => {
32
32
  };
33
33
  // The `arch` carried in a scope: a plain-data record may hold anything readable,
34
34
  // but `arch` is the built model (compiled regexes), so it is recognised apart.
35
- const isArch = (v) => v != null && typeof v === "object" && "nodes" in v && "codeRoles" in v;
35
+ const isArch = (v) => v != null && typeof v === "object" && "nodes" in v && "entities" in v;
36
36
  const isScopeRecord = (scope) => scope !== null && scope !== undefined && typeof scope === "object" && !Array.isArray(scope);
37
37
  const archOf = (scope) => {
38
38
  if (!isScopeRecord(scope))
@@ -46,7 +46,7 @@ const pathInNode = (arch, nodeSlug, itemPath) => {
46
46
  return false;
47
47
  return node.variants.some((v) => v.re.test(itemPath));
48
48
  };
49
- const pathInRole = (arch, role, itemPath) => (arch?.nodes.roleHomes[role] ?? []).some((h) => (0, pattern_1.compilePattern)(h.template).re.test(itemPath));
49
+ const pathInEntity = (arch, entity, itemPath) => (arch?.nodes.entityHomes[entity] ?? []).some((h) => (0, pattern_1.compilePattern)(h.template).re.test(itemPath));
50
50
  // The `location:` filter. `value` is a candidate, a file fact, an edge or a bare
51
51
  // path — they all answer the same question.
52
52
  const matchesLocation = (value, entry, scope = {}, asFilter = null) => {
@@ -61,15 +61,15 @@ const matchesLocation = (value, entry, scope = {}, asFilter = null) => {
61
61
  // `{ node: "slug" }` — the path is inside that node.
62
62
  if ((0, queries_1.isObj)(entry) && typeof entry.node === "string")
63
63
  return pathInNode(arch, entry.node, itemPath);
64
- // `{ role }` — the path is one of the places that role is declared to live in.
65
- if ((0, queries_1.isObj)(entry) && typeof entry.role === "string")
66
- return pathInRole(arch, entry.role, itemPath);
64
+ // `{ entity }` — the path is one of the places that entity is declared to live in.
65
+ if ((0, queries_1.isObj)(entry) && typeof entry.entity === "string")
66
+ return pathInEntity(arch, entry.entity, itemPath);
67
67
  // A query over the location itself: `{ piece: { isNull: true } }`.
68
68
  return asFilter ? asFilter(loc, entry) : true;
69
69
  };
70
70
  exports.matchesLocation = matchesLocation;
71
- const resolveRole = (arch, role, rel) => {
72
- const hit = (0, homes_1.homeForRole)(arch, role, rel);
71
+ const resolveEntity = (arch, entity, rel) => {
72
+ const hit = (0, homes_1.homeForEntity)(arch, entity, rel);
73
73
  return hit?.node ? { node: hit.node, path: hit.path } : null;
74
74
  };
75
75
  const resolveNode = (arch, nodeSlug, rel) => {
@@ -85,8 +85,8 @@ const resolveOne = (arch, entry, rel) => {
85
85
  return null;
86
86
  if (typeof entry === "string")
87
87
  return { path: entry, node: (0, tree_1.folderOwner)(arch, (0, place_1.dirOf)(entry))?.slug ?? null };
88
- if (entry.role)
89
- return resolveRole(arch, entry.role, rel);
88
+ if (entry.entity)
89
+ return resolveEntity(arch, entry.entity, rel);
90
90
  if (entry.node)
91
91
  return resolveNode(arch, entry.node, rel);
92
92
  return null;
@@ -135,6 +135,6 @@ Object.defineProperty(exports, "sharedPrefix", { enumerable: true, get: function
135
135
  Object.defineProperty(exports, "destinationsIn", { enumerable: true, get: function () { return homes_2.destinationsIn; } });
136
136
  Object.defineProperty(exports, "destinationOf", { enumerable: true, get: function () { return homes_2.destinationOf; } });
137
137
  Object.defineProperty(exports, "placeFor", { enumerable: true, get: function () { return homes_2.placeFor; } });
138
- Object.defineProperty(exports, "roleFitsAt", { enumerable: true, get: function () { return homes_2.roleFitsAt; } });
139
- Object.defineProperty(exports, "rolesAtPath", { enumerable: true, get: function () { return homes_2.rolesAtPath; } });
140
- Object.defineProperty(exports, "homeForRole", { enumerable: true, get: function () { return homes_2.homeForRole; } });
138
+ Object.defineProperty(exports, "entityFitsAt", { enumerable: true, get: function () { return homes_2.entityFitsAt; } });
139
+ Object.defineProperty(exports, "entitiesAtPath", { enumerable: true, get: function () { return homes_2.entitiesAtPath; } });
140
+ Object.defineProperty(exports, "homeForEntity", { enumerable: true, get: function () { return homes_2.homeForEntity; } });
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SCALAR_OPS = exports.QUANTIFIERS = exports.CONTAINERS = void 0;
4
4
  // The operator vocabulary AS THE REPORT READS IT: which keys stand for a list,
5
5
  // which of them say "one of them", and how a scalar operator is spelled for a
6
- // human. Two readers share it — the Node-side summarizer (`data/invariants.js`)
6
+ // human. Two readers share it — the Node-side summarizer (`data/rules.js`)
7
7
  // and the browser describer (`src/utils/describe.js`) — because they used to
8
8
  // carry the same three tables twice and printed two different truths.
9
9
  //
@@ -1,7 +1,7 @@
1
1
  import type { AccessGraph } from "./graph";
2
2
  import type { EnrichedFinding } from "./finding";
3
3
  import type { FileTreeEntry } from "./file-tree";
4
- import type { InvariantSummary, NodeSummary, RoleSummary } from "./summaries";
4
+ import type { RuleSummary, NodeSummary, EntitySummary } from "./summaries";
5
5
  type CountGroup = {
6
6
  key: string;
7
7
  count: number;
@@ -18,8 +18,8 @@ type OverviewStats = {
18
18
  nodes: number;
19
19
  folders: number;
20
20
  fileNodes: number;
21
- roles: number;
22
- invariants: number;
21
+ entities: number;
22
+ rules: number;
23
23
  findings: number;
24
24
  filesWithFindings: number;
25
25
  edges: number;
@@ -30,13 +30,13 @@ type OverviewData = {
30
30
  stats: OverviewStats;
31
31
  nodes: NodeSummary[];
32
32
  access: AccessGraph;
33
- roles: RoleSummary[];
34
- invariants: InvariantSummary[];
33
+ entities: EntitySummary[];
34
+ rules: RuleSummary[];
35
35
  findings: EnrichedFinding[];
36
36
  fileTree: FileTreeEntry;
37
37
  groups: {
38
38
  byCategory: CountGroup[];
39
- byInvariant: CountGroup[];
39
+ byRule: CountGroup[];
40
40
  byNode: CountGroup[];
41
41
  };
42
42
  };
@@ -1,16 +1,16 @@
1
- import type { FieldValue } from "../../utils/field";
2
- import type { Arch } from "../architecture";
3
- import type { Finding } from "../findings";
1
+ import type { FieldValue } from "@md-code/follow-architecture/utils/field";
2
+ import type { Arch } from "@md-code/follow-architecture/entities/architecture";
3
+ import type { Finding } from "@md-code/follow-architecture/entities/findings";
4
4
  import type { NodeSummary } from "./summaries";
5
- import type { RelationToken } from "../token";
5
+ import type { RelationToken } from "@md-code/follow-architecture/entities/token";
6
6
  type Places = {
7
7
  folderOf: (slug: string | null | undefined) => string | null;
8
8
  pathOf: (slug: string) => string;
9
- roles: () => string[];
10
- rolesAtPath: (rel: string) => string[];
11
- homeTemplates: (role: string) => string[];
12
- homeFor: (role: string, rel: string) => {
13
- role: string;
9
+ entities: () => string[];
10
+ entitiesAtPath: (rel: string) => string[];
11
+ homeTemplates: (entity: string) => string[];
12
+ homeFor: (entity: string, rel: string) => {
13
+ entity: string;
14
14
  path: string;
15
15
  folder: boolean;
16
16
  concrete: boolean;
@@ -35,7 +35,7 @@ type CtxOwner = {
35
35
  slug?: string;
36
36
  path?: string;
37
37
  paths?: string[];
38
- roles?: string[];
38
+ entities?: string[];
39
39
  } | null | undefined;
40
40
  type CtxViolation = {
41
41
  kind?: string;
@@ -54,7 +54,7 @@ type DecisionCtx = {
54
54
  plan?: CtxPlan;
55
55
  nodes?: NodeSummary[];
56
56
  arch?: Arch;
57
- invariant?: string | null;
57
+ rule?: string | null;
58
58
  places: Places;
59
59
  };
60
60
  export type { Places, CtxPlan, CtxOwner, CtxViolation, DecisionCtx };
@@ -1,16 +1,16 @@
1
- import type { RelationToken } from "../token";
2
- import type { Repair } from "../repair";
3
- import type { Story } from "../story";
4
- import type { Place } from "../place";
5
- import type { FindingHighlight } from "../findings";
6
- import type { Violation } from "../../nodes/finally/violation";
1
+ import type { RelationToken } from "@md-code/follow-architecture/entities/token";
2
+ import type { Repair } from "@md-code/follow-architecture/entities/repair";
3
+ import type { Story } from "@md-code/follow-architecture/entities/story";
4
+ import type { Place } from "@md-code/follow-architecture/entities/place";
5
+ import type { FindingHighlight } from "@md-code/follow-architecture/entities/findings";
6
+ import type { Violation } from "@md-code/follow-architecture/nodes/finally/violation";
7
7
  type PlanPlace = Place;
8
8
  type PlanRelation = Place & {
9
9
  kind: string;
10
10
  line: number | null;
11
11
  };
12
12
  type Plan = {
13
- role: string | null;
13
+ entity: string | null;
14
14
  before: PlanPlace | null;
15
15
  after: PlanPlace | null;
16
16
  target: PlanPlace | null;
@@ -45,10 +45,10 @@ type EnrichedFinding = {
45
45
  fixOptions: Repair[];
46
46
  errorType: string;
47
47
  ownerNode: string | null;
48
- nodeRoles: string[];
48
+ nodeEntities: string[];
49
49
  ownerPaths: string[];
50
- role: string | null;
51
- invariant: string | null;
50
+ entity: string | null;
51
+ ruleId: string | null;
52
52
  violation: FindingViolation | null;
53
53
  boundary: Boundary | null;
54
54
  plan: Plan;
@@ -8,38 +8,54 @@ type AccessEdge = {
8
8
  toPath: string;
9
9
  actor: string;
10
10
  actorPath?: string;
11
- actorRoles?: string[];
12
- actorRole: string | null;
11
+ actorEntities?: string[];
12
+ actorEntity: string | null;
13
13
  subject: string;
14
14
  subjectPath?: string;
15
- fromRoles?: string[];
15
+ fromEntities?: string[];
16
16
  same: boolean;
17
17
  via: string;
18
18
  target: string;
19
19
  broken?: boolean;
20
20
  brokenCount?: number;
21
21
  option?: boolean;
22
+ count?: number;
23
+ sample?: ObservedPlace;
24
+ declared?: boolean;
25
+ };
26
+ type ObservedPlace = {
27
+ file: string;
28
+ line: number;
29
+ sentence: string;
30
+ };
31
+ type ObservedEdge = {
32
+ kind: string;
33
+ from: string;
34
+ to: string;
35
+ count: number;
36
+ broken: number;
37
+ sample: ObservedPlace;
22
38
  };
23
39
  type Unplaceable = {
24
40
  kind: string;
25
- targetRole: string;
41
+ targetEntity: string;
26
42
  who: string;
27
43
  };
28
44
  type Mention = {
29
45
  kind: string;
30
- targetRole: string;
46
+ targetEntity: string;
31
47
  targetPaths: string[];
32
48
  };
33
49
  type GraphViolation = {
34
50
  kind: string;
35
51
  from: string;
36
52
  to: string;
37
- role: string;
53
+ entity: string;
38
54
  file: string;
39
55
  line: number;
40
56
  title: string;
41
57
  };
42
- type RoleNode = {
58
+ type EntityNode = {
43
59
  slug: string;
44
60
  name: string;
45
61
  paths: string[];
@@ -53,13 +69,14 @@ type Adjacency = {
53
69
  };
54
70
  type AccessGraph = {
55
71
  kinds: string[];
56
- roles: string[];
72
+ entities: string[];
57
73
  edges: AccessEdge[];
58
74
  violations: GraphViolation[];
59
75
  unplaceable: Unplaceable[];
60
76
  mentions: Record<string, Mention[]>;
61
77
  byNode: Record<string, Adjacency>;
62
- roleNodes: RoleNode[];
63
- roleEdges: AccessEdge[];
78
+ entityNodes: EntityNode[];
79
+ entityEdges: AccessEdge[];
80
+ observed: ObservedEdge[];
64
81
  };
65
- export type { AccessEdge, Unplaceable, Mention, GraphViolation, RoleNode, Adjacency, AccessGraph };
82
+ export type { AccessEdge, ObservedEdge, ObservedPlace, Unplaceable, Mention, GraphViolation, EntityNode, Adjacency, AccessGraph, };
@@ -1,6 +1,6 @@
1
1
  import type { Project } from "ts-morph";
2
- import type { Arch } from "../architecture";
3
- import type { Finding } from "../findings";
2
+ import type { Arch } from "@md-code/follow-architecture/entities/architecture";
3
+ import type { Finding } from "@md-code/follow-architecture/entities/findings";
4
4
  type OverviewInput = {
5
5
  arch: Arch;
6
6
  findings: Finding[];
@@ -1,6 +1,6 @@
1
- import type { FieldValue } from "../../utils/field";
2
- import type { Located } from "../facts";
3
- import type { RoleDef, ReportObject } from "../architecture";
1
+ import type { FieldValue } from "@md-code/follow-architecture/utils/field";
2
+ import type { Located } from "@md-code/follow-architecture/entities/facts";
3
+ import type { EntityDef, ReportObject } from "@md-code/follow-architecture/entities/architecture";
4
4
  type Snippet = {
5
5
  startLine: number;
6
6
  lines: string[];
@@ -11,36 +11,38 @@ type MatchedRange = {
11
11
  to: number;
12
12
  why: string;
13
13
  };
14
- type RoleExample = Required<Pick<Located, "name" | "line">> & {
14
+ type EntityExample = Required<Pick<Located, "name" | "line">> & {
15
15
  file: string;
16
16
  rank: number;
17
17
  code: Snippet | null;
18
18
  matched: MatchedRange[];
19
19
  };
20
- type RoleHome = {
20
+ type EntityHome = {
21
21
  slug: string;
22
22
  paths: string[];
23
23
  label: string;
24
24
  labels: string[];
25
25
  };
26
- type RoleAction = {
26
+ type EntityAction = {
27
27
  kind: string;
28
28
  of: string | null;
29
29
  from: string[];
30
30
  scopeAccess: {
31
31
  scope: string;
32
32
  segments: string[];
33
+ type?: string;
34
+ entity?: string[];
33
35
  }[];
34
36
  };
35
- type RoleSummary = Pick<RoleDef, "slug" | "name"> & {
37
+ type EntitySummary = Pick<EntityDef, "slug" | "name"> & {
36
38
  infer: FieldValue;
37
39
  report: {
38
40
  message: string | null;
39
41
  fix: string | null;
40
42
  };
41
- actions: RoleAction[];
42
- homes: RoleHome[];
43
- examples: RoleExample[];
43
+ actions: EntityAction[];
44
+ homes: EntityHome[];
45
+ examples: EntityExample[];
44
46
  exampleCount: number;
45
47
  };
46
48
  type NodeSummary = {
@@ -58,22 +60,22 @@ type NodeSummary = {
58
60
  sample: ({
59
61
  file: string;
60
62
  } & Snippet) | null;
61
- roles: string[];
63
+ entities: string[];
62
64
  closed?: boolean;
63
65
  };
64
- type InvariantRule = {
66
+ type RuleCondition = {
65
67
  conditions: string[];
66
68
  message: string | null;
67
69
  fix: FieldValue | ReportObject["fix"];
68
70
  };
69
- type InvariantSummary = {
71
+ type RuleSummary = {
70
72
  id: string;
71
73
  where: string[];
72
74
  ignore: string[];
73
75
  when: string[];
74
76
  dedupeBy: string[];
75
77
  report: string | null;
76
- infer: InvariantRule[];
78
+ infer: RuleCondition[];
77
79
  findingCount: number;
78
80
  };
79
- export type { Snippet, MatchedRange, RoleExample, RoleHome, RoleAction, RoleSummary, NodeSummary, InvariantRule, InvariantSummary };
81
+ export type { Snippet, MatchedRange, EntityExample, EntityHome, EntityAction, EntitySummary, NodeSummary, RuleCondition, RuleSummary, };
@@ -1,4 +1,4 @@
1
- import { isObj, isList, type FieldValue } from "../utils/field";
1
+ import { isObj, isList, type FieldValue } from "@md-code/follow-architecture/utils/field";
2
2
  import type { QueryFilter, QueryScope } from "./architecture";
3
3
  declare const COMPOSITION_OPS: Set<string>;
4
4
  declare const KNOWN_OPS: Set<string>;