laymos 0.0.1 → 0.0.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 (583) hide show
  1. package/README.md +137 -710
  2. package/bin/laymos.mjs +2 -0
  3. package/dist/architecture/analyze-project/analyze-project.d.ts +9 -0
  4. package/dist/architecture/analyze-project/analyze-project.d.ts.map +1 -0
  5. package/dist/architecture/analyze-project/analyze-project.js +47 -0
  6. package/dist/architecture/analyze-project/index.d.ts +3 -0
  7. package/dist/architecture/analyze-project/index.d.ts.map +1 -0
  8. package/dist/architecture/analyze-project/index.js +1 -0
  9. package/dist/architecture/build-report/build-report.d.ts +7 -0
  10. package/dist/architecture/build-report/build-report.d.ts.map +1 -0
  11. package/dist/{engine/4-emit/emit.js → architecture/build-report/build-report.js} +12 -9
  12. package/dist/architecture/build-report/index.d.ts +2 -0
  13. package/dist/architecture/build-report/index.d.ts.map +1 -0
  14. package/dist/architecture/build-report/index.js +1 -0
  15. package/dist/architecture/errors.d.ts +11 -0
  16. package/dist/architecture/errors.d.ts.map +1 -0
  17. package/dist/{engine → architecture}/errors.js +0 -2
  18. package/dist/{engine/1-extract/extract.d.ts → architecture/extract-dependencies/extract-dependencies.d.ts} +1 -1
  19. package/dist/architecture/extract-dependencies/extract-dependencies.d.ts.map +1 -0
  20. package/dist/{engine/1-extract/extract.js → architecture/extract-dependencies/extract-dependencies.js} +13 -11
  21. package/dist/architecture/extract-dependencies/index.d.ts +3 -0
  22. package/dist/architecture/extract-dependencies/index.d.ts.map +1 -0
  23. package/dist/architecture/extract-dependencies/index.js +1 -0
  24. package/dist/architecture/resolve-architecture/index.d.ts +3 -0
  25. package/dist/architecture/resolve-architecture/index.d.ts.map +1 -0
  26. package/dist/architecture/resolve-architecture/index.js +1 -0
  27. package/dist/{engine/2-resolve/resolve.d.ts → architecture/resolve-architecture/resolve-architecture.d.ts} +2 -2
  28. package/dist/architecture/resolve-architecture/resolve-architecture.d.ts.map +1 -0
  29. package/dist/{engine/2-resolve/resolve.js → architecture/resolve-architecture/resolve-architecture.js} +1 -1
  30. package/dist/architecture/validate-rules/index.d.ts +3 -0
  31. package/dist/architecture/validate-rules/index.d.ts.map +1 -0
  32. package/dist/architecture/validate-rules/index.js +1 -0
  33. package/dist/{engine/3-evaluate/evaluate.d.ts → architecture/validate-rules/validate-rules.d.ts} +4 -4
  34. package/dist/architecture/validate-rules/validate-rules.d.ts.map +1 -0
  35. package/dist/{engine/3-evaluate/evaluate.js → architecture/validate-rules/validate-rules.js} +2 -2
  36. package/dist/architecture-analysis-schema/architecture-analysis-schema.d.ts +109 -0
  37. package/dist/architecture-analysis-schema/architecture-analysis-schema.d.ts.map +1 -0
  38. package/dist/architecture-analysis-schema/architecture-analysis-schema.js +10 -0
  39. package/dist/architecture-analysis-schema/index.d.ts +7 -0
  40. package/dist/architecture-analysis-schema/index.d.ts.map +1 -0
  41. package/dist/architecture-analysis-schema/index.js +3 -0
  42. package/dist/architecture-analysis-schema/layer-analysis-schema.d.ts +27 -0
  43. package/dist/architecture-analysis-schema/layer-analysis-schema.d.ts.map +1 -0
  44. package/dist/architecture-analysis-schema/layer-analysis-schema.js +18 -0
  45. package/dist/architecture-analysis-schema/module-analysis-schema.d.ts +150 -0
  46. package/dist/architecture-analysis-schema/module-analysis-schema.d.ts.map +1 -0
  47. package/dist/architecture-analysis-schema/module-analysis-schema.js +96 -0
  48. package/dist/architecture-analysis-schema/module-source-schema.d.ts +16 -0
  49. package/dist/architecture-analysis-schema/module-source-schema.d.ts.map +1 -0
  50. package/dist/architecture-analysis-schema/module-source-schema.js +10 -0
  51. package/dist/architecture-analysis-schema/project-config-schema.d.ts +51 -0
  52. package/dist/architecture-analysis-schema/project-config-schema.d.ts.map +1 -0
  53. package/dist/architecture-analysis-schema/project-config-schema.js +110 -0
  54. package/dist/change-set-schema/change-set-schema.d.ts +55 -0
  55. package/dist/change-set-schema/change-set-schema.d.ts.map +1 -0
  56. package/dist/change-set-schema/change-set-schema.js +43 -0
  57. package/dist/change-set-schema/index.d.ts +3 -0
  58. package/dist/change-set-schema/index.d.ts.map +1 -0
  59. package/dist/change-set-schema/index.js +2 -0
  60. package/dist/cli/cli.js +6 -1
  61. package/dist/cli/deps/dependency-tree.d.ts +3 -0
  62. package/dist/cli/deps/dependency-tree.d.ts.map +1 -0
  63. package/dist/cli/deps/dependency-tree.js +39 -0
  64. package/dist/cli/deps/deps.d.ts +7 -0
  65. package/dist/cli/deps/deps.d.ts.map +1 -0
  66. package/dist/cli/deps/deps.js +26 -0
  67. package/dist/cli/deps/index.d.ts +2 -0
  68. package/dist/cli/deps/index.d.ts.map +1 -0
  69. package/dist/cli/deps/index.js +2 -0
  70. package/dist/cli/errors.d.ts +2 -0
  71. package/dist/cli/errors.d.ts.map +1 -0
  72. package/dist/cli/errors.js +34 -0
  73. package/dist/cli/inspect/file/file.d.ts +8 -0
  74. package/dist/cli/inspect/file/file.d.ts.map +1 -0
  75. package/dist/cli/inspect/file/file.js +16 -0
  76. package/dist/cli/inspect/file/index.d.ts +2 -0
  77. package/dist/cli/inspect/file/index.d.ts.map +1 -0
  78. package/dist/cli/inspect/file/index.js +1 -0
  79. package/dist/cli/inspect/file/report.d.ts +3 -0
  80. package/dist/cli/inspect/file/report.d.ts.map +1 -0
  81. package/dist/cli/inspect/file/report.js +26 -0
  82. package/dist/cli/inspect/index.d.ts +2 -0
  83. package/dist/cli/inspect/index.d.ts.map +1 -0
  84. package/dist/cli/inspect/index.js +1 -0
  85. package/dist/cli/inspect/inspect.d.ts +4 -0
  86. package/dist/cli/inspect/inspect.d.ts.map +1 -0
  87. package/dist/cli/inspect/inspect.js +14 -0
  88. package/dist/cli/inspect/json.d.ts +4 -0
  89. package/dist/cli/inspect/json.d.ts.map +1 -0
  90. package/dist/cli/inspect/json.js +5 -0
  91. package/dist/cli/inspect/layer/index.d.ts +2 -0
  92. package/dist/cli/inspect/layer/index.d.ts.map +1 -0
  93. package/dist/cli/inspect/layer/index.js +1 -0
  94. package/dist/cli/inspect/layer/layer.d.ts +7 -0
  95. package/dist/cli/inspect/layer/layer.d.ts.map +1 -0
  96. package/dist/cli/inspect/layer/layer.js +13 -0
  97. package/dist/cli/inspect/layer/report.d.ts +3 -0
  98. package/dist/cli/inspect/layer/report.d.ts.map +1 -0
  99. package/dist/cli/inspect/layer/report.js +21 -0
  100. package/dist/cli/inspect/module/index.d.ts +2 -0
  101. package/dist/cli/inspect/module/index.d.ts.map +1 -0
  102. package/dist/cli/inspect/module/index.js +1 -0
  103. package/dist/cli/inspect/module/module.d.ts +7 -0
  104. package/dist/cli/inspect/module/module.d.ts.map +1 -0
  105. package/dist/cli/inspect/module/module.js +15 -0
  106. package/dist/cli/inspect/module/report.d.ts +3 -0
  107. package/dist/cli/inspect/module/report.d.ts.map +1 -0
  108. package/dist/cli/inspect/module/report.js +38 -0
  109. package/dist/cli/inspect/path-tree.d.ts +7 -0
  110. package/dist/cli/inspect/path-tree.d.ts.map +1 -0
  111. package/dist/cli/inspect/path-tree.js +62 -0
  112. package/dist/cli/inspect/path.d.ts +5 -0
  113. package/dist/cli/inspect/path.d.ts.map +1 -0
  114. package/dist/cli/inspect/path.js +10 -0
  115. package/dist/cli/inspect/project/index.d.ts +2 -0
  116. package/dist/cli/inspect/project/index.d.ts.map +1 -0
  117. package/dist/cli/inspect/project/index.js +1 -0
  118. package/dist/cli/inspect/project/project.d.ts +8 -0
  119. package/dist/cli/inspect/project/project.d.ts.map +1 -0
  120. package/dist/cli/inspect/project/project.js +19 -0
  121. package/dist/cli/inspect/project/report.d.ts +3 -0
  122. package/dist/cli/inspect/project/report.d.ts.map +1 -0
  123. package/dist/cli/inspect/project/report.js +16 -0
  124. package/dist/cli/lint/index.d.ts +2 -0
  125. package/dist/cli/lint/index.d.ts.map +1 -0
  126. package/dist/cli/lint/index.js +2 -0
  127. package/dist/cli/lint/layers/index.d.ts +3 -0
  128. package/dist/cli/lint/layers/index.d.ts.map +1 -0
  129. package/dist/cli/lint/layers/index.js +4 -0
  130. package/dist/cli/lint/layers/layers.d.ts +5 -0
  131. package/dist/cli/lint/layers/layers.d.ts.map +1 -0
  132. package/dist/cli/lint/layers/layers.js +18 -0
  133. package/dist/cli/lint/layers/report.d.ts +5 -0
  134. package/dist/cli/lint/layers/report.d.ts.map +1 -0
  135. package/dist/cli/lint/layers/report.js +60 -0
  136. package/dist/cli/lint/lint.d.ts +4 -0
  137. package/dist/cli/lint/lint.d.ts.map +1 -0
  138. package/dist/cli/lint/lint.js +26 -0
  139. package/dist/cli/lint/modules/index.d.ts +5 -0
  140. package/dist/cli/lint/modules/index.d.ts.map +1 -0
  141. package/dist/cli/lint/modules/index.js +4 -0
  142. package/dist/cli/lint/modules/modules.d.ts +5 -0
  143. package/dist/cli/lint/modules/modules.d.ts.map +1 -0
  144. package/dist/cli/lint/modules/modules.js +15 -0
  145. package/dist/cli/lint/modules/report.d.ts +5 -0
  146. package/dist/cli/lint/modules/report.d.ts.map +1 -0
  147. package/dist/cli/lint/modules/report.js +69 -0
  148. package/dist/cli/run.d.ts +1 -8
  149. package/dist/cli/run.d.ts.map +1 -1
  150. package/dist/cli/run.js +14 -242
  151. package/dist/cli/stories/index.d.ts +2 -0
  152. package/dist/cli/stories/index.d.ts.map +1 -0
  153. package/dist/cli/stories/index.js +1 -0
  154. package/dist/cli/stories/progress.d.ts +7 -0
  155. package/dist/cli/stories/progress.d.ts.map +1 -0
  156. package/dist/cli/stories/progress.js +45 -0
  157. package/dist/cli/stories/report.d.ts +9 -0
  158. package/dist/cli/stories/report.d.ts.map +1 -0
  159. package/dist/cli/stories/report.js +63 -0
  160. package/dist/cli/stories/stories.d.ts +6 -0
  161. package/dist/cli/stories/stories.d.ts.map +1 -0
  162. package/dist/cli/stories/stories.js +30 -0
  163. package/dist/config/define-config.d.ts +5 -0
  164. package/dist/config/define-config.d.ts.map +1 -1
  165. package/dist/config/define-config.js +152 -7
  166. package/dist/config/index.d.ts +6 -0
  167. package/dist/config/index.d.ts.map +1 -1
  168. package/dist/config/index.js +2 -0
  169. package/dist/config/layer-graph.d.ts +2 -2
  170. package/dist/config/layer-graph.d.ts.map +1 -1
  171. package/dist/config/layer-graph.js +2 -29
  172. package/dist/config/layer.d.ts +2 -2
  173. package/dist/config/layer.d.ts.map +1 -1
  174. package/dist/config/layer.js +2 -15
  175. package/dist/config/load-config/index.d.ts +2 -0
  176. package/dist/config/load-config/index.d.ts.map +1 -0
  177. package/dist/config/load-config/index.js +1 -0
  178. package/dist/config/load-config/load-config.d.ts +34 -0
  179. package/dist/config/load-config/load-config.d.ts.map +1 -0
  180. package/dist/config/load-config/load-config.js +127 -0
  181. package/dist/config/module.d.ts +4 -2
  182. package/dist/config/module.d.ts.map +1 -1
  183. package/dist/config/module.js +5 -12
  184. package/dist/config/project-narrative.d.ts +15 -0
  185. package/dist/config/project-narrative.d.ts.map +1 -0
  186. package/dist/config/project-narrative.js +11 -0
  187. package/dist/config/types.d.ts +5 -3
  188. package/dist/config/types.d.ts.map +1 -1
  189. package/dist/domain/architecture-analysis/architecture-analysis.d.ts +4 -0
  190. package/dist/domain/architecture-analysis/architecture-analysis.d.ts.map +1 -0
  191. package/dist/domain/architecture-analysis/architecture-analysis.js +13 -0
  192. package/dist/domain/architecture-analysis/index.d.ts +3 -0
  193. package/dist/domain/architecture-analysis/index.d.ts.map +1 -0
  194. package/dist/domain/architecture-analysis/index.js +2 -0
  195. package/dist/domain/architecture-analysis/layer-rules.d.ts +3 -0
  196. package/dist/domain/architecture-analysis/layer-rules.d.ts.map +1 -0
  197. package/dist/domain/architecture-analysis/layer-rules.js +15 -0
  198. package/dist/domain/architecture-analysis/layers/allowed-dependencies.d.ts +3 -0
  199. package/dist/domain/architecture-analysis/layers/allowed-dependencies.d.ts.map +1 -0
  200. package/dist/domain/architecture-analysis/layers/allowed-dependencies.js +20 -0
  201. package/dist/domain/architecture-analysis/layers/coverage-violations.d.ts +2 -0
  202. package/dist/domain/architecture-analysis/layers/coverage-violations.d.ts.map +1 -0
  203. package/dist/domain/architecture-analysis/layers/coverage-violations.js +5 -0
  204. package/dist/domain/architecture-analysis/layers/dependency-violations.d.ts +5 -0
  205. package/dist/domain/architecture-analysis/layers/dependency-violations.d.ts.map +1 -0
  206. package/dist/domain/architecture-analysis/layers/dependency-violations.js +18 -0
  207. package/dist/domain/architecture-analysis/layers/index.d.ts +9 -0
  208. package/dist/domain/architecture-analysis/layers/index.d.ts.map +1 -0
  209. package/dist/domain/architecture-analysis/layers/index.js +4 -0
  210. package/dist/domain/architecture-analysis/layers/layer-membership.d.ts +3 -0
  211. package/dist/domain/architecture-analysis/layers/layer-membership.d.ts.map +1 -0
  212. package/dist/domain/architecture-analysis/layers/layer-membership.js +13 -0
  213. package/dist/domain/architecture-analysis/layers/layers.d.ts +11 -0
  214. package/dist/domain/architecture-analysis/layers/layers.d.ts.map +1 -0
  215. package/dist/domain/architecture-analysis/layers/layers.js +22 -0
  216. package/dist/domain/architecture-analysis/layers/module-coverage-violations.d.ts +4 -0
  217. package/dist/domain/architecture-analysis/layers/module-coverage-violations.d.ts.map +1 -0
  218. package/dist/domain/architecture-analysis/layers/module-coverage-violations.js +9 -0
  219. package/dist/domain/architecture-analysis/modules/dependency-graph.d.ts +2 -0
  220. package/dist/domain/architecture-analysis/modules/dependency-graph.d.ts.map +1 -0
  221. package/dist/domain/architecture-analysis/modules/dependency-graph.js +45 -0
  222. package/dist/domain/architecture-analysis/modules/dependency-permissions.d.ts +4 -0
  223. package/dist/domain/architecture-analysis/modules/dependency-permissions.d.ts.map +1 -0
  224. package/dist/domain/architecture-analysis/modules/dependency-permissions.js +35 -0
  225. package/dist/domain/architecture-analysis/modules/index.d.ts +12 -0
  226. package/dist/domain/architecture-analysis/modules/index.d.ts.map +1 -0
  227. package/dist/domain/architecture-analysis/modules/index.js +3 -0
  228. package/dist/domain/architecture-analysis/modules/module-descriptors.d.ts +5 -0
  229. package/dist/domain/architecture-analysis/modules/module-descriptors.d.ts.map +1 -0
  230. package/dist/domain/architecture-analysis/modules/module-descriptors.js +37 -0
  231. package/dist/domain/architecture-analysis/modules/module-membership.d.ts +3 -0
  232. package/dist/domain/architecture-analysis/modules/module-membership.d.ts.map +1 -0
  233. package/dist/domain/architecture-analysis/modules/module-membership.js +12 -0
  234. package/dist/domain/architecture-analysis/modules/modules.d.ts +16 -0
  235. package/dist/domain/architecture-analysis/modules/modules.d.ts.map +1 -0
  236. package/dist/domain/architecture-analysis/modules/modules.js +35 -0
  237. package/dist/domain/architecture-analysis/modules/public-entry-points.d.ts +3 -0
  238. package/dist/domain/architecture-analysis/modules/public-entry-points.d.ts.map +1 -0
  239. package/dist/domain/architecture-analysis/modules/public-entry-points.js +11 -0
  240. package/dist/domain/architecture-analysis/modules/unexposed-modules.d.ts +3 -0
  241. package/dist/domain/architecture-analysis/modules/unexposed-modules.d.ts.map +1 -0
  242. package/dist/domain/architecture-analysis/modules/unexposed-modules.js +10 -0
  243. package/dist/domain/architecture-analysis/modules/violations/boundaries.d.ts +8 -0
  244. package/dist/domain/architecture-analysis/modules/violations/boundaries.d.ts.map +1 -0
  245. package/dist/domain/architecture-analysis/modules/violations/boundaries.js +47 -0
  246. package/dist/domain/architecture-analysis/modules/violations/coverage.d.ts +3 -0
  247. package/dist/domain/architecture-analysis/modules/violations/coverage.d.ts.map +1 -0
  248. package/dist/domain/architecture-analysis/modules/violations/coverage.js +7 -0
  249. package/dist/domain/architecture-analysis/modules/violations/cycles.d.ts +3 -0
  250. package/dist/domain/architecture-analysis/modules/violations/cycles.d.ts.map +1 -0
  251. package/dist/domain/architecture-analysis/modules/violations/cycles.js +7 -0
  252. package/dist/domain/architecture-analysis/modules/violations/dead-modules.d.ts +3 -0
  253. package/dist/domain/architecture-analysis/modules/violations/dead-modules.d.ts.map +1 -0
  254. package/dist/domain/architecture-analysis/modules/violations/dead-modules.js +23 -0
  255. package/dist/domain/architecture-analysis/modules/violations/dependencies.d.ts +4 -0
  256. package/dist/domain/architecture-analysis/modules/violations/dependencies.d.ts.map +1 -0
  257. package/dist/domain/architecture-analysis/modules/violations/dependencies.js +7 -0
  258. package/dist/domain/architecture-analysis/modules/violations/entry-points.d.ts +3 -0
  259. package/dist/domain/architecture-analysis/modules/violations/entry-points.d.ts.map +1 -0
  260. package/dist/domain/architecture-analysis/modules/violations/entry-points.js +17 -0
  261. package/dist/domain/architecture-analysis/modules/violations/graph-coverage.d.ts +3 -0
  262. package/dist/domain/architecture-analysis/modules/violations/graph-coverage.d.ts.map +1 -0
  263. package/dist/domain/architecture-analysis/modules/violations/graph-coverage.js +16 -0
  264. package/dist/domain/architecture-analysis/modules/violations/index.d.ts +3 -0
  265. package/dist/domain/architecture-analysis/modules/violations/index.d.ts.map +1 -0
  266. package/dist/domain/architecture-analysis/modules/violations/index.js +2 -0
  267. package/dist/domain/architecture-analysis/modules/violations/unused-shared.d.ts +3 -0
  268. package/dist/domain/architecture-analysis/modules/violations/unused-shared.d.ts.map +1 -0
  269. package/dist/domain/architecture-analysis/modules/violations/unused-shared.js +9 -0
  270. package/dist/domain/architecture-analysis/modules/violations/violations.d.ts +9 -0
  271. package/dist/domain/architecture-analysis/modules/violations/violations.d.ts.map +1 -0
  272. package/dist/domain/architecture-analysis/modules/violations/violations.js +22 -0
  273. package/dist/domain/file-graph/file-graph.d.ts +10 -0
  274. package/dist/domain/file-graph/file-graph.d.ts.map +1 -0
  275. package/dist/domain/file-graph/file-graph.js +37 -0
  276. package/dist/domain/file-graph/index.d.ts +4 -0
  277. package/dist/domain/file-graph/index.d.ts.map +1 -0
  278. package/dist/domain/file-graph/index.js +1 -0
  279. package/dist/domain/project-config/index.d.ts +10 -0
  280. package/dist/domain/project-config/index.d.ts.map +1 -0
  281. package/dist/domain/project-config/index.js +12 -0
  282. package/dist/domain/project-config/project-config.d.ts +52 -0
  283. package/dist/domain/project-config/project-config.d.ts.map +1 -0
  284. package/dist/domain/project-config/project-config.js +39 -0
  285. package/dist/domain/project-config/resolve.d.ts +8 -0
  286. package/dist/domain/project-config/resolve.d.ts.map +1 -0
  287. package/dist/domain/project-config/resolve.js +29 -0
  288. package/dist/domain/project-config/validation/containment.d.ts +4 -0
  289. package/dist/domain/project-config/validation/containment.d.ts.map +1 -0
  290. package/dist/domain/project-config/validation/containment.js +21 -0
  291. package/dist/domain/project-config/validation/index.d.ts +3 -0
  292. package/dist/domain/project-config/validation/index.d.ts.map +1 -0
  293. package/dist/domain/project-config/validation/index.js +2 -0
  294. package/dist/domain/project-config/validation/layers/cycles.d.ts +3 -0
  295. package/dist/domain/project-config/validation/layers/cycles.d.ts.map +1 -0
  296. package/dist/domain/project-config/validation/layers/cycles.js +64 -0
  297. package/dist/domain/project-config/validation/layers/index.d.ts +3 -0
  298. package/dist/domain/project-config/validation/layers/index.d.ts.map +1 -0
  299. package/dist/domain/project-config/validation/layers/index.js +2 -0
  300. package/dist/domain/project-config/validation/layers/layers.d.ts +3 -0
  301. package/dist/domain/project-config/validation/layers/layers.d.ts.map +1 -0
  302. package/dist/domain/project-config/validation/layers/layers.js +9 -0
  303. package/dist/domain/project-config/validation/layers/overlaps.d.ts +3 -0
  304. package/dist/domain/project-config/validation/layers/overlaps.d.ts.map +1 -0
  305. package/dist/domain/project-config/validation/layers/overlaps.js +26 -0
  306. package/dist/domain/project-config/validation/layers/references.d.ts +3 -0
  307. package/dist/domain/project-config/validation/layers/references.d.ts.map +1 -0
  308. package/dist/domain/project-config/validation/layers/references.js +21 -0
  309. package/dist/domain/project-config/validation/modules/containment.d.ts +3 -0
  310. package/dist/domain/project-config/validation/modules/containment.d.ts.map +1 -0
  311. package/dist/domain/project-config/validation/modules/containment.js +24 -0
  312. package/dist/domain/project-config/validation/modules/graphs.d.ts +4 -0
  313. package/dist/domain/project-config/validation/modules/graphs.d.ts.map +1 -0
  314. package/dist/domain/project-config/validation/modules/graphs.js +96 -0
  315. package/dist/domain/project-config/validation/modules/index.d.ts +3 -0
  316. package/dist/domain/project-config/validation/modules/index.d.ts.map +1 -0
  317. package/dist/domain/project-config/validation/modules/index.js +2 -0
  318. package/dist/domain/project-config/validation/modules/kinds.d.ts +3 -0
  319. package/dist/domain/project-config/validation/modules/kinds.d.ts.map +1 -0
  320. package/dist/domain/project-config/validation/modules/kinds.js +18 -0
  321. package/dist/domain/project-config/validation/modules/modules.d.ts +3 -0
  322. package/dist/domain/project-config/validation/modules/modules.d.ts.map +1 -0
  323. package/dist/domain/project-config/validation/modules/modules.js +16 -0
  324. package/dist/domain/project-config/validation/modules/nested.d.ts +3 -0
  325. package/dist/domain/project-config/validation/modules/nested.d.ts.map +1 -0
  326. package/dist/domain/project-config/validation/modules/nested.js +34 -0
  327. package/dist/domain/project-config/validation/modules/overlaps.d.ts +4 -0
  328. package/dist/domain/project-config/validation/modules/overlaps.d.ts.map +1 -0
  329. package/dist/domain/project-config/validation/modules/overlaps.js +43 -0
  330. package/dist/domain/project-config/validation/modules/paths.d.ts +3 -0
  331. package/dist/domain/project-config/validation/modules/paths.d.ts.map +1 -0
  332. package/dist/domain/project-config/validation/modules/paths.js +27 -0
  333. package/dist/domain/project-config/validation/modules/scopes.d.ts +4 -0
  334. package/dist/domain/project-config/validation/modules/scopes.d.ts.map +1 -0
  335. package/dist/domain/project-config/validation/modules/scopes.js +28 -0
  336. package/dist/domain/project-config/validation/modules/subpaths.d.ts +3 -0
  337. package/dist/domain/project-config/validation/modules/subpaths.d.ts.map +1 -0
  338. package/dist/domain/project-config/validation/modules/subpaths.js +40 -0
  339. package/dist/domain/project-config/validation/paths.d.ts +3 -0
  340. package/dist/domain/project-config/validation/paths.d.ts.map +1 -0
  341. package/dist/domain/project-config/validation/paths.js +39 -0
  342. package/dist/domain/project-config/validation/validation.d.ts +3 -0
  343. package/dist/domain/project-config/validation/validation.d.ts.map +1 -0
  344. package/dist/domain/project-config/validation/validation.js +12 -0
  345. package/dist/entrypoints/cli/cli.d.ts +3 -0
  346. package/dist/entrypoints/cli/cli.d.ts.map +1 -0
  347. package/dist/entrypoints/cli/cli.js +6 -0
  348. package/dist/entrypoints/cli/run.d.ts +13 -0
  349. package/dist/entrypoints/cli/run.d.ts.map +1 -0
  350. package/dist/entrypoints/cli/run.js +155 -0
  351. package/dist/entrypoints/cli/test-output.d.ts +17 -0
  352. package/dist/entrypoints/cli/test-output.d.ts.map +1 -0
  353. package/dist/entrypoints/cli/test-output.js +244 -0
  354. package/dist/entrypoints/node/index.d.ts +24 -0
  355. package/dist/entrypoints/node/index.d.ts.map +1 -0
  356. package/dist/entrypoints/node/index.js +27 -0
  357. package/dist/entrypoints/report/index.d.ts +2 -0
  358. package/dist/entrypoints/report/index.d.ts.map +1 -0
  359. package/dist/entrypoints/report/index.js +1 -0
  360. package/dist/index.d.ts +17 -1
  361. package/dist/index.d.ts.map +1 -1
  362. package/dist/index.js +22 -1
  363. package/dist/markdown/index.d.ts +3 -0
  364. package/dist/markdown/index.d.ts.map +1 -0
  365. package/dist/markdown/index.js +1 -0
  366. package/dist/markdown/markdown.d.ts +7 -0
  367. package/dist/markdown/markdown.d.ts.map +1 -0
  368. package/dist/markdown/markdown.js +13 -0
  369. package/dist/orchestrator/analyze-project/analyze-project.d.ts +119 -0
  370. package/dist/orchestrator/analyze-project/analyze-project.d.ts.map +1 -0
  371. package/dist/orchestrator/analyze-project/analyze-project.js +9 -0
  372. package/dist/orchestrator/analyze-project/index.d.ts +2 -0
  373. package/dist/orchestrator/analyze-project/index.d.ts.map +1 -0
  374. package/dist/orchestrator/analyze-project/index.js +2 -0
  375. package/dist/orchestrator/inspect/index.d.ts +4 -0
  376. package/dist/orchestrator/inspect/index.d.ts.map +1 -0
  377. package/dist/orchestrator/inspect/index.js +1 -0
  378. package/dist/orchestrator/inspect/inspect.d.ts +269 -0
  379. package/dist/orchestrator/inspect/inspect.d.ts.map +1 -0
  380. package/dist/orchestrator/inspect/inspect.js +147 -0
  381. package/dist/orchestrator/load-changes/index.d.ts +2 -0
  382. package/dist/orchestrator/load-changes/index.d.ts.map +1 -0
  383. package/dist/orchestrator/load-changes/index.js +2 -0
  384. package/dist/orchestrator/load-changes/load-changes.d.ts +6 -0
  385. package/dist/orchestrator/load-changes/load-changes.d.ts.map +1 -0
  386. package/dist/orchestrator/load-changes/load-changes.js +18 -0
  387. package/dist/orchestrator/load-module-source/errors.d.ts +17 -0
  388. package/dist/orchestrator/load-module-source/errors.d.ts.map +1 -0
  389. package/dist/orchestrator/load-module-source/errors.js +5 -0
  390. package/dist/orchestrator/load-module-source/index.d.ts +2 -0
  391. package/dist/orchestrator/load-module-source/index.d.ts.map +1 -0
  392. package/dist/orchestrator/load-module-source/index.js +1 -0
  393. package/dist/orchestrator/load-module-source/load-module-source.d.ts +12 -0
  394. package/dist/orchestrator/load-module-source/load-module-source.d.ts.map +1 -0
  395. package/dist/orchestrator/load-module-source/load-module-source.js +39 -0
  396. package/dist/orchestrator/load-project/index.d.ts +3 -0
  397. package/dist/orchestrator/load-project/index.d.ts.map +1 -0
  398. package/dist/orchestrator/load-project/index.js +2 -0
  399. package/dist/orchestrator/load-project/load-project.d.ts +54 -0
  400. package/dist/orchestrator/load-project/load-project.d.ts.map +1 -0
  401. package/dist/orchestrator/load-project/load-project.js +30 -0
  402. package/dist/orchestrator/query-dependencies/index.d.ts +3 -0
  403. package/dist/orchestrator/query-dependencies/index.d.ts.map +1 -0
  404. package/dist/orchestrator/query-dependencies/index.js +4 -0
  405. package/dist/orchestrator/query-dependencies/query-dependencies.d.ts +12 -0
  406. package/dist/orchestrator/query-dependencies/query-dependencies.d.ts.map +1 -0
  407. package/dist/orchestrator/query-dependencies/query-dependencies.js +20 -0
  408. package/dist/orchestrator/run-stories/errors.d.ts +11 -0
  409. package/dist/orchestrator/run-stories/errors.d.ts.map +1 -0
  410. package/dist/orchestrator/run-stories/errors.js +3 -0
  411. package/dist/orchestrator/run-stories/extract-snippets.d.ts +12 -0
  412. package/dist/orchestrator/run-stories/extract-snippets.d.ts.map +1 -0
  413. package/dist/orchestrator/run-stories/extract-snippets.js +181 -0
  414. package/dist/orchestrator/run-stories/index.d.ts +3 -0
  415. package/dist/orchestrator/run-stories/index.d.ts.map +1 -0
  416. package/dist/orchestrator/run-stories/index.js +3 -0
  417. package/dist/orchestrator/run-stories/run-stories.d.ts +16 -0
  418. package/dist/orchestrator/run-stories/run-stories.d.ts.map +1 -0
  419. package/dist/orchestrator/run-stories/run-stories.js +290 -0
  420. package/dist/report/architecture.d.ts +1 -1
  421. package/dist/report/architecture.d.ts.map +1 -1
  422. package/dist/report/index.d.ts +2 -1
  423. package/dist/report/index.d.ts.map +1 -1
  424. package/dist/report/index.js +1 -1
  425. package/dist/report/tests.d.ts +411 -0
  426. package/dist/report/tests.d.ts.map +1 -0
  427. package/dist/report/tests.js +102 -0
  428. package/dist/services/config/config.d.ts +12 -0
  429. package/dist/services/config/config.d.ts.map +1 -0
  430. package/dist/services/config/config.js +46 -0
  431. package/dist/services/config/errors.d.ts +13 -0
  432. package/dist/services/config/errors.d.ts.map +1 -0
  433. package/dist/services/config/errors.js +3 -0
  434. package/dist/services/config/index.d.ts +4 -0
  435. package/dist/services/config/index.d.ts.map +1 -0
  436. package/dist/services/config/index.js +7 -0
  437. package/dist/services/file-cruiser/errors.d.ts +10 -0
  438. package/dist/services/file-cruiser/errors.d.ts.map +1 -0
  439. package/dist/services/file-cruiser/errors.js +3 -0
  440. package/dist/services/file-cruiser/file-cruiser.d.ts +11 -0
  441. package/dist/services/file-cruiser/file-cruiser.d.ts.map +1 -0
  442. package/dist/services/file-cruiser/file-cruiser.js +7 -0
  443. package/dist/services/file-cruiser/index.d.ts +4 -0
  444. package/dist/services/file-cruiser/index.d.ts.map +1 -0
  445. package/dist/services/file-cruiser/index.js +6 -0
  446. package/dist/services/file-cruiser/oxc/file-scanner.d.ts +5 -0
  447. package/dist/services/file-cruiser/oxc/file-scanner.d.ts.map +1 -0
  448. package/dist/services/file-cruiser/oxc/file-scanner.js +54 -0
  449. package/dist/services/file-cruiser/oxc/import-resolver.d.ts +5 -0
  450. package/dist/services/file-cruiser/oxc/import-resolver.d.ts.map +1 -0
  451. package/dist/services/file-cruiser/oxc/import-resolver.js +44 -0
  452. package/dist/services/file-cruiser/oxc/index.d.ts +2 -0
  453. package/dist/services/file-cruiser/oxc/index.d.ts.map +1 -0
  454. package/dist/services/file-cruiser/oxc/index.js +2 -0
  455. package/dist/services/file-cruiser/oxc/oxc.d.ts +5 -0
  456. package/dist/services/file-cruiser/oxc/oxc.d.ts.map +1 -0
  457. package/dist/services/file-cruiser/oxc/oxc.js +29 -0
  458. package/dist/services/git/changed-paths.d.ts +4 -0
  459. package/dist/services/git/changed-paths.d.ts.map +1 -0
  460. package/dist/services/git/changed-paths.js +85 -0
  461. package/dist/services/git/errors.d.ts +11 -0
  462. package/dist/services/git/errors.d.ts.map +1 -0
  463. package/dist/services/git/errors.js +3 -0
  464. package/dist/services/git/git.d.ts +12 -0
  465. package/dist/services/git/git.d.ts.map +1 -0
  466. package/dist/services/git/git.js +23 -0
  467. package/dist/services/git/index.d.ts +4 -0
  468. package/dist/services/git/index.d.ts.map +1 -0
  469. package/dist/services/git/index.js +6 -0
  470. package/dist/services/git/parse-patch.d.ts +3 -0
  471. package/dist/services/git/parse-patch.d.ts.map +1 -0
  472. package/dist/services/git/parse-patch.js +53 -0
  473. package/dist/services/git/run-git.d.ts +9 -0
  474. package/dist/services/git/run-git.d.ts.map +1 -0
  475. package/dist/services/git/run-git.js +22 -0
  476. package/dist/story/index.d.ts +3 -0
  477. package/dist/story/index.d.ts.map +1 -0
  478. package/dist/story/index.js +2 -0
  479. package/dist/story/schema/index.d.ts +6 -0
  480. package/dist/story/schema/index.d.ts.map +1 -0
  481. package/dist/story/schema/index.js +4 -0
  482. package/dist/story/schema/slug.d.ts +2 -0
  483. package/dist/story/schema/slug.d.ts.map +1 -0
  484. package/dist/story/schema/slug.js +6 -0
  485. package/dist/story/schema/story-report-schema.d.ts +408 -0
  486. package/dist/story/schema/story-report-schema.d.ts.map +1 -0
  487. package/dist/story/schema/story-report-schema.js +94 -0
  488. package/dist/story/schema/story-tree-schema.d.ts +42 -0
  489. package/dist/story/schema/story-tree-schema.d.ts.map +1 -0
  490. package/dist/story/schema/story-tree-schema.js +40 -0
  491. package/dist/story/story.d.ts +38 -0
  492. package/dist/story/story.d.ts.map +1 -0
  493. package/dist/story/story.js +56 -0
  494. package/dist/tests/authoring/index.d.ts +72 -0
  495. package/dist/tests/authoring/index.d.ts.map +1 -0
  496. package/dist/tests/authoring/index.js +312 -0
  497. package/dist/tests/run-tests/index.d.ts +3 -0
  498. package/dist/tests/run-tests/index.d.ts.map +1 -0
  499. package/dist/tests/run-tests/index.js +1 -0
  500. package/dist/tests/run-tests/run-tests.d.ts +26 -0
  501. package/dist/tests/run-tests/run-tests.d.ts.map +1 -0
  502. package/dist/tests/run-tests/run-tests.js +284 -0
  503. package/package.json +36 -24
  504. package/schema.json +212 -0
  505. package/dist/cli/index.d.ts +0 -2
  506. package/dist/cli/index.d.ts.map +0 -1
  507. package/dist/cli/index.js +0 -1
  508. package/dist/engine/1-extract/extract.d.ts.map +0 -1
  509. package/dist/engine/1-extract/index.d.ts +0 -3
  510. package/dist/engine/1-extract/index.d.ts.map +0 -1
  511. package/dist/engine/1-extract/index.js +0 -1
  512. package/dist/engine/2-resolve/index.d.ts +0 -3
  513. package/dist/engine/2-resolve/index.d.ts.map +0 -1
  514. package/dist/engine/2-resolve/index.js +0 -1
  515. package/dist/engine/2-resolve/resolve.d.ts.map +0 -1
  516. package/dist/engine/3-evaluate/evaluate.d.ts.map +0 -1
  517. package/dist/engine/3-evaluate/index.d.ts +0 -3
  518. package/dist/engine/3-evaluate/index.d.ts.map +0 -1
  519. package/dist/engine/3-evaluate/index.js +0 -1
  520. package/dist/engine/4-emit/emit.d.ts +0 -7
  521. package/dist/engine/4-emit/emit.d.ts.map +0 -1
  522. package/dist/engine/4-emit/index.d.ts +0 -2
  523. package/dist/engine/4-emit/index.d.ts.map +0 -1
  524. package/dist/engine/4-emit/index.js +0 -1
  525. package/dist/engine/errors.d.ts +0 -19
  526. package/dist/engine/errors.d.ts.map +0 -1
  527. package/dist/node.d.ts +0 -24
  528. package/dist/node.d.ts.map +0 -1
  529. package/dist/node.js +0 -139
  530. package/dist/report/stories.d.ts +0 -22
  531. package/dist/report/stories.d.ts.map +0 -1
  532. package/dist/report/stories.js +0 -1
  533. package/dist/story/artifact/artifact.d.ts +0 -57
  534. package/dist/story/artifact/artifact.d.ts.map +0 -1
  535. package/dist/story/artifact/artifact.js +0 -234
  536. package/dist/story/artifact/index.d.ts +0 -2
  537. package/dist/story/artifact/index.d.ts.map +0 -1
  538. package/dist/story/artifact/index.js +0 -1
  539. package/dist/story/artifact/storage.d.ts +0 -10
  540. package/dist/story/artifact/storage.d.ts.map +0 -1
  541. package/dist/story/artifact/storage.js +0 -162
  542. package/dist/story/artifact/types.d.ts +0 -74
  543. package/dist/story/artifact/types.d.ts.map +0 -1
  544. package/dist/story/artifact/types.js +0 -1
  545. package/dist/story/core/blocks.d.ts +0 -20
  546. package/dist/story/core/blocks.d.ts.map +0 -1
  547. package/dist/story/core/blocks.js +0 -104
  548. package/dist/story/core/declare.d.ts +0 -63
  549. package/dist/story/core/declare.d.ts.map +0 -1
  550. package/dist/story/core/declare.js +0 -62
  551. package/dist/story/core/index.d.ts +0 -4
  552. package/dist/story/core/index.d.ts.map +0 -1
  553. package/dist/story/core/index.js +0 -1
  554. package/dist/story/core/recorder.d.ts +0 -38
  555. package/dist/story/core/recorder.d.ts.map +0 -1
  556. package/dist/story/core/recorder.js +0 -28
  557. package/dist/story/core/runtime-context.d.ts +0 -14
  558. package/dist/story/core/runtime-context.d.ts.map +0 -1
  559. package/dist/story/core/runtime-context.js +0 -19
  560. package/dist/story/core/types.d.ts +0 -21
  561. package/dist/story/core/types.d.ts.map +0 -1
  562. package/dist/story/core/types.js +0 -1
  563. package/dist/story/effect/effect.d.ts +0 -52
  564. package/dist/story/effect/effect.d.ts.map +0 -1
  565. package/dist/story/effect/effect.js +0 -99
  566. package/dist/story/effect/index.d.ts +0 -3
  567. package/dist/story/effect/index.d.ts.map +0 -1
  568. package/dist/story/effect/index.js +0 -1
  569. package/dist/story/runner/index.d.ts +0 -3
  570. package/dist/story/runner/index.d.ts.map +0 -1
  571. package/dist/story/runner/index.js +0 -1
  572. package/dist/story/runner/runner.d.ts +0 -44
  573. package/dist/story/runner/runner.d.ts.map +0 -1
  574. package/dist/story/runner/runner.js +0 -476
  575. package/dist/story/story-runtime/index.d.ts +0 -2
  576. package/dist/story/story-runtime/index.d.ts.map +0 -1
  577. package/dist/story/story-runtime/index.js +0 -1
  578. package/dist/story/story-runtime/story-runtime.d.ts +0 -52
  579. package/dist/story/story-runtime/story-runtime.d.ts.map +0 -1
  580. package/dist/story/story-runtime/story-runtime.js +0 -194
  581. package/dist/story/vanilla/index.d.ts +0 -29
  582. package/dist/story/vanilla/index.d.ts.map +0 -1
  583. package/dist/story/vanilla/index.js +0 -78
