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,56 @@
1
+ import { Context, Effect } from 'effect';
2
+ import { makeTraceRecorder } from '@pkishorez/effect-tracer/recorder';
3
+ export class StoryContext extends Context.Service()('StoryContext') {
4
+ }
5
+ export const Story = {
6
+ make(story) {
7
+ return story;
8
+ },
9
+ question(question, options) {
10
+ return { question, answer: options.answer, proof: options.proof };
11
+ },
12
+ group(title, children) {
13
+ return { title, children };
14
+ },
15
+ trace(effect) {
16
+ return Effect.gen(function* () {
17
+ const context = yield* StoryContext;
18
+ const recorder = makeTraceRecorder();
19
+ return yield* recorder
20
+ .instrument(effect)
21
+ .pipe(Effect.onExit(() => context.beginSection({ kind: 'trace', trace: recorder.snapshot() })));
22
+ });
23
+ },
24
+ flow(effect) {
25
+ return Effect.gen(function* () {
26
+ const context = yield* StoryContext;
27
+ const recorder = makeTraceRecorder();
28
+ return yield* recorder
29
+ .instrument(effect)
30
+ .pipe(Effect.onExit(() => Effect.forEach(recorder.snapshotFlows(), (flow) => context.beginSection({ kind: 'flow', flow }))));
31
+ });
32
+ },
33
+ assert(description, passed) {
34
+ return Effect.flatMap(StoryContext, (context) => context.assert(description, passed));
35
+ },
36
+ };
37
+ export function isStory(value) {
38
+ if (typeof value !== 'object' || value === null)
39
+ return false;
40
+ const story = value;
41
+ return (typeof story.title === 'string' &&
42
+ typeof story.sourceUrl === 'string' &&
43
+ Array.isArray(story.questions) &&
44
+ story.questions.every((question) => typeof question.question === 'string' &&
45
+ typeof question.answer === 'string' &&
46
+ Effect.isEffect(question.proof)));
47
+ }
48
+ export function isStoryGroup(value) {
49
+ if (typeof value !== 'object' || value === null)
50
+ return false;
51
+ const group = value;
52
+ if (typeof group.title !== 'string' || !Array.isArray(group.children)) {
53
+ return false;
54
+ }
55
+ return group.children.every((child) => isStory(child) || isStoryGroup(child));
56
+ }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "laymos",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "private": false,
5
- "description": "Layers. Modules. Stories. Declare your architecture once; get enforcement and the diagram for free.",
5
+ "description": "Enforces architectural dependency rules and explores source dependencies.",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/pkishorez/monorepo"
@@ -15,54 +15,66 @@
15
15
  "import": "./dist/index.js",
16
16
  "default": "./dist/index.js"
17
17
  },
