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,56 @@
|
|
|
1
|
+
import { Context, Effect } from 'effect';
|
|
2
|
+
import { makeTraceRecorder } from '@pkishorez/effect-tracer/recorder';
|
|
3
|
+
export class StoryContext extends Context.Service()('StoryContext') {
|
|
4
|
+
}
|
|
5
|
+
export const Story = {
|
|
6
|
+
make(story) {
|
|
7
|
+
return story;
|
|
8
|
+
},
|
|
9
|
+
question(question, options) {
|
|
10
|
+
return { question, answer: options.answer, proof: options.proof };
|
|
11
|
+
},
|
|
12
|
+
group(title, children) {
|
|
13
|
+
return { title, children };
|
|
14
|
+
},
|
|
15
|
+
trace(effect) {
|
|
16
|
+
return Effect.gen(function* () {
|
|
17
|
+
const context = yield* StoryContext;
|
|
18
|
+
const recorder = makeTraceRecorder();
|
|
19
|
+
return yield* recorder
|
|
20
|
+
.instrument(effect)
|
|
21
|
+
.pipe(Effect.onExit(() => context.beginSection({ kind: 'trace', trace: recorder.snapshot() })));
|
|
22
|
+
});
|
|
23
|
+
},
|
|
24
|
+
flow(effect) {
|
|
25
|
+
return Effect.gen(function* () {
|
|
26
|
+
const context = yield* StoryContext;
|
|
27
|
+
const recorder = makeTraceRecorder();
|
|
28
|
+
return yield* recorder
|
|
29
|
+
.instrument(effect)
|
|
30
|
+
.pipe(Effect.onExit(() => Effect.forEach(recorder.snapshotFlows(), (flow) => context.beginSection({ kind: 'flow', flow }))));
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
assert(description, passed) {
|
|
34
|
+
return Effect.flatMap(StoryContext, (context) => context.assert(description, passed));
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
export function isStory(value) {
|
|
38
|
+
if (typeof value !== 'object' || value === null)
|
|
39
|
+
return false;
|
|
40
|
+
const story = value;
|
|
41
|
+
return (typeof story.title === 'string' &&
|
|
42
|
+
typeof story.sourceUrl === 'string' &&
|
|
43
|
+
Array.isArray(story.questions) &&
|
|
44
|
+
story.questions.every((question) => typeof question.question === 'string' &&
|
|
45
|
+
typeof question.answer === 'string' &&
|
|
46
|
+
Effect.isEffect(question.proof)));
|
|
47
|
+
}
|
|
48
|
+
export function isStoryGroup(value) {
|
|
49
|
+
if (typeof value !== 'object' || value === null)
|
|
50
|
+
return false;
|
|
51
|
+
const group = value;
|
|
52
|
+
if (typeof group.title !== 'string' || !Array.isArray(group.children)) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
return group.children.every((child) => isStory(child) || isStoryGroup(child));
|
|
56
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Effect } from 'effect';
|
|
2
|
+
import { describe as vitestDescribe, test as vitestTest, type ExpectStatic, type TestArtifactBase, type TestContext, type TestOptions, type SuiteOptions } from 'vitest';
|
|
3
|
+
import type { LaymosTestEvidence, TestTraceSpan } from '../../report/tests.js';
|
|
4
|
+
interface LaymosMetadata {
|
|
5
|
+
readonly description: string;
|
|
6
|
+
readonly documentation?: string;
|
|
7
|
+
}
|
|
8
|
+
interface SpanSelector {
|
|
9
|
+
readonly name?: string | RegExp;
|
|
10
|
+
readonly status?: TestTraceSpan['status'];
|
|
11
|
+
readonly attributes?: Readonly<Record<string, unknown>>;
|
|
12
|
+
}
|
|
13
|
+
interface TraceCapture {
|
|
14
|
+
<A, E, R>(effect: Effect.Effect<A, E, R>): Effect.Effect<A, E, R>;
|
|
15
|
+
getSpans(selector?: SpanSelector): readonly TestTraceSpan[];
|
|
16
|
+
getSpanCount(selector?: SpanSelector): number;
|
|
17
|
+
}
|
|
18
|
+
interface LaymosContext extends TestContext {
|
|
19
|
+
readonly expect: ExpectStatic;
|
|
20
|
+
readonly trace: TraceCapture;
|
|
21
|
+
}
|
|
22
|
+
type LaymosHandler = (context: LaymosContext) => LaymosHandlerResult;
|
|
23
|
+
type LaymosHandlerResult = void | Promise<void> | Effect.Effect<void, unknown, never>;
|
|
24
|
+
type LaymosTestOptions = Omit<TestOptions, 'fails'> & LaymosMetadata;
|
|
25
|
+
type LaymosDescribeOptions = Omit<SuiteOptions, 'fails'> & LaymosMetadata;
|
|
26
|
+
interface LaymosEachTest {
|
|
27
|
+
<Row extends readonly unknown[]>(cases: ReadonlyArray<Row>): (name: string, options: LaymosTestOptions, handler: (...argumentsList: [...Row, LaymosContext]) => LaymosHandlerResult) => unknown;
|
|
28
|
+
<Row>(cases: ReadonlyArray<Row>): (name: string, options: LaymosTestOptions, handler: (row: Row, context: LaymosContext) => LaymosHandlerResult) => unknown;
|
|
29
|
+
(strings: TemplateStringsArray, ...values: readonly unknown[]): (name: string, options: LaymosTestOptions, handler: (row: Readonly<Record<string, unknown>>, context: LaymosContext) => LaymosHandlerResult) => unknown;
|
|
30
|
+
}
|
|
31
|
+
interface LaymosTestApi {
|
|
32
|
+
(name: string, options: LaymosTestOptions, handler: LaymosHandler): unknown;
|
|
33
|
+
only: LaymosTestApi;
|
|
34
|
+
skip: LaymosTestApi;
|
|
35
|
+
todo(name: string, options: LaymosTestOptions): unknown;
|
|
36
|
+
each: LaymosEachTest;
|
|
37
|
+
extend(...argumentsList: Parameters<typeof vitestTest.extend>): LaymosTestApi;
|
|
38
|
+
skipIf(...argumentsList: Parameters<typeof vitestTest.skipIf>): LaymosTestApi;
|
|
39
|
+
runIf(...argumentsList: Parameters<typeof vitestTest.runIf>): LaymosTestApi;
|
|
40
|
+
}
|
|
41
|
+
interface LaymosEachDescribe {
|
|
42
|
+
<Row extends readonly unknown[]>(cases: ReadonlyArray<Row>): (name: string, options: LaymosDescribeOptions, factory: (...argumentsList: Row) => void | Promise<void>) => unknown;
|
|
43
|
+
<Row>(cases: ReadonlyArray<Row>): (name: string, options: LaymosDescribeOptions, factory: (row: Row) => void | Promise<void>) => unknown;
|
|
44
|
+
(strings: TemplateStringsArray, ...values: readonly unknown[]): (name: string, options: LaymosDescribeOptions, factory: (row: Readonly<Record<string, unknown>>) => void | Promise<void>) => unknown;
|
|
45
|
+
}
|
|
46
|
+
interface LaymosDescribeApi {
|
|
47
|
+
(name: string, options: LaymosDescribeOptions, factory: () => void | Promise<void>): unknown;
|
|
48
|
+
only: LaymosDescribeApi;
|
|
49
|
+
skip: LaymosDescribeApi;
|
|
50
|
+
todo(name: string, options: LaymosDescribeOptions): unknown;
|
|
51
|
+
each: LaymosEachDescribe;
|
|
52
|
+
skipIf(...argumentsList: Parameters<typeof vitestDescribe.skipIf>): LaymosDescribeApi;
|
|
53
|
+
runIf(...argumentsList: Parameters<typeof vitestDescribe.runIf>): LaymosDescribeApi;
|
|
54
|
+
}
|
|
55
|
+
interface LaymosTestArtifact extends TestArtifactBase {
|
|
56
|
+
readonly type: 'laymos:test-evidence';
|
|
57
|
+
readonly evidence: LaymosTestEvidence;
|
|
58
|
+
}
|
|
59
|
+
declare const laymosTestArtifactKey: unique symbol;
|
|
60
|
+
declare module 'vitest' {
|
|
61
|
+
interface TaskMeta {
|
|
62
|
+
readonly laymosTest?: LaymosMetadata;
|
|
63
|
+
readonly laymosSuite?: LaymosMetadata;
|
|
64
|
+
}
|
|
65
|
+
interface TestArtifactRegistry {
|
|
66
|
+
[laymosTestArtifactKey]: LaymosTestArtifact;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
export declare const laymosTest: LaymosTestApi;
|
|
70
|
+
export declare const laymosDescribe: LaymosDescribeApi;
|
|
71
|
+
export {};
|
|
72
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tests/authoring/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
import { Effect } from 'effect';
|
|
2
|
+
import { makeTraceRecorder } from '@pkishorez/effect-tracer/recorder';
|
|
3
|
+
import { stringify } from '@vitest/utils/display';
|
|
4
|
+
import { describe as vitestDescribe, recordArtifact, test as vitestTest, } from 'vitest';
|
|
5
|
+
const laymosTestArtifactKey = Symbol('laymos:test-evidence');
|
|
6
|
+
export const laymosTest = wrapTestApi(vitestTest);
|
|
7
|
+
export const laymosDescribe = wrapDescribeApi(vitestDescribe);
|
|
8
|
+
function wrapTestApi(api, spreadEachArguments = false) {
|
|
9
|
+
return new Proxy(api, {
|
|
10
|
+
apply(target, thisArgument, argumentsList) {
|
|
11
|
+
const [name, options, handler] = argumentsList;
|
|
12
|
+
const metadata = validateMetadata(name, options, 'Laymos Test');
|
|
13
|
+
if (options.fails === true) {
|
|
14
|
+
throw new TypeError('Laymos Tests do not support the "fails" option');
|
|
15
|
+
}
|
|
16
|
+
const testOptions = withMeta(options, 'laymosTest', metadata);
|
|
17
|
+
if (typeof handler !== 'function') {
|
|
18
|
+
return Reflect.apply(target, thisArgument, [name, testOptions]);
|
|
19
|
+
}
|
|
20
|
+
return Reflect.apply(target, thisArgument, [
|
|
21
|
+
name,
|
|
22
|
+
testOptions,
|
|
23
|
+
async (...callbackArguments) => {
|
|
24
|
+
const context = callbackArguments.at(-1);
|
|
25
|
+
const callbackValues = callbackArguments.slice(0, -1);
|
|
26
|
+
const handlerArguments = spreadEachArguments &&
|
|
27
|
+
callbackValues.length === 1 &&
|
|
28
|
+
Array.isArray(callbackValues[0])
|
|
29
|
+
? callbackValues[0]
|
|
30
|
+
: callbackValues;
|
|
31
|
+
const assertions = [];
|
|
32
|
+
const assertionErrors = [];
|
|
33
|
+
const names = new Set();
|
|
34
|
+
const trace = makeTraceCapture();
|
|
35
|
+
const scopedExpect = makeExpect(context.expect, assertions, assertionErrors, names);
|
|
36
|
+
let executionError;
|
|
37
|
+
try {
|
|
38
|
+
const result = Reflect.apply(handler, undefined, [
|
|
39
|
+
...handlerArguments,
|
|
40
|
+
{ ...context, expect: scopedExpect, trace },
|
|
41
|
+
]);
|
|
42
|
+
if (Effect.isEffect(result)) {
|
|
43
|
+
await Effect.runPromise(result, { signal: context.signal });
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
await result;
|
|
47
|
+
}
|
|
48
|
+
if (assertions.length === 0) {
|
|
49
|
+
throw namedError('MissingTestAssertion', 'A completed Laymos Test must record at least one named assertion');
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
executionError = error;
|
|
54
|
+
}
|
|
55
|
+
finally {
|
|
56
|
+
await recordArtifact(context.task, {
|
|
57
|
+
type: 'laymos:test-evidence',
|
|
58
|
+
evidence: {
|
|
59
|
+
...metadata,
|
|
60
|
+
assertions,
|
|
61
|
+
...(trace.completedTrace === undefined
|
|
62
|
+
? {}
|
|
63
|
+
: { trace: trace.completedTrace }),
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
if (executionError !== undefined)
|
|
68
|
+
throw executionError;
|
|
69
|
+
if (assertionErrors.length > 0) {
|
|
70
|
+
const failure = new AggregateError(assertionErrors, `${assertionErrors.length} named assertion(s) failed`);
|
|
71
|
+
failure.name = 'LaymosAssertionFailures';
|
|
72
|
+
throw failure;
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
]);
|
|
76
|
+
},
|
|
77
|
+
get(target, property) {
|
|
78
|
+
const value = Reflect.get(target, property, target);
|
|
79
|
+
if (typeof value !== 'function')
|
|
80
|
+
return value;
|
|
81
|
+
if (property === 'each') {
|
|
82
|
+
const forEach = Reflect.get(target, 'for', target);
|
|
83
|
+
return (...argumentsList) => wrapTestApi(Reflect.apply(forEach, target, argumentsList), true);
|
|
84
|
+
}
|
|
85
|
+
if (property === 'extend' ||
|
|
86
|
+
property === 'skipIf' ||
|
|
87
|
+
property === 'runIf') {
|
|
88
|
+
return (...argumentsList) => wrapTestApi(Reflect.apply(value, target, argumentsList));
|
|
89
|
+
}
|
|
90
|
+
return wrapTestApi(value);
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
function wrapDescribeApi(api) {
|
|
95
|
+
return new Proxy(api, {
|
|
96
|
+
apply(target, thisArgument, argumentsList) {
|
|
97
|
+
const [name, options, factory] = argumentsList;
|
|
98
|
+
const metadata = validateMetadata(name, options, 'Laymos Suite');
|
|
99
|
+
if (options.fails === true) {
|
|
100
|
+
throw new TypeError('Laymos Suites do not support the "fails" option');
|
|
101
|
+
}
|
|
102
|
+
return Reflect.apply(target, thisArgument, [
|
|
103
|
+
name,
|
|
104
|
+
withMeta(options, 'laymosSuite', metadata),
|
|
105
|
+
factory,
|
|
106
|
+
]);
|
|
107
|
+
},
|
|
108
|
+
get(target, property) {
|
|
109
|
+
const value = Reflect.get(target, property, target);
|
|
110
|
+
if (typeof value !== 'function')
|
|
111
|
+
return value;
|
|
112
|
+
if (property === 'each' ||
|
|
113
|
+
property === 'skipIf' ||
|
|
114
|
+
property === 'runIf') {
|
|
115
|
+
return (...argumentsList) => wrapDescribeApi(Reflect.apply(value, target, argumentsList));
|
|
116
|
+
}
|
|
117
|
+
return wrapDescribeApi(value);
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
function validateMetadata(name, options, subject) {
|
|
122
|
+
requireText(name, `${subject} name`);
|
|
123
|
+
if (!isRecord(options)) {
|
|
124
|
+
throw new TypeError(`${subject} options are required`);
|
|
125
|
+
}
|
|
126
|
+
requireText(options.description, `${subject} description`);
|
|
127
|
+
if (options.documentation !== undefined) {
|
|
128
|
+
requireText(options.documentation, `${subject} documentation`);
|
|
129
|
+
}
|
|
130
|
+
return {
|
|
131
|
+
description: options.description,
|
|
132
|
+
...(options.documentation === undefined
|
|
133
|
+
? {}
|
|
134
|
+
: { documentation: options.documentation }),
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
function withMeta(options, key, metadata) {
|
|
138
|
+
const { description: _, documentation: __, ...testOptions } = options;
|
|
139
|
+
return {
|
|
140
|
+
...testOptions,
|
|
141
|
+
meta: {
|
|
142
|
+
...(isRecord(options.meta) ? options.meta : {}),
|
|
143
|
+
[key]: metadata,
|
|
144
|
+
},
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
function makeExpect(expect, assertions, errors, names) {
|
|
148
|
+
return new Proxy(expect, {
|
|
149
|
+
apply(target, thisArgument, [actual, message]) {
|
|
150
|
+
requireText(message, 'Test Assertion name');
|
|
151
|
+
const name = message.trim();
|
|
152
|
+
if (names.has(name)) {
|
|
153
|
+
throw namedError('DuplicateTestAssertionName', `Test Assertion names must be unique: "${name}"`);
|
|
154
|
+
}
|
|
155
|
+
names.add(name);
|
|
156
|
+
const assertion = Reflect.apply(target, thisArgument, [actual, message]);
|
|
157
|
+
return wrapAssertion(assertion, {
|
|
158
|
+
actual,
|
|
159
|
+
name,
|
|
160
|
+
assertions,
|
|
161
|
+
errors,
|
|
162
|
+
path: [],
|
|
163
|
+
});
|
|
164
|
+
},
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
function wrapAssertion(assertion, state) {
|
|
168
|
+
return new Proxy(assertion, {
|
|
169
|
+
get(target, property) {
|
|
170
|
+
const value = Reflect.get(target, property, target);
|
|
171
|
+
const nextPath = [...state.path, String(property)];
|
|
172
|
+
if (typeof value !== 'function') {
|
|
173
|
+
return isRecord(value)
|
|
174
|
+
? wrapAssertion(value, { ...state, path: nextPath })
|
|
175
|
+
: value;
|
|
176
|
+
}
|
|
177
|
+
return (...expectedArguments) => {
|
|
178
|
+
try {
|
|
179
|
+
const result = Reflect.apply(value, target, expectedArguments);
|
|
180
|
+
if (isPromiseLike(result)) {
|
|
181
|
+
return result.then((resolved) => {
|
|
182
|
+
recordAssertion(state, nextPath, expectedArguments, 'passed');
|
|
183
|
+
return resolved;
|
|
184
|
+
}, (error) => {
|
|
185
|
+
recordAssertion(state, nextPath, expectedArguments, 'failed', error);
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
recordAssertion(state, nextPath, expectedArguments, 'passed');
|
|
189
|
+
return result;
|
|
190
|
+
}
|
|
191
|
+
catch (error) {
|
|
192
|
+
recordAssertion(state, nextPath, expectedArguments, 'failed', error);
|
|
193
|
+
return assertion;
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
},
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
function recordAssertion(state, path, expectedArguments, status, failure) {
|
|
200
|
+
const error = failure instanceof Error ? failure : new Error(String(failure));
|
|
201
|
+
state.assertions.push({
|
|
202
|
+
name: state.name,
|
|
203
|
+
matcher: path.join('.'),
|
|
204
|
+
status,
|
|
205
|
+
actual: testValue(state.actual),
|
|
206
|
+
...(expectedArguments.length === 0
|
|
207
|
+
? {}
|
|
208
|
+
: {
|
|
209
|
+
expected: testValue(expectedArguments.length === 1
|
|
210
|
+
? expectedArguments[0]
|
|
211
|
+
: expectedArguments),
|
|
212
|
+
}),
|
|
213
|
+
...(status === 'failed' ? { error: errorReport(error) } : {}),
|
|
214
|
+
});
|
|
215
|
+
if (status === 'failed')
|
|
216
|
+
state.errors.push(error);
|
|
217
|
+
}
|
|
218
|
+
function makeTraceCapture() {
|
|
219
|
+
let started = false;
|
|
220
|
+
let completedTrace;
|
|
221
|
+
const capture = ((effect) => Effect.suspend(() => {
|
|
222
|
+
if (started) {
|
|
223
|
+
return Effect.die(namedError('TestTraceAlreadyCaptured', 'A Laymos Test can capture only one Effect trace'));
|
|
224
|
+
}
|
|
225
|
+
started = true;
|
|
226
|
+
// A test that ends with an open span recorded something incoherent, so
|
|
227
|
+
// the recorder is asked to reject that rather than report it as running.
|
|
228
|
+
const recorder = makeTraceRecorder({
|
|
229
|
+
requireFinishedSpans: true,
|
|
230
|
+
formatValue: stringify,
|
|
231
|
+
});
|
|
232
|
+
return recorder.instrument(effect).pipe(Effect.ensuring(Effect.sync(() => {
|
|
233
|
+
const { spans, logs } = recorder.snapshot();
|
|
234
|
+
completedTrace = { spans, logs };
|
|
235
|
+
})));
|
|
236
|
+
}));
|
|
237
|
+
capture.getSpans = (selector) => {
|
|
238
|
+
if (completedTrace === undefined) {
|
|
239
|
+
throw namedError('TestTraceNotCaptured', 'Trace evidence is available only after trace(effect) completes');
|
|
240
|
+
}
|
|
241
|
+
return selector === undefined
|
|
242
|
+
? completedTrace.spans
|
|
243
|
+
: completedTrace.spans.filter((span) => matchesSpan(span, selector));
|
|
244
|
+
};
|
|
245
|
+
capture.getSpanCount = (selector) => capture.getSpans(selector).length;
|
|
246
|
+
Object.defineProperty(capture, 'completedTrace', {
|
|
247
|
+
get: () => completedTrace,
|
|
248
|
+
});
|
|
249
|
+
return capture;
|
|
250
|
+
}
|
|
251
|
+
function matchesSpan(span, selector) {
|
|
252
|
+
if (selector.name !== undefined &&
|
|
253
|
+
(typeof selector.name === 'string'
|
|
254
|
+
? span.name !== selector.name
|
|
255
|
+
: !new RegExp(selector.name.source, selector.name.flags).test(span.name))) {
|
|
256
|
+
return false;
|
|
257
|
+
}
|
|
258
|
+
if (selector.status !== undefined && span.status !== selector.status) {
|
|
259
|
+
return false;
|
|
260
|
+
}
|
|
261
|
+
return Object.entries(selector.attributes ?? {}).every(([key, value]) => valuesEqual(span.attributes[key], testValue(value)));
|
|
262
|
+
}
|
|
263
|
+
function valuesEqual(left, right) {
|
|
264
|
+
if (Object.is(left, right))
|
|
265
|
+
return true;
|
|
266
|
+
if (Array.isArray(left) && Array.isArray(right)) {
|
|
267
|
+
return (left.length === right.length &&
|
|
268
|
+
left.every((value, index) => valuesEqual(value, right[index])));
|
|
269
|
+
}
|
|
270
|
+
if (isRecord(left) &&
|
|
271
|
+
!Array.isArray(left) &&
|
|
272
|
+
isRecord(right) &&
|
|
273
|
+
!Array.isArray(right)) {
|
|
274
|
+
const leftRecord = left;
|
|
275
|
+
const rightRecord = right;
|
|
276
|
+
const leftKeys = Object.keys(left);
|
|
277
|
+
const rightKeys = Object.keys(right);
|
|
278
|
+
return (leftKeys.length === rightKeys.length &&
|
|
279
|
+
leftKeys.every((key) => key in right && valuesEqual(leftRecord[key], rightRecord[key])));
|
|
280
|
+
}
|
|
281
|
+
return false;
|
|
282
|
+
}
|
|
283
|
+
function testValue(value) {
|
|
284
|
+
try {
|
|
285
|
+
const serialized = JSON.stringify(value);
|
|
286
|
+
if (serialized !== undefined)
|
|
287
|
+
return JSON.parse(serialized);
|
|
288
|
+
}
|
|
289
|
+
catch { }
|
|
290
|
+
return stringify(value);
|
|
291
|
+
}
|
|
292
|
+
function errorReport(error) {
|
|
293
|
+
return {
|
|
294
|
+
name: error.name || 'Error',
|
|
295
|
+
message: error.message,
|
|
296
|
+
...(error.stack === undefined ? {} : { stack: error.stack }),
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
function namedError(name, message) {
|
|
300
|
+
return Object.assign(new Error(message), { name });
|
|
301
|
+
}
|
|
302
|
+
function requireText(value, subject) {
|
|
303
|
+
if (typeof value !== 'string' || value.trim().length === 0) {
|
|
304
|
+
throw new TypeError(`${subject} must not be empty`);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
function isRecord(value) {
|
|
308
|
+
return typeof value === 'object' && value !== null;
|
|
309
|
+
}
|
|
310
|
+
function isPromiseLike(value) {
|
|
311
|
+
return isRecord(value) && typeof value.then === 'function';
|
|
312
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tests/run-tests/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,eAAe,GAChB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { executeTests, TestRunInProgress, TestRunnerError, } from './run-tests.js';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Effect } from 'effect';
|
|
2
|
+
import { type TestErrorReport, type TestsReport } from '../../report/tests.js';
|
|
3
|
+
export interface TestsRunOptions {
|
|
4
|
+
readonly files?: readonly string[];
|
|
5
|
+
readonly testNamePattern?: string | RegExp;
|
|
6
|
+
}
|
|
7
|
+
declare const TestRunInProgress_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
8
|
+
readonly _tag: "TestRunInProgress";
|
|
9
|
+
} & Readonly<A>;
|
|
10
|
+
export declare class TestRunInProgress extends TestRunInProgress_base<{
|
|
11
|
+
readonly projectDir: string;
|
|
12
|
+
readonly message: string;
|
|
13
|
+
}> {
|
|
14
|
+
}
|
|
15
|
+
declare const TestRunnerError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
16
|
+
readonly _tag: "TestRunnerError";
|
|
17
|
+
} & Readonly<A>;
|
|
18
|
+
export declare class TestRunnerError extends TestRunnerError_base<{
|
|
19
|
+
readonly message: string;
|
|
20
|
+
readonly cause: unknown;
|
|
21
|
+
}> {
|
|
22
|
+
}
|
|
23
|
+
export declare function executeTests(projectDir: string, options?: TestsRunOptions): Effect.Effect<TestsReport, TestRunInProgress | TestRunnerError>;
|
|
24
|
+
export declare function mapError(error: unknown): TestErrorReport;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=run-tests.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-tests.d.ts","sourceRoot":"","sources":["../../../src/tests/run-tests/run-tests.ts"],"names":[],"mappings":"AAKA,OAAO,EAAQ,MAAM,EAAkB,MAAM,QAAQ,CAAC;AAUtD,OAAO,EAGL,KAAK,eAAe,EAIpB,KAAK,WAAW,EACjB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC5C;;;;AAED,qBAAa,iBAAkB,SAAQ,uBAAsC;IAC3E,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B,CAAC;CAAG;;;;AAEL,qBAAa,eAAgB,SAAQ,qBAAoC;IACvE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB,CAAC;CAAG;AAqCL,wBAAgB,YAAY,CAC1B,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE,eAAoB,GAC5B,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,iBAAiB,GAAG,eAAe,CAAC,CAwBjE;AAqPD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,CAmBxD"}
|