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,290 @@
1
+ import { existsSync, readFileSync } from 'node:fs';
2
+ import { dirname, join, relative, resolve, sep } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ import { Cause, Effect, Exit, Stream } from 'effect';
5
+ import { NodeServices } from '@effect/platform-node';
6
+ import { tsImport } from 'tsx/esm/api';
7
+ import { isStory, isStoryGroup, StoryContext, } from '../../story/index.js';
8
+ import { slugifyQuestion } from '../../story/schema/index.js';
9
+ import { ConfigService, ConfigServiceLive, } from '../../services/config/index.js';
10
+ import { extractSnippets, storySnippets, } from './extract-snippets.js';
11
+ import { StoriesError } from './errors.js';
12
+ export function getStoryTree(configPath) {
13
+ return Effect.map(loadRoot(configPath), ({ tree }) => tree);
14
+ }
15
+ const DEFAULT_CONCURRENCY = 16;
16
+ export function planStories(configPath, options) {
17
+ return Effect.gen(function* () {
18
+ const { stories } = yield* loadRoot(configPath);
19
+ const planned = yield* scopeStories(stories, options?.scope);
20
+ return {
21
+ total: planned.length,
22
+ reports: runEachStory(planned, options?.concurrency ?? DEFAULT_CONCURRENCY),
23
+ };
24
+ });
25
+ }
26
+ export function runStories(configPath, options) {
27
+ return Stream.unwrap(Effect.map(planStories(configPath, options), ({ reports }) => reports));
28
+ }
29
+ function runEachStory(stories, concurrency) {
30
+ // Ordered concurrent mapping needs three slots; anything less runs one at a time.
31
+ return Stream.fromArray(stories).pipe(Stream.mapEffect(runStory, concurrency >= 3 ? { concurrency } : undefined));
32
+ }
33
+ function scopeStories(stories, scope) {
34
+ if (scope === undefined)
35
+ return Effect.succeed(stories);
36
+ const scoped = stories.filter(({ id }) => id === scope || id.startsWith(`${scope}/`));
37
+ if (scoped.length === 0) {
38
+ return Effect.fail(new StoriesError({ reason: 'unknown-scope', path: scope, cause: null }));
39
+ }
40
+ return Effect.succeed(scoped);
41
+ }
42
+ function loadRoot(configPath) {
43
+ return Effect.gen(function* () {
44
+ const absoluteConfigPath = resolve(configPath);
45
+ const configService = yield* ConfigService;
46
+ const config = yield* configService.read(absoluteConfigPath);
47
+ if (config.storiesPath === undefined) {
48
+ return yield* new StoriesError({
49
+ reason: 'no-stories-path',
50
+ path: absoluteConfigPath,
51
+ cause: null,
52
+ });
53
+ }
54
+ const storiesRoot = join(dirname(absoluteConfigPath), config.storiesPath);
55
+ const entryPoint = join(storiesRoot, 'index.ts');
56
+ const barrel = yield* Effect.tryPromise({
57
+ try: () => tsImport(entryPoint, import.meta.url),
58
+ catch: (cause) => new StoriesError({ reason: 'load', path: entryPoint, cause }),
59
+ });
60
+ const root = barrel.default;
61
+ if (!isStoryGroup(root)) {
62
+ return yield* new StoriesError({
63
+ reason: 'invalid-root',
64
+ path: entryPoint,
65
+ cause: null,
66
+ });
67
+ }
68
+ return yield* indexGroup(root, [root.title], entryPoint, {
69
+ projectRoot: dirname(absoluteConfigPath),
70
+ storiesRoot,
71
+ supportCache: new Map(),
72
+ });
73
+ }).pipe(Effect.provide(ConfigServiceLive), Effect.provide(NodeServices.layer));
74
+ }
75
+ function indexGroup(group, path, entryPoint, options) {
76
+ return Effect.gen(function* () {
77
+ yield* checkUniqueTitles(group.children, path, entryPoint);
78
+ const groups = [];
79
+ const leaves = [];
80
+ const stories = [];
81
+ for (const child of group.children) {
82
+ const id = [...path, child.title].join('/');
83
+ if (isStory(child)) {
84
+ const source = yield* loadStorySource(child, options.projectRoot);
85
+ const snippets = extractSnippets(source.path, source.content);
86
+ const questions = yield* indexQuestions(child, source, storySnippets(snippets, child.title));
87
+ leaves.push({
88
+ id,
89
+ title: child.title,
90
+ setup: snippets.setup,
91
+ questions,
92
+ source,
93
+ support: resolveSupport(child, options),
94
+ });
95
+ stories.push({ id, story: child });
96
+ }
97
+ else {
98
+ const indexed = yield* indexGroup(child, [...path, child.title], entryPoint, options);
99
+ groups.push(indexed.tree);
100
+ stories.push(...indexed.stories);
101
+ }
102
+ }
103
+ return {
104
+ tree: { title: group.title, groups, stories: leaves },
105
+ stories,
106
+ };
107
+ });
108
+ }
109
+ function indexQuestions(story, source, snippets) {
110
+ return Effect.gen(function* () {
111
+ const seen = new Set();
112
+ const leaves = [];
113
+ for (const [index, question] of story.questions.entries()) {
114
+ const slug = slugifyQuestion(question.question);
115
+ if (seen.has(slug)) {
116
+ return yield* new StoriesError({
117
+ reason: 'duplicate-question',
118
+ path: source.path,
119
+ cause: question.question,
120
+ });
121
+ }
122
+ seen.add(slug);
123
+ const snippet = snippets.proofs.get(question.question) ?? snippets.orderedProofs[index];
124
+ if (snippet === undefined) {
125
+ return yield* new StoriesError({
126
+ reason: 'snippet-extraction',
127
+ path: source.path,
128
+ cause: question.question,
129
+ });
130
+ }
131
+ leaves.push({
132
+ slug,
133
+ question: question.question,
134
+ answer: question.answer,
135
+ snippet,
136
+ });
137
+ }
138
+ return leaves;
139
+ });
140
+ }
141
+ function loadStorySource(story, projectRoot) {
142
+ return Effect.try({
143
+ try: () => {
144
+ const filePath = fileURLToPath(story.sourceUrl);
145
+ return {
146
+ path: relative(projectRoot, filePath),
147
+ content: readFileSync(filePath, 'utf8'),
148
+ };
149
+ },
150
+ catch: (cause) => new StoriesError({ reason: 'load', path: story.sourceUrl, cause }),
151
+ });
152
+ }
153
+ const SUPPORT_FILE = 'support.ts';
154
+ function resolveSupport(story, options) {
155
+ const { projectRoot, storiesRoot, supportCache } = options;
156
+ let directory;
157
+ try {
158
+ directory = dirname(fileURLToPath(story.sourceUrl));
159
+ }
160
+ catch {
161
+ return null;
162
+ }
163
+ const root = resolve(storiesRoot);
164
+ const visited = [];
165
+ let found = null;
166
+ while (directory === root || directory.startsWith(`${root}${sep}`)) {
167
+ const cached = supportCache.get(directory);
168
+ if (cached !== undefined) {
169
+ found = cached;
170
+ break;
171
+ }
172
+ visited.push(directory);
173
+ const candidate = join(directory, SUPPORT_FILE);
174
+ if (existsSync(candidate)) {
175
+ found = {
176
+ path: relative(projectRoot, candidate),
177
+ content: readFileSync(candidate, 'utf8'),
178
+ };
179
+ break;
180
+ }
181
+ directory = dirname(directory);
182
+ }
183
+ for (const cachedDirectory of visited) {
184
+ supportCache.set(cachedDirectory, found);
185
+ }
186
+ return found;
187
+ }
188
+ function checkUniqueTitles(children, path, entryPoint) {
189
+ const seen = new Set();
190
+ for (const child of children) {
191
+ if (seen.has(child.title)) {
192
+ return new StoriesError({
193
+ reason: 'duplicate-title',
194
+ path: entryPoint,
195
+ cause: [...path, child.title].join('/'),
196
+ });
197
+ }
198
+ seen.add(child.title);
199
+ }
200
+ return Effect.void;
201
+ }
202
+ function runStory({ id, story }) {
203
+ return Effect.gen(function* () {
204
+ const questions = [];
205
+ for (const question of story.questions) {
206
+ questions.push(yield* runQuestion(question));
207
+ }
208
+ const verdict = questions.some(({ verdict }) => verdict === 'errored')
209
+ ? 'errored'
210
+ : questions.some(({ verdict }) => verdict === 'failed')
211
+ ? 'failed'
212
+ : 'passed';
213
+ return { id, verdict, questions };
214
+ });
215
+ }
216
+ function runQuestion(question) {
217
+ return Effect.gen(function* () {
218
+ const sections = [];
219
+ const assertions = [];
220
+ const exit = yield* question.proof.pipe(Effect.provideService(StoryContext, {
221
+ beginSection: (section) => Effect.sync(() => {
222
+ sections.push(section);
223
+ }),
224
+ assert: (description, passed) => Effect.sync(() => {
225
+ assertions.push({ description, passed });
226
+ }),
227
+ }), Effect.exit);
228
+ const slug = slugifyQuestion(question.question);
229
+ if (Exit.isFailure(exit)) {
230
+ return {
231
+ slug,
232
+ verdict: 'errored',
233
+ error: Cause.pretty(exit.cause),
234
+ assertions,
235
+ sections,
236
+ };
237
+ }
238
+ const failed = assertions.some((assertion) => !assertion.passed);
239
+ return {
240
+ slug,
241
+ verdict: failed ? 'failed' : 'passed',
242
+ result: toJsonValue(exit.value),
243
+ assertions,
244
+ sections,
245
+ };
246
+ });
247
+ }
248
+ function toJsonValue(value, ancestors = new Set()) {
249
+ if (value === null || value === undefined)
250
+ return null;
251
+ switch (typeof value) {
252
+ case 'string':
253
+ return value;
254
+ case 'number':
255
+ return Number.isFinite(value) ? value : String(value);
256
+ case 'boolean':
257
+ return value;
258
+ case 'bigint':
259
+ case 'function':
260
+ case 'symbol':
261
+ return String(value);
262
+ }
263
+ const object = value;
264
+ if (ancestors.has(object))
265
+ return '[circular]';
266
+ ancestors.add(object);
267
+ const json = toJsonObject(object, ancestors);
268
+ ancestors.delete(object);
269
+ return json;
270
+ }
271
+ function toJsonObject(object, ancestors) {
272
+ if (Array.isArray(object)) {
273
+ return object.map((item) => toJsonValue(item, ancestors));
274
+ }
275
+ if (object instanceof Date)
276
+ return object.toISOString();
277
+ if (object instanceof Map) {
278
+ return [...object.entries()].map(([key, item]) => [
279
+ toJsonValue(key, ancestors),
280
+ toJsonValue(item, ancestors),
281
+ ]);
282
+ }
283
+ if (object instanceof Set) {
284
+ return [...object.values()].map((item) => toJsonValue(item, ancestors));
285
+ }
286
+ return Object.fromEntries(Object.entries(object).map(([key, item]) => [
287
+ key,
288
+ toJsonValue(item, ancestors),
289
+ ]));
290
+ }
@@ -0,0 +1,12 @@
1
+ import { Context, Effect, FileSystem, Layer } from 'effect';
2
+ import { type Config } from '../../domain/project-config/index.js';
3
+ import { ConfigError } from './errors.js';
4
+ declare const ConfigService_base: Context.ServiceClass<ConfigService, "ConfigService", {
5
+ readonly read: (filePath: string) => Effect.Effect<Config, ConfigError>;
6
+ }>;
7
+ export declare class ConfigService extends ConfigService_base {
8
+ static jsonSchema(): Readonly<Record<string, unknown>>;
9
+ }
10
+ export declare const ConfigServiceLive: Layer.Layer<ConfigService, never, FileSystem.FileSystem>;
11
+ export {};
12
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/services/config/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE5D,OAAO,EAGL,KAAK,MAAM,EAEZ,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;;mBAKvB,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC;;AAH3E,qBAAa,aAAc,SAAQ,kBAKf;IAClB,MAAM,CAAC,UAAU,IAAI,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAErD;CACF;AAED,eAAO,MAAM,iBAAiB,0DAyD7B,CAAC"}
@@ -0,0 +1,46 @@
1
+ import { Context, Effect, FileSystem, Layer } from 'effect';
2
+ import { decodeProjectConfig, projectConfigJsonSchema, validateConfig, } from '../../domain/project-config/index.js';
3
+ import { ConfigError } from './errors.js';
4
+ export class ConfigService extends Context.Service()('ConfigService') {
5
+ static jsonSchema() {
6
+ return projectConfigJsonSchema();
7
+ }
8
+ }
9
+ export const ConfigServiceLive = Layer.effect(ConfigService, Effect.gen(function* () {
10
+ const fs = yield* FileSystem.FileSystem;
11
+ return {
12
+ read: (filePath) => Effect.gen(function* () {
13
+ const raw = yield* fs.readFileString(filePath).pipe(Effect.mapError((cause) => new ConfigError({
14
+ reason: 'read',
15
+ filePath,
16
+ cause,
17
+ issues: [],
18
+ })));
19
+ const json = yield* Effect.try({
20
+ try: () => JSON.parse(raw),
21
+ catch: (cause) => new ConfigError({
22
+ reason: 'parse',
23
+ filePath,
24
+ cause,
25
+ issues: [],
26
+ }),
27
+ });
28
+ const decoded = yield* decodeProjectConfig(json).pipe(Effect.mapError((cause) => new ConfigError({
29
+ reason: 'schema',
30
+ filePath,
31
+ cause,
32
+ issues: [],
33
+ })));
34
+ const issues = validateConfig(decoded);
35
+ if (issues.length > 0) {
36
+ return yield* new ConfigError({
37
+ reason: 'validation',
38
+ filePath,
39
+ cause: issues,
40
+ issues,
41
+ });
42
+ }
43
+ return decoded;
44
+ }).pipe(Effect.withSpan('config.read')),
45
+ };
46
+ }));
@@ -0,0 +1,13 @@
1
+ import type { ConfigValidationIssue } from '../../domain/project-config/index.js';
2
+ declare const ConfigError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
3
+ readonly _tag: "ConfigError";
4
+ } & Readonly<A>;
5
+ export declare class ConfigError extends ConfigError_base<{
6
+ readonly reason: 'read' | 'parse' | 'schema' | 'validation';
7
+ readonly filePath: string;
8
+ readonly cause: unknown;
9
+ readonly issues: readonly ConfigValidationIssue[];
10
+ }> {
11
+ }
12
+ export {};
13
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/services/config/errors.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;;;;AAElF,qBAAa,WAAY,SAAQ,iBAAgC;IAC/D,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,YAAY,CAAC;IAC5D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,SAAS,qBAAqB,EAAE,CAAC;CACnD,CAAC;CAAG"}
@@ -0,0 +1,3 @@
1
+ import { Data } from 'effect';
2
+ export class ConfigError extends Data.TaggedError('ConfigError') {
3
+ }
@@ -0,0 +1,4 @@
1
+ export { ConfigService } from './config.js';
2
+ export { ConfigServiceLive } from './config.js';
3
+ export { ConfigError } from './errors.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/config/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,7 @@
1
+ // Service tag callers yield to obtain the config service. Also exposes the
2
+ // static `jsonSchema()` for the published JSON Schema of laymos.config.json.
3
+ export { ConfigService } from './config.js';
4
+ // Live layer providing ConfigService via the platform FileSystem.
5
+ export { ConfigServiceLive } from './config.js';
6
+ // Tagged error callers pattern-match on when a read fails.
7
+ export { ConfigError } from './errors.js';
@@ -0,0 +1,10 @@
1
+ declare const CruiseError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
2
+ readonly _tag: "CruiseError";
3
+ } & Readonly<A>;
4
+ export declare class CruiseError extends CruiseError_base<{
5
+ readonly baseDir: string;
6
+ readonly cause: unknown;
7
+ }> {
8
+ }
9
+ export {};
10
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/services/file-cruiser/errors.ts"],"names":[],"mappings":";;;AAEA,qBAAa,WAAY,SAAQ,iBAAgC;IAC/D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB,CAAC;CAAG"}
@@ -0,0 +1,3 @@
1
+ import { Data } from 'effect';
2
+ export class CruiseError extends Data.TaggedError('CruiseError') {
3
+ }
@@ -0,0 +1,11 @@
1
+ import { Context, Effect, Layer } from 'effect';
2
+ import type { FileGraph } from '../../domain/file-graph/index.js';
3
+ import type { CruiseError } from './errors.js';
4
+ declare const Cruiser_base: Context.ServiceClass<Cruiser, "Cruiser", {
5
+ readonly cruise: (baseDir: string, sourceRoots: readonly string[], ignoredPaths?: readonly string[]) => Effect.Effect<FileGraph, CruiseError>;
6
+ }>;
7
+ export declare class Cruiser extends Cruiser_base {
8
+ }
9
+ export declare const CruiserLive: Layer.Layer<Cruiser, never, never>;
10
+ export {};
11
+ //# sourceMappingURL=file-cruiser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-cruiser.d.ts","sourceRoot":"","sources":["../../../src/services/file-cruiser/file-cruiser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAEhD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;;qBAM1B,CACf,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,KAC7B,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,WAAW,CAAC;;AAP9C,qBAAa,OAAQ,SAAQ,YASf;CAAG;AAEjB,eAAO,MAAM,WAAW,oCAGtB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { Context, Layer } from 'effect';
2
+ import { buildFileGraph } from './oxc/index.js';
3
+ export class Cruiser extends Context.Service()('Cruiser') {
4
+ }
5
+ export const CruiserLive = Layer.succeed(Cruiser)({
6
+ cruise: (baseDir, sourceRoots, ignoredPaths = []) => buildFileGraph(baseDir, sourceRoots, ignoredPaths),
7
+ });
@@ -0,0 +1,4 @@
1
+ export { Cruiser } from './file-cruiser.js';
2
+ export { CruiserLive } from './file-cruiser.js';
3
+ export { CruiseError } from './errors.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/file-cruiser/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,6 @@
1
+ // Service tag callers yield to obtain the cruiser.
2
+ export { Cruiser } from './file-cruiser.js';
3
+ // Live layer providing Cruiser via oxc-parser/oxc-resolver.
4
+ export { CruiserLive } from './file-cruiser.js';
5
+ // Tagged error callers pattern-match on when a cruise fails.
6
+ export { CruiseError } from './errors.js';
@@ -0,0 +1,5 @@
1
+ export declare const sourceExtensions: string[];
2
+ export declare function listSourceFiles(baseDir: string, sourceRoots: readonly string[]): Promise<string[]>;
3
+ export declare function pathContains(parent: string, child: string): boolean;
4
+ export declare function toPosixPath(path: string): string;
5
+ //# sourceMappingURL=file-scanner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-scanner.d.ts","sourceRoot":"","sources":["../../../../src/services/file-cruiser/oxc/file-scanner.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,gBAAgB,UAAiD,CAAC;AAE/E,wBAAsB,eAAe,CACnC,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,SAAS,MAAM,EAAE,GAC7B,OAAO,CAAC,MAAM,EAAE,CAAC,CAsBnB;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAEnE;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEhD"}
@@ -0,0 +1,54 @@
1
+ import { readdir, stat } from 'node:fs/promises';
2
+ import { relative, resolve, sep } from 'node:path';
3
+ import { Schema } from 'effect';
4
+ const MissingFileErrorSchema = Schema.Struct({
5
+ code: Schema.Literal('ENOENT'),
6
+ });
7
+ export const sourceExtensions = ['.ts', '.tsx', '.js', '.jsx', '.mjs', '.cjs'];
8
+ export async function listSourceFiles(baseDir, sourceRoots) {
9
+ const files = new Set();
10
+ for (const sourceRoot of sourceRoots) {
11
+ const absolute = resolve(baseDir, sourceRoot);
12
+ const sourceRootStat = await statOrUndefined(absolute);
13
+ if (sourceRootStat?.isFile()) {
14
+ if (isSupportedSourceFile(sourceRoot))
15
+ files.add(sourceRoot);
16
+ continue;
17
+ }
18
+ if (!sourceRootStat?.isDirectory())
19
+ continue;
20
+ const entries = await readdir(absolute, {
21
+ recursive: true,
22
+ withFileTypes: true,
23
+ });
24
+ for (const entry of entries) {
25
+ if (!entry.isFile() || !isSupportedSourceFile(entry.name))
26
+ continue;
27
+ files.add(toPosixPath(relative(baseDir, resolve(entry.parentPath, entry.name))));
28
+ }
29
+ }
30
+ return [...files].sort();
31
+ }
32
+ export function pathContains(parent, child) {
33
+ return parent === '.' || child === parent || child.startsWith(`${parent}/`);
34
+ }
35
+ export function toPosixPath(path) {
36
+ return sep === '/' ? path : path.split(sep).join('/');
37
+ }
38
+ async function statOrUndefined(path) {
39
+ try {
40
+ return await stat(path);
41
+ }
42
+ catch (cause) {
43
+ if (Schema.is(MissingFileErrorSchema)(cause)) {
44
+ return undefined;
45
+ }
46
+ throw cause;
47
+ }
48
+ }
49
+ function isSupportedSourceFile(path) {
50
+ return (sourceExtensions.some((extension) => path.endsWith(extension)) &&
51
+ !path.endsWith('.d.ts') &&
52
+ !/\.(?:test|spec)\.[cm]?[jt]sx?$/.test(path) &&
53
+ !/\.min\.(?:[cm]?js|jsx)$/.test(path));
54
+ }
@@ -0,0 +1,5 @@
1
+ import { ResolverFactory } from 'oxc-resolver';
2
+ export declare function createResolver(): ResolverFactory;
3
+ export declare function extractSpecifiers(absolutePath: string): Promise<string[]>;
4
+ export declare function resolveSpecifier(resolver: ResolverFactory, baseDir: string, eligible: ReadonlySet<string>, fromFile: string, specifier: string): string | undefined;
5
+ //# sourceMappingURL=import-resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"import-resolver.d.ts","sourceRoot":"","sources":["../../../../src/services/file-cruiser/oxc/import-resolver.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAI/C,wBAAgB,cAAc,IAAI,eAAe,CAWhD;AAED,wBAAsB,iBAAiB,CACrC,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,MAAM,EAAE,CAAC,CAenB;AAED,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,EAC7B,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,GAChB,MAAM,GAAG,SAAS,CAUpB"}
@@ -0,0 +1,44 @@
1
+ import { readFile } from 'node:fs/promises';
2
+ import { relative, sep } from 'node:path';
3
+ import { parseSync } from 'oxc-parser';
4
+ import { ResolverFactory } from 'oxc-resolver';
5
+ import { sourceExtensions, toPosixPath } from './file-scanner.js';
6
+ export function createResolver() {
7
+ return new ResolverFactory({
8
+ tsconfig: 'auto',
9
+ extensions: sourceExtensions,
10
+ extensionAlias: {
11
+ '.js': ['.ts', '.tsx', '.js'],
12
+ '.jsx': ['.tsx', '.jsx'],
13
+ '.mjs': ['.mts', '.mjs'],
14
+ '.cjs': ['.cts', '.cjs'],
15
+ },
16
+ });
17
+ }
18
+ export async function extractSpecifiers(absolutePath) {
19
+ const sourceText = await readFile(absolutePath, 'utf8');
20
+ const result = parseSync(absolutePath, sourceText);
21
+ const specifiers = [];
22
+ for (const staticImport of result.module.staticImports) {
23
+ specifiers.push(staticImport.moduleRequest.value);
24
+ }
25
+ for (const staticExport of result.module.staticExports) {
26
+ for (const entry of staticExport.entries) {
27
+ if (entry.moduleRequest !== null) {
28
+ specifiers.push(entry.moduleRequest.value);
29
+ }
30
+ }
31
+ }
32
+ return specifiers;
33
+ }
34
+ export function resolveSpecifier(resolver, baseDir, eligible, fromFile, specifier) {
35
+ const result = resolver.resolveFileSync(fromFile, specifier);
36
+ if (result.builtin !== undefined || result.path === undefined) {
37
+ return undefined;
38
+ }
39
+ if (result.path.split(sep).includes('node_modules')) {
40
+ return undefined;
41
+ }
42
+ const relativePath = toPosixPath(relative(baseDir, result.path));
43
+ return eligible.has(relativePath) ? relativePath : undefined;
44
+ }
@@ -0,0 +1,2 @@
1
+ export { buildFileGraph } from './oxc.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/file-cruiser/oxc/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,2 @@
1
+ // Builds the raw file-dependency graph using oxc-parser and oxc-resolver.
2
+ export { buildFileGraph } from './oxc.js';
@@ -0,0 +1,5 @@
1
+ import { Effect } from 'effect';
2
+ import type { FileGraph } from '../../../domain/file-graph/index.js';
3
+ import { CruiseError } from '../errors.js';
4
+ export declare function buildFileGraph(baseDir: string, sourceRoots: readonly string[], ignoredPaths: readonly string[]): Effect.Effect<FileGraph, CruiseError>;
5
+ //# sourceMappingURL=oxc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oxc.d.ts","sourceRoot":"","sources":["../../../../src/services/file-cruiser/oxc/oxc.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAQ3C,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,YAAY,EAAE,SAAS,MAAM,EAAE,GAC9B,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,WAAW,CAAC,CAoCvC"}
@@ -0,0 +1,29 @@
1
+ import { realpath } from 'node:fs/promises';
2
+ import { resolve } from 'node:path';
3
+ import { Effect } from 'effect';
4
+ import { CruiseError } from '../errors.js';
5
+ import { listSourceFiles, pathContains } from './file-scanner.js';
6
+ import { createResolver, extractSpecifiers, resolveSpecifier, } from './import-resolver.js';
7
+ export function buildFileGraph(baseDir, sourceRoots, ignoredPaths) {
8
+ return Effect.tryPromise({
9
+ try: async () => {
10
+ const realBaseDir = await realpath(baseDir);
11
+ const files = await listSourceFiles(realBaseDir, sourceRoots);
12
+ const eligibleFiles = files.filter((path) => !ignoredPaths.some((ignored) => pathContains(ignored, path)));
13
+ const eligible = new Set(eligibleFiles);
14
+ const imports = new Map(eligibleFiles.map((path) => [path, new Set()]));
15
+ const resolver = createResolver();
16
+ for (const path of eligibleFiles) {
17
+ const absolute = resolve(realBaseDir, path);
18
+ const specifiers = await extractSpecifiers(absolute);
19
+ for (const specifier of specifiers) {
20
+ const to = resolveSpecifier(resolver, realBaseDir, eligible, absolute, specifier);
21
+ if (to !== undefined)
22
+ imports.get(path).add(to);
23
+ }
24
+ }
25
+ return new Map(eligibleFiles.map((path) => [path, [...imports.get(path)].sort()]));
26
+ },
27
+ catch: (cause) => new CruiseError({ baseDir, cause }),
28
+ }).pipe(Effect.withSpan('dependencies.extract'));
29
+ }
@@ -0,0 +1,4 @@
1
+ import type { ChangeSet, DiffHunk } from '../../change-set-schema/index.js';
2
+ export declare function readChangeSet(baseDir: string, baseRef: string): Promise<ChangeSet>;
3
+ export declare function readFileDiff(baseDir: string, baseRef: string, path: string): Promise<readonly DiffHunk[]>;
4
+ //# sourceMappingURL=changed-paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"changed-paths.d.ts","sourceRoot":"","sources":["../../../src/services/git/changed-paths.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,SAAS,EAET,QAAQ,EACT,MAAM,kCAAkC,CAAC;AAY1C,wBAAsB,aAAa,CACjC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,SAAS,CAAC,CA+BpB;AA8CD,wBAAsB,YAAY,CAChC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,SAAS,QAAQ,EAAE,CAAC,CAiB9B"}