laymos 0.0.1 → 0.0.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 (491) hide show
  1. package/README.md +137 -710
  2. package/bin/laymos.mjs +2 -0
  3. package/dist/architecture-analysis-schema/architecture-analysis-schema.d.ts +109 -0
  4. package/dist/architecture-analysis-schema/architecture-analysis-schema.d.ts.map +1 -0
  5. package/dist/architecture-analysis-schema/architecture-analysis-schema.js +10 -0
  6. package/dist/architecture-analysis-schema/index.d.ts +7 -0
  7. package/dist/architecture-analysis-schema/index.d.ts.map +1 -0
  8. package/dist/architecture-analysis-schema/index.js +3 -0
  9. package/dist/architecture-analysis-schema/layer-analysis-schema.d.ts +27 -0
  10. package/dist/architecture-analysis-schema/layer-analysis-schema.d.ts.map +1 -0
  11. package/dist/architecture-analysis-schema/layer-analysis-schema.js +18 -0
  12. package/dist/architecture-analysis-schema/module-analysis-schema.d.ts +150 -0
  13. package/dist/architecture-analysis-schema/module-analysis-schema.d.ts.map +1 -0
  14. package/dist/architecture-analysis-schema/module-analysis-schema.js +96 -0
  15. package/dist/architecture-analysis-schema/module-source-schema.d.ts +16 -0
  16. package/dist/architecture-analysis-schema/module-source-schema.d.ts.map +1 -0
  17. package/dist/architecture-analysis-schema/module-source-schema.js +10 -0
  18. package/dist/architecture-analysis-schema/project-config-schema.d.ts +51 -0
  19. package/dist/architecture-analysis-schema/project-config-schema.d.ts.map +1 -0
  20. package/dist/architecture-analysis-schema/project-config-schema.js +110 -0
  21. package/dist/change-set-schema/change-set-schema.d.ts +55 -0
  22. package/dist/change-set-schema/change-set-schema.d.ts.map +1 -0
  23. package/dist/change-set-schema/change-set-schema.js +43 -0
  24. package/dist/change-set-schema/index.d.ts +3 -0
  25. package/dist/change-set-schema/index.d.ts.map +1 -0
  26. package/dist/change-set-schema/index.js +2 -0
  27. package/dist/cli/cli.js +6 -1
  28. package/dist/cli/errors.d.ts +2 -0
  29. package/dist/cli/errors.d.ts.map +1 -0
  30. package/dist/cli/errors.js +34 -0
  31. package/dist/cli/inspect/file/file.d.ts +8 -0
  32. package/dist/cli/inspect/file/file.d.ts.map +1 -0
  33. package/dist/cli/inspect/file/file.js +16 -0
  34. package/dist/cli/inspect/file/index.d.ts +2 -0
  35. package/dist/cli/inspect/file/index.d.ts.map +1 -0
  36. package/dist/cli/inspect/file/index.js +1 -0
  37. package/dist/cli/inspect/file/report.d.ts +3 -0
  38. package/dist/cli/inspect/file/report.d.ts.map +1 -0
  39. package/dist/cli/inspect/file/report.js +26 -0
  40. package/dist/cli/inspect/index.d.ts +2 -0
  41. package/dist/cli/inspect/index.d.ts.map +1 -0
  42. package/dist/cli/inspect/index.js +1 -0
  43. package/dist/cli/inspect/inspect.d.ts +4 -0
  44. package/dist/cli/inspect/inspect.d.ts.map +1 -0
  45. package/dist/cli/inspect/inspect.js +14 -0
  46. package/dist/cli/inspect/json.d.ts +4 -0
  47. package/dist/cli/inspect/json.d.ts.map +1 -0
  48. package/dist/cli/inspect/json.js +5 -0
  49. package/dist/cli/inspect/layer/index.d.ts +2 -0
  50. package/dist/cli/inspect/layer/index.d.ts.map +1 -0
  51. package/dist/cli/inspect/layer/index.js +1 -0
  52. package/dist/cli/inspect/layer/layer.d.ts +7 -0
  53. package/dist/cli/inspect/layer/layer.d.ts.map +1 -0
  54. package/dist/cli/inspect/layer/layer.js +13 -0
  55. package/dist/cli/inspect/layer/report.d.ts +3 -0
  56. package/dist/cli/inspect/layer/report.d.ts.map +1 -0
  57. package/dist/cli/inspect/layer/report.js +21 -0
  58. package/dist/cli/inspect/module/index.d.ts +2 -0
  59. package/dist/cli/inspect/module/index.d.ts.map +1 -0
  60. package/dist/cli/inspect/module/index.js +1 -0
  61. package/dist/cli/inspect/module/module.d.ts +7 -0
  62. package/dist/cli/inspect/module/module.d.ts.map +1 -0
  63. package/dist/cli/inspect/module/module.js +15 -0
  64. package/dist/cli/inspect/module/report.d.ts +3 -0
  65. package/dist/cli/inspect/module/report.d.ts.map +1 -0
  66. package/dist/cli/inspect/module/report.js +38 -0
  67. package/dist/cli/inspect/path-tree.d.ts +7 -0
  68. package/dist/cli/inspect/path-tree.d.ts.map +1 -0
  69. package/dist/cli/inspect/path-tree.js +62 -0
  70. package/dist/cli/inspect/path.d.ts +5 -0
  71. package/dist/cli/inspect/path.d.ts.map +1 -0
  72. package/dist/cli/inspect/path.js +10 -0
  73. package/dist/cli/inspect/project/index.d.ts +2 -0
  74. package/dist/cli/inspect/project/index.d.ts.map +1 -0
  75. package/dist/cli/inspect/project/index.js +1 -0
  76. package/dist/cli/inspect/project/project.d.ts +8 -0
  77. package/dist/cli/inspect/project/project.d.ts.map +1 -0
  78. package/dist/cli/inspect/project/project.js +19 -0
  79. package/dist/cli/inspect/project/report.d.ts +3 -0
  80. package/dist/cli/inspect/project/report.d.ts.map +1 -0
  81. package/dist/cli/inspect/project/report.js +16 -0
  82. package/dist/cli/lint/index.d.ts +2 -0
  83. package/dist/cli/lint/index.d.ts.map +1 -0
  84. package/dist/cli/lint/index.js +2 -0
  85. package/dist/cli/lint/layers/index.d.ts +3 -0
  86. package/dist/cli/lint/layers/index.d.ts.map +1 -0
  87. package/dist/cli/lint/layers/index.js +4 -0
  88. package/dist/cli/lint/layers/layers.d.ts +5 -0
  89. package/dist/cli/lint/layers/layers.d.ts.map +1 -0
  90. package/dist/cli/lint/layers/layers.js +18 -0
  91. package/dist/cli/lint/layers/report.d.ts +5 -0
  92. package/dist/cli/lint/layers/report.d.ts.map +1 -0
  93. package/dist/cli/lint/layers/report.js +60 -0
  94. package/dist/cli/lint/lint.d.ts +4 -0
  95. package/dist/cli/lint/lint.d.ts.map +1 -0
  96. package/dist/cli/lint/lint.js +26 -0
  97. package/dist/cli/lint/modules/index.d.ts +5 -0
  98. package/dist/cli/lint/modules/index.d.ts.map +1 -0
  99. package/dist/cli/lint/modules/index.js +4 -0
  100. package/dist/cli/lint/modules/modules.d.ts +5 -0
  101. package/dist/cli/lint/modules/modules.d.ts.map +1 -0
  102. package/dist/cli/lint/modules/modules.js +15 -0
  103. package/dist/cli/lint/modules/report.d.ts +5 -0
  104. package/dist/cli/lint/modules/report.d.ts.map +1 -0
  105. package/dist/cli/lint/modules/report.js +69 -0
  106. package/dist/cli/run.d.ts +1 -8
  107. package/dist/cli/run.d.ts.map +1 -1
  108. package/dist/cli/run.js +14 -242
  109. package/dist/cli/stories/index.d.ts +2 -0
  110. package/dist/cli/stories/index.d.ts.map +1 -0
  111. package/dist/cli/stories/index.js +1 -0
  112. package/dist/cli/stories/progress.d.ts +7 -0
  113. package/dist/cli/stories/progress.d.ts.map +1 -0
  114. package/dist/cli/stories/progress.js +45 -0
  115. package/dist/cli/stories/report.d.ts +9 -0
  116. package/dist/cli/stories/report.d.ts.map +1 -0
  117. package/dist/cli/stories/report.js +63 -0
  118. package/dist/cli/stories/stories.d.ts +6 -0
  119. package/dist/cli/stories/stories.d.ts.map +1 -0
  120. package/dist/cli/stories/stories.js +30 -0
  121. package/dist/domain/architecture-analysis/architecture-analysis.d.ts +4 -0
  122. package/dist/domain/architecture-analysis/architecture-analysis.d.ts.map +1 -0
  123. package/dist/domain/architecture-analysis/architecture-analysis.js +13 -0
  124. package/dist/domain/architecture-analysis/index.d.ts +3 -0
  125. package/dist/domain/architecture-analysis/index.d.ts.map +1 -0
  126. package/dist/domain/architecture-analysis/index.js +2 -0
  127. package/dist/domain/architecture-analysis/layer-rules.d.ts +3 -0
  128. package/dist/domain/architecture-analysis/layer-rules.d.ts.map +1 -0
  129. package/dist/domain/architecture-analysis/layer-rules.js +15 -0
  130. package/dist/domain/architecture-analysis/layers/allowed-dependencies.d.ts +3 -0
  131. package/dist/domain/architecture-analysis/layers/allowed-dependencies.d.ts.map +1 -0
  132. package/dist/domain/architecture-analysis/layers/allowed-dependencies.js +20 -0
  133. package/dist/domain/architecture-analysis/layers/coverage-violations.d.ts +2 -0
  134. package/dist/domain/architecture-analysis/layers/coverage-violations.d.ts.map +1 -0
  135. package/dist/domain/architecture-analysis/layers/coverage-violations.js +5 -0
  136. package/dist/domain/architecture-analysis/layers/dependency-violations.d.ts +5 -0
  137. package/dist/domain/architecture-analysis/layers/dependency-violations.d.ts.map +1 -0
  138. package/dist/domain/architecture-analysis/layers/dependency-violations.js +18 -0
  139. package/dist/domain/architecture-analysis/layers/index.d.ts +9 -0
  140. package/dist/domain/architecture-analysis/layers/index.d.ts.map +1 -0
  141. package/dist/domain/architecture-analysis/layers/index.js +4 -0
  142. package/dist/domain/architecture-analysis/layers/layer-membership.d.ts +3 -0
  143. package/dist/domain/architecture-analysis/layers/layer-membership.d.ts.map +1 -0
  144. package/dist/domain/architecture-analysis/layers/layer-membership.js +13 -0
  145. package/dist/domain/architecture-analysis/layers/layers.d.ts +11 -0
  146. package/dist/domain/architecture-analysis/layers/layers.d.ts.map +1 -0
  147. package/dist/domain/architecture-analysis/layers/layers.js +22 -0
  148. package/dist/domain/architecture-analysis/layers/module-coverage-violations.d.ts +4 -0
  149. package/dist/domain/architecture-analysis/layers/module-coverage-violations.d.ts.map +1 -0
  150. package/dist/domain/architecture-analysis/layers/module-coverage-violations.js +9 -0
  151. package/dist/domain/architecture-analysis/modules/dependency-graph.d.ts +2 -0
  152. package/dist/domain/architecture-analysis/modules/dependency-graph.d.ts.map +1 -0
  153. package/dist/domain/architecture-analysis/modules/dependency-graph.js +45 -0
  154. package/dist/domain/architecture-analysis/modules/dependency-permissions.d.ts +4 -0
  155. package/dist/domain/architecture-analysis/modules/dependency-permissions.d.ts.map +1 -0
  156. package/dist/domain/architecture-analysis/modules/dependency-permissions.js +35 -0
  157. package/dist/domain/architecture-analysis/modules/index.d.ts +12 -0
  158. package/dist/domain/architecture-analysis/modules/index.d.ts.map +1 -0
  159. package/dist/domain/architecture-analysis/modules/index.js +3 -0
  160. package/dist/domain/architecture-analysis/modules/module-descriptors.d.ts +5 -0
  161. package/dist/domain/architecture-analysis/modules/module-descriptors.d.ts.map +1 -0
  162. package/dist/domain/architecture-analysis/modules/module-descriptors.js +37 -0
  163. package/dist/domain/architecture-analysis/modules/module-membership.d.ts +3 -0
  164. package/dist/domain/architecture-analysis/modules/module-membership.d.ts.map +1 -0
  165. package/dist/domain/architecture-analysis/modules/module-membership.js +12 -0
  166. package/dist/domain/architecture-analysis/modules/modules.d.ts +16 -0
  167. package/dist/domain/architecture-analysis/modules/modules.d.ts.map +1 -0
  168. package/dist/domain/architecture-analysis/modules/modules.js +35 -0
  169. package/dist/domain/architecture-analysis/modules/public-entry-points.d.ts +3 -0
  170. package/dist/domain/architecture-analysis/modules/public-entry-points.d.ts.map +1 -0
  171. package/dist/domain/architecture-analysis/modules/public-entry-points.js +11 -0
  172. package/dist/domain/architecture-analysis/modules/violations/boundaries.d.ts +8 -0
  173. package/dist/domain/architecture-analysis/modules/violations/boundaries.d.ts.map +1 -0
  174. package/dist/domain/architecture-analysis/modules/violations/boundaries.js +47 -0
  175. package/dist/domain/architecture-analysis/modules/violations/coverage.d.ts +3 -0
  176. package/dist/domain/architecture-analysis/modules/violations/coverage.d.ts.map +1 -0
  177. package/dist/domain/architecture-analysis/modules/violations/coverage.js +7 -0
  178. package/dist/domain/architecture-analysis/modules/violations/cycles.d.ts +3 -0
  179. package/dist/domain/architecture-analysis/modules/violations/cycles.d.ts.map +1 -0
  180. package/dist/domain/architecture-analysis/modules/violations/cycles.js +7 -0
  181. package/dist/domain/architecture-analysis/modules/violations/dead-modules.d.ts +3 -0
  182. package/dist/domain/architecture-analysis/modules/violations/dead-modules.d.ts.map +1 -0
  183. package/dist/domain/architecture-analysis/modules/violations/dead-modules.js +23 -0
  184. package/dist/domain/architecture-analysis/modules/violations/dependencies.d.ts +4 -0
  185. package/dist/domain/architecture-analysis/modules/violations/dependencies.d.ts.map +1 -0
  186. package/dist/domain/architecture-analysis/modules/violations/dependencies.js +7 -0
  187. package/dist/domain/architecture-analysis/modules/violations/entry-points.d.ts +3 -0
  188. package/dist/domain/architecture-analysis/modules/violations/entry-points.d.ts.map +1 -0
  189. package/dist/domain/architecture-analysis/modules/violations/entry-points.js +17 -0
  190. package/dist/domain/architecture-analysis/modules/violations/graph-coverage.d.ts +3 -0
  191. package/dist/domain/architecture-analysis/modules/violations/graph-coverage.d.ts.map +1 -0
  192. package/dist/domain/architecture-analysis/modules/violations/graph-coverage.js +16 -0
  193. package/dist/domain/architecture-analysis/modules/violations/index.d.ts +3 -0
  194. package/dist/domain/architecture-analysis/modules/violations/index.d.ts.map +1 -0
  195. package/dist/domain/architecture-analysis/modules/violations/index.js +2 -0
  196. package/dist/domain/architecture-analysis/modules/violations/unused-shared.d.ts +3 -0
  197. package/dist/domain/architecture-analysis/modules/violations/unused-shared.d.ts.map +1 -0
  198. package/dist/domain/architecture-analysis/modules/violations/unused-shared.js +9 -0
  199. package/dist/domain/architecture-analysis/modules/violations/violations.d.ts +9 -0
  200. package/dist/domain/architecture-analysis/modules/violations/violations.d.ts.map +1 -0
  201. package/dist/domain/architecture-analysis/modules/violations/violations.js +22 -0
  202. package/dist/domain/file-graph/file-graph.d.ts +10 -0
  203. package/dist/domain/file-graph/file-graph.d.ts.map +1 -0
  204. package/dist/domain/file-graph/file-graph.js +37 -0
  205. package/dist/domain/file-graph/index.d.ts +4 -0
  206. package/dist/domain/file-graph/index.d.ts.map +1 -0
  207. package/dist/domain/file-graph/index.js +1 -0
  208. package/dist/domain/project-config/index.d.ts +10 -0
  209. package/dist/domain/project-config/index.d.ts.map +1 -0
  210. package/dist/domain/project-config/index.js +12 -0
  211. package/dist/domain/project-config/project-config.d.ts +52 -0
  212. package/dist/domain/project-config/project-config.d.ts.map +1 -0
  213. package/dist/domain/project-config/project-config.js +39 -0
  214. package/dist/domain/project-config/resolve.d.ts +8 -0
  215. package/dist/domain/project-config/resolve.d.ts.map +1 -0
  216. package/dist/domain/project-config/resolve.js +29 -0
  217. package/dist/domain/project-config/validation/containment.d.ts +4 -0
  218. package/dist/domain/project-config/validation/containment.d.ts.map +1 -0
  219. package/dist/domain/project-config/validation/containment.js +21 -0
  220. package/dist/domain/project-config/validation/index.d.ts +3 -0
  221. package/dist/domain/project-config/validation/index.d.ts.map +1 -0
  222. package/dist/domain/project-config/validation/index.js +2 -0
  223. package/dist/domain/project-config/validation/layers/cycles.d.ts +3 -0
  224. package/dist/domain/project-config/validation/layers/cycles.d.ts.map +1 -0
  225. package/dist/domain/project-config/validation/layers/cycles.js +64 -0
  226. package/dist/domain/project-config/validation/layers/index.d.ts +3 -0
  227. package/dist/domain/project-config/validation/layers/index.d.ts.map +1 -0
  228. package/dist/domain/project-config/validation/layers/index.js +2 -0
  229. package/dist/domain/project-config/validation/layers/layers.d.ts +3 -0
  230. package/dist/domain/project-config/validation/layers/layers.d.ts.map +1 -0
  231. package/dist/domain/project-config/validation/layers/layers.js +9 -0
  232. package/dist/domain/project-config/validation/layers/overlaps.d.ts +3 -0
  233. package/dist/domain/project-config/validation/layers/overlaps.d.ts.map +1 -0
  234. package/dist/domain/project-config/validation/layers/overlaps.js +26 -0
  235. package/dist/domain/project-config/validation/layers/references.d.ts +3 -0
  236. package/dist/domain/project-config/validation/layers/references.d.ts.map +1 -0
  237. package/dist/domain/project-config/validation/layers/references.js +21 -0
  238. package/dist/domain/project-config/validation/modules/graphs.d.ts +4 -0
  239. package/dist/domain/project-config/validation/modules/graphs.d.ts.map +1 -0
  240. package/dist/domain/project-config/validation/modules/graphs.js +96 -0
  241. package/dist/domain/project-config/validation/modules/index.d.ts +3 -0
  242. package/dist/domain/project-config/validation/modules/index.d.ts.map +1 -0
  243. package/dist/domain/project-config/validation/modules/index.js +2 -0
  244. package/dist/domain/project-config/validation/modules/modules.d.ts +3 -0
  245. package/dist/domain/project-config/validation/modules/modules.d.ts.map +1 -0
  246. package/dist/domain/project-config/validation/modules/modules.js +16 -0
  247. package/dist/domain/project-config/validation/modules/overlaps.d.ts +4 -0
  248. package/dist/domain/project-config/validation/modules/overlaps.d.ts.map +1 -0
  249. package/dist/domain/project-config/validation/modules/overlaps.js +43 -0
  250. package/dist/domain/project-config/validation/modules/paths.d.ts +3 -0
  251. package/dist/domain/project-config/validation/modules/paths.d.ts.map +1 -0
  252. package/dist/domain/project-config/validation/modules/paths.js +27 -0
  253. package/dist/domain/project-config/validation/modules/scopes.d.ts +4 -0
  254. package/dist/domain/project-config/validation/modules/scopes.d.ts.map +1 -0
  255. package/dist/domain/project-config/validation/modules/scopes.js +28 -0
  256. package/dist/domain/project-config/validation/paths.d.ts +3 -0
  257. package/dist/domain/project-config/validation/paths.d.ts.map +1 -0
  258. package/dist/domain/project-config/validation/paths.js +39 -0
  259. package/dist/domain/project-config/validation/validation.d.ts +3 -0
  260. package/dist/domain/project-config/validation/validation.d.ts.map +1 -0
  261. package/dist/domain/project-config/validation/validation.js +12 -0
  262. package/dist/index.d.ts +17 -1
  263. package/dist/index.d.ts.map +1 -1
  264. package/dist/index.js +22 -1
  265. package/dist/orchestrator/analyze-project/analyze-project.d.ts +119 -0
  266. package/dist/orchestrator/analyze-project/analyze-project.d.ts.map +1 -0
  267. package/dist/orchestrator/analyze-project/analyze-project.js +9 -0
  268. package/dist/orchestrator/analyze-project/index.d.ts +2 -0
  269. package/dist/orchestrator/analyze-project/index.d.ts.map +1 -0
  270. package/dist/orchestrator/analyze-project/index.js +2 -0
  271. package/dist/orchestrator/inspect/index.d.ts +4 -0
  272. package/dist/orchestrator/inspect/index.d.ts.map +1 -0
  273. package/dist/orchestrator/inspect/index.js +1 -0
  274. package/dist/orchestrator/inspect/inspect.d.ts +269 -0
  275. package/dist/orchestrator/inspect/inspect.d.ts.map +1 -0
  276. package/dist/orchestrator/inspect/inspect.js +147 -0
  277. package/dist/orchestrator/load-changes/index.d.ts +2 -0
  278. package/dist/orchestrator/load-changes/index.d.ts.map +1 -0
  279. package/dist/orchestrator/load-changes/index.js +2 -0
  280. package/dist/orchestrator/load-changes/load-changes.d.ts +6 -0
  281. package/dist/orchestrator/load-changes/load-changes.d.ts.map +1 -0
  282. package/dist/orchestrator/load-changes/load-changes.js +18 -0
  283. package/dist/orchestrator/load-module-source/errors.d.ts +17 -0
  284. package/dist/orchestrator/load-module-source/errors.d.ts.map +1 -0
  285. package/dist/orchestrator/load-module-source/errors.js +5 -0
  286. package/dist/orchestrator/load-module-source/index.d.ts +2 -0
  287. package/dist/orchestrator/load-module-source/index.d.ts.map +1 -0
  288. package/dist/orchestrator/load-module-source/index.js +1 -0
  289. package/dist/orchestrator/load-module-source/load-module-source.d.ts +12 -0
  290. package/dist/orchestrator/load-module-source/load-module-source.d.ts.map +1 -0
  291. package/dist/orchestrator/load-module-source/load-module-source.js +39 -0
  292. package/dist/orchestrator/load-project/index.d.ts +3 -0
  293. package/dist/orchestrator/load-project/index.d.ts.map +1 -0
  294. package/dist/orchestrator/load-project/index.js +2 -0
  295. package/dist/orchestrator/load-project/load-project.d.ts +54 -0
  296. package/dist/orchestrator/load-project/load-project.d.ts.map +1 -0
  297. package/dist/orchestrator/load-project/load-project.js +30 -0
  298. package/dist/orchestrator/run-stories/errors.d.ts +11 -0
  299. package/dist/orchestrator/run-stories/errors.d.ts.map +1 -0
  300. package/dist/orchestrator/run-stories/errors.js +3 -0
  301. package/dist/orchestrator/run-stories/extract-snippets.d.ts +12 -0
  302. package/dist/orchestrator/run-stories/extract-snippets.d.ts.map +1 -0
  303. package/dist/orchestrator/run-stories/extract-snippets.js +181 -0
  304. package/dist/orchestrator/run-stories/index.d.ts +3 -0
  305. package/dist/orchestrator/run-stories/index.d.ts.map +1 -0
  306. package/dist/orchestrator/run-stories/index.js +3 -0
  307. package/dist/orchestrator/run-stories/run-stories.d.ts +16 -0
  308. package/dist/orchestrator/run-stories/run-stories.d.ts.map +1 -0
  309. package/dist/orchestrator/run-stories/run-stories.js +290 -0
  310. package/dist/services/config/config.d.ts +12 -0
  311. package/dist/services/config/config.d.ts.map +1 -0
  312. package/dist/services/config/config.js +46 -0
  313. package/dist/services/config/errors.d.ts +13 -0
  314. package/dist/services/config/errors.d.ts.map +1 -0
  315. package/dist/services/config/errors.js +3 -0
  316. package/dist/services/config/index.d.ts +4 -0
  317. package/dist/services/config/index.d.ts.map +1 -0
  318. package/dist/services/config/index.js +7 -0
  319. package/dist/services/file-cruiser/errors.d.ts +10 -0
  320. package/dist/services/file-cruiser/errors.d.ts.map +1 -0
  321. package/dist/services/file-cruiser/errors.js +3 -0
  322. package/dist/services/file-cruiser/file-cruiser.d.ts +11 -0
  323. package/dist/services/file-cruiser/file-cruiser.d.ts.map +1 -0
  324. package/dist/services/file-cruiser/file-cruiser.js +7 -0
  325. package/dist/services/file-cruiser/index.d.ts +4 -0
  326. package/dist/services/file-cruiser/index.d.ts.map +1 -0
  327. package/dist/services/file-cruiser/index.js +6 -0
  328. package/dist/services/file-cruiser/oxc/file-scanner.d.ts +5 -0
  329. package/dist/services/file-cruiser/oxc/file-scanner.d.ts.map +1 -0
  330. package/dist/services/file-cruiser/oxc/file-scanner.js +54 -0
  331. package/dist/services/file-cruiser/oxc/import-resolver.d.ts +5 -0
  332. package/dist/services/file-cruiser/oxc/import-resolver.d.ts.map +1 -0
  333. package/dist/services/file-cruiser/oxc/import-resolver.js +44 -0
  334. package/dist/services/file-cruiser/oxc/index.d.ts +2 -0
  335. package/dist/services/file-cruiser/oxc/index.d.ts.map +1 -0
  336. package/dist/services/file-cruiser/oxc/index.js +2 -0
  337. package/dist/services/file-cruiser/oxc/oxc.d.ts +5 -0
  338. package/dist/services/file-cruiser/oxc/oxc.d.ts.map +1 -0
  339. package/dist/services/file-cruiser/oxc/oxc.js +29 -0
  340. package/dist/services/git/changed-paths.d.ts +4 -0
  341. package/dist/services/git/changed-paths.d.ts.map +1 -0
  342. package/dist/services/git/changed-paths.js +85 -0
  343. package/dist/services/git/errors.d.ts +11 -0
  344. package/dist/services/git/errors.d.ts.map +1 -0
  345. package/dist/services/git/errors.js +3 -0
  346. package/dist/services/git/git.d.ts +12 -0
  347. package/dist/services/git/git.d.ts.map +1 -0
  348. package/dist/services/git/git.js +23 -0
  349. package/dist/services/git/index.d.ts +4 -0
  350. package/dist/services/git/index.d.ts.map +1 -0
  351. package/dist/services/git/index.js +6 -0
  352. package/dist/services/git/parse-patch.d.ts +3 -0
  353. package/dist/services/git/parse-patch.d.ts.map +1 -0
  354. package/dist/services/git/parse-patch.js +53 -0
  355. package/dist/services/git/run-git.d.ts +9 -0
  356. package/dist/services/git/run-git.d.ts.map +1 -0
  357. package/dist/services/git/run-git.js +22 -0
  358. package/dist/story/index.d.ts +3 -0
  359. package/dist/story/index.d.ts.map +1 -0
  360. package/dist/story/index.js +2 -0
  361. package/dist/story/schema/index.d.ts +6 -0
  362. package/dist/story/schema/index.d.ts.map +1 -0
  363. package/dist/story/schema/index.js +4 -0
  364. package/dist/story/schema/slug.d.ts +2 -0
  365. package/dist/story/schema/slug.d.ts.map +1 -0
  366. package/dist/story/schema/slug.js +6 -0
  367. package/dist/story/schema/story-report-schema.d.ts +408 -0
  368. package/dist/story/schema/story-report-schema.d.ts.map +1 -0
  369. package/dist/story/schema/story-report-schema.js +94 -0
  370. package/dist/story/schema/story-tree-schema.d.ts +42 -0
  371. package/dist/story/schema/story-tree-schema.d.ts.map +1 -0
  372. package/dist/story/schema/story-tree-schema.js +40 -0
  373. package/dist/story/story.d.ts +38 -0
  374. package/dist/story/story.d.ts.map +1 -0
  375. package/dist/story/story.js +56 -0
  376. package/package.json +36 -24
  377. package/schema.json +212 -0
  378. package/dist/cli/index.d.ts +0 -2
  379. package/dist/cli/index.d.ts.map +0 -1
  380. package/dist/cli/index.js +0 -1
  381. package/dist/config/define-config.d.ts +0 -3
  382. package/dist/config/define-config.d.ts.map +0 -1
  383. package/dist/config/define-config.js +0 -228
  384. package/dist/config/index.d.ts +0 -5
  385. package/dist/config/index.d.ts.map +0 -1
  386. package/dist/config/index.js +0 -4
  387. package/dist/config/layer-graph.d.ts +0 -7
  388. package/dist/config/layer-graph.d.ts.map +0 -1
  389. package/dist/config/layer-graph.js +0 -53
  390. package/dist/config/layer.d.ts +0 -5
  391. package/dist/config/layer.d.ts.map +0 -1
  392. package/dist/config/layer.js +0 -21
  393. package/dist/config/module.d.ts +0 -9
  394. package/dist/config/module.d.ts.map +0 -1
  395. package/dist/config/module.js +0 -29
  396. package/dist/config/path.d.ts +0 -4
  397. package/dist/config/path.d.ts.map +0 -1
  398. package/dist/config/path.js +0 -32
  399. package/dist/config/types.d.ts +0 -36
  400. package/dist/config/types.d.ts.map +0 -1
  401. package/dist/config/types.js +0 -1
  402. package/dist/engine/1-extract/extract.d.ts +0 -12
  403. package/dist/engine/1-extract/extract.d.ts.map +0 -1
  404. package/dist/engine/1-extract/extract.js +0 -160
  405. package/dist/engine/1-extract/index.d.ts +0 -3
  406. package/dist/engine/1-extract/index.d.ts.map +0 -1
  407. package/dist/engine/1-extract/index.js +0 -1
  408. package/dist/engine/2-resolve/index.d.ts +0 -3
  409. package/dist/engine/2-resolve/index.d.ts.map +0 -1
  410. package/dist/engine/2-resolve/index.js +0 -1
  411. package/dist/engine/2-resolve/resolve.d.ts +0 -24
  412. package/dist/engine/2-resolve/resolve.d.ts.map +0 -1
  413. package/dist/engine/2-resolve/resolve.js +0 -74
  414. package/dist/engine/3-evaluate/evaluate.d.ts +0 -10
  415. package/dist/engine/3-evaluate/evaluate.d.ts.map +0 -1
  416. package/dist/engine/3-evaluate/evaluate.js +0 -80
  417. package/dist/engine/3-evaluate/index.d.ts +0 -3
  418. package/dist/engine/3-evaluate/index.d.ts.map +0 -1
  419. package/dist/engine/3-evaluate/index.js +0 -1
  420. package/dist/engine/4-emit/emit.d.ts +0 -7
  421. package/dist/engine/4-emit/emit.d.ts.map +0 -1
  422. package/dist/engine/4-emit/emit.js +0 -77
  423. package/dist/engine/4-emit/index.d.ts +0 -2
  424. package/dist/engine/4-emit/index.d.ts.map +0 -1
  425. package/dist/engine/4-emit/index.js +0 -1
  426. package/dist/engine/errors.d.ts +0 -19
  427. package/dist/engine/errors.d.ts.map +0 -1
  428. package/dist/engine/errors.js +0 -5
  429. package/dist/node.d.ts +0 -24
  430. package/dist/node.d.ts.map +0 -1
  431. package/dist/node.js +0 -139
  432. package/dist/report/architecture.d.ts +0 -104
  433. package/dist/report/architecture.d.ts.map +0 -1
  434. package/dist/report/architecture.js +0 -1
  435. package/dist/report/index.d.ts +0 -3
  436. package/dist/report/index.d.ts.map +0 -1
  437. package/dist/report/index.js +0 -2
  438. package/dist/report/stories.d.ts +0 -22
  439. package/dist/report/stories.d.ts.map +0 -1
  440. package/dist/report/stories.js +0 -1
  441. package/dist/story/artifact/artifact.d.ts +0 -57
  442. package/dist/story/artifact/artifact.d.ts.map +0 -1
  443. package/dist/story/artifact/artifact.js +0 -234
  444. package/dist/story/artifact/index.d.ts +0 -2
  445. package/dist/story/artifact/index.d.ts.map +0 -1
  446. package/dist/story/artifact/index.js +0 -1
  447. package/dist/story/artifact/storage.d.ts +0 -10
  448. package/dist/story/artifact/storage.d.ts.map +0 -1
  449. package/dist/story/artifact/storage.js +0 -162
  450. package/dist/story/artifact/types.d.ts +0 -74
  451. package/dist/story/artifact/types.d.ts.map +0 -1
  452. package/dist/story/artifact/types.js +0 -1
  453. package/dist/story/core/blocks.d.ts +0 -20
  454. package/dist/story/core/blocks.d.ts.map +0 -1
  455. package/dist/story/core/blocks.js +0 -104
  456. package/dist/story/core/declare.d.ts +0 -63
  457. package/dist/story/core/declare.d.ts.map +0 -1
  458. package/dist/story/core/declare.js +0 -62
  459. package/dist/story/core/index.d.ts +0 -4
  460. package/dist/story/core/index.d.ts.map +0 -1
  461. package/dist/story/core/index.js +0 -1
  462. package/dist/story/core/recorder.d.ts +0 -38
  463. package/dist/story/core/recorder.d.ts.map +0 -1
  464. package/dist/story/core/recorder.js +0 -28
  465. package/dist/story/core/runtime-context.d.ts +0 -14
  466. package/dist/story/core/runtime-context.d.ts.map +0 -1
  467. package/dist/story/core/runtime-context.js +0 -19
  468. package/dist/story/core/types.d.ts +0 -21
  469. package/dist/story/core/types.d.ts.map +0 -1
  470. package/dist/story/core/types.js +0 -1
  471. package/dist/story/effect/effect.d.ts +0 -52
  472. package/dist/story/effect/effect.d.ts.map +0 -1
  473. package/dist/story/effect/effect.js +0 -99
  474. package/dist/story/effect/index.d.ts +0 -3
  475. package/dist/story/effect/index.d.ts.map +0 -1
  476. package/dist/story/effect/index.js +0 -1
  477. package/dist/story/runner/index.d.ts +0 -3
  478. package/dist/story/runner/index.d.ts.map +0 -1
  479. package/dist/story/runner/index.js +0 -1
  480. package/dist/story/runner/runner.d.ts +0 -44
  481. package/dist/story/runner/runner.d.ts.map +0 -1
  482. package/dist/story/runner/runner.js +0 -476
  483. package/dist/story/story-runtime/index.d.ts +0 -2
  484. package/dist/story/story-runtime/index.d.ts.map +0 -1
  485. package/dist/story/story-runtime/index.js +0 -1
  486. package/dist/story/story-runtime/story-runtime.d.ts +0 -52
  487. package/dist/story/story-runtime/story-runtime.d.ts.map +0 -1
  488. package/dist/story/story-runtime/story-runtime.js +0 -194
  489. package/dist/story/vanilla/index.d.ts +0 -29
  490. package/dist/story/vanilla/index.d.ts.map +0 -1
  491. package/dist/story/vanilla/index.js +0 -78
