@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,43 +1,81 @@
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 (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
26
  exports.entryKey = exports.fillTemplate = exports.labelOf = exports.accessorLabel = exports.checkWhere = exports.matchesWhere = exports.parseWhere = exports.parseWhereEntry = exports.toList = void 0;
4
27
  // THE `where` GRAMMAR — one implementation of "here" / "by this code", shared by
5
- // node `role:` homes, codeRole actions and invariant `where`/`except`.
28
+ // node `entity:` homes, entity actions and rule `where`/`except`.
6
29
  //
7
30
  // 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
31
+ // { entity } code that IS that entity (its file declares it)
32
+ // { entity, same } …and in the SAME node instance as the target
10
33
  // { node } any file under that declared node
11
- // { template } a path built from the tree (role homes)
34
+ // { template } a path built from the tree (entity homes)
12
35
  // "glob" a path pattern
13
36
  // { <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");
37
+ const pattern_1 = require("@md-code/follow-architecture/utils/pattern");
38
+ const aliases_1 = require("@md-code/follow-architecture/utils/aliases");
39
+ const match_1 = require("@md-code/follow-architecture/entities/tree/match");
40
+ const queries_1 = require("@md-code/follow-architecture/entities/queries");
17
41
  const place_1 = require("./place");
18
- const field_1 = require("../../utils/field");
42
+ const configError = __importStar(require("@md-code/follow-architecture/report/configErrors"));
43
+ const field_1 = require("@md-code/follow-architecture/utils/field");
19
44
  Object.defineProperty(exports, "toList", { enumerable: true, get: function () { return field_1.toList; } });
20
45
  const queryMatcher = () => queries_1.matches;
21
46
  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 };
47
+ if ("role" in entry)
48
+ throw configError.unknownWhereKey({ key: "role" });
49
+ if (entry.entity != null)
50
+ return {
51
+ type: "entity",
52
+ entity: String(entry.entity),
53
+ same: Boolean(entry.same),
54
+ via: entry.via === "import" ? "import" : null,
55
+ };
24
56
  if (entry.node != null)
25
57
  return { type: "node", node: String(entry.node) };
26
58
  if (entry.template != null)
27
59
  return { type: "template", template: String(entry.template) };
28
60
  return { type: "query", query: entry };