18
- "./node": {
19
- "types": "./dist/node.d.ts",
20
- "import": "./dist/node.js",
21
- "default": "./dist/node.js"
18
+ "./architecture-analysis-schema": {
19
+ "types": "./dist/architecture-analysis-schema/index.d.ts",
20
+ "import": "./dist/architecture-analysis-schema/index.js",
21
+ "default": "./dist/architecture-analysis-schema/index.js"
22
22
  },
23
- "./report": {
24
- "types": "./dist/report/index.d.ts",
25
- "import": "./dist/report/index.js",
26
- "default": "./dist/report/index.js"
23
+ "./change-set-schema": {
24
+ "types": "./dist/change-set-schema/index.d.ts",
25
+ "import": "./dist/change-set-schema/index.js",
26
+ "default": "./dist/change-set-schema/index.js"
27
27
  },
28
28
  "./story": {
29
- "types": "./dist/story/effect/index.d.ts",
30
- "import": "./dist/story/effect/index.js",
31
- "default": "./dist/story/effect/index.js"
29
+ "types": "./dist/story/index.d.ts",
30
+ "import": "./dist/story/index.js",
31
+ "default": "./dist/story/index.js"
32
+ },
33
+ "./story/schema": {
34
+ "types": "./dist/story/schema/index.d.ts",
35
+ "import": "./dist/story/schema/index.js",
36
+ "default": "./dist/story/schema/index.js"
32
37
  }
33
38
  },
34
39
  "bin": {
35
- "laymos": "dist/cli/cli.js"
40
+ "laymos": "bin/laymos.mjs"
36
41
  },
37
42
  "files": [
43
+ "bin",
38
44
  "dist",
45
+ "schema.json",
39
46
  "README.md",
40
47
  "LICENSE"
41
48
  ],
42
49
  "dependencies": {
43
- "@effect/platform-node": "4.0.0-beta.98",
44
- "jiti": "2.7.0",
45
- "skott": "0.35.11"
50
+ "@effect/platform-node": "4.0.0-beta.102",
51
+ "oxc-parser": "0.143.0",
52
+ "oxc-resolver": "11.24.2",
53
+ "tsx": "4.23.1",
54
+ "yoctocolors": "2.2.0",
55
+ "@pkishorez/effect-tracer": "0.0.2"
46
56
  },
47
57
  "devDependencies": {
48
- "@typescript/native": "npm:typescript@7.0.2",
49
58
  "@types/node": "26.1.1",
50
- "effect": "4.0.0-beta.98",
59
+ "@typescript/native": "npm:typescript@7.0.2",
60
+ "effect": "4.0.0-beta.102",
61
+ "tsx": "4.23.1",
51
62
  "typescript": "npm:@typescript/typescript6@6.0.2",
52
63
  "vitest": "4.1.10"
53
64
  },
54
65
  "peerDependencies": {
55
- "effect": "^4.0.0-beta.78"
66
+ "effect": "4.0.0-beta.102"
56
67
  },
57
68
  "publishConfig": {
58
69
  "access": "public"
59
70
  },
60
71
  "scripts": {
61
- "build": "tsc",
62
- "build:watch": "tsc --watch",
72
+ "build": "tsc -p tsconfig.build.json",
73
+ "build:watch": "tsc -p tsconfig.build.json --watch",
74
+ "dev": "tsx src/cli/cli.ts",
63
75
  "fmt": "vp fmt",
64
- "lint": "vp check && tsc --noEmit",
65
- "lint:laymos": "jiti src/cli/cli.ts lint",
76
+ "lint": "vp check && tsc",
77
+ "schema": "vitest run src/services/config/tests/config.test.ts -u",
66
78
  "test": "vitest run"
67
79
  }
68
80
  }