@@ -0,0 +1,5 @@
1
+ import type { LayerAnalysis } from '../../../architecture-analysis-schema/index.js';
2
+ type LayerReportInput = Pick<LayerAnalysis, 'forbiddenImports' | 'layersWithoutModules' | 'unassignedFiles'>;
3
+ export declare function renderLayerReport(result: LayerReportInput): string;
4
+ export {};
5
+ //# sourceMappingURL=report.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../../../src/cli/lint/layers/report.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAEpF,KAAK,gBAAgB,GAAG,IAAI,CAC1B,aAAa,EACb,kBAAkB,GAAG,sBAAsB,GAAG,iBAAiB,CAChE,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAgBlE"}
@@ -0,0 +1,60 @@
1
+ import * as colors from 'yoctocolors';
2
+ export function renderLayerReport(result) {
3
+ const count = result.unassignedFiles.length +
4
+ result.forbiddenImports.length +
5
+ result.layersWithoutModules.length;
6
+ if (count === 0)
7
+ return colors.green('✓ No layer violations');
8
+ const sections = [
9
+ colors.red('Layer violations'),
10
+ ...renderForbiddenImports(result),
11
+ ...renderUnassignedFiles(result.unassignedFiles),
12
+ ...renderLayersWithoutModules(result.layersWithoutModules),
13
+ '',
14
+ `${count} ${count === 1 ? 'violation' : 'violations'}`,
15
+ ];
16
+ return sections.join('\n');
17
+ }
18
+ function renderLayersWithoutModules(layers) {
19
+ if (layers.length === 0)
20
+ return [];
21
+ return [
22
+ '',
23
+ 'layers without modules',
24
+ ...[...layers]
25
+ .sort((left, right) => left.localeCompare(right))
26
+ .map((layer) => ` ${colors.yellow('✕')} ${layer}`),
27
+ ];
28
+ }
29
+ function renderForbiddenImports(result) {
30
+ const groups = new Map();
31
+ for (const violation of result.forbiddenImports) {
32
+ const key = `${violation.fromLayer}\0${violation.toLayer}`;
33
+ groups.set(key, [...(groups.get(key) ?? []), violation]);
34
+ }
35
+ return [...groups.entries()]
36
+ .sort(([left], [right]) => left.localeCompare(right))
37
+ .flatMap(([key, violations]) => {
38
+ const [fromLayer, toLayer] = key.split('\0');
39
+ return [
40
+ '',
41
+ `${fromLayer} → ${toLayer}`,
42
+ ...[...violations]
43
+ .sort((left, right) => left.fromFile === right.fromFile
44
+ ? left.toFile.localeCompare(right.toFile)
45
+ : left.fromFile.localeCompare(right.fromFile))
46
+ .map(({ fromFile, toFile }) => ` ${colors.red('✕')} ${fromFile} → ${toFile}`),
47
+ ];
48
+ });
49
+ }
50
+ function renderUnassignedFiles(files) {
51
+ if (files.length === 0)
52
+ return [];
53
+ return [
54
+ '',
55
+ 'unassigned files',
56
+ ...[...files]
57
+ .sort((left, right) => left.localeCompare(right))
58
+ .map((file) => ` ${colors.yellow('✕')} ${file}`),
59
+ ];
60
+ }
@@ -0,0 +1,4 @@
1
+ import { Effect } from 'effect';
2
+ import { Command } from 'effect/unstable/cli';
3
+ export declare function makeLintCommand<R>(configPath: Effect.Effect<string, never, R>): Command.Command<"lint", {} | {}, {}, import("../../index.js").ConfigError | import("../../index.js").CruiseError, Exclude<R, "effect/unstable/cli/GlobalFlag/log-level"> | Exclude<Exclude<R, "effect/unstable/cli/GlobalFlag/log-level">, Command.CommandContext<"lint">>>;
4
+ //# sourceMappingURL=lint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../../src/cli/lint/lint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,MAAM,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAQ9C,wBAAgB,eAAe,CAAC,CAAC,EAC/B,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,+QAW5C"}
@@ -0,0 +1,26 @@
1
+ import { Console, Effect } from 'effect';
2
+ import { Command } from 'effect/unstable/cli';
3
+ import { analyzeProject } from '../../orchestrator/analyze-project/index.js';
4
+ import { makeLayersCommand } from './layers/index.js';
5
+ import { renderLayerReport } from './layers/report.js';
6
+ import { makeModulesCommand } from './modules/index.js';
7
+ import { renderModuleReport } from './modules/report.js';
8
+ export function makeLintCommand(configPath) {
9
+ return Command.make('lint', {}, () => configPath.pipe(Effect.flatMap(runLint))).pipe(Command.withDescription('Check every configured architectural rule.'), Command.withSubcommands([
10
+ makeLayersCommand(configPath),
11
+ makeModulesCommand(configPath),
12
+ ]));
13
+ }
14
+ function runLint(configPath) {
15
+ return Effect.gen(function* () {
16
+ const result = yield* analyzeProject(configPath);
17
+ yield* Console.log(renderLayerReport(result.layerAnalysis));
18
+ yield* Console.log(renderModuleReport(result.moduleAnalysis));
19
+ if (result.layerAnalysis.unassignedFiles.length > 0 ||
20
+ result.layerAnalysis.forbiddenImports.length > 0 ||
21
+ result.layerAnalysis.layersWithoutModules.length > 0 ||
22
+ result.moduleAnalysis.violations.length > 0) {
23
+ process.exitCode = 1;
24
+ }
25
+ });
26
+ }
@@ -0,0 +1,5 @@
1
+ /** The lint parent uses this to register the focused Module command. */
2
+ export { makeModulesCommand } from './modules.js';
3
+ /** Full CLI orchestration uses this to run focused Module lint. */
4
+ export { runModulesLint } from './modules.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cli/lint/modules/index.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,mEAAmE;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,4 @@
1
+ /** The lint parent uses this to register the focused Module command. */
2
+ export { makeModulesCommand } from './modules.js';
3
+ /** Full CLI orchestration uses this to run focused Module lint. */
4
+ export { runModulesLint } from './modules.js';
@@ -0,0 +1,5 @@
1
+ import { Effect } from 'effect';
2
+ import { Command } from 'effect/unstable/cli';
3
+ export declare function makeModulesCommand<R>(configPath: Effect.Effect<string, never, R>): Command.Command<"modules", {}, {}, import("../../../index.js").ConfigError | import("../../../index.js").CruiseError, Exclude<R, "effect/unstable/cli/GlobalFlag/log-level">>;
4
+ export declare function runModulesLint(configPath: string): Effect.Effect<void, import("../../../index.js").ConfigError | import("../../../index.js").CruiseError, never>;
5
+ //# sourceMappingURL=modules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../../../../src/cli/lint/modules/modules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,MAAM,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAK9C,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,iLAS5C;AAED,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,iHAMhD"}
@@ -0,0 +1,15 @@
1
+ import { Console, Effect } from 'effect';
2
+ import { Command } from 'effect/unstable/cli';
3
+ import { analyzeProject } from '../../../orchestrator/analyze-project/index.js';
4
+ import { renderModuleReport } from './report.js';
5
+ export function makeModulesCommand(configPath) {
6
+ return Command.make('modules', {}, () => configPath.pipe(Effect.flatMap(runModulesLint))).pipe(Command.withDescription('Check Module coverage, public boundaries, dependencies, and cycles.'));
7
+ }
8
+ export function runModulesLint(configPath) {
9
+ return Effect.gen(function* () {
10
+ const { moduleAnalysis } = yield* analyzeProject(configPath);
11
+ yield* Console.log(renderModuleReport(moduleAnalysis));
12
+ if (moduleAnalysis.violations.length > 0)
13
+ process.exitCode = 1;
14
+ });
15
+ }
@@ -0,0 +1,5 @@
1
+ import type { ModuleAnalysis } from '../../../domain/architecture-analysis/modules/index.js';
2
+ type ModuleReportInput = Pick<ModuleAnalysis, 'modules' | 'graphs' | 'violations'>;
3
+ export declare function renderModuleReport(result: ModuleReportInput): string;
4
+ export {};
5
+ //# sourceMappingURL=report.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../../../src/cli/lint/modules/report.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,cAAc,EAEf,MAAM,wDAAwD,CAAC;AAahE,KAAK,iBAAiB,GAAG,IAAI,CAC3B,cAAc,EACd,SAAS,GAAG,QAAQ,GAAG,YAAY,CACpC,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAkBpE"}
@@ -0,0 +1,69 @@
1
+ import * as colors from 'yoctocolors';
2
+ const headings = {
3
+ coverage: 'unassigned files',
4
+ 'graph-coverage': 'files below a Module Graph with no member',
5
+ 'missing-entry-point': 'missing Module entry points',
6
+ dependency: 'forbidden Module dependencies',
7
+ boundary: 'internal Module imports',
8
+ cycle: 'Module cycles',
9
+ 'unused-shared': 'unused Shared Modules',
10
+ 'dead-module': 'Modules nothing may import',
11
+ };
12
+ export function renderModuleReport(result) {
13
+ const summary = renderSummary(result.modules, result.graphs);
14
+ if (result.violations.length === 0) {
15
+ return [summary, colors.green('✓ No Module violations')].join('\n');
16
+ }
17
+ const sections = [summary, '', colors.red('Module violations')];
18
+ for (const kind of Object.keys(headings)) {
19
+ const violations = result.violations.filter((violation) => violation.kind === kind);
20
+ if (violations.length === 0)
21
+ continue;
22
+ sections.push('', headings[kind], ...violations.map(renderViolation));
23
+ }
24
+ sections.push('', `${result.violations.length} ${result.violations.length === 1 ? 'violation' : 'violations'}`);
25
+ return sections.join('\n');
26
+ }
27
+ function renderSummary(modules, graphs) {
28
+ const sharedByLayer = new Map();
29
+ let shared = 0;
30
+ let exposed = 0;
31
+ let members = 0;
32
+ for (const module of modules) {
33
+ if (module.exposed)
34
+ exposed += 1;
35
+ if (module.graph !== undefined)
36
+ members += 1;
37
+ if (!module.shared)
38
+ continue;
39
+ shared += 1;
40
+ sharedByLayer.set(module.layer, (sharedByLayer.get(module.layer) ?? 0) + 1);
41
+ }
42
+ const layers = [...sharedByLayer]
43
+ .sort(([left], [right]) => left.localeCompare(right))
44
+ .map(([layer, count]) => `${layer} ${count}`)
45
+ .join(', ');
46
+ return [
47
+ `Modules: ${modules.length} (${shared} Shared, ${exposed} exposed, ${members} in a Module Graph)`,
48
+ `Module Graphs: ${graphs.length}`,
49
+ `Shared by Layer: ${layers || 'none'}`,
50
+ ].join('\n');
51
+ }
52
+ function renderViolation(violation) {
53
+ switch (violation.kind) {
54
+ case 'coverage':
55
+ return ` ${colors.yellow('✕')} ${violation.file}`;
56
+ case 'graph-coverage':
57
+ return ` ${colors.yellow('✕')} ${violation.graph}: ${violation.file}`;
58
+ case 'missing-entry-point':
59
+ return ` ${colors.red('✕')} Missing Module entry point: ${violation.path}`;
60
+ case 'dependency':
61
+ case 'boundary':
62
+ return ` ${colors.red('✕')} ${violation.fromModule} → ${violation.toModule}: ${violation.fromFile} → ${violation.toFile}`;
63
+ case 'cycle':
64
+ return ` ${colors.red('✕')} ${violation.modules.join(' → ')} → ${violation.modules[0]}`;
65
+ case 'unused-shared':
66
+ case 'dead-module':
67
+ return ` ${colors.red('✕')} ${violation.module}`;
68
+ }
69
+ }
package/dist/cli/run.d.ts CHANGED
@@ -1,11 +1,4 @@
1
1
  import { Effect } from 'effect';
