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,39 @@
|
|
|
1
|
+
import { posix } from 'node:path';
|
|
2
|
+
export function findInvalidPaths(config) {
|
|
3
|
+
return configPaths(config)
|
|
4
|
+
.filter(({ path }) => !isCanonicalProjectPath(path))
|
|
5
|
+
.map(({ location, path }) => ({
|
|
6
|
+
kind: 'path',
|
|
7
|
+
message: `${location} must be a canonical project-relative path: ${JSON.stringify(path)}`,
|
|
8
|
+
}));
|
|
9
|
+
}
|
|
10
|
+
function configPaths(config) {
|
|
11
|
+
return [
|
|
12
|
+
...config.sourceRoots.map((path, index) => ({
|
|
13
|
+
location: `sourceRoots[${index}]`,
|
|
14
|
+
path,
|
|
15
|
+
})),
|
|
16
|
+
...config.ignoredPaths.map((path, index) => ({
|
|
17
|
+
location: `ignoredPaths[${index}]`,
|
|
18
|
+
path,
|
|
19
|
+
})),
|
|
20
|
+
...Object.entries(config.layers).flatMap(([layer, value]) => value.paths.map((path, index) => ({
|
|
21
|
+
location: `layers.${layer}.paths[${index}]`,
|
|
22
|
+
path,
|
|
23
|
+
}))),
|
|
24
|
+
];
|
|
25
|
+
}
|
|
26
|
+
function isCanonicalProjectPath(path) {
|
|
27
|
+
if (path === '.')
|
|
28
|
+
return true;
|
|
29
|
+
if (path.length === 0 ||
|
|
30
|
+
path.includes('\\') ||
|
|
31
|
+
path.startsWith('/') ||
|
|
32
|
+
path.endsWith('/') ||
|
|
33
|
+
path.startsWith('../') ||
|
|
34
|
+
path === '..' ||
|
|
35
|
+
/^[A-Za-z]:/.test(path)) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
return posix.normalize(path) === path;
|
|
39
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../../src/domain/project-config/validation/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAK1E,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,GACb,SAAS,qBAAqB,EAAE,CAQlC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { validateLayers } from './layers/index.js';
|
|
2
|
+
import { validateModules } from './modules/index.js';
|
|
3
|
+
import { findInvalidPaths } from './paths.js';
|
|
4
|
+
export function validateProjectConfig(config) {
|
|
5
|
+
const pathIssues = findInvalidPaths(config);
|
|
6
|
+
const moduleIssues = validateModules(config);
|
|
7
|
+
const modulePathIssues = moduleIssues.filter(({ kind }) => kind === 'path');
|
|
8
|
+
if (pathIssues.length > 0 || modulePathIssues.length > 0) {
|
|
9
|
+
return [...pathIssues, ...modulePathIssues];
|
|
10
|
+
}
|
|
11
|
+
return [...validateLayers(config), ...moduleIssues];
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../src/entrypoints/cli/cli.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Effect } from 'effect';
|
|
3
|
+
import * as NodeRuntime from '@effect/platform-node/NodeRuntime';
|
|
4
|
+
import * as NodeServices from '@effect/platform-node/NodeServices';
|
|
5
|
+
import { cli } from './run.js';
|
|
6
|
+
cli.pipe(Effect.provide(NodeServices.layer), NodeRuntime.runMain());
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Effect, FileSystem, Path } from 'effect';
|
|
2
|
+
import { Command } from 'effect/unstable/cli';
|
|
3
|
+
import type { LaymosReport } from '../../report/index.js';
|
|
4
|
+
export declare function lintPasses(report: Pick<LaymosReport, 'violations'>): boolean;
|
|
5
|
+
export declare const command: Command.Command<"laymos", {
|
|
6
|
+
readonly color: boolean;
|
|
7
|
+
} | {
|
|
8
|
+
readonly color: boolean;
|
|
9
|
+
}, {
|
|
10
|
+
readonly color: boolean;
|
|
11
|
+
}, never, FileSystem.FileSystem | Path.Path>;
|
|
12
|
+
export declare const cli: Effect.Effect<void, import("effect/unstable/cli/CliError").CliError, Command.Environment>;
|
|
13
|
+
//# sourceMappingURL=run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/entrypoints/cli/run.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAU,IAAI,EAAU,MAAM,QAAQ,CAAC;AAClE,OAAO,EAAY,OAAO,EAAQ,MAAM,qBAAqB,CAAC;AAG9D,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,uBAAuB,CAAC;AAUrE,wBAAgB,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,YAAY,EAAE,YAAY,CAAC,GAAG,OAAO,CAE5E;AA+KD,eAAO,MAAM,OAAO;;;;;;4CAEnB,CAAC;AAEF,eAAO,MAAM,GAAG,2FAAkD,CAAC"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { statSync } from 'node:fs';
|
|
2
|
+
import { resolve } from 'node:path';
|
|
3
|
+
import { Effect, Option, Schema } from 'effect';
|
|
4
|
+
import { Argument, Command, Flag } from 'effect/unstable/cli';
|
|
5
|
+
import { analyzeProject, runTests } from '../node/index.js';
|
|
6
|
+
import { renderTestsReport, selectedTestCases } from './test-output.js';
|
|
7
|
+
const paint = (stream, code, color) => (text) => color && stream.isTTY && process.env['NO_COLOR'] === undefined
|
|
8
|
+
? `\x1b[${code}m${text}\x1b[0m`
|
|
9
|
+
: text;
|
|
10
|
+
export function lintPasses(report) {
|
|
11
|
+
return report.violations.length === 0;
|
|
12
|
+
}
|
|
13
|
+
function lint(color) {
|
|
14
|
+
const green = paint(process.stdout, '32', color);
|
|
15
|
+
const yellow = paint(process.stdout, '33', color);
|
|
16
|
+
const red = paint(process.stderr, '31', color);
|
|
17
|
+
return analyzeProject({ projectDir: process.cwd() }).pipe(Effect.flatMap((report) => Effect.suspend(() => {
|
|
18
|
+
reportCoverage(report, yellow);
|
|
19
|
+
reportWarnings(report, yellow);
|
|
20
|
+
if (lintPasses(report)) {
|
|
21
|
+
process.stdout.write(green('No violations found.\n'));
|
|
22
|
+
return Effect.void;
|
|
23
|
+
}
|
|
24
|
+
reportViolations(report.violations, red);
|
|
25
|
+
return markFailure();
|
|
26
|
+
})), Effect.catch((error) => Effect.sync(() => {
|
|
27
|
+
process.stderr.write(red(`Error: ${errorMessage(error)}\n`));
|
|
28
|
+
process.exitCode = 1;
|
|
29
|
+
})));
|
|
30
|
+
}
|
|
31
|
+
function reportCoverage(report, yellow) {
|
|
32
|
+
const ignored = Object.values(report.files).filter((file) => file.kind === 'ignored').length;
|
|
33
|
+
const layerCoverage = report.coverage.layers;
|
|
34
|
+
const moduleTotal = report.coverage.modules.reduce((total, coverage) => total + coverage.totalFiles, 0);
|
|
35
|
+
const moduleCovered = report.coverage.modules.reduce((total, coverage) => total + coverage.coveredFiles, 0);
|
|
36
|
+
const ignoredSuffix = ignored > 0 ? ` (${ignored} ignored)` : '';
|
|
37
|
+
process.stdout.write([
|
|
38
|
+
`Scanned ${layerCoverage.totalFiles} source file(s)${ignoredSuffix}.`,
|
|
39
|
+
`Layers: ${layerCoverage.coveredFiles}/${layerCoverage.totalFiles} file(s) covered.`,
|
|
40
|
+
`Modules: ${moduleCovered}/${moduleTotal} layer-covered file(s) covered.`,
|
|
41
|
+
].join('\n') + '\n');
|
|
42
|
+
if (layerCoverage.uncovered.length > 0) {
|
|
43
|
+
writeWarningList('file(s) not covered by any layer', layerCoverage.uncovered, yellow);
|
|
44
|
+
}
|
|
45
|
+
for (const coverage of report.coverage.modules) {
|
|
46
|
+
if (coverage.uncovered.length > 0) {
|
|
47
|
+
writeWarningList(`file(s) in layer "${coverage.layer}" not covered by a module`, coverage.uncovered, yellow);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function reportWarnings(report, yellow) {
|
|
52
|
+
for (const warning of report.warnings) {
|
|
53
|
+
const detail = warning.kind === 'missing-source-root'
|
|
54
|
+
? `source root does not exist: ${warning.path}`
|
|
55
|
+
: warning.kind === 'missing-layer-path'
|
|
56
|
+
? `layer "${warning.layer}" path does not exist: ${warning.path}`
|
|
57
|
+
: `module path does not exist: ${warning.path}`;
|
|
58
|
+
process.stdout.write(yellow(`warning: ${detail}\n`));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function writeWarningList(title, files, yellow) {
|
|
62
|
+
process.stdout.write(yellow(`warning: ${files.length} ${title}:\n`));
|
|
63
|
+
for (const file of files)
|
|
64
|
+
process.stdout.write(yellow(` - ${file}\n`));
|
|
65
|
+
}
|
|
66
|
+
function reportViolations(violations, red) {
|
|
67
|
+
process.stderr.write(red(`Found ${violations.length} architecture violation(s):\n`));
|
|
68
|
+
for (const violation of violations) {
|
|
69
|
+
if (violation.kind === 'layer') {
|
|
70
|
+
process.stderr.write(red(` - [layer] ${violation.from.layer} -> ${violation.to.layer}\n`));
|
|
71
|
+
}
|
|
72
|
+
else if (violation.kind === 'module') {
|
|
73
|
+
process.stderr.write(red(` - [${violation.rule}] ${violation.from.module} -> ${violation.to.module}\n`));
|
|
74
|
+
}
|
|
75
|
+
process.stderr.write(red(` ${violation.from.file} -> ${violation.to.file}\n`));
|
|
76
|
+
}
|
|
77
|
+
process.stderr.write(red(`Lint failed: ${violations.length} violation(s).\n`));
|
|
78
|
+
}
|
|
79
|
+
const ErrorMessageSchema = Schema.Struct({ message: Schema.String });
|
|
80
|
+
function errorMessage(error) {
|
|
81
|
+
const decoded = Schema.decodeUnknownOption(ErrorMessageSchema)(error);
|
|
82
|
+
return Option.isSome(decoded) ? decoded.value.message : String(error);
|
|
83
|
+
}
|
|
84
|
+
const colorFlag = Flag.boolean('color').pipe(Flag.withDefault(true), Flag.withDescription('Enable terminal colors; use --no-color to disable.'));
|
|
85
|
+
const rootCommand = Command.make('laymos', {}, () => Effect.void).pipe(Command.withSharedFlags({ color: colorFlag }));
|
|
86
|
+
const lintCommand = Command.make('lint', {}, () => Effect.gen(function* () {
|
|
87
|
+
const { color } = yield* rootCommand;
|
|
88
|
+
yield* lint(color);
|
|
89
|
+
})).pipe(Command.withDescription('Lint the declared project architecture.'));
|
|
90
|
+
const targetArgument = Argument.string('target').pipe(Argument.withDescription('Existing test file or literal test-name query.'), Argument.optional);
|
|
91
|
+
const verboseFlag = Flag.boolean('verbose').pipe(Flag.withDefault(false), Flag.withDescription('Expand all evidence, trace attributes, events, and logs.'));
|
|
92
|
+
const testCommand = Command.make('test', { target: targetArgument, verbose: verboseFlag }, ({ target, verbose }) => Effect.gen(function* () {
|
|
93
|
+
const { color } = yield* rootCommand;
|
|
94
|
+
yield* test(Option.getOrUndefined(target), verbose, color);
|
|
95
|
+
})).pipe(Command.withDescription('Run Vitest and present cases, assertions, traces, and timing.'));
|
|
96
|
+
export const command = rootCommand.pipe(Command.withSubcommands([lintCommand, testCommand]));
|
|
97
|
+
export const cli = command.pipe(Command.run({ version: '0.0.1' }));
|
|
98
|
+
function test(target, verbose, color) {
|
|
99
|
+
const selection = resolveTestSelection(target);
|
|
100
|
+
const red = paint(process.stderr, '31', color);
|
|
101
|
+
return runTests({
|
|
102
|
+
projectDir: process.cwd(),
|
|
103
|
+
...(selection?.kind === 'file' ? { files: [selection.path] } : {}),
|
|
104
|
+
...(selection?.kind === 'name'
|
|
105
|
+
? { testNamePattern: literalNamePattern(selection.query) }
|
|
106
|
+
: {}),
|
|
107
|
+
}).pipe(Effect.flatMap((report) => Effect.suspend(() => {
|
|
108
|
+
const nameQuery = selection?.kind === 'name' ? selection.query : undefined;
|
|
109
|
+
const selected = selectedTestCases(report, nameQuery);
|
|
110
|
+
const reportOptions = {
|
|
111
|
+
color: color &&
|
|
112
|
+
process.stdout.isTTY === true &&
|
|
113
|
+
process.env['NO_COLOR'] === undefined,
|
|
114
|
+
detailed: target !== undefined || verbose,
|
|
115
|
+
...(nameQuery === undefined ? {} : { nameQuery }),
|
|
116
|
+
verbose,
|
|
117
|
+
};
|
|
118
|
+
if (selected.length === 0) {
|
|
119
|
+
if (report.status === 'failed') {
|
|
120
|
+
process.stdout.write(renderTestsReport(report, reportOptions));
|
|
121
|
+
}
|
|
122
|
+
const message = nameQuery === undefined
|
|
123
|
+
? 'No tests found.'
|
|
124
|
+
: `No tests matched "${nameQuery}".`;
|
|
125
|
+
process.stderr.write(red(`${message}\n`));
|
|
126
|
+
return markFailure();
|
|
127
|
+
}
|
|
128
|
+
process.stdout.write(renderTestsReport(report, reportOptions));
|
|
129
|
+
return report.status === 'failed' ? markFailure() : Effect.void;
|
|
130
|
+
})), Effect.catch((error) => Effect.sync(() => {
|
|
131
|
+
process.stderr.write(red(`Error: ${errorMessage(error)}\n`));
|
|
132
|
+
process.exitCode = 1;
|
|
133
|
+
})));
|
|
134
|
+
}
|
|
135
|
+
function markFailure() {
|
|
136
|
+
return Effect.sync(() => {
|
|
137
|
+
process.exitCode = 1;
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
function resolveTestSelection(target) {
|
|
141
|
+
if (target === undefined)
|
|
142
|
+
return undefined;
|
|
143
|
+
const path = resolve(process.cwd(), target);
|
|
144
|
+
try {
|
|
145
|
+
if (statSync(path).isFile())
|
|
146
|
+
return { kind: 'file', path };
|
|
147
|
+
}
|
|
148
|
+
catch {
|
|
149
|
+
return { kind: 'name', query: target };
|
|
150
|
+
}
|
|
151
|
+
return { kind: 'name', query: target };
|
|
152
|
+
}
|
|
153
|
+
function literalNamePattern(query) {
|
|
154
|
+
return new RegExp(query.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), 'i');
|
|
155
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { TestCaseReport, TestsReport } from '../../report/tests.js';
|
|
2
|
+
export interface TestOutputOptions {
|
|
3
|
+
readonly color: boolean;
|
|
4
|
+
readonly detailed: boolean;
|
|
5
|
+
readonly nameQuery?: string;
|
|
6
|
+
readonly verbose: boolean;
|
|
7
|
+
}
|
|
8
|
+
interface SelectedCase {
|
|
9
|
+
readonly caseReport: TestCaseReport;
|
|
10
|
+
readonly modulePath: string;
|
|
11
|
+
}
|
|
12
|
+
/** Returns the cases visible for an optional literal full-name query. */
|
|
13
|
+
export declare function selectedTestCases(report: TestsReport, nameQuery?: string): readonly SelectedCase[];
|
|
14
|
+
/** Renders a completed Test Report for terminal presentation. */
|
|
15
|
+
export declare function renderTestsReport(report: TestsReport, options: TestOutputOptions): string;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=test-output.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-output.d.ts","sourceRoot":"","sources":["../../../src/entrypoints/cli/test-output.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,cAAc,EAOd,WAAW,EACZ,MAAM,uBAAuB,CAAC;AAE/B,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AASD,UAAU,YAAY;IACpB,QAAQ,CAAC,UAAU,EAAE,cAAc,CAAC;IACpC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,yEAAyE;AACzE,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,WAAW,EACnB,SAAS,CAAC,EAAE,MAAM,GACjB,SAAS,YAAY,EAAE,CAqBzB;AAED,iEAAiE;AACjE,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,iBAAiB,GACzB,MAAM,CA+CR"}
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
/** Returns the cases visible for an optional literal full-name query. */
|
|
2
|
+
export function selectedTestCases(report, nameQuery) {
|
|
3
|
+
const normalizedQuery = nameQuery?.toLocaleLowerCase();
|
|
4
|
+
return report.modules.flatMap((module) => [...module.cases, ...module.suites.flatMap(collectSuiteCases)]
|
|
5
|
+
.filter((caseReport) => normalizedQuery === undefined ||
|
|
6
|
+
caseReport.fullName.toLocaleLowerCase().includes(normalizedQuery))
|
|
7
|
+
.map((caseReport) => ({
|
|
8
|
+
caseReport,
|
|
9
|
+
modulePath: module.path,
|
|
10
|
+
}))
|
|
11
|
+
.sort((left, right) => (left.caseReport.location?.line ?? Number.MAX_SAFE_INTEGER) -
|
|
12
|
+
(right.caseReport.location?.line ?? Number.MAX_SAFE_INTEGER) ||
|
|
13
|
+
(left.caseReport.location?.column ?? Number.MAX_SAFE_INTEGER) -
|
|
14
|
+
(right.caseReport.location?.column ?? Number.MAX_SAFE_INTEGER)));
|
|
15
|
+
}
|
|
16
|
+
/** Renders a completed Test Report for terminal presentation. */
|
|
17
|
+
export function renderTestsReport(report, options) {
|
|
18
|
+
const palette = makePalette(options.color);
|
|
19
|
+
const selected = selectedTestCases(report, options.nameQuery);
|
|
20
|
+
const byModule = Map.groupBy(selected, ({ modulePath }) => modulePath);
|
|
21
|
+
const lines = [];
|
|
22
|
+
for (const [modulePath, cases] of byModule) {
|
|
23
|
+
const status = aggregateStatus(cases.map(({ caseReport }) => caseReport.status));
|
|
24
|
+
lines.push(`${statusLabel(status, palette)} ${modulePath}`, ...cases.flatMap(({ caseReport }) => options.detailed || caseReport.status === 'failed'
|
|
25
|
+
? renderDetailedCase(caseReport, modulePath, options, palette)
|
|
26
|
+
: renderCompactCase(caseReport, palette)), '');
|
|
27
|
+
}
|
|
28
|
+
const hierarchyErrors = report.modules.flatMap((module) => [
|
|
29
|
+
...module.errors,
|
|
30
|
+
...module.suites.flatMap(collectSuiteErrors),
|
|
31
|
+
]);
|
|
32
|
+
if (hierarchyErrors.length > 0) {
|
|
33
|
+
lines.push(palette.red('Test collection errors'), ...hierarchyErrors.flatMap((error) => renderError(error, options.verbose, palette, ' ')), '');
|
|
34
|
+
}
|
|
35
|
+
if (report.unhandledErrors.length > 0) {
|
|
36
|
+
lines.push(palette.red('Unhandled errors'), ...report.unhandledErrors.flatMap((error) => renderError(error, options.verbose, palette, ' ')), '');
|
|
37
|
+
}
|
|
38
|
+
lines.push(renderSummary(report, selected, palette));
|
|
39
|
+
return `${lines.join('\n')}\n`;
|
|
40
|
+
}
|
|
41
|
+
function collectSuiteCases(suite) {
|
|
42
|
+
return [...suite.cases, ...suite.suites.flatMap(collectSuiteCases)];
|
|
43
|
+
}
|
|
44
|
+
function collectSuiteErrors(suite) {
|
|
45
|
+
return [...suite.errors, ...suite.suites.flatMap(collectSuiteErrors)];
|
|
46
|
+
}
|
|
47
|
+
function aggregateStatus(statuses) {
|
|
48
|
+
if (statuses.some((status) => status === 'failed'))
|
|
49
|
+
return 'failed';
|
|
50
|
+
if (statuses.some((status) => status === 'passed'))
|
|
51
|
+
return 'passed';
|
|
52
|
+
if (statuses.some((status) => status === 'pending'))
|
|
53
|
+
return 'pending';
|
|
54
|
+
return 'skipped';
|
|
55
|
+
}
|
|
56
|
+
function renderCompactCase(report, palette) {
|
|
57
|
+
const evidence = report.evidence;
|
|
58
|
+
const details = [
|
|
59
|
+
evidence === undefined
|
|
60
|
+
? undefined
|
|
61
|
+
: `${evidence.assertions.length} ${plural(evidence.assertions.length, 'assertion')}`,
|
|
62
|
+
evidence?.trace === undefined
|
|
63
|
+
? undefined
|
|
64
|
+
: `${evidence.trace.spans.length} ${plural(evidence.trace.spans.length, 'span')}`,
|
|
65
|
+
].filter((detail) => detail !== undefined);
|
|
66
|
+
const suffix = details.length === 0 ? '' : ` · ${details.join(' · ')}`;
|
|
67
|
+
return [
|
|
68
|
+
` ${statusSymbol(report.status, palette)} ${report.fullName} ${palette.dim(formatDuration(report.duration))}${suffix}`,
|
|
69
|
+
];
|
|
70
|
+
}
|
|
71
|
+
function renderDetailedCase(report, modulePath, options, palette) {
|
|
72
|
+
const location = report.location === undefined
|
|
73
|
+
? modulePath
|
|
74
|
+
: `${modulePath}:${report.location.line}:${report.location.column}`;
|
|
75
|
+
const lines = [
|
|
76
|
+
'',
|
|
77
|
+
` ${statusSymbol(report.status, palette)} ${report.fullName}`,
|
|
78
|
+
palette.dim(` ${location} · ${formatDuration(report.duration)}`),
|
|
79
|
+
];
|
|
80
|
+
if (report.evidence?.description !== undefined) {
|
|
81
|
+
lines.push('', ` ${report.evidence.description}`);
|
|
82
|
+
}
|
|
83
|
+
if (report.evidence !== undefined) {
|
|
84
|
+
lines.push('', palette.dim(' Assertions'), ...report.evidence.assertions.flatMap((assertion) => renderAssertion(assertion, options.verbose, palette)));
|
|
85
|
+
if (report.evidence.trace !== undefined) {
|
|
86
|
+
lines.push('', palette.dim(' Trace'), ...renderTrace(report.evidence.trace.spans, report.evidence.trace.logs, options.verbose, palette));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
if (report.errors.length > 0) {
|
|
90
|
+
lines.push('', palette.red(' Errors'), ...report.errors.flatMap((error) => renderError(error, options.verbose, palette, ' ')));
|
|
91
|
+
}
|
|
92
|
+
return lines;
|
|
93
|
+
}
|
|
94
|
+
function renderAssertion(assertion, verbose, palette) {
|
|
95
|
+
const lines = [
|
|
96
|
+
` ${assertion.status === 'passed' ? palette.green('✓') : palette.red('✗')} ${assertion.name}`,
|
|
97
|
+
];
|
|
98
|
+
if (assertion.expected !== undefined) {
|
|
99
|
+
lines.push(` expected: ${formatValue(assertion.expected)}`);
|
|
100
|
+
}
|
|
101
|
+
if (assertion.actual !== undefined) {
|
|
102
|
+
lines.push(` actual: ${formatValue(assertion.actual)}`);
|
|
103
|
+
}
|
|
104
|
+
if (verbose)
|
|
105
|
+
lines.push(palette.dim(` matcher: ${assertion.matcher}`));
|
|
106
|
+
if (assertion.error?.diff !== undefined) {
|
|
107
|
+
lines.push('', ...assertion.error.diff.split('\n').map((line) => ` ${line}`));
|
|
108
|
+
}
|
|
109
|
+
else if (assertion.status === 'failed' &&
|
|
110
|
+
assertion.error?.message !== undefined) {
|
|
111
|
+
lines.push(palette.red(` ${assertion.error.message}`));
|
|
112
|
+
}
|
|
113
|
+
if (verbose && assertion.error?.stack !== undefined) {
|
|
114
|
+
lines.push(...assertion.error.stack
|
|
115
|
+
.split('\n')
|
|
116
|
+
.map((line) => palette.dim(` ${line}`)));
|
|
117
|
+
}
|
|
118
|
+
return lines;
|
|
119
|
+
}
|
|
120
|
+
function renderTrace(spans, logs, verbose, palette) {
|
|
121
|
+
const byId = new Map(spans.map((span) => [span.spanId, span]));
|
|
122
|
+
const children = Map.groupBy(spans, (span) => span.parentSpanId !== null && byId.has(span.parentSpanId)
|
|
123
|
+
? span.parentSpanId
|
|
124
|
+
: null);
|
|
125
|
+
const logsBySpan = Map.groupBy(logs, ({ spanId }) => spanId);
|
|
126
|
+
const lines = (children.get(null) ?? []).flatMap((span, index, roots) => renderSpan(span, children, logsBySpan, '', index === roots.length - 1, verbose, palette));
|
|
127
|
+
const unscoped = logsBySpan.get(null) ?? [];
|
|
128
|
+
if (verbose && unscoped.length > 0) {
|
|
129
|
+
lines.push(' Unscoped logs', ...unscoped.map((log) => renderLog(log, ' ', palette)));
|
|
130
|
+
}
|
|
131
|
+
return lines;
|
|
132
|
+
}
|
|
133
|
+
function renderSpan(span, children, logs, prefix, last, verbose, palette) {
|
|
134
|
+
const branch = last ? '└─' : '├─';
|
|
135
|
+
const duration = span.endTime === null
|
|
136
|
+
? 'running'
|
|
137
|
+
: formatDuration(span.endTime - span.startTime);
|
|
138
|
+
const status = span.status === 'error' ? ` ${palette.red('[error]')}` : '';
|
|
139
|
+
const lines = [
|
|
140
|
+
` ${prefix}${branch} ${span.name} ${palette.dim(duration)}${status}`,
|
|
141
|
+
];
|
|
142
|
+
const detailPrefix = ` ${prefix}${last ? ' ' : '│ '}`;
|
|
143
|
+
if (verbose) {
|
|
144
|
+
const attributes = Object.entries(span.attributes);
|
|
145
|
+
if (attributes.length > 0) {
|
|
146
|
+
lines.push(`${detailPrefix}attributes:`, ...attributes.map(([key, value]) => `${detailPrefix} ${key}: ${formatValue(value)}`));
|
|
147
|
+
}
|
|
148
|
+
const spanLogs = logs.get(span.spanId) ?? [];
|
|
149
|
+
if (spanLogs.length > 0) {
|
|
150
|
+
lines.push(`${detailPrefix}logs:`, ...spanLogs.map((log) => renderLog(log, `${detailPrefix} `, palette)));
|
|
151
|
+
}
|
|
152
|
+
if (span.events.length > 0) {
|
|
153
|
+
lines.push(`${detailPrefix}events:`, ...span.events.flatMap((event) => [
|
|
154
|
+
`${detailPrefix} ${event.name} ${palette.dim(formatTimestampOffset(event.timestamp, span.startTime))}`,
|
|
155
|
+
...Object.entries(event.attributes).map(([key, value]) => `${detailPrefix} ${key}: ${formatValue(value)}`),
|
|
156
|
+
]));
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
const childSpans = children.get(span.spanId) ?? [];
|
|
160
|
+
for (const [index, child] of childSpans.entries()) {
|
|
161
|
+
lines.push(...renderSpan(child, children, logs, `${prefix}${last ? ' ' : '│ '}`, index === childSpans.length - 1, verbose, palette));
|
|
162
|
+
}
|
|
163
|
+
return lines;
|
|
164
|
+
}
|
|
165
|
+
function renderLog(log, prefix, palette) {
|
|
166
|
+
const level = log.level === 'Error' || log.level === 'Fatal'
|
|
167
|
+
? palette.red(log.level.toUpperCase())
|
|
168
|
+
: log.level === 'Warn'
|
|
169
|
+
? palette.yellow('WARN')
|
|
170
|
+
: palette.dim(log.level.toUpperCase());
|
|
171
|
+
const annotations = Object.entries(log.annotations)
|
|
172
|
+
.map(([key, value]) => `${key}=${formatValue(value)}`)
|
|
173
|
+
.join(' ');
|
|
174
|
+
return `${prefix}${level} ${formatValue(log.message)}${annotations === '' ? '' : ` ${palette.dim(annotations)}`}`;
|
|
175
|
+
}
|
|
176
|
+
function renderError(error, verbose, palette, prefix) {
|
|
177
|
+
const lines = [palette.red(`${prefix}${error.name}: ${error.message}`)];
|
|
178
|
+
if (error.diff !== undefined) {
|
|
179
|
+
lines.push(...error.diff.split('\n').map((line) => `${prefix}${line}`));
|
|
180
|
+
}
|
|
181
|
+
if (verbose && error.stack !== undefined) {
|
|
182
|
+
lines.push(...error.stack.split('\n').map((line) => palette.dim(`${prefix}${line}`)));
|
|
183
|
+
}
|
|
184
|
+
return lines;
|
|
185
|
+
}
|
|
186
|
+
function renderSummary(report, selected, palette) {
|
|
187
|
+
const cases = selected.map(({ caseReport }) => caseReport);
|
|
188
|
+
const passed = cases.filter(({ status }) => status === 'passed').length;
|
|
189
|
+
const failed = cases.filter(({ status }) => status === 'failed').length;
|
|
190
|
+
const skipped = cases.filter(({ status }) => status === 'skipped' || status === 'pending').length;
|
|
191
|
+
const assertions = cases.reduce((total, caseReport) => total + (caseReport.evidence?.assertions.length ?? 0), 0);
|
|
192
|
+
const spans = cases.reduce((total, caseReport) => total + (caseReport.evidence?.trace?.spans.length ?? 0), 0);
|
|
193
|
+
return [
|
|
194
|
+
passed === 0 ? undefined : palette.green(`${passed} passed`),
|
|
195
|
+
failed === 0 ? undefined : palette.red(`${failed} failed`),
|
|
196
|
+
skipped === 0 ? undefined : palette.yellow(`${skipped} skipped`),
|
|
197
|
+
`${assertions} ${plural(assertions, 'assertion')}`,
|
|
198
|
+
`${spans} ${plural(spans, 'span')}`,
|
|
199
|
+
formatDuration(report.duration),
|
|
200
|
+
]
|
|
201
|
+
.filter((part) => part !== undefined)
|
|
202
|
+
.join(' · ');
|
|
203
|
+
}
|
|
204
|
+
function statusLabel(status, palette) {
|
|
205
|
+
if (status === 'passed')
|
|
206
|
+
return palette.green('PASS');
|
|
207
|
+
if (status === 'failed')
|
|
208
|
+
return palette.red('FAIL');
|
|
209
|
+
if (status === 'pending')
|
|
210
|
+
return palette.yellow('PENDING');
|
|
211
|
+
return palette.yellow('SKIP');
|
|
212
|
+
}
|
|
213
|
+
function statusSymbol(status, palette) {
|
|
214
|
+
if (status === 'passed')
|
|
215
|
+
return palette.green('✓');
|
|
216
|
+
if (status === 'failed')
|
|
217
|
+
return palette.red('✗');
|
|
218
|
+
return palette.yellow('○');
|
|
219
|
+
}
|
|
220
|
+
function formatDuration(milliseconds) {
|
|
221
|
+
if (milliseconds < 1)
|
|
222
|
+
return `${Math.round(milliseconds * 1000)} µs`;
|
|
223
|
+
if (milliseconds < 1000)
|
|
224
|
+
return `${milliseconds.toFixed(1)} ms`;
|
|
225
|
+
return `${(milliseconds / 1000).toFixed(2)} s`;
|
|
226
|
+
}
|
|
227
|
+
function formatTimestampOffset(timestamp, startTime) {
|
|
228
|
+
return `+${formatDuration(Math.max(0, timestamp - startTime))}`;
|
|
229
|
+
}
|
|
230
|
+
function formatValue(value) {
|
|
231
|
+
return JSON.stringify(value);
|
|
232
|
+
}
|
|
233
|
+
function plural(count, singular) {
|
|
234
|
+
return count === 1 ? singular : `${singular}s`;
|
|
235
|
+
}
|
|
236
|
+
function makePalette(color) {
|
|
237
|
+
const paint = (code) => (text) => color ? `\x1b[${code}m${text}\x1b[0m` : text;
|
|
238
|
+
return {
|
|
239
|
+
dim: paint('2'),
|
|
240
|
+
green: paint('32'),
|
|
241
|
+
red: paint('31'),
|
|
242
|
+
yellow: paint('33'),
|
|
243
|
+
};
|
|
244
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Effect } from 'effect';
|
|
2
|
+
import { type AnalyzeProjectRequest } from '../../architecture/analyze-project/index.js';
|
|
3
|
+
import type { LaymosError } from '../../architecture/errors.js';
|
|
4
|
+
import { type ProjectNarrative } from '../../config/project-narrative.js';
|
|
5
|
+
import type { LaymosReport } from '../../report/index.js';
|
|
6
|
+
import type { TestsReport } from '../../report/tests.js';
|
|
7
|
+
import { type TestRunInProgress, type TestRunnerError, type TestsRunOptions } from '../../tests/run-tests/index.js';
|
|
8
|
+
export { ConfigImportError, ConfigNotFoundError, ConfigValidationError, } from '../../config/load-config/index.js';
|
|
9
|
+
export { ExtractError } from '../../architecture/errors.js';
|
|
10
|
+
export { TestRunInProgress, TestRunnerError, } from '../../tests/run-tests/index.js';
|
|
11
|
+
export type { TestsRunOptions } from '../../tests/run-tests/index.js';
|
|
12
|
+
export interface GetProjectNarrativeRequest {
|
|
13
|
+
readonly projectDir: string;
|
|
14
|
+
}
|
|
15
|
+
export interface RunTestsRequest extends TestsRunOptions {
|
|
16
|
+
readonly projectDir: string;
|
|
17
|
+
}
|
|
18
|
+
/** Runs the project's ordinary Vitest suite and returns a serializable report. */
|
|
19
|
+
export declare function runTests(request: RunTestsRequest): Effect.Effect<TestsReport, TestRunInProgress | TestRunnerError>;
|
|
20
|
+
/** Analyzes one project's declared and actual static architecture. */
|
|
21
|
+
export declare function analyzeProject(request: AnalyzeProjectRequest): Effect.Effect<LaymosReport, LaymosError>;
|
|
22
|
+
/** Loads the project narrative without waiting for project analysis. */
|
|
23
|
+
export declare function getProjectNarrative({ projectDir, }: GetProjectNarrativeRequest): Effect.Effect<ProjectNarrative | undefined, import('../../config/load-config/index.js').LoadConfigError>;
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/entrypoints/node/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,6CAA6C,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAEhE,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,eAAe,EACrB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EACL,iBAAiB,EACjB,eAAe,GAChB,MAAM,gCAAgC,CAAC;AACxC,YAAY,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEtE,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACtD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,kFAAkF;AAClF,wBAAgB,QAAQ,CACtB,OAAO,EAAE,eAAe,GACvB,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,iBAAiB,GAAG,eAAe,CAAC,CAOjE;AAED,sEAAsE;AACtE,wBAAgB,cAAc,CAC5B,OAAO,EAAE,qBAAqB,GAC7B,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,WAAW,CAAC,CAE1C;AAED,wEAAwE;AACxE,wBAAgB,mBAAmB,CAAC,EAClC,UAAU,GACX,EAAE,0BAA0B,GAAG,MAAM,CAAC,MAAM,CAC3C,gBAAgB,GAAG,SAAS,EAC5B,OAAO,mCAAmC,EAAE,eAAe,CAC5D,CAQA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Effect } from 'effect';
|
|
2
|
+
import { analyzeProject as analyzeProjectOperation, } from '../../architecture/analyze-project/index.js';
|
|
3
|
+
import { loadConfig } from '../../config/load-config/index.js';
|
|
4
|
+
import { serializeProjectNarrative, } from '../../config/project-narrative.js';
|
|
5
|
+
import { executeTests, } from '../../tests/run-tests/index.js';
|
|
6
|
+
export { ConfigImportError, ConfigNotFoundError, ConfigValidationError, } from '../../config/load-config/index.js';
|
|
7
|
+
export { ExtractError } from '../../architecture/errors.js';
|
|
8
|
+
export { TestRunInProgress, TestRunnerError, } from '../../tests/run-tests/index.js';
|
|
9
|
+
/** Runs the project's ordinary Vitest suite and returns a serializable report. */
|
|
10
|
+
export function runTests(request) {
|
|
11
|
+
return executeTests(request.projectDir, {
|
|
12
|
+
...(request.files === undefined ? {} : { files: request.files }),
|
|
13
|
+
...(request.testNamePattern === undefined
|
|
14
|
+
? {}
|
|
15
|
+
: { testNamePattern: request.testNamePattern }),
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
/** Analyzes one project's declared and actual static architecture. */
|
|
19
|
+
export function analyzeProject(request) {
|
|
20
|
+
return analyzeProjectOperation(request);
|
|
21
|
+
}
|
|
22
|
+
/** Loads the project narrative without waiting for project analysis. */
|
|
23
|
+
export function getProjectNarrative({ projectDir, }) {
|
|
24
|
+
return loadConfig({ projectDir }).pipe(Effect.map((config) => config.project === undefined
|
|
25
|
+
? undefined
|
|
26
|
+
: serializeProjectNarrative(config.project)));
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/entrypoints/report/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../../report/index.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { analyzeProject } from './orchestrator/analyze-project/index.js';
|
|
2
|
+
export { loadModuleSource, ModuleSourceNotFound, ModuleSourceReadError, } from './orchestrator/load-module-source/index.js';
|
|
3
|
+
export { ArchitectureAnalysisSchema } from './architecture-analysis-schema/index.js';
|
|
4
|
+
export type { ArchitectureAnalysis } from './architecture-analysis-schema/index.js';
|
|
5
|
+
export { ModuleSourceSnapshotSchema } from './architecture-analysis-schema/index.js';
|
|
6
|
+
export type { ModuleSourceFile, ModuleSourceSnapshot, } from './architecture-analysis-schema/index.js';
|
|
7
|
+
export { InspectionTargetNotFound, ModuleInspectionCycle, inspectFile, inspectLayer, inspectModule, inspectProject, } from './orchestrator/inspect/index.js';
|
|
8
|
+
export type { FileInspection, FileInspectionOptions, LayerInspection, ModuleInspection, ProjectInspection, } from './orchestrator/inspect/index.js';
|
|
9
|
+
export { ConfigError } from './services/config/index.js';
|
|
10
|
+
export { CruiseError } from './services/file-cruiser/index.js';
|
|
11
|
+
export { getStoryTree, planStories, runStories, StoriesError, } from './orchestrator/run-stories/index.js';
|
|
12
|
+
export { StoryReportSchema, StoryTreeSchema } from './story/schema/index.js';
|
|
13
|
+
export type { StoryReport, StoryTree } from './story/schema/index.js';
|
|
14
|
+
export { loadChangeSet, loadFileDiff, } from './orchestrator/load-changes/index.js';
|
|
15
|
+
export { GitError } from './services/git/index.js';
|
|
16
|
+
export { ChangedPathSchema, ChangeSetSchema, ChangeStatusSchema, DiffHunkSchema, DiffLineSchema, FileDiffSchema, } from './change-set-schema/index.js';
|
|
17
|
+
export type { ChangedPath, ChangeSet, ChangeStatus, DiffHunk, DiffLine, FileDiff, } from './change-set-schema/index.js';
|
|
2
18
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAEzE,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,4CAA4C,CAAC;AAEpD,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAErF,YAAY,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AACrF,YAAY,EACV,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,WAAW,EACX,YAAY,EACZ,aAAa,EACb,cAAc,GACf,MAAM,iCAAiC,CAAC;AACzC,YAAY,EACV,cAAc,EACd,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAE/D,OAAO,EACL,YAAY,EACZ,WAAW,EACX,UAAU,EACV,YAAY,GACb,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC7E,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEtE,OAAO,EACL,aAAa,EACb,YAAY,GACb,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEnD,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,cAAc,GACf,MAAM,8BAA8B,CAAC;AAEtC,YAAY,EACV,WAAW,EACX,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,QAAQ,GACT,MAAM,8BAA8B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
// Node consumers use this high-level capability to produce Architecture Analysis.
|
|
2
|
+
export { analyzeProject } from './orchestrator/analyze-project/index.js';
|
|
3
|
+
// Node consumers use this high-level capability to inspect one Configured Module.
|
|
4
|
+
export { loadModuleSource, ModuleSourceNotFound, ModuleSourceReadError, } from './orchestrator/load-module-source/index.js';
|
|
5
|
+
// RPC transports use this browser-safe runtime contract for Architecture Analysis.
|
|
6
|
+
export { ArchitectureAnalysisSchema } from './architecture-analysis-schema/index.js';
|
|
7
|
+
export { ModuleSourceSnapshotSchema } from './architecture-analysis-schema/index.js';
|
|
8
|
+
export { InspectionTargetNotFound, ModuleInspectionCycle, inspectFile, inspectLayer, inspectModule, inspectProject, } from './orchestrator/inspect/index.js';
|
|
9
|
+
// Analysis callers distinguish Config loading and validation failures.
|
|
10
|
+
export { ConfigError } from './services/config/index.js';
|
|
11
|
+
// Analysis callers distinguish source cruising failures.
|
|
12
|
+
export { CruiseError } from './services/file-cruiser/index.js';
|
|
13
|
+
// Node consumers use this high-level capability to load and run the Story tree.
|
|
14
|
+
export { getStoryTree, planStories, runStories, StoriesError, } from './orchestrator/run-stories/index.js';
|
|
15
|
+
// RPC transports use this browser-safe runtime contract for Story reports.
|
|
16
|
+
export { StoryReportSchema, StoryTreeSchema } from './story/schema/index.js';
|
|
17
|
+
// Node consumers use this high-level capability to report what a Base ref changed.
|
|
18
|
+
export { loadChangeSet, loadFileDiff, } from './orchestrator/load-changes/index.js';
|
|
19
|
+
// Change set callers distinguish a missing repository from a failed git command.
|
|
20
|
+
export { GitError } from './services/git/index.js';
|
|
21
|
+
// RPC transports use this browser-safe runtime contract for Change sets.
|
|
22
|
+
export { ChangedPathSchema, ChangeSetSchema, ChangeStatusSchema, DiffHunkSchema, DiffLineSchema, FileDiffSchema, } from './change-set-schema/index.js';
|