laymos 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +137 -710
- package/bin/laymos.mjs +2 -0
- package/dist/architecture/analyze-project/analyze-project.d.ts +9 -0
- package/dist/architecture/analyze-project/analyze-project.d.ts.map +1 -0
- package/dist/architecture/analyze-project/analyze-project.js +47 -0
- package/dist/architecture/analyze-project/index.d.ts +3 -0
- package/dist/architecture/analyze-project/index.d.ts.map +1 -0
- package/dist/architecture/analyze-project/index.js +1 -0
- package/dist/architecture/build-report/build-report.d.ts +7 -0
- package/dist/architecture/build-report/build-report.d.ts.map +1 -0
- package/dist/{engine/4-emit/emit.js → architecture/build-report/build-report.js} +12 -9
- package/dist/architecture/build-report/index.d.ts +2 -0
- package/dist/architecture/build-report/index.d.ts.map +1 -0
- package/dist/architecture/build-report/index.js +1 -0
- package/dist/architecture/errors.d.ts +11 -0
- package/dist/architecture/errors.d.ts.map +1 -0
- package/dist/{engine → architecture}/errors.js +0 -2
- package/dist/{engine/1-extract/extract.d.ts → architecture/extract-dependencies/extract-dependencies.d.ts} +1 -1
- package/dist/architecture/extract-dependencies/extract-dependencies.d.ts.map +1 -0
- package/dist/{engine/1-extract/extract.js → architecture/extract-dependencies/extract-dependencies.js} +13 -11
- package/dist/architecture/extract-dependencies/index.d.ts +3 -0
- package/dist/architecture/extract-dependencies/index.d.ts.map +1 -0
- package/dist/architecture/extract-dependencies/index.js +1 -0
- package/dist/architecture/resolve-architecture/index.d.ts +3 -0
- package/dist/architecture/resolve-architecture/index.d.ts.map +1 -0
- package/dist/architecture/resolve-architecture/index.js +1 -0
- package/dist/{engine/2-resolve/resolve.d.ts → architecture/resolve-architecture/resolve-architecture.d.ts} +2 -2
- package/dist/architecture/resolve-architecture/resolve-architecture.d.ts.map +1 -0
- package/dist/{engine/2-resolve/resolve.js → architecture/resolve-architecture/resolve-architecture.js} +1 -1
- package/dist/architecture/validate-rules/index.d.ts +3 -0
- package/dist/architecture/validate-rules/index.d.ts.map +1 -0
- package/dist/architecture/validate-rules/index.js +1 -0
- package/dist/{engine/3-evaluate/evaluate.d.ts → architecture/validate-rules/validate-rules.d.ts} +4 -4
- package/dist/architecture/validate-rules/validate-rules.d.ts.map +1 -0
- package/dist/{engine/3-evaluate/evaluate.js → architecture/validate-rules/validate-rules.js} +2 -2
- package/dist/architecture-analysis-schema/architecture-analysis-schema.d.ts +109 -0
- package/dist/architecture-analysis-schema/architecture-analysis-schema.d.ts.map +1 -0
- package/dist/architecture-analysis-schema/architecture-analysis-schema.js +10 -0
- package/dist/architecture-analysis-schema/index.d.ts +7 -0
- package/dist/architecture-analysis-schema/index.d.ts.map +1 -0
- package/dist/architecture-analysis-schema/index.js +3 -0
- package/dist/architecture-analysis-schema/layer-analysis-schema.d.ts +27 -0
- package/dist/architecture-analysis-schema/layer-analysis-schema.d.ts.map +1 -0
- package/dist/architecture-analysis-schema/layer-analysis-schema.js +18 -0
- package/dist/architecture-analysis-schema/module-analysis-schema.d.ts +150 -0
- package/dist/architecture-analysis-schema/module-analysis-schema.d.ts.map +1 -0
- package/dist/architecture-analysis-schema/module-analysis-schema.js +96 -0
- package/dist/architecture-analysis-schema/module-source-schema.d.ts +16 -0
- package/dist/architecture-analysis-schema/module-source-schema.d.ts.map +1 -0
- package/dist/architecture-analysis-schema/module-source-schema.js +10 -0
- package/dist/architecture-analysis-schema/project-config-schema.d.ts +51 -0
- package/dist/architecture-analysis-schema/project-config-schema.d.ts.map +1 -0
- package/dist/architecture-analysis-schema/project-config-schema.js +110 -0
- package/dist/change-set-schema/change-set-schema.d.ts +55 -0
- package/dist/change-set-schema/change-set-schema.d.ts.map +1 -0
- package/dist/change-set-schema/change-set-schema.js +43 -0
- package/dist/change-set-schema/index.d.ts +3 -0
- package/dist/change-set-schema/index.d.ts.map +1 -0
- package/dist/change-set-schema/index.js +2 -0
- package/dist/cli/cli.js +6 -1
- package/dist/cli/deps/dependency-tree.d.ts +3 -0
- package/dist/cli/deps/dependency-tree.d.ts.map +1 -0
- package/dist/cli/deps/dependency-tree.js +39 -0
- package/dist/cli/deps/deps.d.ts +7 -0
- package/dist/cli/deps/deps.d.ts.map +1 -0
- package/dist/cli/deps/deps.js +26 -0
- package/dist/cli/deps/index.d.ts +2 -0
- package/dist/cli/deps/index.d.ts.map +1 -0
- package/dist/cli/deps/index.js +2 -0
- package/dist/cli/errors.d.ts +2 -0
- package/dist/cli/errors.d.ts.map +1 -0
- package/dist/cli/errors.js +34 -0
- package/dist/cli/inspect/file/file.d.ts +8 -0
- package/dist/cli/inspect/file/file.d.ts.map +1 -0
- package/dist/cli/inspect/file/file.js +16 -0
- package/dist/cli/inspect/file/index.d.ts +2 -0
- package/dist/cli/inspect/file/index.d.ts.map +1 -0
- package/dist/cli/inspect/file/index.js +1 -0
- package/dist/cli/inspect/file/report.d.ts +3 -0
- package/dist/cli/inspect/file/report.d.ts.map +1 -0
- package/dist/cli/inspect/file/report.js +26 -0
- package/dist/cli/inspect/index.d.ts +2 -0
- package/dist/cli/inspect/index.d.ts.map +1 -0
- package/dist/cli/inspect/index.js +1 -0
- package/dist/cli/inspect/inspect.d.ts +4 -0
- package/dist/cli/inspect/inspect.d.ts.map +1 -0
- package/dist/cli/inspect/inspect.js +14 -0
- package/dist/cli/inspect/json.d.ts +4 -0
- package/dist/cli/inspect/json.d.ts.map +1 -0
- package/dist/cli/inspect/json.js +5 -0
- package/dist/cli/inspect/layer/index.d.ts +2 -0
- package/dist/cli/inspect/layer/index.d.ts.map +1 -0
- package/dist/cli/inspect/layer/index.js +1 -0
- package/dist/cli/inspect/layer/layer.d.ts +7 -0
- package/dist/cli/inspect/layer/layer.d.ts.map +1 -0
- package/dist/cli/inspect/layer/layer.js +13 -0
- package/dist/cli/inspect/layer/report.d.ts +3 -0
- package/dist/cli/inspect/layer/report.d.ts.map +1 -0
- package/dist/cli/inspect/layer/report.js +21 -0
- package/dist/cli/inspect/module/index.d.ts +2 -0
- package/dist/cli/inspect/module/index.d.ts.map +1 -0
- package/dist/cli/inspect/module/index.js +1 -0
- package/dist/cli/inspect/module/module.d.ts +7 -0
- package/dist/cli/inspect/module/module.d.ts.map +1 -0
- package/dist/cli/inspect/module/module.js +15 -0
- package/dist/cli/inspect/module/report.d.ts +3 -0
- package/dist/cli/inspect/module/report.d.ts.map +1 -0
- package/dist/cli/inspect/module/report.js +38 -0
- package/dist/cli/inspect/path-tree.d.ts +7 -0
- package/dist/cli/inspect/path-tree.d.ts.map +1 -0
- package/dist/cli/inspect/path-tree.js +62 -0
- package/dist/cli/inspect/path.d.ts +5 -0
- package/dist/cli/inspect/path.d.ts.map +1 -0
- package/dist/cli/inspect/path.js +10 -0
- package/dist/cli/inspect/project/index.d.ts +2 -0
- package/dist/cli/inspect/project/index.d.ts.map +1 -0
- package/dist/cli/inspect/project/index.js +1 -0
- package/dist/cli/inspect/project/project.d.ts +8 -0
- package/dist/cli/inspect/project/project.d.ts.map +1 -0
- package/dist/cli/inspect/project/project.js +19 -0
- package/dist/cli/inspect/project/report.d.ts +3 -0
- package/dist/cli/inspect/project/report.d.ts.map +1 -0
- package/dist/cli/inspect/project/report.js +16 -0
- package/dist/cli/lint/index.d.ts +2 -0
- package/dist/cli/lint/index.d.ts.map +1 -0
- package/dist/cli/lint/index.js +2 -0
- package/dist/cli/lint/layers/index.d.ts +3 -0
- package/dist/cli/lint/layers/index.d.ts.map +1 -0
- package/dist/cli/lint/layers/index.js +4 -0
- package/dist/cli/lint/layers/layers.d.ts +5 -0
- package/dist/cli/lint/layers/layers.d.ts.map +1 -0
- package/dist/cli/lint/layers/layers.js +18 -0
- package/dist/cli/lint/layers/report.d.ts +5 -0
- package/dist/cli/lint/layers/report.d.ts.map +1 -0
- package/dist/cli/lint/layers/report.js +60 -0
- package/dist/cli/lint/lint.d.ts +4 -0
- package/dist/cli/lint/lint.d.ts.map +1 -0
- package/dist/cli/lint/lint.js +26 -0
- package/dist/cli/lint/modules/index.d.ts +5 -0
- package/dist/cli/lint/modules/index.d.ts.map +1 -0
- package/dist/cli/lint/modules/index.js +4 -0
- package/dist/cli/lint/modules/modules.d.ts +5 -0
- package/dist/cli/lint/modules/modules.d.ts.map +1 -0
- package/dist/cli/lint/modules/modules.js +15 -0
- package/dist/cli/lint/modules/report.d.ts +5 -0
- package/dist/cli/lint/modules/report.d.ts.map +1 -0
- package/dist/cli/lint/modules/report.js +69 -0
- package/dist/cli/run.d.ts +1 -8
- package/dist/cli/run.d.ts.map +1 -1
- package/dist/cli/run.js +14 -242
- package/dist/cli/stories/index.d.ts +2 -0
- package/dist/cli/stories/index.d.ts.map +1 -0
- package/dist/cli/stories/index.js +1 -0
- package/dist/cli/stories/progress.d.ts +7 -0
- package/dist/cli/stories/progress.d.ts.map +1 -0
- package/dist/cli/stories/progress.js +45 -0
- package/dist/cli/stories/report.d.ts +9 -0
- package/dist/cli/stories/report.d.ts.map +1 -0
- package/dist/cli/stories/report.js +63 -0
- package/dist/cli/stories/stories.d.ts +6 -0
- package/dist/cli/stories/stories.d.ts.map +1 -0
- package/dist/cli/stories/stories.js +30 -0
- package/dist/config/define-config.d.ts +5 -0
- package/dist/config/define-config.d.ts.map +1 -1
- package/dist/config/define-config.js +152 -7
- package/dist/config/index.d.ts +6 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +2 -0
- package/dist/config/layer-graph.d.ts +2 -2
- package/dist/config/layer-graph.d.ts.map +1 -1
- package/dist/config/layer-graph.js +2 -29
- package/dist/config/layer.d.ts +2 -2
- package/dist/config/layer.d.ts.map +1 -1
- package/dist/config/layer.js +2 -15
- package/dist/config/load-config/index.d.ts +2 -0
- package/dist/config/load-config/index.d.ts.map +1 -0
- package/dist/config/load-config/index.js +1 -0
- package/dist/config/load-config/load-config.d.ts +34 -0
- package/dist/config/load-config/load-config.d.ts.map +1 -0
- package/dist/config/load-config/load-config.js +127 -0
- package/dist/config/module.d.ts +4 -2
- package/dist/config/module.d.ts.map +1 -1
- package/dist/config/module.js +5 -12
- package/dist/config/project-narrative.d.ts +15 -0
- package/dist/config/project-narrative.d.ts.map +1 -0
- package/dist/config/project-narrative.js +11 -0
- package/dist/config/types.d.ts +5 -3
- package/dist/config/types.d.ts.map +1 -1
- package/dist/domain/architecture-analysis/architecture-analysis.d.ts +4 -0
- package/dist/domain/architecture-analysis/architecture-analysis.d.ts.map +1 -0
- package/dist/domain/architecture-analysis/architecture-analysis.js +13 -0
- package/dist/domain/architecture-analysis/index.d.ts +3 -0
- package/dist/domain/architecture-analysis/index.d.ts.map +1 -0
- package/dist/domain/architecture-analysis/index.js +2 -0
- package/dist/domain/architecture-analysis/layer-rules.d.ts +3 -0
- package/dist/domain/architecture-analysis/layer-rules.d.ts.map +1 -0
- package/dist/domain/architecture-analysis/layer-rules.js +15 -0
- package/dist/domain/architecture-analysis/layers/allowed-dependencies.d.ts +3 -0
- package/dist/domain/architecture-analysis/layers/allowed-dependencies.d.ts.map +1 -0
- package/dist/domain/architecture-analysis/layers/allowed-dependencies.js +20 -0
- package/dist/domain/architecture-analysis/layers/coverage-violations.d.ts +2 -0
- package/dist/domain/architecture-analysis/layers/coverage-violations.d.ts.map +1 -0
- package/dist/domain/architecture-analysis/layers/coverage-violations.js +5 -0
- package/dist/domain/architecture-analysis/layers/dependency-violations.d.ts +5 -0
- package/dist/domain/architecture-analysis/layers/dependency-violations.d.ts.map +1 -0
- package/dist/domain/architecture-analysis/layers/dependency-violations.js +18 -0
- package/dist/domain/architecture-analysis/layers/index.d.ts +9 -0
- package/dist/domain/architecture-analysis/layers/index.d.ts.map +1 -0
- package/dist/domain/architecture-analysis/layers/index.js +4 -0
- package/dist/domain/architecture-analysis/layers/layer-membership.d.ts +3 -0
- package/dist/domain/architecture-analysis/layers/layer-membership.d.ts.map +1 -0
- package/dist/domain/architecture-analysis/layers/layer-membership.js +13 -0
- package/dist/domain/architecture-analysis/layers/layers.d.ts +11 -0
- package/dist/domain/architecture-analysis/layers/layers.d.ts.map +1 -0
- package/dist/domain/architecture-analysis/layers/layers.js +22 -0
- package/dist/domain/architecture-analysis/layers/module-coverage-violations.d.ts +4 -0
- package/dist/domain/architecture-analysis/layers/module-coverage-violations.d.ts.map +1 -0
- package/dist/domain/architecture-analysis/layers/module-coverage-violations.js +9 -0
- package/dist/domain/architecture-analysis/modules/dependency-graph.d.ts +2 -0
- package/dist/domain/architecture-analysis/modules/dependency-graph.d.ts.map +1 -0
- package/dist/domain/architecture-analysis/modules/dependency-graph.js +45 -0
- package/dist/domain/architecture-analysis/modules/dependency-permissions.d.ts +4 -0
- package/dist/domain/architecture-analysis/modules/dependency-permissions.d.ts.map +1 -0
- package/dist/domain/architecture-analysis/modules/dependency-permissions.js +35 -0
- package/dist/domain/architecture-analysis/modules/index.d.ts +12 -0
- package/dist/domain/architecture-analysis/modules/index.d.ts.map +1 -0
- package/dist/domain/architecture-analysis/modules/index.js +3 -0
- package/dist/domain/architecture-analysis/modules/module-descriptors.d.ts +5 -0
- package/dist/domain/architecture-analysis/modules/module-descriptors.d.ts.map +1 -0
- package/dist/domain/architecture-analysis/modules/module-descriptors.js +37 -0
- package/dist/domain/architecture-analysis/modules/module-membership.d.ts +3 -0
- package/dist/domain/architecture-analysis/modules/module-membership.d.ts.map +1 -0
- package/dist/domain/architecture-analysis/modules/module-membership.js +12 -0
- package/dist/domain/architecture-analysis/modules/modules.d.ts +16 -0
- package/dist/domain/architecture-analysis/modules/modules.d.ts.map +1 -0
- package/dist/domain/architecture-analysis/modules/modules.js +35 -0
- package/dist/domain/architecture-analysis/modules/public-entry-points.d.ts +3 -0
- package/dist/domain/architecture-analysis/modules/public-entry-points.d.ts.map +1 -0
- package/dist/domain/architecture-analysis/modules/public-entry-points.js +11 -0
- package/dist/domain/architecture-analysis/modules/unexposed-modules.d.ts +3 -0
- package/dist/domain/architecture-analysis/modules/unexposed-modules.d.ts.map +1 -0
- package/dist/domain/architecture-analysis/modules/unexposed-modules.js +10 -0
- package/dist/domain/architecture-analysis/modules/violations/boundaries.d.ts +8 -0
- package/dist/domain/architecture-analysis/modules/violations/boundaries.d.ts.map +1 -0
- package/dist/domain/architecture-analysis/modules/violations/boundaries.js +47 -0
- package/dist/domain/architecture-analysis/modules/violations/coverage.d.ts +3 -0
- package/dist/domain/architecture-analysis/modules/violations/coverage.d.ts.map +1 -0
- package/dist/domain/architecture-analysis/modules/violations/coverage.js +7 -0
- package/dist/domain/architecture-analysis/modules/violations/cycles.d.ts +3 -0
- package/dist/domain/architecture-analysis/modules/violations/cycles.d.ts.map +1 -0
- package/dist/domain/architecture-analysis/modules/violations/cycles.js +7 -0
- package/dist/domain/architecture-analysis/modules/violations/dead-modules.d.ts +3 -0
- package/dist/domain/architecture-analysis/modules/violations/dead-modules.d.ts.map +1 -0
- package/dist/domain/architecture-analysis/modules/violations/dead-modules.js +23 -0
- package/dist/domain/architecture-analysis/modules/violations/dependencies.d.ts +4 -0
- package/dist/domain/architecture-analysis/modules/violations/dependencies.d.ts.map +1 -0
- package/dist/domain/architecture-analysis/modules/violations/dependencies.js +7 -0
- package/dist/domain/architecture-analysis/modules/violations/entry-points.d.ts +3 -0
- package/dist/domain/architecture-analysis/modules/violations/entry-points.d.ts.map +1 -0
- package/dist/domain/architecture-analysis/modules/violations/entry-points.js +17 -0
- package/dist/domain/architecture-analysis/modules/violations/graph-coverage.d.ts +3 -0
- package/dist/domain/architecture-analysis/modules/violations/graph-coverage.d.ts.map +1 -0
- package/dist/domain/architecture-analysis/modules/violations/graph-coverage.js +16 -0
- package/dist/domain/architecture-analysis/modules/violations/index.d.ts +3 -0
- package/dist/domain/architecture-analysis/modules/violations/index.d.ts.map +1 -0
- package/dist/domain/architecture-analysis/modules/violations/index.js +2 -0
- package/dist/domain/architecture-analysis/modules/violations/unused-shared.d.ts +3 -0
- package/dist/domain/architecture-analysis/modules/violations/unused-shared.d.ts.map +1 -0
- package/dist/domain/architecture-analysis/modules/violations/unused-shared.js +9 -0
- package/dist/domain/architecture-analysis/modules/violations/violations.d.ts +9 -0
- package/dist/domain/architecture-analysis/modules/violations/violations.d.ts.map +1 -0
- package/dist/domain/architecture-analysis/modules/violations/violations.js +22 -0
- package/dist/domain/file-graph/file-graph.d.ts +10 -0
- package/dist/domain/file-graph/file-graph.d.ts.map +1 -0
- package/dist/domain/file-graph/file-graph.js +37 -0
- package/dist/domain/file-graph/index.d.ts +4 -0
- package/dist/domain/file-graph/index.d.ts.map +1 -0
- package/dist/domain/file-graph/index.js +1 -0
- package/dist/domain/project-config/index.d.ts +10 -0
- package/dist/domain/project-config/index.d.ts.map +1 -0
- package/dist/domain/project-config/index.js +12 -0
- package/dist/domain/project-config/project-config.d.ts +52 -0
- package/dist/domain/project-config/project-config.d.ts.map +1 -0
- package/dist/domain/project-config/project-config.js +39 -0
- package/dist/domain/project-config/resolve.d.ts +8 -0
- package/dist/domain/project-config/resolve.d.ts.map +1 -0
- package/dist/domain/project-config/resolve.js +29 -0
- package/dist/domain/project-config/validation/containment.d.ts +4 -0
- package/dist/domain/project-config/validation/containment.d.ts.map +1 -0
- package/dist/domain/project-config/validation/containment.js +21 -0
- package/dist/domain/project-config/validation/index.d.ts +3 -0
- package/dist/domain/project-config/validation/index.d.ts.map +1 -0
- package/dist/domain/project-config/validation/index.js +2 -0
- package/dist/domain/project-config/validation/layers/cycles.d.ts +3 -0
- package/dist/domain/project-config/validation/layers/cycles.d.ts.map +1 -0
- package/dist/domain/project-config/validation/layers/cycles.js +64 -0
- package/dist/domain/project-config/validation/layers/index.d.ts +3 -0
- package/dist/domain/project-config/validation/layers/index.d.ts.map +1 -0
- package/dist/domain/project-config/validation/layers/index.js +2 -0
- package/dist/domain/project-config/validation/layers/layers.d.ts +3 -0
- package/dist/domain/project-config/validation/layers/layers.d.ts.map +1 -0
- package/dist/domain/project-config/validation/layers/layers.js +9 -0
- package/dist/domain/project-config/validation/layers/overlaps.d.ts +3 -0
- package/dist/domain/project-config/validation/layers/overlaps.d.ts.map +1 -0
- package/dist/domain/project-config/validation/layers/overlaps.js +26 -0
- package/dist/domain/project-config/validation/layers/references.d.ts +3 -0
- package/dist/domain/project-config/validation/layers/references.d.ts.map +1 -0
- package/dist/domain/project-config/validation/layers/references.js +21 -0
- package/dist/domain/project-config/validation/modules/containment.d.ts +3 -0
- package/dist/domain/project-config/validation/modules/containment.d.ts.map +1 -0
- package/dist/domain/project-config/validation/modules/containment.js +24 -0
- package/dist/domain/project-config/validation/modules/graphs.d.ts +4 -0
- package/dist/domain/project-config/validation/modules/graphs.d.ts.map +1 -0
- package/dist/domain/project-config/validation/modules/graphs.js +96 -0
- package/dist/domain/project-config/validation/modules/index.d.ts +3 -0
- package/dist/domain/project-config/validation/modules/index.d.ts.map +1 -0
- package/dist/domain/project-config/validation/modules/index.js +2 -0
- package/dist/domain/project-config/validation/modules/kinds.d.ts +3 -0
- package/dist/domain/project-config/validation/modules/kinds.d.ts.map +1 -0
- package/dist/domain/project-config/validation/modules/kinds.js +18 -0
- package/dist/domain/project-config/validation/modules/modules.d.ts +3 -0
- package/dist/domain/project-config/validation/modules/modules.d.ts.map +1 -0
- package/dist/domain/project-config/validation/modules/modules.js +16 -0
- package/dist/domain/project-config/validation/modules/nested.d.ts +3 -0
- package/dist/domain/project-config/validation/modules/nested.d.ts.map +1 -0
- package/dist/domain/project-config/validation/modules/nested.js +34 -0
- package/dist/domain/project-config/validation/modules/overlaps.d.ts +4 -0
- package/dist/domain/project-config/validation/modules/overlaps.d.ts.map +1 -0
- package/dist/domain/project-config/validation/modules/overlaps.js +43 -0
- package/dist/domain/project-config/validation/modules/paths.d.ts +3 -0
- package/dist/domain/project-config/validation/modules/paths.d.ts.map +1 -0
- package/dist/domain/project-config/validation/modules/paths.js +27 -0
- package/dist/domain/project-config/validation/modules/scopes.d.ts +4 -0
- package/dist/domain/project-config/validation/modules/scopes.d.ts.map +1 -0
- package/dist/domain/project-config/validation/modules/scopes.js +28 -0
- package/dist/domain/project-config/validation/modules/subpaths.d.ts +3 -0
- package/dist/domain/project-config/validation/modules/subpaths.d.ts.map +1 -0
- package/dist/domain/project-config/validation/modules/subpaths.js +40 -0
- package/dist/domain/project-config/validation/paths.d.ts +3 -0
- package/dist/domain/project-config/validation/paths.d.ts.map +1 -0
- package/dist/domain/project-config/validation/paths.js +39 -0
- package/dist/domain/project-config/validation/validation.d.ts +3 -0
- package/dist/domain/project-config/validation/validation.d.ts.map +1 -0
- package/dist/domain/project-config/validation/validation.js +12 -0
- package/dist/entrypoints/cli/cli.d.ts +3 -0
- package/dist/entrypoints/cli/cli.d.ts.map +1 -0
- package/dist/entrypoints/cli/cli.js +6 -0
- package/dist/entrypoints/cli/run.d.ts +13 -0
- package/dist/entrypoints/cli/run.d.ts.map +1 -0
- package/dist/entrypoints/cli/run.js +155 -0
- package/dist/entrypoints/cli/test-output.d.ts +17 -0
- package/dist/entrypoints/cli/test-output.d.ts.map +1 -0
- package/dist/entrypoints/cli/test-output.js +244 -0
- package/dist/entrypoints/node/index.d.ts +24 -0
- package/dist/entrypoints/node/index.d.ts.map +1 -0
- package/dist/entrypoints/node/index.js +27 -0
- package/dist/entrypoints/report/index.d.ts +2 -0
- package/dist/entrypoints/report/index.d.ts.map +1 -0
- package/dist/entrypoints/report/index.js +1 -0
- package/dist/index.d.ts +17 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -1
- package/dist/markdown/index.d.ts +3 -0
- package/dist/markdown/index.d.ts.map +1 -0
- package/dist/markdown/index.js +1 -0
- package/dist/markdown/markdown.d.ts +7 -0
- package/dist/markdown/markdown.d.ts.map +1 -0
- package/dist/markdown/markdown.js +13 -0
- package/dist/orchestrator/analyze-project/analyze-project.d.ts +119 -0
- package/dist/orchestrator/analyze-project/analyze-project.d.ts.map +1 -0
- package/dist/orchestrator/analyze-project/analyze-project.js +9 -0
- package/dist/orchestrator/analyze-project/index.d.ts +2 -0
- package/dist/orchestrator/analyze-project/index.d.ts.map +1 -0
- package/dist/orchestrator/analyze-project/index.js +2 -0
- package/dist/orchestrator/inspect/index.d.ts +4 -0
- package/dist/orchestrator/inspect/index.d.ts.map +1 -0
- package/dist/orchestrator/inspect/index.js +1 -0
- package/dist/orchestrator/inspect/inspect.d.ts +269 -0
- package/dist/orchestrator/inspect/inspect.d.ts.map +1 -0
- package/dist/orchestrator/inspect/inspect.js +147 -0
- package/dist/orchestrator/load-changes/index.d.ts +2 -0
- package/dist/orchestrator/load-changes/index.d.ts.map +1 -0
- package/dist/orchestrator/load-changes/index.js +2 -0
- package/dist/orchestrator/load-changes/load-changes.d.ts +6 -0
- package/dist/orchestrator/load-changes/load-changes.d.ts.map +1 -0
- package/dist/orchestrator/load-changes/load-changes.js +18 -0
- package/dist/orchestrator/load-module-source/errors.d.ts +17 -0
- package/dist/orchestrator/load-module-source/errors.d.ts.map +1 -0
- package/dist/orchestrator/load-module-source/errors.js +5 -0
- package/dist/orchestrator/load-module-source/index.d.ts +2 -0
- package/dist/orchestrator/load-module-source/index.d.ts.map +1 -0
- package/dist/orchestrator/load-module-source/index.js +1 -0
- package/dist/orchestrator/load-module-source/load-module-source.d.ts +12 -0
- package/dist/orchestrator/load-module-source/load-module-source.d.ts.map +1 -0
- package/dist/orchestrator/load-module-source/load-module-source.js +39 -0
- package/dist/orchestrator/load-project/index.d.ts +3 -0
- package/dist/orchestrator/load-project/index.d.ts.map +1 -0
- package/dist/orchestrator/load-project/index.js +2 -0
- package/dist/orchestrator/load-project/load-project.d.ts +54 -0
- package/dist/orchestrator/load-project/load-project.d.ts.map +1 -0
- package/dist/orchestrator/load-project/load-project.js +30 -0
- package/dist/orchestrator/query-dependencies/index.d.ts +3 -0
- package/dist/orchestrator/query-dependencies/index.d.ts.map +1 -0
- package/dist/orchestrator/query-dependencies/index.js +4 -0
- package/dist/orchestrator/query-dependencies/query-dependencies.d.ts +12 -0
- package/dist/orchestrator/query-dependencies/query-dependencies.d.ts.map +1 -0
- package/dist/orchestrator/query-dependencies/query-dependencies.js +20 -0
- package/dist/orchestrator/run-stories/errors.d.ts +11 -0
- package/dist/orchestrator/run-stories/errors.d.ts.map +1 -0
- package/dist/orchestrator/run-stories/errors.js +3 -0
- package/dist/orchestrator/run-stories/extract-snippets.d.ts +12 -0
- package/dist/orchestrator/run-stories/extract-snippets.d.ts.map +1 -0
- package/dist/orchestrator/run-stories/extract-snippets.js +181 -0
- package/dist/orchestrator/run-stories/index.d.ts +3 -0
- package/dist/orchestrator/run-stories/index.d.ts.map +1 -0
- package/dist/orchestrator/run-stories/index.js +3 -0
- package/dist/orchestrator/run-stories/run-stories.d.ts +16 -0
- package/dist/orchestrator/run-stories/run-stories.d.ts.map +1 -0
- package/dist/orchestrator/run-stories/run-stories.js +290 -0
- package/dist/report/architecture.d.ts +1 -1
- package/dist/report/architecture.d.ts.map +1 -1
- package/dist/report/index.d.ts +2 -1
- package/dist/report/index.d.ts.map +1 -1
- package/dist/report/index.js +1 -1
- package/dist/report/tests.d.ts +411 -0
- package/dist/report/tests.d.ts.map +1 -0
- package/dist/report/tests.js +102 -0
- package/dist/services/config/config.d.ts +12 -0
- package/dist/services/config/config.d.ts.map +1 -0
- package/dist/services/config/config.js +46 -0
- package/dist/services/config/errors.d.ts +13 -0
- package/dist/services/config/errors.d.ts.map +1 -0
- package/dist/services/config/errors.js +3 -0
- package/dist/services/config/index.d.ts +4 -0
- package/dist/services/config/index.d.ts.map +1 -0
- package/dist/services/config/index.js +7 -0
- package/dist/services/file-cruiser/errors.d.ts +10 -0
- package/dist/services/file-cruiser/errors.d.ts.map +1 -0
- package/dist/services/file-cruiser/errors.js +3 -0
- package/dist/services/file-cruiser/file-cruiser.d.ts +11 -0
- package/dist/services/file-cruiser/file-cruiser.d.ts.map +1 -0
- package/dist/services/file-cruiser/file-cruiser.js +7 -0
- package/dist/services/file-cruiser/index.d.ts +4 -0
- package/dist/services/file-cruiser/index.d.ts.map +1 -0
- package/dist/services/file-cruiser/index.js +6 -0
- package/dist/services/file-cruiser/oxc/file-scanner.d.ts +5 -0
- package/dist/services/file-cruiser/oxc/file-scanner.d.ts.map +1 -0
- package/dist/services/file-cruiser/oxc/file-scanner.js +54 -0
- package/dist/services/file-cruiser/oxc/import-resolver.d.ts +5 -0
- package/dist/services/file-cruiser/oxc/import-resolver.d.ts.map +1 -0
- package/dist/services/file-cruiser/oxc/import-resolver.js +44 -0
- package/dist/services/file-cruiser/oxc/index.d.ts +2 -0
- package/dist/services/file-cruiser/oxc/index.d.ts.map +1 -0
- package/dist/services/file-cruiser/oxc/index.js +2 -0
- package/dist/services/file-cruiser/oxc/oxc.d.ts +5 -0
- package/dist/services/file-cruiser/oxc/oxc.d.ts.map +1 -0
- package/dist/services/file-cruiser/oxc/oxc.js +29 -0
- package/dist/services/git/changed-paths.d.ts +4 -0
- package/dist/services/git/changed-paths.d.ts.map +1 -0
- package/dist/services/git/changed-paths.js +85 -0
- package/dist/services/git/errors.d.ts +11 -0
- package/dist/services/git/errors.d.ts.map +1 -0
- package/dist/services/git/errors.js +3 -0
- package/dist/services/git/git.d.ts +12 -0
- package/dist/services/git/git.d.ts.map +1 -0
- package/dist/services/git/git.js +23 -0
- package/dist/services/git/index.d.ts +4 -0
- package/dist/services/git/index.d.ts.map +1 -0
- package/dist/services/git/index.js +6 -0
- package/dist/services/git/parse-patch.d.ts +3 -0
- package/dist/services/git/parse-patch.d.ts.map +1 -0
- package/dist/services/git/parse-patch.js +53 -0
- package/dist/services/git/run-git.d.ts +9 -0
- package/dist/services/git/run-git.d.ts.map +1 -0
- package/dist/services/git/run-git.js +22 -0
- package/dist/story/index.d.ts +3 -0
- package/dist/story/index.d.ts.map +1 -0
- package/dist/story/index.js +2 -0
- package/dist/story/schema/index.d.ts +6 -0
- package/dist/story/schema/index.d.ts.map +1 -0
- package/dist/story/schema/index.js +4 -0
- package/dist/story/schema/slug.d.ts +2 -0
- package/dist/story/schema/slug.d.ts.map +1 -0
- package/dist/story/schema/slug.js +6 -0
- package/dist/story/schema/story-report-schema.d.ts +408 -0
- package/dist/story/schema/story-report-schema.d.ts.map +1 -0
- package/dist/story/schema/story-report-schema.js +94 -0
- package/dist/story/schema/story-tree-schema.d.ts +42 -0
- package/dist/story/schema/story-tree-schema.d.ts.map +1 -0
- package/dist/story/schema/story-tree-schema.js +40 -0
- package/dist/story/story.d.ts +38 -0
- package/dist/story/story.d.ts.map +1 -0
- package/dist/story/story.js +56 -0
- package/dist/tests/authoring/index.d.ts +72 -0
- package/dist/tests/authoring/index.d.ts.map +1 -0
- package/dist/tests/authoring/index.js +312 -0
- package/dist/tests/run-tests/index.d.ts +3 -0
- package/dist/tests/run-tests/index.d.ts.map +1 -0
- package/dist/tests/run-tests/index.js +1 -0
- package/dist/tests/run-tests/run-tests.d.ts +26 -0
- package/dist/tests/run-tests/run-tests.d.ts.map +1 -0
- package/dist/tests/run-tests/run-tests.js +284 -0
- package/package.json +36 -24
- package/schema.json +212 -0
- package/dist/cli/index.d.ts +0 -2
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js +0 -1
- package/dist/engine/1-extract/extract.d.ts.map +0 -1
- package/dist/engine/1-extract/index.d.ts +0 -3
- package/dist/engine/1-extract/index.d.ts.map +0 -1
- package/dist/engine/1-extract/index.js +0 -1
- package/dist/engine/2-resolve/index.d.ts +0 -3
- package/dist/engine/2-resolve/index.d.ts.map +0 -1
- package/dist/engine/2-resolve/index.js +0 -1
- package/dist/engine/2-resolve/resolve.d.ts.map +0 -1
- package/dist/engine/3-evaluate/evaluate.d.ts.map +0 -1
- package/dist/engine/3-evaluate/index.d.ts +0 -3
- package/dist/engine/3-evaluate/index.d.ts.map +0 -1
- package/dist/engine/3-evaluate/index.js +0 -1
- package/dist/engine/4-emit/emit.d.ts +0 -7
- package/dist/engine/4-emit/emit.d.ts.map +0 -1
- package/dist/engine/4-emit/index.d.ts +0 -2
- package/dist/engine/4-emit/index.d.ts.map +0 -1
- package/dist/engine/4-emit/index.js +0 -1
- package/dist/engine/errors.d.ts +0 -19
- package/dist/engine/errors.d.ts.map +0 -1
- package/dist/node.d.ts +0 -24
- package/dist/node.d.ts.map +0 -1
- package/dist/node.js +0 -139
- package/dist/report/stories.d.ts +0 -22
- package/dist/report/stories.d.ts.map +0 -1
- package/dist/report/stories.js +0 -1
- package/dist/story/artifact/artifact.d.ts +0 -57
- package/dist/story/artifact/artifact.d.ts.map +0 -1
- package/dist/story/artifact/artifact.js +0 -234
- package/dist/story/artifact/index.d.ts +0 -2
- package/dist/story/artifact/index.d.ts.map +0 -1
- package/dist/story/artifact/index.js +0 -1
- package/dist/story/artifact/storage.d.ts +0 -10
- package/dist/story/artifact/storage.d.ts.map +0 -1
- package/dist/story/artifact/storage.js +0 -162
- package/dist/story/artifact/types.d.ts +0 -74
- package/dist/story/artifact/types.d.ts.map +0 -1
- package/dist/story/artifact/types.js +0 -1
- package/dist/story/core/blocks.d.ts +0 -20
- package/dist/story/core/blocks.d.ts.map +0 -1
- package/dist/story/core/blocks.js +0 -104
- package/dist/story/core/declare.d.ts +0 -63
- package/dist/story/core/declare.d.ts.map +0 -1
- package/dist/story/core/declare.js +0 -62
- package/dist/story/core/index.d.ts +0 -4
- package/dist/story/core/index.d.ts.map +0 -1
- package/dist/story/core/index.js +0 -1
- package/dist/story/core/recorder.d.ts +0 -38
- package/dist/story/core/recorder.d.ts.map +0 -1
- package/dist/story/core/recorder.js +0 -28
- package/dist/story/core/runtime-context.d.ts +0 -14
- package/dist/story/core/runtime-context.d.ts.map +0 -1
- package/dist/story/core/runtime-context.js +0 -19
- package/dist/story/core/types.d.ts +0 -21
- package/dist/story/core/types.d.ts.map +0 -1
- package/dist/story/core/types.js +0 -1
- package/dist/story/effect/effect.d.ts +0 -52
- package/dist/story/effect/effect.d.ts.map +0 -1
- package/dist/story/effect/effect.js +0 -99
- package/dist/story/effect/index.d.ts +0 -3
- package/dist/story/effect/index.d.ts.map +0 -1
- package/dist/story/effect/index.js +0 -1
- package/dist/story/runner/index.d.ts +0 -3
- package/dist/story/runner/index.d.ts.map +0 -1
- package/dist/story/runner/index.js +0 -1
- package/dist/story/runner/runner.d.ts +0 -44
- package/dist/story/runner/runner.d.ts.map +0 -1
- package/dist/story/runner/runner.js +0 -476
- package/dist/story/story-runtime/index.d.ts +0 -2
- package/dist/story/story-runtime/index.d.ts.map +0 -1
- package/dist/story/story-runtime/index.js +0 -1
- package/dist/story/story-runtime/story-runtime.d.ts +0 -52
- package/dist/story/story-runtime/story-runtime.d.ts.map +0 -1
- package/dist/story/story-runtime/story-runtime.js +0 -194
- package/dist/story/vanilla/index.d.ts +0 -29
- package/dist/story/vanilla/index.d.ts.map +0 -1
- package/dist/story/vanilla/index.js +0 -78
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { LayerAnalysis } from '../../../architecture-analysis-schema/index.js';
|
|
2
|
+
type LayerReportInput = Pick<LayerAnalysis, 'forbiddenImports' | 'layersWithoutModules' | 'unassignedFiles'>;
|
|
3
|
+
export declare function renderLayerReport(result: LayerReportInput): string;
|
|
4
|
+
export {};
|
|
5
|
+
//# sourceMappingURL=report.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../../../src/cli/lint/layers/report.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAEpF,KAAK,gBAAgB,GAAG,IAAI,CAC1B,aAAa,EACb,kBAAkB,GAAG,sBAAsB,GAAG,iBAAiB,CAChE,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAgBlE"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as colors from 'yoctocolors';
|
|
2
|
+
export function renderLayerReport(result) {
|
|
3
|
+
const count = result.unassignedFiles.length +
|
|
4
|
+
result.forbiddenImports.length +
|
|
5
|
+
result.layersWithoutModules.length;
|
|
6
|
+
if (count === 0)
|
|
7
|
+
return colors.green('✓ No layer violations');
|
|
8
|
+
const sections = [
|
|
9
|
+
colors.red('Layer violations'),
|
|
10
|
+
...renderForbiddenImports(result),
|
|
11
|
+
...renderUnassignedFiles(result.unassignedFiles),
|
|
12
|
+
...renderLayersWithoutModules(result.layersWithoutModules),
|
|
13
|
+
'',
|
|
14
|
+
`${count} ${count === 1 ? 'violation' : 'violations'}`,
|
|
15
|
+
];
|
|
16
|
+
return sections.join('\n');
|
|
17
|
+
}
|
|
18
|
+
function renderLayersWithoutModules(layers) {
|
|
19
|
+
if (layers.length === 0)
|
|
20
|
+
return [];
|
|
21
|
+
return [
|
|
22
|
+
'',
|
|
23
|
+
'layers without modules',
|
|
24
|
+
...[...layers]
|
|
25
|
+
.sort((left, right) => left.localeCompare(right))
|
|
26
|
+
.map((layer) => ` ${colors.yellow('✕')} ${layer}`),
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
function renderForbiddenImports(result) {
|
|
30
|
+
const groups = new Map();
|
|
31
|
+
for (const violation of result.forbiddenImports) {
|
|
32
|
+
const key = `${violation.fromLayer}\0${violation.toLayer}`;
|
|
33
|
+
groups.set(key, [...(groups.get(key) ?? []), violation]);
|
|
34
|
+
}
|
|
35
|
+
return [...groups.entries()]
|
|
36
|
+
.sort(([left], [right]) => left.localeCompare(right))
|
|
37
|
+
.flatMap(([key, violations]) => {
|
|
38
|
+
const [fromLayer, toLayer] = key.split('\0');
|
|
39
|
+
return [
|
|
40
|
+
'',
|
|
41
|
+
`${fromLayer} → ${toLayer}`,
|
|
42
|
+
...[...violations]
|
|
43
|
+
.sort((left, right) => left.fromFile === right.fromFile
|
|
44
|
+
? left.toFile.localeCompare(right.toFile)
|
|
45
|
+
: left.fromFile.localeCompare(right.fromFile))
|
|
46
|
+
.map(({ fromFile, toFile }) => ` ${colors.red('✕')} ${fromFile} → ${toFile}`),
|
|
47
|
+
];
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function renderUnassignedFiles(files) {
|
|
51
|
+
if (files.length === 0)
|
|
52
|
+
return [];
|
|
53
|
+
return [
|
|
54
|
+
'',
|
|
55
|
+
'unassigned files',
|
|
56
|
+
...[...files]
|
|
57
|
+
.sort((left, right) => left.localeCompare(right))
|
|
58
|
+
.map((file) => ` ${colors.yellow('✕')} ${file}`),
|
|
59
|
+
];
|
|
60
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Effect } from 'effect';
|
|
2
|
+
import { Command } from 'effect/unstable/cli';
|
|
3
|
+
export declare function makeLintCommand<R>(configPath: Effect.Effect<string, never, R>): Command.Command<"lint", {} | {}, {}, import("../../index.js").ConfigError | import("../../index.js").CruiseError, Exclude<R, "effect/unstable/cli/GlobalFlag/log-level"> | Exclude<Exclude<R, "effect/unstable/cli/GlobalFlag/log-level">, Command.CommandContext<"lint">>>;
|
|
4
|
+
//# sourceMappingURL=lint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../../src/cli/lint/lint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,MAAM,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAQ9C,wBAAgB,eAAe,CAAC,CAAC,EAC/B,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,+QAW5C"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Console, Effect } from 'effect';
|
|
2
|
+
import { Command } from 'effect/unstable/cli';
|
|
3
|
+
import { analyzeProject } from '../../orchestrator/analyze-project/index.js';
|
|
4
|
+
import { makeLayersCommand } from './layers/index.js';
|
|
5
|
+
import { renderLayerReport } from './layers/report.js';
|
|
6
|
+
import { makeModulesCommand } from './modules/index.js';
|
|
7
|
+
import { renderModuleReport } from './modules/report.js';
|
|
8
|
+
export function makeLintCommand(configPath) {
|
|
9
|
+
return Command.make('lint', {}, () => configPath.pipe(Effect.flatMap(runLint))).pipe(Command.withDescription('Check every configured architectural rule.'), Command.withSubcommands([
|
|
10
|
+
makeLayersCommand(configPath),
|
|
11
|
+
makeModulesCommand(configPath),
|
|
12
|
+
]));
|
|
13
|
+
}
|
|
14
|
+
function runLint(configPath) {
|
|
15
|
+
return Effect.gen(function* () {
|
|
16
|
+
const result = yield* analyzeProject(configPath);
|
|
17
|
+
yield* Console.log(renderLayerReport(result.layerAnalysis));
|
|
18
|
+
yield* Console.log(renderModuleReport(result.moduleAnalysis));
|
|
19
|
+
if (result.layerAnalysis.unassignedFiles.length > 0 ||
|
|
20
|
+
result.layerAnalysis.forbiddenImports.length > 0 ||
|
|
21
|
+
result.layerAnalysis.layersWithoutModules.length > 0 ||
|
|
22
|
+
result.moduleAnalysis.violations.length > 0) {
|
|
23
|
+
process.exitCode = 1;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** The lint parent uses this to register the focused Module command. */
|
|
2
|
+
export { makeModulesCommand } from './modules.js';
|
|
3
|
+
/** Full CLI orchestration uses this to run focused Module lint. */
|
|
4
|
+
export { runModulesLint } from './modules.js';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cli/lint/modules/index.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,mEAAmE;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Effect } from 'effect';
|
|
2
|
+
import { Command } from 'effect/unstable/cli';
|
|
3
|
+
export declare function makeModulesCommand<R>(configPath: Effect.Effect<string, never, R>): Command.Command<"modules", {}, {}, import("../../../index.js").ConfigError | import("../../../index.js").CruiseError, Exclude<R, "effect/unstable/cli/GlobalFlag/log-level">>;
|
|
4
|
+
export declare function runModulesLint(configPath: string): Effect.Effect<void, import("../../../index.js").ConfigError | import("../../../index.js").CruiseError, never>;
|
|
5
|
+
//# sourceMappingURL=modules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../../../../src/cli/lint/modules/modules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,MAAM,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAK9C,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,iLAS5C;AAED,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,iHAMhD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Console, Effect } from 'effect';
|
|
2
|
+
import { Command } from 'effect/unstable/cli';
|
|
3
|
+
import { analyzeProject } from '../../../orchestrator/analyze-project/index.js';
|
|
4
|
+
import { renderModuleReport } from './report.js';
|
|
5
|
+
export function makeModulesCommand(configPath) {
|
|
6
|
+
return Command.make('modules', {}, () => configPath.pipe(Effect.flatMap(runModulesLint))).pipe(Command.withDescription('Check Module coverage, public boundaries, dependencies, and cycles.'));
|
|
7
|
+
}
|
|
8
|
+
export function runModulesLint(configPath) {
|
|
9
|
+
return Effect.gen(function* () {
|
|
10
|
+
const { moduleAnalysis } = yield* analyzeProject(configPath);
|
|
11
|
+
yield* Console.log(renderModuleReport(moduleAnalysis));
|
|
12
|
+
if (moduleAnalysis.violations.length > 0)
|
|
13
|
+
process.exitCode = 1;
|
|
14
|
+
});
|
|
15
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ModuleAnalysis } from '../../../domain/architecture-analysis/modules/index.js';
|
|
2
|
+
type ModuleReportInput = Pick<ModuleAnalysis, 'modules' | 'graphs' | 'violations'>;
|
|
3
|
+
export declare function renderModuleReport(result: ModuleReportInput): string;
|
|
4
|
+
export {};
|
|
5
|
+
//# sourceMappingURL=report.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../../../src/cli/lint/modules/report.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,cAAc,EAEf,MAAM,wDAAwD,CAAC;AAahE,KAAK,iBAAiB,GAAG,IAAI,CAC3B,cAAc,EACd,SAAS,GAAG,QAAQ,GAAG,YAAY,CACpC,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAkBpE"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import * as colors from 'yoctocolors';
|
|
2
|
+
const headings = {
|
|
3
|
+
coverage: 'unassigned files',
|
|
4
|
+
'graph-coverage': 'files below a Module Graph with no member',
|
|
5
|
+
'missing-entry-point': 'missing Module entry points',
|
|
6
|
+
dependency: 'forbidden Module dependencies',
|
|
7
|
+
boundary: 'internal Module imports',
|
|
8
|
+
cycle: 'Module cycles',
|
|
9
|
+
'unused-shared': 'unused Shared Modules',
|
|
10
|
+
'dead-module': 'Modules nothing may import',
|
|
11
|
+
};
|
|
12
|
+
export function renderModuleReport(result) {
|
|
13
|
+
const summary = renderSummary(result.modules, result.graphs);
|
|
14
|
+
if (result.violations.length === 0) {
|
|
15
|
+
return [summary, colors.green('✓ No Module violations')].join('\n');
|
|
16
|
+
}
|
|
17
|
+
const sections = [summary, '', colors.red('Module violations')];
|
|
18
|
+
for (const kind of Object.keys(headings)) {
|
|
19
|
+
const violations = result.violations.filter((violation) => violation.kind === kind);
|
|
20
|
+
if (violations.length === 0)
|
|
21
|
+
continue;
|
|
22
|
+
sections.push('', headings[kind], ...violations.map(renderViolation));
|
|
23
|
+
}
|
|
24
|
+
sections.push('', `${result.violations.length} ${result.violations.length === 1 ? 'violation' : 'violations'}`);
|
|
25
|
+
return sections.join('\n');
|
|
26
|
+
}
|
|
27
|
+
function renderSummary(modules, graphs) {
|
|
28
|
+
const sharedByLayer = new Map();
|
|
29
|
+
let shared = 0;
|
|
30
|
+
let exposed = 0;
|
|
31
|
+
let members = 0;
|
|
32
|
+
for (const module of modules) {
|
|
33
|
+
if (module.exposed)
|
|
34
|
+
exposed += 1;
|
|
35
|
+
if (module.graph !== undefined)
|
|
36
|
+
members += 1;
|
|
37
|
+
if (!module.shared)
|
|
38
|
+
continue;
|
|
39
|
+
shared += 1;
|
|
40
|
+
sharedByLayer.set(module.layer, (sharedByLayer.get(module.layer) ?? 0) + 1);
|
|
41
|
+
}
|
|
42
|
+
const layers = [...sharedByLayer]
|
|
43
|
+
.sort(([left], [right]) => left.localeCompare(right))
|
|
44
|
+
.map(([layer, count]) => `${layer} ${count}`)
|
|
45
|
+
.join(', ');
|
|
46
|
+
return [
|
|
47
|
+
`Modules: ${modules.length} (${shared} Shared, ${exposed} exposed, ${members} in a Module Graph)`,
|
|
48
|
+
`Module Graphs: ${graphs.length}`,
|
|
49
|
+
`Shared by Layer: ${layers || 'none'}`,
|
|
50
|
+
].join('\n');
|
|
51
|
+
}
|
|
52
|
+
function renderViolation(violation) {
|
|
53
|
+
switch (violation.kind) {
|
|
54
|
+
case 'coverage':
|
|
55
|
+
return ` ${colors.yellow('✕')} ${violation.file}`;
|
|
56
|
+
case 'graph-coverage':
|
|
57
|
+
return ` ${colors.yellow('✕')} ${violation.graph}: ${violation.file}`;
|
|
58
|
+
case 'missing-entry-point':
|
|
59
|
+
return ` ${colors.red('✕')} Missing Module entry point: ${violation.path}`;
|
|
60
|
+
case 'dependency':
|
|
61
|
+
case 'boundary':
|
|
62
|
+
return ` ${colors.red('✕')} ${violation.fromModule} → ${violation.toModule}: ${violation.fromFile} → ${violation.toFile}`;
|
|
63
|
+
case 'cycle':
|
|
64
|
+
return ` ${colors.red('✕')} ${violation.modules.join(' → ')} → ${violation.modules[0]}`;
|
|
65
|
+
case 'unused-shared':
|
|
66
|
+
case 'dead-module':
|
|
67
|
+
return ` ${colors.red('✕')} ${violation.module}`;
|
|
68
|
+
}
|
|
69
|
+
}
|
package/dist/cli/run.d.ts
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
import { Effect } from 'effect';
|
|
2
2
|
import { Command } from 'effect/unstable/cli';
|
|
3
|
-
import
|
|
4
|
-
declare class CliExit {
|
|
5
|
-
readonly _tag = "CliExit";
|
|
6
|
-
}
|
|
7
|
-
export declare function lintPasses(report: Pick<LaymosReport, 'violations'>): boolean;
|
|
8
|
-
export declare const command: Command.Command<"laymos", {} | {}, {}, CliExit, never>;
|
|
9
|
-
export declare const cli: Effect.Effect<void, CliExit | import("effect/unstable/cli/CliError").CliError, Command.Environment>;
|
|
10
|
-
export {};
|
|
3
|
+
export declare const cli: Effect.Effect<void, import("../index.js").ConfigError | import("../index.js").CruiseError | import("../index.js").InspectionTargetNotFound | import("../index.js").ModuleInspectionCycle | import("../index.js").StoriesError | import("effect/unstable/cli/CliError").CliError, Command.Environment>;
|
|
11
4
|
//# sourceMappingURL=run.d.ts.map
|
package/dist/cli/run.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/cli/run.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/cli/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,OAAO,EAAQ,MAAM,qBAAqB,CAAC;AAmBpD,eAAO,MAAM,GAAG,uSAOf,CAAC"}
|
package/dist/cli/run.js
CHANGED
|
@@ -1,242 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
function lint() {
|
|
17
|
-
return analyzeProject(process.cwd()).pipe(Effect.flatMap((report) => Effect.suspend(() => {
|
|
18
|
-
reportCoverage(report);
|
|
19
|
-
reportWarnings(report);
|
|
20
|
-
if (lintPasses(report)) {
|
|
21
|
-
process.stdout.write(green('No violations found.\n'));
|
|
22
|
-
return Effect.void;
|
|
23
|
-
}
|
|
24
|
-
reportViolations(report.violations);
|
|
25
|
-
return Effect.fail(new CliExit());
|
|
26
|
-
})), Effect.catch((error) => error instanceof CliExit
|
|
27
|
-
? Effect.fail(error)
|
|
28
|
-
: Effect.sync(() => {
|
|
29
|
-
process.stderr.write(red(`Error: ${errorMessage(error)}\n`));
|
|
30
|
-
}).pipe(Effect.andThen(Effect.fail(new CliExit())))));
|
|
31
|
-
}
|
|
32
|
-
function stories(files, timeout, group) {
|
|
33
|
-
return Effect.suspend(() => {
|
|
34
|
-
let options;
|
|
35
|
-
let selectedGroupPath;
|
|
36
|
-
try {
|
|
37
|
-
options = storyRunOptions(timeout);
|
|
38
|
-
selectedGroupPath = Option.isSome(group)
|
|
39
|
-
? groupPath(group.value)
|
|
40
|
-
: undefined;
|
|
41
|
-
}
|
|
42
|
-
catch (error) {
|
|
43
|
-
process.stderr.write(red(`Error: ${errorMessage(error)}\n`));
|
|
44
|
-
return Effect.fail(new CliExit());
|
|
45
|
-
}
|
|
46
|
-
if (Option.isSome(group) && files.length > 0) {
|
|
47
|
-
process.stderr.write(red('Error: --group cannot be combined with Story file arguments\n'));
|
|
48
|
-
return Effect.fail(new CliExit());
|
|
49
|
-
}
|
|
50
|
-
const run = selectedGroupPath
|
|
51
|
-
? runStoryGroup(process.cwd(), selectedGroupPath, options)
|
|
52
|
-
: runStories(process.cwd(), files, options);
|
|
53
|
-
return run.pipe(Effect.flatMap((result) => Effect.suspend(() => {
|
|
54
|
-
reportStoriesRun(result);
|
|
55
|
-
if (result.status === 'passed')
|
|
56
|
-
return Effect.void;
|
|
57
|
-
return Effect.fail(new CliExit());
|
|
58
|
-
})), Effect.catch((error) => error instanceof CliExit
|
|
59
|
-
? Effect.fail(error)
|
|
60
|
-
: Effect.sync(() => {
|
|
61
|
-
process.stderr.write(red(`Error: ${errorMessage(error)}\n`));
|
|
62
|
-
}).pipe(Effect.andThen(Effect.fail(new CliExit())))));
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
function groupPath(input) {
|
|
66
|
-
const path = input.split('/').map((segment) => segment.trim());
|
|
67
|
-
if (path.length === 0 || path.some((segment) => segment.length === 0)) {
|
|
68
|
-
throw new Error(`Invalid --group "${input}"; use a path such as "DynamoDB / Entities"`);
|
|
69
|
-
}
|
|
70
|
-
return path;
|
|
71
|
-
}
|
|
72
|
-
function storyRunOptions(timeout) {
|
|
73
|
-
if (Option.isNone(timeout))
|
|
74
|
-
return {};
|
|
75
|
-
const input = timeout.value;
|
|
76
|
-
let millis;
|
|
77
|
-
try {
|
|
78
|
-
millis = Duration.toMillis(input);
|
|
79
|
-
}
|
|
80
|
-
catch {
|
|
81
|
-
millis = Number.NaN;
|
|
82
|
-
}
|
|
83
|
-
if (!Number.isFinite(millis) || millis <= 0) {
|
|
84
|
-
throw new Error(`Invalid --timeout "${timeout.value}"; use a duration such as "90 seconds"`);
|
|
85
|
-
}
|
|
86
|
-
return { timeout: input };
|
|
87
|
-
}
|
|
88
|
-
function reportStoriesRun(result) {
|
|
89
|
-
const stories = Object.entries(result.report.stories);
|
|
90
|
-
process.stdout.write(`${stories.length} ${stories.length === 1 ? 'Story' : 'Stories'} executed.\n`);
|
|
91
|
-
for (const [storyId, artifact] of stories) {
|
|
92
|
-
reportStory(storyId, artifact);
|
|
93
|
-
}
|
|
94
|
-
for (const failure of result.failures) {
|
|
95
|
-
const scope = failure.scenario === undefined
|
|
96
|
-
? failure.storyId
|
|
97
|
-
: `${failure.storyId} › ${failure.scenario}`;
|
|
98
|
-
const phase = failure.phase === undefined ? '' : ` [${failure.phase}]`;
|
|
99
|
-
process.stderr.write(red(` - ${scope}${phase}: ${failure.message}\n`));
|
|
100
|
-
}
|
|
101
|
-
if (result.status === 'passed') {
|
|
102
|
-
process.stdout.write(green('All Scenarios passed.\n'));
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
process.stderr.write(red('Some Scenarios failed or were interrupted.\n'));
|
|
106
|
-
}
|
|
107
|
-
function reportStory(storyId, artifact) {
|
|
108
|
-
const passed = artifact.scenarios.every(({ outcome }) => outcome === 'succeeded' || outcome === 'skipped');
|
|
109
|
-
process.stdout.write(`\n${passed ? green('✓') : red('×')} ${artifact.name} ${paintMuted(`(${storyId})`)}\n`);
|
|
110
|
-
for (const scenario of artifact.scenarios) {
|
|
111
|
-
const icon = scenario.outcome === 'succeeded'
|
|
112
|
-
? green('✓')
|
|
113
|
-
: scenario.outcome === 'skipped'
|
|
114
|
-
? paintMuted('○')
|
|
115
|
-
: scenario.outcome === 'interrupted'
|
|
116
|
-
? yellow('!')
|
|
117
|
-
: red('×');
|
|
118
|
-
const timing = scenario.durationMillis === undefined
|
|
119
|
-
? ''
|
|
120
|
-
: paintMuted(` ${scenario.durationMillis}ms`);
|
|
121
|
-
process.stdout.write(` ${icon} ${scenario.name}${timing}\n`);
|
|
122
|
-
reportUnsuccessfulPaths(artifact, scenario.execution);
|
|
123
|
-
}
|
|
124
|
-
reportDecisionGaps(artifact);
|
|
125
|
-
}
|
|
126
|
-
function reportUnsuccessfulPaths(artifact, execution, parents = []) {
|
|
127
|
-
for (const item of execution) {
|
|
128
|
-
if ('parallel' in item) {
|
|
129
|
-
for (const branch of item.parallel) {
|
|
130
|
-
reportUnsuccessfulPaths(artifact, branch, parents);
|
|
131
|
-
}
|
|
132
|
-
continue;
|
|
133
|
-
}
|
|
134
|
-
const name = artifact.blocks[item.blockId]?.name ?? item.blockId;
|
|
135
|
-
const path = [...parents, name];
|
|
136
|
-
if (item.outcome !== 'succeeded') {
|
|
137
|
-
process.stdout.write(` ${yellow(item.outcome)}: ${path.join(' › ')}\n`);
|
|
138
|
-
}
|
|
139
|
-
reportUnsuccessfulPaths(artifact, item.children, path);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
function reportDecisionGaps(artifact) {
|
|
143
|
-
for (const [blockId, block] of Object.entries(artifact.blocks)) {
|
|
144
|
-
if (block.kind !== 'decision')
|
|
145
|
-
continue;
|
|
146
|
-
const observed = new Set();
|
|
147
|
-
for (const scenario of artifact.scenarios) {
|
|
148
|
-
collectSelectedArms(scenario.execution, blockId, observed);
|
|
149
|
-
}
|
|
150
|
-
const missing = block.arms.filter((arm) => !observed.has(selectedArmKey(arm)));
|
|
151
|
-
if (missing.length === 0)
|
|
152
|
-
continue;
|
|
153
|
-
const location = `${block.location.file}:${block.location.line}:${block.location.column}`;
|
|
154
|
-
process.stdout.write(` ${paintMuted('decision')} ${block.name}: ${block.arms.length - missing.length}/${block.arms.length} arms observed ${paintMuted(`(${location})`)}\n`);
|
|
155
|
-
process.stdout.write(` unobserved: ${missing.map((arm) => arm.name).join(', ')}\n`);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
function collectSelectedArms(execution, blockId, observed) {
|
|
159
|
-
for (const item of execution) {
|
|
160
|
-
if ('parallel' in item) {
|
|
161
|
-
for (const branch of item.parallel) {
|
|
162
|
-
collectSelectedArms(branch, blockId, observed);
|
|
163
|
-
}
|
|
164
|
-
continue;
|
|
165
|
-
}
|
|
166
|
-
if (item.blockId === blockId && item.selectedArm !== undefined) {
|
|
167
|
-
observed.add(selectedArmKey(item.selectedArm));
|
|
168
|
-
}
|
|
169
|
-
collectSelectedArms(item.children, blockId, observed);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
function selectedArmKey(arm) {
|
|
173
|
-
return arm.kind === 'otherwise'
|
|
174
|
-
? 'otherwise'
|
|
175
|
-
: `literal:${typeof arm.value}:${String(arm.value)}`;
|
|
176
|
-
}
|
|
177
|
-
const paintMuted = paint(process.stdout, '2');
|
|
178
|
-
function reportCoverage(report) {
|
|
179
|
-
const ignored = Object.values(report.files).filter((file) => file.kind === 'ignored').length;
|
|
180
|
-
const layerCoverage = report.coverage.layers;
|
|
181
|
-
const moduleTotal = report.coverage.modules.reduce((total, coverage) => total + coverage.totalFiles, 0);
|
|
182
|
-
const moduleCovered = report.coverage.modules.reduce((total, coverage) => total + coverage.coveredFiles, 0);
|
|
183
|
-
const ignoredSuffix = ignored > 0 ? ` (${ignored} ignored)` : '';
|
|
184
|
-
process.stdout.write([
|
|
185
|
-
`Scanned ${layerCoverage.totalFiles} source file(s)${ignoredSuffix}.`,
|
|
186
|
-
`Layers: ${layerCoverage.coveredFiles}/${layerCoverage.totalFiles} file(s) covered.`,
|
|
187
|
-
`Modules: ${moduleCovered}/${moduleTotal} layer-covered file(s) covered.`,
|
|
188
|
-
].join('\n') + '\n');
|
|
189
|
-
if (layerCoverage.uncovered.length > 0) {
|
|
190
|
-
writeWarningList('file(s) not covered by any layer', layerCoverage.uncovered);
|
|
191
|
-
}
|
|
192
|
-
for (const coverage of report.coverage.modules) {
|
|
193
|
-
if (coverage.uncovered.length > 0) {
|
|
194
|
-
writeWarningList(`file(s) in layer "${coverage.layer}" not covered by a module`, coverage.uncovered);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
function reportWarnings(report) {
|
|
199
|
-
for (const warning of report.warnings) {
|
|
200
|
-
const detail = warning.kind === 'missing-source-root'
|
|
201
|
-
? `source root does not exist: ${warning.path}`
|
|
202
|
-
: warning.kind === 'missing-layer-path'
|
|
203
|
-
? `layer "${warning.layer}" path does not exist: ${warning.path}`
|
|
204
|
-
: `module path does not exist: ${warning.path}`;
|
|
205
|
-
process.stdout.write(yellow(`warning: ${detail}\n`));
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
function writeWarningList(title, files) {
|
|
209
|
-
process.stdout.write(yellow(`warning: ${files.length} ${title}:\n`));
|
|
210
|
-
for (const file of files)
|
|
211
|
-
process.stdout.write(yellow(` - ${file}\n`));
|
|
212
|
-
}
|
|
213
|
-
function reportViolations(violations) {
|
|
214
|
-
process.stderr.write(red(`Found ${violations.length} architecture violation(s):\n`));
|
|
215
|
-
for (const violation of violations) {
|
|
216
|
-
if (violation.kind === 'layer') {
|
|
217
|
-
process.stderr.write(red(` - [layer] ${violation.from.layer} -> ${violation.to.layer}\n`));
|
|
218
|
-
}
|
|
219
|
-
else {
|
|
220
|
-
process.stderr.write(red(` - [${violation.rule}] ${violation.from.module} -> ${violation.to.module}\n`));
|
|
221
|
-
}
|
|
222
|
-
process.stderr.write(red(` ${violation.from.file} -> ${violation.to.file}\n`));
|
|
223
|
-
}
|
|
224
|
-
process.stderr.write(red(`Lint failed: ${violations.length} violation(s).\n`));
|
|
225
|
-
}
|
|
226
|
-
function errorMessage(error) {
|
|
227
|
-
if (typeof error === 'object' &&
|
|
228
|
-
error !== null &&
|
|
229
|
-
'cause' in error &&
|
|
230
|
-
error.cause !== undefined) {
|
|
231
|
-
return errorMessage(error.cause);
|
|
232
|
-
}
|
|
233
|
-
return error instanceof Error ? error.message : String(error);
|
|
234
|
-
}
|
|
235
|
-
const lintCommand = Command.make('lint', {}, lint).pipe(Command.withDescription('Check the project against its declared architecture. Coverage gaps are warnings only.'));
|
|
236
|
-
const storiesCommand = Command.make('stories', {
|
|
237
|
-
stories: Argument.string('story').pipe(Argument.variadic()),
|
|
238
|
-
timeout: Flag.string('timeout').pipe(Flag.optional, Flag.withDescription('Default Scenario timeout for this run, e.g. "90 seconds".')),
|
|
239
|
-
group: Flag.string('group').pipe(Flag.optional, Flag.withDescription('Run one Story Group subtree, e.g. "DynamoDB / Entities".')),
|
|
240
|
-
}, ({ stories: files, timeout, group }) => stories(files, timeout, group)).pipe(Command.withDescription('Run Story files or one --group subtree (all Stories by default) and print fresh execution evidence.'));
|
|
241
|
-
export const command = Command.make('laymos', {}, () => Effect.void).pipe(Command.withSubcommands([lintCommand, storiesCommand]));
|
|
242
|
-
export const cli = command.pipe(Command.run({ version: '0.0.0' }));
|
|
1
|
+
import { Effect } from 'effect';
|
|
2
|
+
import { Command, Flag } from 'effect/unstable/cli';
|
|
3
|
+
import { makeInspectCommand } from './inspect/index.js';
|
|
4
|
+
import { makeLintCommand } from './lint/index.js';
|
|
5
|
+
import { makeStoriesCommand } from './stories/index.js';
|
|
6
|
+
const rootCommand = Command.make('laymos', {}, () => Effect.void).pipe(Command.withSharedFlags({
|
|
7
|
+
config: Flag.string('config').pipe(Flag.withDefault('laymos.config.json'), Flag.withDescription('Config file path. Project paths are relative to its directory.')),
|
|
8
|
+
}));
|
|
9
|
+
const configPath = rootCommand.pipe(Effect.map(({ config }) => config));
|
|
10
|
+
export const cli = rootCommand.pipe(Command.withSubcommands([
|
|
11
|
+
makeInspectCommand(configPath),
|
|
12
|
+
makeLintCommand(configPath),
|
|
13
|
+
makeStoriesCommand(configPath),
|
|
14
|
+
]), Command.run({ version: '0.0.1' }));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/stories/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { makeStoriesCommand } from './stories.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { StoryVerdict } from '../../story/schema/index.js';
|
|
2
|
+
export interface StoryProgress {
|
|
3
|
+
readonly record: (verdict: StoryVerdict) => void;
|
|
4
|
+
readonly stop: () => void;
|
|
5
|
+
}
|
|
6
|
+
export declare function startProgress(total: number): StoryProgress;
|
|
7
|
+
//# sourceMappingURL=progress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/cli/stories/progress.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAGhE,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAAC;IACjD,QAAQ,CAAC,IAAI,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,CAuB1D"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as colors from 'yoctocolors';
|
|
2
|
+
import { countVerdict, emptyTally, renderTally } from './report.js';
|
|
3
|
+
export function startProgress(total) {
|
|
4
|
+
const line = liveLine();
|
|
5
|
+
if (line === null)
|
|
6
|
+
return silentProgress;
|
|
7
|
+
let tally = emptyTally;
|
|
8
|
+
let frame = 0;
|
|
9
|
+
const draw = () => line.write(`${colors.cyan(spinner[frame])} ${renderTally(tally, total)}`);
|
|
10
|
+
const ticker = setInterval(() => {
|
|
11
|
+
frame = (frame + 1) % spinner.length;
|
|
12
|
+
draw();
|
|
13
|
+
}, frameMillis);
|
|
14
|
+
ticker.unref();
|
|
15
|
+
draw();
|
|
16
|
+
return {
|
|
17
|
+
record: (verdict) => {
|
|
18
|
+
tally = countVerdict(tally, verdict);
|
|
19
|
+
draw();
|
|
20
|
+
},
|
|
21
|
+
stop: () => {
|
|
22
|
+
clearInterval(ticker);
|
|
23
|
+
line.clear();
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
const spinner = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
|
|
28
|
+
const frameMillis = 80;
|
|
29
|
+
const silentProgress = { record: () => { }, stop: () => { } };
|
|
30
|
+
function liveLine() {
|
|
31
|
+
const stream = process.stderr;
|
|
32
|
+
if (!stream.isTTY)
|
|
33
|
+
return null;
|
|
34
|
+
const clear = () => {
|
|
35
|
+
stream.clearLine(0);
|
|
36
|
+
stream.cursorTo(0);
|
|
37
|
+
};
|
|
38
|
+
return {
|
|
39
|
+
write: (text) => {
|
|
40
|
+
clear();
|
|
41
|
+
stream.write(text);
|
|
42
|
+
},
|
|
43
|
+
clear,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { StoryReport, StoryVerdict } from '../../story/schema/index.js';
|
|
2
|
+
export type VerdictTally = Readonly<Record<StoryVerdict, number>>;
|
|
3
|
+
export declare const emptyTally: VerdictTally;
|
|
4
|
+
export declare function countVerdict(tally: VerdictTally, verdict: StoryVerdict): VerdictTally;
|
|
5
|
+
export declare function tallyReports(reports: readonly StoryReport[]): VerdictTally;
|
|
6
|
+
export declare function renderTally(tally: VerdictTally, total: number): string;
|
|
7
|
+
export declare function renderSummary(reports: readonly StoryReport[], total: number): string;
|
|
8
|
+
export declare function renderStoryReports(reports: readonly StoryReport[]): string;
|
|
9
|
+
//# sourceMappingURL=report.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../../src/cli/stories/report.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,WAAW,EACX,YAAY,EACb,MAAM,6BAA6B,CAAC;AAErC,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;AAElE,eAAO,MAAM,UAAU,EAAE,YAAmD,CAAC;AAE7E,wBAAgB,YAAY,CAC1B,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,YAAY,GACpB,YAAY,CAEd;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,GAAG,YAAY,CAK1E;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAStE;AAED,wBAAgB,aAAa,CAC3B,OAAO,EAAE,SAAS,WAAW,EAAE,EAC/B,KAAK,EAAE,MAAM,GACZ,MAAM,CAKR;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,GAAG,MAAM,CAE1E"}
|