package/schema.json ADDED
@@ -0,0 +1,212 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "type": "object",
4
+ "properties": {
5
+ "$schema": {
6
+ "anyOf": [
7
+ {
8
+ "type": "string"
9
+ },
10
+ {
11
+ "type": "null"
12
+ }
13
+ ],
14
+ "description": "JSON Schema URL, used by editors for autocomplete and validation."
15
+ },
16
+ "sourceRoots": {
17
+ "type": "array",
18
+ "description": "Canonical project-relative files or folders that define the complete static analysis universe.",
19
+ "allOf": [
20
+ {
21
+ "minItems": 1
22
+ }
23
+ ],
24
+ "items": {
25
+ "type": "string"
26
+ }
27
+ },
28
+ "ignoredPaths": {
29
+ "type": "array",
30
+ "description": "Canonical project-relative files or folders explicitly excluded from the analysis universe.",
31
+ "items": {
32
+ "type": "string"
33
+ }
34
+ },
35
+ "storiesPath": {
36
+ "anyOf": [
37
+ {
38
+ "type": "string"
39
+ },
40
+ {
41
+ "type": "null"
42
+ }
43
+ ],
44
+ "description": "Canonical project-relative folder holding every Story file and the index.ts entry point exposing the Story Collection. Implicitly an Ignored path."
45
+ },
46
+ "layers": {
47
+ "type": "object",
48
+ "additionalProperties": {
49
+ "type": "object",
50
+ "properties": {
51
+ "paths": {
52
+ "type": "array",
53
+ "description": "Canonical project-relative paths belonging to this Layer. No declared Layer scopes may overlap, within one Layer or across Layers.",
54
+ "allOf": [
55
+ {
56
+ "minItems": 1
57
+ }
58
+ ],
59
+ "items": {
60
+ "type": "string"
61
+ }
62
+ },
63
+ "description": {
64
+ "anyOf": [
65
+ {
66
+ "type": "string"
67
+ },
68
+ {
69
+ "type": "null"
70
+ }
71
+ ],
72
+ "description": "Human-readable summary of this Layer."
73
+ },
74
+ "modules": {
75
+ "type": "object",
76
+ "additionalProperties": {
77
+ "$ref": "#/definitions/Objects_"
78
+ },
79
+ "description": "Every free-form Configured Module in this Layer, keyed by canonical project-relative source file or directory."
80
+ },
81
+ "moduleGraphs": {
82
+ "type": "object",
83
+ "additionalProperties": {
84
+ "type": "object",
85
+ "properties": {
86
+ "description": {
87
+ "anyOf": [
88
+ {
89
+ "type": "string"
90
+ },
91
+ {
92
+ "type": "null"
93
+ }
94
+ ],
95
+ "description": "Human-readable summary of this Module Graph."
96
+ },
97
+ "path": {
98
+ "type": "string",
99
+ "description": "Canonical project-relative directory rooting this Module Graph. Every member lives below it and every file below it must belong to a member."
100
+ },
101
+ "modules": {
102
+ "type": "object",
103
+ "additionalProperties": {
104
+ "$ref": "#/definitions/Objects_"
105
+ },
106
+ "description": "Every member of this Module Graph, keyed relative to its path. At least two members, at least one exposed, and no member may be Shared.",
107
+ "allOf": [
108
+ {
109
+ "minProperties": 2
110
+ }
111
+ ]
112
+ },
113
+ "rules": {
114
+ "type": "object",
115
+ "additionalProperties": {
116
+ "type": "array",
117
+ "items": {
118
+ "type": "string"
119
+ }
120
+ },
121
+ "description": "Maps a member key to the member keys it may directly depend on. Rules are default-deny and, unlike LayerGraph Rules, are NOT transitive: only declared edges are permitted. They must be acyclic within this Module Graph."
122
+ }
123
+ },
124
+ "required": [
125
+ "path",
126
+ "modules"
127
+ ],
128
+ "additionalProperties": false,
129
+ "title": "Module Graph",
130
+ "description": "A named, bounded set of Modules inside one Layer describing one capability too large for a single Module. Unlike a LayerGraph it is a disjoint unit: its Rules are never unioned with another Graph’s, are not transitive, and are checked for cycles on their own."
131
+ },
132
+ "description": "Every Module Graph in this Layer, keyed by id."
133
+ }
134
+ },
135
+ "required": [
136
+ "paths"
137
+ ],
138
+ "additionalProperties": false,
139
+ "title": "Layer",
140
+ "description": "A named, configured group of project-relative paths, owning the Modules and Module Graphs declared within it."
141
+ },
142
+ "description": "Every Layer in the project, keyed by id, each owning its Modules and Module Graphs.",
143
+ "allOf": [
144
+ {
145
+ "minProperties": 1
146
+ }
147
+ ]
148
+ },
149
+ "layerGraphs": {
150
+ "type": "object",
151
+ "additionalProperties": {
152
+ "type": "object",
153
+ "properties": {
154
+ "description": {
155
+ "anyOf": [
156
+ {
157
+ "type": "string"
158
+ },
159
+ {
160
+ "type": "null"
161
+ }
162
+ ],
163
+ "description": "Human-readable summary of this LayerGraph."
164
+ },
165
+ "rules": {
166
+ "type": "object",
167
+ "additionalProperties": {
168
+ "type": "array",
169
+ "items": {
170
+ "type": "string"
171
+ }
172
+ },
173
+ "description": "Maps a Layer id to the Layer ids it may directly depend on. Rules are default-deny and transitive: a dependency between two Layers with no declared path between them, direct or transitive, is a violation. A Layer with no outgoing rule is a valid, intentional leaf."
174
+ }
175
+ },
176
+ "required": [
177
+ "rules"
178
+ ],
179
+ "additionalProperties": false,
180
+ "title": "LayerGraph",
181
+ "description": "A named set of Rules representing one responsibility (e.g. core architecture, test boundaries). This is an organizational grouping, not an enforcement boundary — enforcement unions every Rule declared across every LayerGraph in the project."
182
+ },
183
+ "description": "Every LayerGraph in the project, keyed by id. An empty set denies every cross-Layer dependency."
184
+ }
185
+ },
186
+ "required": [
187
+ "sourceRoots",
188
+ "layers",
189
+ "layerGraphs"
190
+ ],
191
+ "additionalProperties": false,
192
+ "title": "Laymos Config",
193
+ "description": "Declares a project's Layers, their Modules and Module Graphs, and its LayerGraphs.",
194
+ "definitions": {
195
+ "Objects_": {
196
+ "type": "object",
197
+ "properties": {
198
+ "shared": {
199
+ "type": "boolean",
200
+ "description": "Whether peers in the same Layer may import this Module. Illegal inside a Module Graph, where Rules govern peer access."
201
+ },
202
+ "exposed": {
203
+ "type": "boolean",
204
+ "description": "Whether other Layers may import this Module."
205
+ }
206
+ },
207
+ "additionalProperties": false,
208
+ "title": "Module",
209
+ "description": "A Configured Module keyed by its canonical source file or directory — project-relative when declared in a Layer, Module Graph-relative when declared in a Module Graph. Both flags default to false, so a Module is importable by nobody until it says otherwise."
210
+ }
211
+ }
212
+ }
@@ -1,2 +0,0 @@
1
- export { cli, command, lintPasses } from './run.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC"}
package/dist/cli/index.js DELETED
@@ -1 +0,0 @@
1
- export { cli, command, lintPasses } from './run.js';
@@ -1,3 +0,0 @@
1
- import type { LaymosConfig } from './types.js';
2
- export declare function defineConfig(config: LaymosConfig): LaymosConfig;
3
- //# sourceMappingURL=define-config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"define-config.d.ts","sourceRoot":"","sources":["../../src/config/define-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,YAAY,CAAC;AAG1D,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,YAAY,CAuB/D"}
@@ -1,228 +0,0 @@
1
- import { normalizeConfigPath, pathContains } from './path.js';
2
- export function defineConfig(config) {
3
- const normalizedConfig = {
4
- ...config,
5
- sourceRoots: config.sourceRoots.map(normalizeConfigPath),
6
- ...(config.ignore !== undefined
7
- ? { ignore: config.ignore.map(normalizeConfigPath) }
8
- : {}),
9
- };
10
- const issues = [
11
- ...sourceRootIssues(normalizedConfig),
12
- ...duplicateGraphNames(normalizedConfig),
13
- ...duplicateLayerNames(normalizedConfig),
14
- ...duplicateLayerPaths(normalizedConfig),
15
- ...duplicateIgnoredPaths(normalizedConfig),
16
- ...unionCycles(normalizedConfig),
17
- ...moduleIssues(normalizedConfig),
18
- ];
19
- if (issues.length > 0) {
20
- throw new Error(`Invalid laymos config:\n${issues.map((issue) => ` - ${issue}`).join('\n')}`);
21
- }
22
- return normalizedConfig;
23
- }
24
- function sourceRootIssues(config) {
25
- const issues = [];
26
- for (let index = 0; index < config.sourceRoots.length; index++) {
27
- const root = config.sourceRoots[index];
28
- for (let otherIndex = 0; otherIndex < index; otherIndex++) {
29
- const other = config.sourceRoots[otherIndex];
30
- if (root === other) {
31
- issues.push(`Source root "${root}" is declared more than once`);
32
- }
33
- else if (pathContains(root, other) || pathContains(other, root)) {
34
- issues.push(`Source roots "${other}" and "${root}" overlap`);
35
- }
36
- }
37
- }
38
- if (config.sourceRoots.length === 0) {
39
- issues.push('At least one source root is required');
40
- }
41
- const configuredPaths = [
42
- ...layerPathEntries(config).map(([path]) => ['Layer', path]),
43
- ...(config.modules ?? []).map(({ path }) => ['Module', path]),
44
- ...(config.ignore ?? []).map((path) => ['Ignored', path]),
45
- ];
46
- for (const [kind, path] of configuredPaths) {
47
- if (!config.sourceRoots.some((root) => pathContains(root, path))) {
48
- issues.push(`${kind} path "${path}" is not inside any source root`);
49
- }
50
- }
51
- return issues;
52
- }
53
- function duplicateGraphNames(config) {
54
- const seen = new Set();
55
- const issues = [];
56
- for (const graph of config.graphs) {
57
- if (seen.has(graph.name)) {
58
- issues.push(`Duplicate graph name "${graph.name}"`);
59
- }
60
- seen.add(graph.name);
61
- }
62
- return issues;
63
- }
64
- function duplicateLayerNames(config) {
65
- const seen = new Map();
66
- const issues = [];
67
- for (const graph of config.graphs) {
68
- for (const layer of graph.layers) {
69
- const existing = seen.get(layer.name);
70
- if (existing && existing !== layer) {
71
- issues.push(`Layer name "${layer.name}" has multiple definitions — define the layer once and reuse the value`);
72
- }
73
- seen.set(layer.name, existing ?? layer);
74
- }
75
- }
76
- return issues;
77
- }
78
- function layerPathEntries(config) {
79
- const layers = new Set(config.graphs.flatMap((g) => [...g.layers]));
80
- return [...layers].flatMap((layer) => layer.paths.map((path) => [path, layer.name]));
81
- }
82
- function duplicateLayerPaths(config) {
83
- const seen = new Map();
84
- const issues = [];
85
- for (const [path, layerName] of layerPathEntries(config)) {
86
- const existing = seen.get(path);
87
- if (existing !== undefined && existing !== layerName) {
88
- issues.push(`Path "${path}" is declared by both layers "${existing}" and "${layerName}"`);
89
- }
90
- seen.set(path, existing ?? layerName);
91
- }
92
- return issues;
93
- }
94
- function duplicateIgnoredPaths(config) {
95
- const seen = new Set();
96
- const issues = [];
97
- for (const path of config.ignore ?? []) {
98
- if (seen.has(path))
99
- issues.push(`Duplicate ignored path "${path}"`);
100
- seen.add(path);
101
- }
102
- return issues;
103
- }
104
- function moduleIssues(config) {
105
- const issues = [];
106
- const layerPaths = layerPathEntries(config);
107
- const modules = new Map();
108
- for (const def of config.modules ?? []) {
109
- const path = def.path;
110
- const existing = modules.get(path);
111
- if (existing !== undefined) {
112
- issues.push(`Module "${path}" is declared more than once`);
113
- }
114
- else
115
- modules.set(path, def);
116
- }
117
- const paths = [...modules.keys()];
118
- for (let i = 0; i < paths.length; i++) {
119
- for (let j = i + 1; j < paths.length; j++) {
120
- const [a, b] = [paths[i], paths[j]];
121
- if (pathContains(a, b) || pathContains(b, a)) {
122
- issues.push(`Modules "${a}" and "${b}" nest — modules must be flat`);
123
- }
124
- }
125
- }
126
- for (const path of paths) {
127
- let best;
128
- for (const [layerPath, layerName] of layerPaths) {
129
- if (pathContains(layerPath, path) &&
130
- (best === undefined || layerPath.length > best[0].length)) {
131
- best = [layerPath, layerName];
132
- }
133
- }
134
- if (best === undefined) {
135
- issues.push(`Module "${path}" is not inside any layer`);
136
- continue;
137
- }
138
- for (const [layerPath, layerName] of layerPaths) {
139
- if (path !== layerPath &&
140
- pathContains(path, layerPath) &&
141
- layerName !== best[1]) {
142
- issues.push(`Layer "${layerName}" has path "${layerPath}" inside module "${path}" — the module would straddle layers`);
143
- }
144
- }
145
- }
146
- const seenRules = new Set();
147
- for (const rule of config.moduleRules ?? []) {
148
- const from = rule.module.path;
149
- if (seenRules.has(from)) {
150
- issues.push(`Module "${from}" has more than one rules declaration`);
151
- }
152
- seenRules.add(from);
153
- if (modules.get(from) !== rule.module) {
154
- issues.push(`Rules module "${from}" must reuse a value declared in config.modules`);
155
- }
156
- for (const [ruleName, definitions] of [
157
- ['canImport', rule.canImport ?? []],
158
- ['canImportedBy', rule.canImportedBy ?? []],
159
- ]) {
160
- const seenTargets = new Set();
161
- for (const def of definitions) {
162
- const to = def.path;
163
- if (seenTargets.has(to)) {
164
- issues.push(`Rule ${ruleName} on module "${from}" references module "${to}" more than once`);
165
- }
166
- seenTargets.add(to);
167
- if (modules.get(to) !== def) {
168
- issues.push(`Rule ${ruleName} on module "${from}" must reuse module "${to}" from config.modules`);
169
- }
170
- }
171
- }
172
- }
173
- return issues;
174
- }
175
- function unionCycles(config) {
176
- const adjacency = new Map();
177
- for (const graph of config.graphs) {
178
- for (const edge of graph.edges) {
179
- if (!adjacency.has(edge.from.name)) {
180
- adjacency.set(edge.from.name, new Set());
181
- }
182
- adjacency.get(edge.from.name).add(edge.to.name);
183
- if (!adjacency.has(edge.to.name)) {
184
- adjacency.set(edge.to.name, new Set());
185
- }
186
- }
187
- }
188
- const index = new Map();
189
- const lowLink = new Map();
190
- const onStack = new Set();
191
- const stack = [];
192
- const cycles = [];
193
- let counter = 0;
194
- const visit = (node) => {
195
- index.set(node, counter);
196
- lowLink.set(node, counter);
197
- counter++;
198
- stack.push(node);
199
- onStack.add(node);
200
- for (const next of adjacency.get(node) ?? []) {
201
- if (!index.has(next)) {
202
- visit(next);
203
- lowLink.set(node, Math.min(lowLink.get(node), lowLink.get(next)));
204
- }
205
- else if (onStack.has(next)) {
206
- lowLink.set(node, Math.min(lowLink.get(node), index.get(next)));
207
- }
208
- }
209
- if (lowLink.get(node) === index.get(node)) {
210
- const component = [];
211
- let popped;
212
- do {
213
- popped = stack.pop();
214
- onStack.delete(popped);
215
- component.push(popped);
216
- } while (popped !== node);
217
- if (component.length > 1) {
218
- cycles.push(component.reverse());
219
- }
220
- }
221
- };
222
- for (const node of adjacency.keys()) {
223
- if (!index.has(node)) {
224
- visit(node);
225
- }
226
- }
227
- return cycles.map((cycle) => `Union cycle: ${cycle.join(' -> ')} -> ${cycle[0]}`);
228
- }
@@ -1,5 +0,0 @@
1
- export { defineConfig } from './define-config.js';
2
- export { edge, layerGraph } from './layer-graph.js';
3
- export { layer } from './layer.js';
4
- export { module, rules } from './module.js';
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC"}
@@ -1,4 +0,0 @@
1
- export { defineConfig } from './define-config.js';
2
- export { edge, layerGraph } from './layer-graph.js';
3
- export { layer } from './layer.js';
4
- export { module, rules } from './module.js';
@@ -1,7 +0,0 @@
1
- import type { Layer, LayerEdge, LayerGraph } from './types.js';
2
- export declare function edge(from: Layer, to: Layer): LayerEdge;
3
- export declare function edge(from: Layer, to: readonly Layer[]): LayerEdge[];
4
- export declare function layerGraph(name: string, edges: ReadonlyArray<LayerEdge | LayerEdge[]>, options?: {
5
- description?: string;
6
- }): LayerGraph;
7
- //# sourceMappingURL=layer-graph.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"layer-graph.d.ts","sourceRoot":"","sources":["../../src/config/layer-graph.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE/D,wBAAgB,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,GAAG,SAAS,CAAC;AACxD,wBAAgB,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,KAAK,EAAE,GAAG,SAAS,EAAE,CAAC;AAqBrE,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,aAAa,CAAC,SAAS,GAAG,SAAS,EAAE,CAAC,EAC7C,OAAO,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GACjC,UAAU,CA6CZ"}