29
61
  };
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) => {
62
+ // Normalize one entry. `entities` (a Set of declared slugs) lets a bare string that
63
+ // names an entity become an entity reference; without it every string is a glob.
64
+ // `aliases` turns a `@`-prefixed glob or a `location` filter into the repo path it
65
+ // names — ONE reading of the alias map, shared with the import resolver and the
66
+ // node tree.
67
+ const parseWhereEntry = (entry, entities = null, aliases = null) => {
33
68
  if (typeof entry === "string")
34
- return roles?.has(entry) && !entry.includes("/") && !entry.includes("*") ? { type: "role", role: entry, same: false } : { type: "glob", glob: entry };
69
+ return entities?.has(entry) && !entry.includes("/") && !entry.includes("*")
70
+ ? { type: "entity", entity: entry, same: false }
71
+ : { type: "glob", glob: (0, aliases_1.expandPattern)(aliases, entry) };
35
72
  if (!(0, queries_1.isObj)(entry))
36
73
  return { type: "query", query: entry };
37
- return readObjEntry(entry);
74
+ const rewritten = (0, aliases_1.expandLocationFilters)(entry, aliases);
75
+ return readObjEntry((0, queries_1.isObj)(rewritten) ? rewritten : entry);
38
76
  };
39
77
  exports.parseWhereEntry = parseWhereEntry;
40
- const parseWhere = (value, roles = null) => (0, field_1.toList)(value).map((e) => parseWhereEntry(e, roles));
78
+ const parseWhere = (value, entities = null, aliases = null) => (0, field_1.toList)(value).map((e) => parseWhereEntry(e, entities, aliases));
41
79
  exports.parseWhere = parseWhere;
42
80
  const patternOf = (entry) => {
43
81
  if (entry.type === "glob")
@@ -67,15 +105,15 @@ const sameCaps = (source, target) => {
67
105
  }
68
106
  return true;
69
107
  };
70
- // `{ role }` — the file declares that role, and (for `same`) in the SAME node.
71
- const matchesRole = (...args) => {
108
+ // `{ entity }` — the file declares that entity, and (for `same`) in the SAME node.
109
+ const matchesEntity = (...args) => {
72
110
  const [entry, rel, arch, facts, targetCaps] = args;
73
- if (!(facts?.roles ?? []).includes(entry.role ?? ""))
111
+ if (!(facts?.entities ?? []).includes(entry.entity ?? ""))
74
112
  return false;
75
113
  if (!entry.same)
76
114
  return true;
77
115
  const nodeM = (0, match_1.deepestMatch)(rel, arch);
78
- return sameCaps(nodeM ? (0, match_1.matchNode)(nodeM.node, rel)?.caps ?? {} : {}, targetCaps);
116
+ return sameCaps(nodeM ? ((0, match_1.matchNode)(nodeM.node, rel)?.caps ?? {}) : {}, targetCaps);
79
117
  };
80
118
  // `{ node }` — the path is inside that declared node.
81
119
  const matchesNodeEntry = (entry, rel, arch) => {
@@ -92,8 +130,8 @@ const matchesWhere = (...args) => {
92
130
  const pattern = patternOf(entry);
93
131
  if (pattern != null)
94
132
  return capsAgree(pattern, rel, targetCaps);
95
- if (entry.type === "role")
96
- return matchesRole(entry, rel, arch, facts, targetCaps);
133
+ if (entry.type === "entity")
134
+ return matchesEntity(entry, rel, arch, facts, targetCaps);
97
135
  if (entry.type === "node")
98
136
  return matchesNodeEntry(entry, rel, arch);
99
137
  // The scope IS the facts (plus the file and the tree), so a `$ref` can compare
@@ -111,13 +149,20 @@ const checkWhere = (...args) => {
111
149
  };
112
150
  exports.checkWhere = checkWhere;
113
151
  // 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("."));
152
+ // A typed door is spelled by its parameter: `(value: DefaultTheme)`.
153
+ const typeLabel = (type) => `(value: ${type.slice(type.lastIndexOf(".") + 1)})`;
154
+ const accessorLabel = (e) => {
155
+ const segments = e?.segments ?? [];
156
+ if (!segments.length && e?.type)
157
+ return typeLabel(e.type);
158
+ return e?.scope === "function" || e?.scope === "method" ? `${segments.join(".")}(…)` : segments.join(".");
159
+ };
115
160
  exports.accessorLabel = accessorLabel;
116
161
  const kindOf = (entry) => {
117
162
  if (entry.type)
118
163
  return entry.type;
119
- if (entry.role)
120
- return "role";
164
+ if (entry.entity)
165
+ return "entity";
121
166
  if (entry.node)
122
167
  return "node";
123
168
  if (entry.glob)
@@ -127,15 +172,15 @@ const kindOf = (entry) => {
127
172
  return null;
128
173
  };
129
174
  const orText = (value, fallback) => value ?? fallback;
130
- const roleLabel = (entry) => `role ${orText(entry.role, "")}${entry.same ? " (same instance)" : ""}`;
175
+ const entityLabel = (entry) => `entity ${orText(entry.entity, "")}${entry.same ? " (same instance)" : ""}`;
131
176
  // How one `where` entry reads inside a sentence — the ONE place that knows the
132
177
  // entry vocabulary.
133
178
  const labelOf = (entry) => {
134
179
  if (!entry)
135
180
  return "—";
136
181
  const kind = kindOf(entry);
137
- if (kind === "role")
138
- return roleLabel(entry);
182
+ if (kind === "entity")
183
+ return entityLabel(entry);
139
184
  if (kind === "node")
140
185
  return `node ${orText(entry.node, "")}`;
141
186
  if (kind === "glob")
@@ -183,7 +228,9 @@ const fillTemplate = (template, rel = null, caps = null) => {
183
228
  if (template == null)
184
229
  return null;
185
230
  const segs = String(template).split("/");
186
- const relSegs = String(rel ?? "").split("/").filter(Boolean);
231
+ const relSegs = String(rel ?? "")
232
+ .split("/")
233
+ .filter(Boolean);
187
234
  const out = [];
188
235
  for (let i = 0; i < segs.length; i += 1) {
189
236
  const seg = segs[i];
@@ -210,7 +257,9 @@ const entryKey = (entry, rel, arch, facts) => {
210
257
  return fileDir;
211
258
  // A template that names a FAMILY (`…/actions/*.ts`) designates the folder the
212
259
  // family lives in.
213
- const star = String(template).split("/").findIndex((s) => s.includes("*"));
260
+ const star = String(template)
261
+ .split("/")
262
+ .findIndex((s) => s.includes("*"));
214
263
  if (star === -1)
215
264
  return filled;
216
265
  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>;