@@ -0,0 +1,21 @@
1
+ import { posix } from 'node:path';
2
+ export function contains(parent, child) {
3
+ return parent === '.' || child === parent || child.startsWith(`${parent}/`);
4
+ }
5
+ export function overlaps(left, right) {
6
+ return contains(left, right) || contains(right, left);
7
+ }
8
+ export function isCanonicalPath(path, allowDot) {
9
+ if (path === '.')
10
+ return allowDot;
11
+ if (path.length === 0 ||
12
+ path === '..' ||
13
+ path.includes('\\') ||
14
+ path.startsWith('/') ||
15
+ path.endsWith('/') ||
16
+ path.startsWith('../') ||
17
+ /^[A-Za-z]:/.test(path)) {
18
+ return false;
19
+ }
20
+ return posix.normalize(path) === path;
21
+ }
@@ -0,0 +1,3 @@
1
+ /** The Project Config module uses this to enforce semantic invariants. */
2
+ export { validateProjectConfig } from './validation.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/domain/project-config/validation/index.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,2 @@
1
+ /** The Project Config module uses this to enforce semantic invariants. */
2
+ export { validateProjectConfig } from './validation.js';
@@ -0,0 +1,3 @@
1
+ import type { Config, ConfigValidationIssue } from '../../project-config.js';
2
+ export declare function findCycles(layerGraphs: Config['layerGraphs']): readonly ConfigValidationIssue[];
3
+ //# sourceMappingURL=cycles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cycles.d.ts","sourceRoot":"","sources":["../../../../../src/domain/project-config/validation/layers/cycles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAE7E,wBAAgB,UAAU,CACxB,WAAW,EAAE,MAAM,CAAC,aAAa,CAAC,GACjC,SAAS,qBAAqB,EAAE,CAWlC"}
@@ -0,0 +1,64 @@
1
+ export function findCycles(layerGraphs) {
2
+ const graph = combineRules(layerGraphs);
3
+ return stronglyConnectedComponents(graph)
4
+ .filter((component) => component.length > 1 || graph.get(component[0])?.has(component[0]))
5
+ .map((component) => ({
6
+ kind: 'cycle',
7
+ message: `Layer rule cycle includes: ${component.sort().join(', ')}`,
8
+ }));
9
+ }
10
+ function combineRules(layerGraphs) {
11
+ const graph = new Map();
12
+ for (const { rules } of Object.values(layerGraphs)) {
13
+ for (const [from, destinations] of Object.entries(rules)) {
14
+ const edges = graph.get(from) ?? new Set();
15
+ graph.set(from, edges);
16
+ for (const to of destinations) {
17
+ edges.add(to);
18
+ if (!graph.has(to))
19
+ graph.set(to, new Set());
20
+ }
21
+ }
22
+ }
23
+ return graph;
24
+ }
25
+ function stronglyConnectedComponents(graph) {
26
+ let nextIndex = 0;
27
+ const indices = new Map();
28
+ const lowLinks = new Map();
29
+ const stack = [];
30
+ const onStack = new Set();
31
+ const components = [];
32
+ const visit = (node) => {
33
+ const index = nextIndex;
34
+ nextIndex += 1;
35
+ indices.set(node, index);
36
+ lowLinks.set(node, index);
37
+ stack.push(node);
38
+ onStack.add(node);
39
+ for (const destination of graph.get(node) ?? []) {
40
+ if (!indices.has(destination)) {
41
+ visit(destination);
42
+ lowLinks.set(node, Math.min(lowLinks.get(node), lowLinks.get(destination)));
43
+ }
44
+ else if (onStack.has(destination)) {
45
+ lowLinks.set(node, Math.min(lowLinks.get(node), indices.get(destination)));
46
+ }
47
+ }
48
+ if (lowLinks.get(node) !== indices.get(node))
49
+ return;
50
+ const component = [];
51
+ let member;
52
+ do {
53
+ member = stack.pop();
54
+ onStack.delete(member);
55
+ component.push(member);
56
+ } while (member !== node);
57
+ components.push(component);
58
+ };
59
+ for (const node of graph.keys()) {
60
+ if (!indices.has(node))
61
+ visit(node);
62
+ }
63
+ return components;
64
+ }
@@ -0,0 +1,3 @@
1
+ /** Config validation uses this to enforce every Layer invariant. */
2
+ export { validateLayers } from './layers.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/domain/project-config/validation/layers/index.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,2 @@
1
+ /** Config validation uses this to enforce every Layer invariant. */
2
+ export { validateLayers } from './layers.js';
@@ -0,0 +1,3 @@
1
+ import type { Config, ConfigValidationIssue } from '../../project-config.js';
2
+ export declare function validateLayers(config: Config): readonly ConfigValidationIssue[];
3
+ //# sourceMappingURL=layers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layers.d.ts","sourceRoot":"","sources":["../../../../../src/domain/project-config/validation/layers/layers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAK7E,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,GACb,SAAS,qBAAqB,EAAE,CAKlC"}
@@ -0,0 +1,9 @@
1
+ import { findCycles } from './cycles.js';
2
+ import { findOverlaps } from './overlaps.js';
3
+ import { findUnknownReferences } from './references.js';
4
+ export function validateLayers(config) {
5
+ const overlaps = findOverlaps(config.layers);
6
+ const references = findUnknownReferences(config.layers, config.layerGraphs);
7
+ const cycles = references.length === 0 ? findCycles(config.layerGraphs) : [];
8
+ return [...overlaps, ...references, ...cycles];
9
+ }
@@ -0,0 +1,3 @@
1
+ import type { Config, ConfigValidationIssue } from '../../project-config.js';
2
+ export declare function findOverlaps(layers: Config['layers']): readonly ConfigValidationIssue[];
3
+ //# sourceMappingURL=overlaps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overlaps.d.ts","sourceRoot":"","sources":["../../../../../src/domain/project-config/validation/layers/overlaps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAO7E,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,GACvB,SAAS,qBAAqB,EAAE,CAgBlC"}
@@ -0,0 +1,26 @@
1
+ export function findOverlaps(layers) {
2
+ const scopes = Object.entries(layers).flatMap(([layer, value]) => value.paths.map((path) => ({ layer, path })));
3
+ const issues = [];
4
+ for (let left = 0; left < scopes.length; left += 1) {
5
+ for (let right = left + 1; right < scopes.length; right += 1) {
6
+ const first = scopes[left];
7
+ const second = scopes[right];
8
+ if (!pathsOverlap(first.path, second.path))
9
+ continue;
10
+ issues.push(overlapIssue(first, second));
11
+ }
12
+ }
13
+ return issues;
14
+ }
15
+ function pathsOverlap(left, right) {
16
+ return contains(left, right) || contains(right, left);
17
+ }
18
+ function contains(parent, child) {
19
+ return parent === '.' || child === parent || child.startsWith(`${parent}/`);
20
+ }
21
+ function overlapIssue(first, second) {
22
+ return {
23
+ kind: 'overlap',
24
+ message: `Layer scopes overlap: ${first.layer}:${first.path} and ${second.layer}:${second.path}`,
25
+ };
26
+ }
@@ -0,0 +1,3 @@
1
+ import type { Config, ConfigValidationIssue } from '../../project-config.js';
2
+ export declare function findUnknownReferences(layers: Config['layers'], layerGraphs: Config['layerGraphs']): readonly ConfigValidationIssue[];
3
+ //# sourceMappingURL=references.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"references.d.ts","sourceRoot":"","sources":["../../../../../src/domain/project-config/validation/layers/references.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAE7E,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,EACxB,WAAW,EAAE,MAAM,CAAC,aAAa,CAAC,GACjC,SAAS,qBAAqB,EAAE,CAclC"}
@@ -0,0 +1,21 @@
1
+ export function findUnknownReferences(layers, layerGraphs) {
2
+ const known = new Set(Object.keys(layers));
3
+ const issues = [];
4
+ for (const [graph, { rules }] of Object.entries(layerGraphs)) {
5
+ for (const [from, destinations] of Object.entries(rules)) {
6
+ if (!known.has(from))
7
+ issues.push(referenceIssue(graph, from));
8
+ for (const to of destinations) {
9
+ if (!known.has(to))
10
+ issues.push(referenceIssue(graph, to));
11
+ }
12
+ }
13
+ }
14
+ return [...new Map(issues.map((issue) => [issue.message, issue])).values()];
15
+ }
16
+ function referenceIssue(graph, layer) {
17
+ return {
18
+ kind: 'reference',
19
+ message: `LayerGraph ${graph} references unknown Layer ${layer}`,
20
+ };
21
+ }
@@ -0,0 +1,4 @@
1
+ import type { Config, ConfigValidationIssue } from '../../project-config.js';
2
+ import type { ResolvedConfig } from '../../resolve.js';
3
+ export declare function findModuleGraphIssues(config: Config, resolved: ResolvedConfig): readonly ConfigValidationIssue[];
4
+ //# sourceMappingURL=graphs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphs.d.ts","sourceRoot":"","sources":["../../../../../src/domain/project-config/validation/modules/graphs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,cAAc,GACvB,SAAS,qBAAqB,EAAE,CAYlC"}
@@ -0,0 +1,96 @@
1
+ export function findModuleGraphIssues(config, resolved) {
2
+ return [
3
+ ...findDuplicateIds(config),
4
+ ...Object.entries(resolved.graphs).flatMap(([id, graph]) => {
5
+ const members = Object.keys(graph.members).sort();
6
+ return [
7
+ ...findSurfaceIssues(id, graph, resolved),
8
+ ...findRuleReferenceIssues(id, graph, new Set(members)),
9
+ ...findRuleCycles(id, graph),
10
+ ];
11
+ }),
12
+ ];
13
+ }
14
+ function findDuplicateIds(config) {
15
+ const owners = new Map();
16
+ for (const [layer, definition] of Object.entries(config.layers)) {
17
+ for (const id of Object.keys(definition.moduleGraphs)) {
18
+ owners.set(id, [...(owners.get(id) ?? []), layer]);
19
+ }
20
+ }
21
+ return [...owners]
22
+ .filter(([, layers]) => layers.length > 1)
23
+ .sort(([left], [right]) => left.localeCompare(right))
24
+ .map(([id, layers]) => ({
25
+ kind: 'module-graph',
26
+ message: `Module Graph id ${id} is declared in more than one Layer: ${layers.sort().join(', ')}`,
27
+ }));
28
+ }
29
+ function findSurfaceIssues(id, graph, resolved) {
30
+ const definitions = Object.entries(graph.members).map(([member, path]) => [member, resolved.modules[path]]);
31
+ const issues = definitions
32
+ .filter(([, definition]) => definition.shared)
33
+ .sort(([left], [right]) => left.localeCompare(right))
34
+ .map(([member]) => ({
35
+ kind: 'module-graph',
36
+ message: `Module Graph ${id} member ${member} cannot be Shared. Sharing is Layer-wide, so declare it outside the Graph instead.`,
37
+ }));
38
+ if (!definitions.some(([, definition]) => definition.exposed)) {
39
+ issues.push({
40
+ kind: 'module-graph',
41
+ message: `Module Graph ${id} must expose at least one member`,
42
+ });
43
+ }
44
+ return issues;
45
+ }
46
+ function findRuleReferenceIssues(id, graph, members) {
47
+ const issues = [];
48
+ for (const [from, destinations] of Object.entries(graph.rules)) {
49
+ if (!members.has(from)) {
50
+ issues.push({
51
+ kind: 'reference',
52
+ message: `Module Graph ${id} rules reference unknown member ${from}`,
53
+ });
54
+ }
55
+ for (const to of destinations) {
56
+ if (members.has(to) && to !== from)
57
+ continue;
58
+ issues.push({
59
+ kind: to === from ? 'cycle' : 'reference',
60
+ message: to === from
61
+ ? `Module Graph ${id} rule cycle includes: ${from}`
62
+ : `Module Graph ${id} rules reference unknown member ${to}`,
63
+ });
64
+ }
65
+ }
66
+ return [...new Map(issues.map((issue) => [issue.message, issue])).values()];
67
+ }
68
+ function findRuleCycles(id, graph) {
69
+ const members = new Set(Object.keys(graph.members));
70
+ const edges = new Map(Object.entries(graph.rules).map(([from, destinations]) => [
71
+ from,
72
+ destinations.filter((to) => members.has(to) && to !== from),
73
+ ]));
74
+ const state = new Map();
75
+ const cycles = [];
76
+ const visit = (member, trail) => {
77
+ if (state.get(member) === 'done')
78
+ return;
79
+ if (state.get(member) === 'visiting') {
80
+ const start = trail.indexOf(member);
81
+ cycles.push(trail.slice(start).sort().join(', '));
82
+ return;
83
+ }
84
+ state.set(member, 'visiting');
85
+ for (const to of [...(edges.get(member) ?? [])].sort()) {
86
+ visit(to, [...trail, member]);
87
+ }
88
+ state.set(member, 'done');
89
+ };
90
+ for (const member of [...members].sort())
91
+ visit(member, []);
92
+ return [...new Set(cycles)].sort().map((cycle) => ({
93
+ kind: 'cycle',
94
+ message: `Module Graph ${id} rule cycle includes: ${cycle}`,
95
+ }));
96
+ }
@@ -0,0 +1,3 @@
1
+ /** Config validation uses this to enforce every Configured Module invariant. */
2
+ export { validateModules } from './modules.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/domain/project-config/validation/modules/index.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,2 @@
1
+ /** Config validation uses this to enforce every Configured Module invariant. */
2
+ export { validateModules } from './modules.js';
@@ -0,0 +1,3 @@
1
+ import type { Config, ConfigValidationIssue } from '../../project-config.js';
2
+ export declare function validateModules(config: Config): readonly ConfigValidationIssue[];
3
+ //# sourceMappingURL=modules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../../../../../src/domain/project-config/validation/modules/modules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAO7E,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,GACb,SAAS,qBAAqB,EAAE,CASlC"}
@@ -0,0 +1,16 @@
1
+ import { resolveConfig } from '../../resolve.js';
2
+ import { findModuleGraphIssues } from './graphs.js';
3
+ import { findModuleOverlaps } from './overlaps.js';
4
+ import { findModulePathIssues } from './paths.js';
5
+ import { findScopeIssues } from './scopes.js';
6
+ export function validateModules(config) {
7
+ const pathIssues = findModulePathIssues(config);
8
+ if (pathIssues.length > 0)
9
+ return pathIssues;
10
+ const resolved = resolveConfig(config);
11
+ return [
12
+ ...findModuleOverlaps(resolved),
13
+ ...findScopeIssues(config, resolved),
14
+ ...findModuleGraphIssues(config, resolved),
15
+ ];
16
+ }
@@ -0,0 +1,4 @@
1
+ import type { ConfigValidationIssue } from '../../project-config.js';
2
+ import type { ResolvedConfig } from '../../resolve.js';
3
+ export declare function findModuleOverlaps(resolved: ResolvedConfig): readonly ConfigValidationIssue[];
4
+ //# sourceMappingURL=overlaps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overlaps.d.ts","sourceRoot":"","sources":["../../../../../src/domain/project-config/validation/modules/overlaps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGvD,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,cAAc,GACvB,SAAS,qBAAqB,EAAE,CA2ClC"}
@@ -0,0 +1,43 @@
1
+ import { overlaps } from '../containment.js';
2
+ export function findModuleOverlaps(resolved) {
3
+ const roots = Object.keys(resolved.modules).sort();
4
+ const issues = [];
5
+ for (let left = 0; left < roots.length; left += 1) {
6
+ for (let right = left + 1; right < roots.length; right += 1) {
7
+ const first = roots[left];
8
+ const second = roots[right];
9
+ if (!overlaps(first, second))
10
+ continue;
11
+ issues.push({
12
+ kind: 'overlap',
13
+ message: `Module roots overlap: ${first} and ${second}`,
14
+ });
15
+ }
16
+ }
17
+ const graphs = Object.entries(resolved.graphs).sort(([left], [right]) => left.localeCompare(right));
18
+ for (let left = 0; left < graphs.length; left += 1) {
19
+ for (let right = left + 1; right < graphs.length; right += 1) {
20
+ const [firstId, first] = graphs[left];
21
+ const [secondId, second] = graphs[right];
22
+ if (!overlaps(first.path, second.path))
23
+ continue;
24
+ issues.push({
25
+ kind: 'overlap',
26
+ message: `Module Graph roots overlap: ${firstId} and ${secondId}`,
27
+ });
28
+ }
29
+ }
30
+ for (const [id, graph] of graphs) {
31
+ const memberPaths = new Set(Object.values(graph.members));
32
+ const intruder = roots.find((root) => !memberPaths.has(root) &&
33
+ resolved.modules[root]?.graph === undefined &&
34
+ overlaps(graph.path, root));
35
+ if (intruder === undefined)
36
+ continue;
37
+ issues.push({
38
+ kind: 'overlap',
39
+ message: `Module ${intruder} overlaps Module Graph ${id}`,
40
+ });
41
+ }
42
+ return issues;
43
+ }
@@ -0,0 +1,3 @@
1
+ import type { Config, ConfigValidationIssue } from '../../project-config.js';
2
+ export declare function findModulePathIssues(config: Config): readonly ConfigValidationIssue[];
3
+ //# sourceMappingURL=paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../../../src/domain/project-config/validation/modules/paths.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAG7E,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,GACb,SAAS,qBAAqB,EAAE,CAyBlC"}
@@ -0,0 +1,27 @@
1
+ import { isCanonicalPath } from '../containment.js';
2
+ export function findModulePathIssues(config) {
3
+ return Object.entries(config.layers).flatMap(([layer, definition]) => [
4
+ ...Object.keys(definition.modules)
5
+ .filter((root) => !isCanonicalPath(root, true))
6
+ .map((root) => ({
7
+ kind: 'path',
8
+ message: `layers.${layer}.modules key must be a canonical project-relative file or directory: ${JSON.stringify(root)}`,
9
+ })),
10
+ ...Object.entries(definition.moduleGraphs).flatMap(([id, graph]) => [
11
+ ...(isCanonicalPath(graph.path, true)
12
+ ? []
13
+ : [
14
+ {
15
+ kind: 'path',
16
+ message: `layers.${layer}.moduleGraphs.${id}.path must be a canonical project-relative directory: ${JSON.stringify(graph.path)}`,
17
+ },
18
+ ]),
19
+ ...Object.keys(graph.modules)
20
+ .filter((member) => !isCanonicalPath(member, false))
21
+ .map((member) => ({
22
+ kind: 'path',
23
+ message: `Module Graph ${id} member key must be a canonical path below its Graph root: ${JSON.stringify(member)}`,
24
+ })),
25
+ ]),
26
+ ]);
27
+ }
@@ -0,0 +1,4 @@
1
+ import type { Config, ConfigValidationIssue } from '../../project-config.js';
2
+ import type { ResolvedConfig } from '../../resolve.js';
3
+ export declare function findScopeIssues(config: Config, resolved: ResolvedConfig): readonly ConfigValidationIssue[];
4
+ //# sourceMappingURL=scopes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scopes.d.ts","sourceRoot":"","sources":["../../../../../src/domain/project-config/validation/modules/scopes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGvD,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,cAAc,GACvB,SAAS,qBAAqB,EAAE,CASlC"}
@@ -0,0 +1,28 @@
1
+ import { contains } from '../containment.js';
2
+ export function findScopeIssues(config, resolved) {
3
+ return [
4
+ ...Object.entries(resolved.modules).flatMap(([root, definition]) => scopeIssues(config, `Module ${root}`, root, definition.layer)),
5
+ ...Object.entries(resolved.graphs).flatMap(([id, graph]) => scopeIssues(config, `Module Graph ${id}`, graph.path, graph.layer)),
6
+ ];
7
+ }
8
+ function scopeIssues(config, subject, path, layer) {
9
+ const issues = [];
10
+ const scopes = config.layers[layer]?.paths ?? [];
11
+ if (!scopes.some((scope) => contains(scope, path))) {
12
+ issues.push({
13
+ kind: 'module',
14
+ message: `${subject} is not contained by a scope of its Layer ${layer}`,
15
+ });
16
+ }
17
+ const foreign = Object.entries(config.layers).find(([id, definition]) => id !== layer && definition.paths.some((scope) => contains(scope, path)));
18
+ if (foreign !== undefined) {
19
+ issues.push({
20
+ kind: 'module',
21
+ message: `${subject} is declared in Layer ${layer} but falls inside Layer ${foreign[0]}`,
22
+ });
23
+ }
24
+ if (config.ignoredPaths.some((ignored) => contains(ignored, path))) {
25
+ issues.push({ kind: 'module', message: `${subject} is wholly ignored` });
26
+ }
27
+ return issues;
28
+ }
@@ -0,0 +1,3 @@
1
+ import type { Config, ConfigValidationIssue } from '../project-config.js';
2
+ export declare function findInvalidPaths(config: Config): readonly ConfigValidationIssue[];
3
+ //# sourceMappingURL=paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../../src/domain/project-config/validation/paths.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAO1E,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,GACb,SAAS,qBAAqB,EAAE,CAOlC"}
@@ -0,0 +1,39 @@
1
+ import { posix } from 'node:path';
2
+ export function findInvalidPaths(config) {
3
+ return configPaths(config)
4
+ .filter(({ path }) => !isCanonicalProjectPath(path))
5
+ .map(({ location, path }) => ({
6
+ kind: 'path',
7
+ message: `${location} must be a canonical project-relative path: ${JSON.stringify(path)}`,
8
+ }));
9
+ }
10
+ function configPaths(config) {
11
+ return [
12
+ ...config.sourceRoots.map((path, index) => ({
13
+ location: `sourceRoots[${index}]`,
14
+ path,
15
+ })),
16
+ ...config.ignoredPaths.map((path, index) => ({
17
+ location: `ignoredPaths[${index}]`,
18
+ path,
19
+ })),
20
+ ...Object.entries(config.layers).flatMap(([layer, value]) => value.paths.map((path, index) => ({
21
+ location: `layers.${layer}.paths[${index}]`,
22
+ path,
23
+ }))),
24
+ ];
25
+ }
26
+ function isCanonicalProjectPath(path) {
27
+ if (path === '.')
28
+ return true;
29
+ if (path.length === 0 ||
30
+ path.includes('\\') ||
31
+ path.startsWith('/') ||
32
+ path.endsWith('/') ||
33
+ path.startsWith('../') ||
34
+ path === '..' ||
35
+ /^[A-Za-z]:/.test(path)) {
36
+ return false;
37
+ }
38
+ return posix.normalize(path) === path;
39
+ }
@@ -0,0 +1,3 @@
1
+ import type { Config, ConfigValidationIssue } from '../project-config.js';
2
+ export declare function validateProjectConfig(config: Config): readonly ConfigValidationIssue[];
3
+ //# sourceMappingURL=validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../../src/domain/project-config/validation/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAK1E,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,GACb,SAAS,qBAAqB,EAAE,CAQlC"}
@@ -0,0 +1,12 @@
1
+ import { validateLayers } from './layers/index.js';
2
+ import { validateModules } from './modules/index.js';
3
+ import { findInvalidPaths } from './paths.js';
4
+ export function validateProjectConfig(config) {
5
+ const pathIssues = findInvalidPaths(config);
6
+ const moduleIssues = validateModules(config);
7
+ const modulePathIssues = moduleIssues.filter(({ kind }) => kind === 'path');
8
+ if (pathIssues.length > 0 || modulePathIssues.length > 0) {
9
+ return [...pathIssues, ...modulePathIssues];
10
+ }
11
+ return [...validateLayers(config), ...moduleIssues];
12
+ }
package/dist/index.d.ts CHANGED
@@ -1,2 +1,18 @@
1
- export * from './config/index.js';
1
+ export { analyzeProject } from './orchestrator/analyze-project/index.js';
2
+ export { loadModuleSource, ModuleSourceNotFound, ModuleSourceReadError, } from './orchestrator/load-module-source/index.js';
3
+ export { ArchitectureAnalysisSchema } from './architecture-analysis-schema/index.js';
4
+ export type { ArchitectureAnalysis } from './architecture-analysis-schema/index.js';
5
+ export { ModuleSourceSnapshotSchema } from './architecture-analysis-schema/index.js';
6
+ export type { ModuleSourceFile, ModuleSourceSnapshot, } from './architecture-analysis-schema/index.js';
7
+ export { InspectionTargetNotFound, ModuleInspectionCycle, inspectFile, inspectLayer, inspectModule, inspectProject, } from './orchestrator/inspect/index.js';
8
+ export type { FileInspection, FileInspectionOptions, LayerInspection, ModuleInspection, ProjectInspection, } from './orchestrator/inspect/index.js';
9
+ export { ConfigError } from './services/config/index.js';
10
+ export { CruiseError } from './services/file-cruiser/index.js';
11
+ export { getStoryTree, planStories, runStories, StoriesError, } from './orchestrator/run-stories/index.js';
12
+ export { StoryReportSchema, StoryTreeSchema } from './story/schema/index.js';
13
+ export type { StoryReport, StoryTree } from './story/schema/index.js';
14
+ export { loadChangeSet, loadFileDiff, } from './orchestrator/load-changes/index.js';
15
+ export { GitError } from './services/git/index.js';
16
+ export { ChangedPathSchema, ChangeSetSchema, ChangeStatusSchema, DiffHunkSchema, DiffLineSchema, FileDiffSchema, } from './change-set-schema/index.js';
17
+ export type { ChangedPath, ChangeSet, ChangeStatus, DiffHunk, DiffLine, FileDiff, } from './change-set-schema/index.js';
2
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAEzE,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,4CAA4C,CAAC;AAEpD,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAErF,YAAY,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AACrF,YAAY,EACV,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,WAAW,EACX,YAAY,EACZ,aAAa,EACb,cAAc,GACf,MAAM,iCAAiC,CAAC;AACzC,YAAY,EACV,cAAc,EACd,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAE/D,OAAO,EACL,YAAY,EACZ,WAAW,EACX,UAAU,EACV,YAAY,GACb,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC7E,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEtE,OAAO,EACL,aAAa,EACb,YAAY,GACb,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEnD,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,cAAc,GACf,MAAM,8BAA8B,CAAC;AAEtC,YAAY,EACV,WAAW,EACX,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,QAAQ,GACT,MAAM,8BAA8B,CAAC"}
package/dist/index.js CHANGED
@@ -1 +1,22 @@
1
- export * from './config/index.js';
1
+ // Node consumers use this high-level capability to produce Architecture Analysis.
2
+ export { analyzeProject } from './orchestrator/analyze-project/index.js';
3
+ // Node consumers use this high-level capability to inspect one Configured Module.
4
+ export { loadModuleSource, ModuleSourceNotFound, ModuleSourceReadError, } from './orchestrator/load-module-source/index.js';
5
+ // RPC transports use this browser-safe runtime contract for Architecture Analysis.
6
+ export { ArchitectureAnalysisSchema } from './architecture-analysis-schema/index.js';
7
+ export { ModuleSourceSnapshotSchema } from './architecture-analysis-schema/index.js';
8
+ export { InspectionTargetNotFound, ModuleInspectionCycle, inspectFile, inspectLayer, inspectModule, inspectProject, } from './orchestrator/inspect/index.js';
9
+ // Analysis callers distinguish Config loading and validation failures.
10
+ export { ConfigError } from './services/config/index.js';
11
+ // Analysis callers distinguish source cruising failures.
12
+ export { CruiseError } from './services/file-cruiser/index.js';
13
+ // Node consumers use this high-level capability to load and run the Story tree.
14
+ export { getStoryTree, planStories, runStories, StoriesError, } from './orchestrator/run-stories/index.js';
15
+ // RPC transports use this browser-safe runtime contract for Story reports.
16
+ export { StoryReportSchema, StoryTreeSchema } from './story/schema/index.js';
17
+ // Node consumers use this high-level capability to report what a Base ref changed.
18
+ export { loadChangeSet, loadFileDiff, } from './orchestrator/load-changes/index.js';
19
+ // Change set callers distinguish a missing repository from a failed git command.
20
+ export { GitError } from './services/git/index.js';
21
+ // RPC transports use this browser-safe runtime contract for Change sets.
22
+ export { ChangedPathSchema, ChangeSetSchema, ChangeStatusSchema, DiffHunkSchema, DiffLineSchema, FileDiffSchema, } from './change-set-schema/index.js';