2
2
  import { Command } from 'effect/unstable/cli';
3
- import type { LaymosReport } from '../report/index.js';
4
- declare class CliExit {
5
- readonly _tag = "CliExit";
6
- }
7
- export declare function lintPasses(report: Pick<LaymosReport, 'violations'>): boolean;
8
- export declare const command: Command.Command<"laymos", {} | {}, {}, CliExit, never>;
9
- export declare const cli: Effect.Effect<void, CliExit | import("effect/unstable/cli/CliError").CliError, Command.Environment>;
10
- export {};
3
+ export declare const cli: Effect.Effect<void, import("../index.js").ConfigError | import("../index.js").CruiseError | import("../index.js").InspectionTargetNotFound | import("../index.js").ModuleInspectionCycle | import("../index.js").StoriesError | import("effect/unstable/cli/CliError").CliError, Command.Environment>;
11
4
  //# sourceMappingURL=run.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/cli/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,MAAM,EAAU,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAY,OAAO,EAAQ,MAAM,qBAAqB,CAAC;AAI9D,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,oBAAoB,CAAC;AAQlE,cAAM,OAAO;IACX,QAAQ,CAAC,IAAI,aAAa;CAC3B;AAaD,wBAAgB,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,YAAY,EAAE,YAAY,CAAC,GAAG,OAAO,CAE5E;AAqVD,eAAO,MAAM,OAAO,wDAEnB,CAAC;AAEF,eAAO,MAAM,GAAG,qGAAkD,CAAC"}
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/cli/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,OAAO,EAAQ,MAAM,qBAAqB,CAAC;AAmBpD,eAAO,MAAM,GAAG,uSAOf,CAAC"}
package/dist/cli/run.js CHANGED
@@ -1,242 +1,14 @@
1
- import { Duration, Effect, Option } from 'effect';
2
- import { Argument, Command, Flag } from 'effect/unstable/cli';
3
- import { analyzeProject, runStories, runStoryGroup } from '../node.js';
4
- class CliExit {
5
- _tag = 'CliExit';
6
- }
7
- const paint = (stream, code) => (text) => stream.isTTY && process.env['NO_COLOR'] === undefined
8
- ? `\x1b[${code}m${text}\x1b[0m`
9
- : text;
10
- const green = paint(process.stdout, '32');
11
- const yellow = paint(process.stdout, '33');
12
- const red = paint(process.stderr, '31');
13
- export function lintPasses(report) {
14
- return report.violations.length === 0;
15
- }
16
- function lint() {
17
- return analyzeProject(process.cwd()).pipe(Effect.flatMap((report) => Effect.suspend(() => {
18
- reportCoverage(report);
19
- reportWarnings(report);
20
- if (lintPasses(report)) {
21
- process.stdout.write(green('No violations found.\n'));
22
- return Effect.void;
23
- }
24
- reportViolations(report.violations);
25
- return Effect.fail(new CliExit());
26
- })), Effect.catch((error) => error instanceof CliExit
27
- ? Effect.fail(error)
28
- : Effect.sync(() => {
29
- process.stderr.write(red(`Error: ${errorMessage(error)}\n`));
30
- }).pipe(Effect.andThen(Effect.fail(new CliExit())))));
31
- }
32
- function stories(files, timeout, group) {
33
- return Effect.suspend(() => {
34
- let options;
35
- let selectedGroupPath;
36
- try {
37
- options = storyRunOptions(timeout);
38
- selectedGroupPath = Option.isSome(group)
39
- ? groupPath(group.value)
40
- : undefined;
41
- }
42
- catch (error) {
43
- process.stderr.write(red(`Error: ${errorMessage(error)}\n`));
44
- return Effect.fail(new CliExit());
45
- }
46
- if (Option.isSome(group) && files.length > 0) {
47
- process.stderr.write(red('Error: --group cannot be combined with Story file arguments\n'));
48
- return Effect.fail(new CliExit());
49
- }
50
- const run = selectedGroupPath
51
- ? runStoryGroup(process.cwd(), selectedGroupPath, options)
52
- : runStories(process.cwd(), files, options);
53
- return run.pipe(Effect.flatMap((result) => Effect.suspend(() => {
54
- reportStoriesRun(result);
55
- if (result.status === 'passed')
56
- return Effect.void;
57
- return Effect.fail(new CliExit());
58
- })), Effect.catch((error) => error instanceof CliExit
59
- ? Effect.fail(error)
60
- : Effect.sync(() => {
61
- process.stderr.write(red(`Error: ${errorMessage(error)}\n`));
62
- }).pipe(Effect.andThen(Effect.fail(new CliExit())))));
63
- });
64
- }
65
- function groupPath(input) {
66
- const path = input.split('/').map((segment) => segment.trim());
67
- if (path.length === 0 || path.some((segment) => segment.length === 0)) {
68
- throw new Error(`Invalid --group "${input}"; use a path such as "DynamoDB / Entities"`);
69
- }
70
- return path;
71
- }
72
- function storyRunOptions(timeout) {
73
- if (Option.isNone(timeout))
74
- return {};
75
- const input = timeout.value;
76
- let millis;
77
- try {
78
- millis = Duration.toMillis(input);
79
- }
80
- catch {
81
- millis = Number.NaN;
82
- }
83
- if (!Number.isFinite(millis) || millis <= 0) {
84
- throw new Error(`Invalid --timeout "${timeout.value}"; use a duration such as "90 seconds"`);
85
- }
86
- return { timeout: input };
87
- }
88
- function reportStoriesRun(result) {
89
- const stories = Object.entries(result.report.stories);
90
- process.stdout.write(`${stories.length} ${stories.length === 1 ? 'Story' : 'Stories'} executed.\n`);
91
- for (const [storyId, artifact] of stories) {
92
- reportStory(storyId, artifact);
93
- }
94
- for (const failure of result.failures) {
95
- const scope = failure.scenario === undefined
96
- ? failure.storyId
97
- : `${failure.storyId} › ${failure.scenario}`;
98
- const phase = failure.phase === undefined ? '' : ` [${failure.phase}]`;
99
- process.stderr.write(red(` - ${scope}${phase}: ${failure.message}\n`));
100
- }
101
- if (result.status === 'passed') {
102
- process.stdout.write(green('All Scenarios passed.\n'));
103
- return;
104
- }
105
- process.stderr.write(red('Some Scenarios failed or were interrupted.\n'));
106
- }
107
- function reportStory(storyId, artifact) {
108
- const passed = artifact.scenarios.every(({ outcome }) => outcome === 'succeeded' || outcome === 'skipped');
109
- process.stdout.write(`\n${passed ? green('✓') : red('×')} ${artifact.name} ${paintMuted(`(${storyId})`)}\n`);
110
- for (const scenario of artifact.scenarios) {
111
- const icon = scenario.outcome === 'succeeded'
112
- ? green('✓')
113
- : scenario.outcome === 'skipped'
114
- ? paintMuted('○')
115
- : scenario.outcome === 'interrupted'
116
- ? yellow('!')
117
- : red('×');
118
- const timing = scenario.durationMillis === undefined
119
- ? ''
120
- : paintMuted(` ${scenario.durationMillis}ms`);
121
- process.stdout.write(` ${icon} ${scenario.name}${timing}\n`);
122
- reportUnsuccessfulPaths(artifact, scenario.execution);
123
- }
124
- reportDecisionGaps(artifact);
125
- }
126
- function reportUnsuccessfulPaths(artifact, execution, parents = []) {
127
- for (const item of execution) {
128
- if ('parallel' in item) {
129
- for (const branch of item.parallel) {
130
- reportUnsuccessfulPaths(artifact, branch, parents);
131
- }
132
- continue;
133
- }
134
- const name = artifact.blocks[item.blockId]?.name ?? item.blockId;
135
- const path = [...parents, name];
136
- if (item.outcome !== 'succeeded') {
137
- process.stdout.write(` ${yellow(item.outcome)}: ${path.join(' › ')}\n`);
138
- }
139
- reportUnsuccessfulPaths(artifact, item.children, path);
140
- }
141
- }
142
- function reportDecisionGaps(artifact) {
143
- for (const [blockId, block] of Object.entries(artifact.blocks)) {
144
- if (block.kind !== 'decision')
145
- continue;
146
- const observed = new Set();
147
- for (const scenario of artifact.scenarios) {
148
- collectSelectedArms(scenario.execution, blockId, observed);
149
- }
150
- const missing = block.arms.filter((arm) => !observed.has(selectedArmKey(arm)));
151
- if (missing.length === 0)
152
- continue;
153
- const location = `${block.location.file}:${block.location.line}:${block.location.column}`;
154
- process.stdout.write(` ${paintMuted('decision')} ${block.name}: ${block.arms.length - missing.length}/${block.arms.length} arms observed ${paintMuted(`(${location})`)}\n`);
155
- process.stdout.write(` unobserved: ${missing.map((arm) => arm.name).join(', ')}\n`);
156
- }
157
- }
158
- function collectSelectedArms(execution, blockId, observed) {
159
- for (const item of execution) {
160
- if ('parallel' in item) {
161
- for (const branch of item.parallel) {
162
- collectSelectedArms(branch, blockId, observed);
163
- }
164
- continue;
165
- }
166
- if (item.blockId === blockId && item.selectedArm !== undefined) {
167
- observed.add(selectedArmKey(item.selectedArm));
168
- }
169
- collectSelectedArms(item.children, blockId, observed);
170
- }
171
- }
172
- function selectedArmKey(arm) {
173
- return arm.kind === 'otherwise'
174
- ? 'otherwise'
175
- : `literal:${typeof arm.value}:${String(arm.value)}`;
176
- }
177
- const paintMuted = paint(process.stdout, '2');
178
- function reportCoverage(report) {
179
- const ignored = Object.values(report.files).filter((file) => file.kind === 'ignored').length;
180
- const layerCoverage = report.coverage.layers;
181
- const moduleTotal = report.coverage.modules.reduce((total, coverage) => total + coverage.totalFiles, 0);
182
- const moduleCovered = report.coverage.modules.reduce((total, coverage) => total + coverage.coveredFiles, 0);
183
- const ignoredSuffix = ignored > 0 ? ` (${ignored} ignored)` : '';
184
- process.stdout.write([
185
- `Scanned ${layerCoverage.totalFiles} source file(s)${ignoredSuffix}.`,
186
- `Layers: ${layerCoverage.coveredFiles}/${layerCoverage.totalFiles} file(s) covered.`,
187
- `Modules: ${moduleCovered}/${moduleTotal} layer-covered file(s) covered.`,
188
- ].join('\n') + '\n');
189
- if (layerCoverage.uncovered.length > 0) {
190
- writeWarningList('file(s) not covered by any layer', layerCoverage.uncovered);
191
- }
192
- for (const coverage of report.coverage.modules) {
193
- if (coverage.uncovered.length > 0) {
194
- writeWarningList(`file(s) in layer "${coverage.layer}" not covered by a module`, coverage.uncovered);
195
- }
196
- }
197
- }
198
- function reportWarnings(report) {
199
- for (const warning of report.warnings) {
200
- const detail = warning.kind === 'missing-source-root'
201
- ? `source root does not exist: ${warning.path}`
202
- : warning.kind === 'missing-layer-path'
203
- ? `layer "${warning.layer}" path does not exist: ${warning.path}`
204
- : `module path does not exist: ${warning.path}`;
205
- process.stdout.write(yellow(`warning: ${detail}\n`));
206
- }
207
- }
208
- function writeWarningList(title, files) {
209
- process.stdout.write(yellow(`warning: ${files.length} ${title}:\n`));
210
- for (const file of files)
211
- process.stdout.write(yellow(` - ${file}\n`));
212
- }
213
- function reportViolations(violations) {
214
- process.stderr.write(red(`Found ${violations.length} architecture violation(s):\n`));
215
- for (const violation of violations) {
216
- if (violation.kind === 'layer') {
217
- process.stderr.write(red(` - [layer] ${violation.from.layer} -> ${violation.to.layer}\n`));
218
- }
219
- else {
220
- process.stderr.write(red(` - [${violation.rule}] ${violation.from.module} -> ${violation.to.module}\n`));
221
- }
222
- process.stderr.write(red(` ${violation.from.file} -> ${violation.to.file}\n`));
223
- }
224
- process.stderr.write(red(`Lint failed: ${violations.length} violation(s).\n`));
225
- }
226
- function errorMessage(error) {
227
- if (typeof error === 'object' &&
228
- error !== null &&
229
- 'cause' in error &&
230
- error.cause !== undefined) {
231
- return errorMessage(error.cause);
232
- }
233
- return error instanceof Error ? error.message : String(error);
234
- }
235
- const lintCommand = Command.make('lint', {}, lint).pipe(Command.withDescription('Check the project against its declared architecture. Coverage gaps are warnings only.'));
236
- const storiesCommand = Command.make('stories', {
237
- stories: Argument.string('story').pipe(Argument.variadic()),
238
- timeout: Flag.string('timeout').pipe(Flag.optional, Flag.withDescription('Default Scenario timeout for this run, e.g. "90 seconds".')),
239
- group: Flag.string('group').pipe(Flag.optional, Flag.withDescription('Run one Story Group subtree, e.g. "DynamoDB / Entities".')),
240
- }, ({ stories: files, timeout, group }) => stories(files, timeout, group)).pipe(Command.withDescription('Run Story files or one --group subtree (all Stories by default) and print fresh execution evidence.'));
241
- export const command = Command.make('laymos', {}, () => Effect.void).pipe(Command.withSubcommands([lintCommand, storiesCommand]));
242
- export const cli = command.pipe(Command.run({ version: '0.0.0' }));
1
+ import { Effect } from 'effect';
2
+ import { Command, Flag } from 'effect/unstable/cli';
3
+ import { makeInspectCommand } from './inspect/index.js';
4
+ import { makeLintCommand } from './lint/index.js';
5
+ import { makeStoriesCommand } from './stories/index.js';
6
+ const rootCommand = Command.make('laymos', {}, () => Effect.void).pipe(Command.withSharedFlags({
7
+ config: Flag.string('config').pipe(Flag.withDefault('laymos.config.json'), Flag.withDescription('Config file path. Project paths are relative to its directory.')),
8
+ }));
9
+ const configPath = rootCommand.pipe(Effect.map(({ config }) => config));
10
+ export const cli = rootCommand.pipe(Command.withSubcommands([
11
+ makeInspectCommand(configPath),
12
+ makeLintCommand(configPath),
13
+ makeStoriesCommand(configPath),
14
+ ]), Command.run({ version: '0.0.1' }));
@@ -0,0 +1,2 @@
1
+ export { makeStoriesCommand } from './stories.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/stories/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1 @@
1
+ export { makeStoriesCommand } from './stories.js';
@@ -0,0 +1,7 @@
1
+ import type { StoryVerdict } from '../../story/schema/index.js';
2
+ export interface StoryProgress {
3
+ readonly record: (verdict: StoryVerdict) => void;
4
+ readonly stop: () => void;
5
+ }
6
+ export declare function startProgress(total: number): StoryProgress;
7
+ //# sourceMappingURL=progress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/cli/stories/progress.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAGhE,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAAC;IACjD,QAAQ,CAAC,IAAI,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,CAuB1D"}
@@ -0,0 +1,45 @@
1
+ import * as colors from 'yoctocolors';
2
+ import { countVerdict, emptyTally, renderTally } from './report.js';
3
+ export function startProgress(total) {
4
+ const line = liveLine();
5
+ if (line === null)
6
+ return silentProgress;
7
+ let tally = emptyTally;
8
+ let frame = 0;
9
+ const draw = () => line.write(`${colors.cyan(spinner[frame])} ${renderTally(tally, total)}`);
10
+ const ticker = setInterval(() => {
11
+ frame = (frame + 1) % spinner.length;
12
+ draw();
13
+ }, frameMillis);
14
+ ticker.unref();
15
+ draw();
16
+ return {
17
+ record: (verdict) => {
18
+ tally = countVerdict(tally, verdict);
19
+ draw();
20
+ },
21
+ stop: () => {
22
+ clearInterval(ticker);
23
+ line.clear();
24
+ },
25
+ };
26
+ }
27
+ const spinner = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
28
+ const frameMillis = 80;
29
+ const silentProgress = { record: () => { }, stop: () => { } };
30
+ function liveLine() {
31
+ const stream = process.stderr;
32
+ if (!stream.isTTY)
33
+ return null;
34
+ const clear = () => {
35
+ stream.clearLine(0);
36
+ stream.cursorTo(0);
37
+ };
38
+ return {
39
+ write: (text) => {
40
+ clear();
41
+ stream.write(text);
42
+ },
43
+ clear,
44
+ };
45
+ }
@@ -0,0 +1,9 @@
1
+ import type { StoryReport, StoryVerdict } from '../../story/schema/index.js';
2
+ export type VerdictTally = Readonly<Record<StoryVerdict, number>>;
3
+ export declare const emptyTally: VerdictTally;
4
+ export declare function countVerdict(tally: VerdictTally, verdict: StoryVerdict): VerdictTally;
5
+ export declare function tallyReports(reports: readonly StoryReport[]): VerdictTally;
6
+ export declare function renderTally(tally: VerdictTally, total: number): string;
7
+ export declare function renderSummary(reports: readonly StoryReport[], total: number): string;
8
+ export declare function renderStoryReports(reports: readonly StoryReport[]): string;
9
+ //# sourceMappingURL=report.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../../src/cli/stories/report.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,WAAW,EACX,YAAY,EACb,MAAM,6BAA6B,CAAC;AAErC,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;AAElE,eAAO,MAAM,UAAU,EAAE,YAAmD,CAAC;AAE7E,wBAAgB,YAAY,CAC1B,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,YAAY,GACpB,YAAY,CAEd;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,GAAG,YAAY,CAK1E;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAStE;AAED,wBAAgB,aAAa,CAC3B,OAAO,EAAE,SAAS,WAAW,EAAE,EAC/B,KAAK,EAAE,MAAM,GACZ,MAAM,CAKR;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,GAAG,MAAM,CAE1E"}