laymos 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +137 -710
- package/bin/laymos.mjs +2 -0
- 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/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/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/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/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/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/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/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/index.d.ts +17 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -1
- 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/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/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/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/config/define-config.d.ts +0 -3
- package/dist/config/define-config.d.ts.map +0 -1
- package/dist/config/define-config.js +0 -228
- package/dist/config/index.d.ts +0 -5
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/index.js +0 -4
- package/dist/config/layer-graph.d.ts +0 -7
- package/dist/config/layer-graph.d.ts.map +0 -1
- package/dist/config/layer-graph.js +0 -53
- package/dist/config/layer.d.ts +0 -5
- package/dist/config/layer.d.ts.map +0 -1
- package/dist/config/layer.js +0 -21
- package/dist/config/module.d.ts +0 -9
- package/dist/config/module.d.ts.map +0 -1
- package/dist/config/module.js +0 -29
- package/dist/config/path.d.ts +0 -4
- package/dist/config/path.d.ts.map +0 -1
- package/dist/config/path.js +0 -32
- package/dist/config/types.d.ts +0 -36
- package/dist/config/types.d.ts.map +0 -1
- package/dist/config/types.js +0 -1
- package/dist/engine/1-extract/extract.d.ts +0 -12
- package/dist/engine/1-extract/extract.d.ts.map +0 -1
- package/dist/engine/1-extract/extract.js +0 -160
- 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 +0 -24
- package/dist/engine/2-resolve/resolve.d.ts.map +0 -1
- package/dist/engine/2-resolve/resolve.js +0 -74
- package/dist/engine/3-evaluate/evaluate.d.ts +0 -10
- package/dist/engine/3-evaluate/evaluate.d.ts.map +0 -1
- package/dist/engine/3-evaluate/evaluate.js +0 -80
- 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/emit.js +0 -77
- 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/engine/errors.js +0 -5
- package/dist/node.d.ts +0 -24
- package/dist/node.d.ts.map +0 -1
- package/dist/node.js +0 -139
- package/dist/report/architecture.d.ts +0 -104
- package/dist/report/architecture.d.ts.map +0 -1
- package/dist/report/architecture.js +0 -1
- package/dist/report/index.d.ts +0 -3
- package/dist/report/index.d.ts.map +0 -1
- package/dist/report/index.js +0 -2
- 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 @@
|
|
|
1
|
+
export { loadModuleSource, ModuleSourceNotFound, ModuleSourceReadError, } from './load-module-source.js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Effect } from 'effect';
|
|
2
|
+
import { ModuleSourceNotFound, ModuleSourceReadError } from './errors.js';
|
|
3
|
+
export { ModuleSourceNotFound, ModuleSourceReadError } from './errors.js';
|
|
4
|
+
export declare function loadModuleSource(configPath: string, modulePath: string): Effect.Effect<{
|
|
5
|
+
modulePath: string;
|
|
6
|
+
entryPoint?: string;
|
|
7
|
+
files: {
|
|
8
|
+
readonly path: string;
|
|
9
|
+
readonly content: string;
|
|
10
|
+
}[];
|
|
11
|
+
}, import("../../services/config/errors.js").ConfigError | import("../../services/file-cruiser/errors.js").CruiseError | ModuleSourceNotFound | ModuleSourceReadError, never>;
|
|
12
|
+
//# sourceMappingURL=load-module-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-module-source.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/load-module-source/load-module-source.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAc,MAAM,QAAQ,CAAC;AAO5C,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAE1E,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAE1E,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;;;;;;;8KA0CtE"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { dirname, resolve } from 'node:path';
|
|
2
|
+
import { NodeServices } from '@effect/platform-node';
|
|
3
|
+
import { Effect, FileSystem } from 'effect';
|
|
4
|
+
import { analyzeArchitecture } from '../../domain/architecture-analysis/index.js';
|
|
5
|
+
import { ConfigServiceLive } from '../../services/config/index.js';
|
|
6
|
+
import { CruiserLive } from '../../services/file-cruiser/index.js';
|
|
7
|
+
import { loadProject } from '../load-project/index.js';
|
|
8
|
+
import { ModuleSourceNotFound, ModuleSourceReadError } from './errors.js';
|
|
9
|
+
export { ModuleSourceNotFound, ModuleSourceReadError } from './errors.js';
|
|
10
|
+
export function loadModuleSource(configPath, modulePath) {
|
|
11
|
+
const absoluteConfigPath = resolve(configPath);
|
|
12
|
+
const baseDir = dirname(absoluteConfigPath);
|
|
13
|
+
return Effect.gen(function* () {
|
|
14
|
+
const { config, fileGraph } = yield* loadProject(absoluteConfigPath);
|
|
15
|
+
const analysis = analyzeArchitecture(fileGraph, config);
|
|
16
|
+
const module = analysis.moduleAnalysis.modules.find(({ path }) => path === modulePath);
|
|
17
|
+
if (module === undefined) {
|
|
18
|
+
return yield* new ModuleSourceNotFound({ modulePath });
|
|
19
|
+
}
|
|
20
|
+
const paths = [...analysis.moduleAnalysis.membership]
|
|
21
|
+
.filter(([, owner]) => owner === modulePath)
|
|
22
|
+
.map(([path]) => path)
|
|
23
|
+
.sort((left, right) => left.localeCompare(right));
|
|
24
|
+
const fileSystem = yield* FileSystem.FileSystem;
|
|
25
|
+
const files = yield* Effect.forEach(paths, (path) => fileSystem.readFileString(resolve(baseDir, path)).pipe(Effect.map((content) => ({ path, content })), Effect.mapError((cause) => new ModuleSourceReadError({ filePath: path, cause }))));
|
|
26
|
+
const rootEntryPoint = moduleEntryPoint(modulePath, analysis.moduleAnalysis.entryPoints);
|
|
27
|
+
return {
|
|
28
|
+
modulePath,
|
|
29
|
+
...(rootEntryPoint === undefined ? {} : { entryPoint: rootEntryPoint }),
|
|
30
|
+
files,
|
|
31
|
+
};
|
|
32
|
+
}).pipe(Effect.provide(ConfigServiceLive), Effect.provide(CruiserLive), Effect.provide(NodeServices.layer));
|
|
33
|
+
}
|
|
34
|
+
function moduleEntryPoint(modulePath, entryPoints) {
|
|
35
|
+
if (entryPoints.has(modulePath))
|
|
36
|
+
return modulePath;
|
|
37
|
+
const directoryEntryPoint = `${modulePath}/index.ts`;
|
|
38
|
+
return entryPoints.has(directoryEntryPoint) ? directoryEntryPoint : undefined;
|
|
39
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/load-project/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Effect } from 'effect';
|
|
2
|
+
import type { FileGraph } from '../../domain/file-graph/index.js';
|
|
3
|
+
import { type Config } from '../../domain/project-config/index.js';
|
|
4
|
+
import { ConfigError, ConfigService } from '../../services/config/index.js';
|
|
5
|
+
import { Cruiser } from '../../services/file-cruiser/index.js';
|
|
6
|
+
export interface LoadedProject {
|
|
7
|
+
readonly config: Config;
|
|
8
|
+
readonly fileGraph: FileGraph;
|
|
9
|
+
}
|
|
10
|
+
export declare function loadProject(configPath: string): Effect.Effect<{
|
|
11
|
+
config: {
|
|
12
|
+
readonly $schema?: string | undefined;
|
|
13
|
+
readonly sourceRoots: readonly string[];
|
|
14
|
+
readonly ignoredPaths: readonly string[];
|
|
15
|
+
readonly storiesPath?: string | undefined;
|
|
16
|
+
readonly layers: {
|
|
17
|
+
readonly [x: string]: {
|
|
18
|
+
readonly paths: readonly string[];
|
|
19
|
+
readonly description?: string | undefined;
|
|
20
|
+
readonly modules: {
|
|
21
|
+
readonly [x: string]: {
|
|
22
|
+
readonly shared: boolean;
|
|
23
|
+
readonly exposed: boolean;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
readonly moduleGraphs: {
|
|
27
|
+
readonly [x: string]: {
|
|
28
|
+
readonly description?: string | undefined;
|
|
29
|
+
readonly path: string;
|
|
30
|
+
readonly modules: {
|
|
31
|
+
readonly [x: string]: {
|
|
32
|
+
readonly shared: boolean;
|
|
33
|
+
readonly exposed: boolean;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
readonly rules: {
|
|
37
|
+
readonly [x: string]: readonly string[];
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
readonly layerGraphs: {
|
|
44
|
+
readonly [x: string]: {
|
|
45
|
+
readonly description?: string | undefined;
|
|
46
|
+
readonly rules: {
|
|
47
|
+
readonly [x: string]: readonly string[];
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
fileGraph: FileGraph;
|
|
53
|
+
}, ConfigError | import("../../services/file-cruiser/errors.js").CruiseError, ConfigService | Cruiser>;
|
|
54
|
+
//# sourceMappingURL=load-project.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-project.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/load-project/load-project.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EACL,KAAK,MAAM,EAEZ,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAE/D,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;CAC/B;AAED,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uGA4B7C"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { dirname, resolve } from 'node:path';
|
|
2
|
+
import { Effect } from 'effect';
|
|
3
|
+
import { validateLoadedConfig, } from '../../domain/project-config/index.js';
|
|
4
|
+
import { ConfigError, ConfigService } from '../../services/config/index.js';
|
|
5
|
+
import { Cruiser } from '../../services/file-cruiser/index.js';
|
|
6
|
+
export function loadProject(configPath) {
|
|
7
|
+
return Effect.gen(function* () {
|
|
8
|
+
const absoluteConfigPath = resolve(configPath);
|
|
9
|
+
const baseDir = dirname(absoluteConfigPath);
|
|
10
|
+
const configService = yield* ConfigService;
|
|
11
|
+
const config = yield* configService.read(absoluteConfigPath);
|
|
12
|
+
const cruiser = yield* Cruiser;
|
|
13
|
+
const fileGraph = yield* cruiser.cruise(baseDir, config.sourceRoots, config.storiesPath === undefined
|
|
14
|
+
? config.ignoredPaths
|
|
15
|
+
: [...config.ignoredPaths, config.storiesPath]);
|
|
16
|
+
const issues = validateLoadedConfig(config, fileGraph.keys());
|
|
17
|
+
if (issues.length > 0) {
|
|
18
|
+
return yield* new ConfigError({
|
|
19
|
+
reason: 'validation',
|
|
20
|
+
filePath: absoluteConfigPath,
|
|
21
|
+
cause: issues,
|
|
22
|
+
issues,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
config,
|
|
27
|
+
fileGraph,
|
|
28
|
+
};
|
|
29
|
+
});
|
|
30
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const StoriesError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
2
|
+
readonly _tag: "StoriesError";
|
|
3
|
+
} & Readonly<A>;
|
|
4
|
+
export declare class StoriesError extends StoriesError_base<{
|
|
5
|
+
readonly reason: 'no-stories-path' | 'load' | 'invalid-root' | 'duplicate-title' | 'duplicate-question' | 'snippet-extraction' | 'unknown-scope';
|
|
6
|
+
readonly path: string;
|
|
7
|
+
readonly cause: unknown;
|
|
8
|
+
}> {
|
|
9
|
+
}
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/run-stories/errors.ts"],"names":[],"mappings":";;;AAEA,qBAAa,YAAa,SAAQ,kBAAiC;IACjE,QAAQ,CAAC,MAAM,EACX,iBAAiB,GACjB,MAAM,GACN,cAAc,GACd,iBAAiB,GACjB,oBAAoB,GACpB,oBAAoB,GACpB,eAAe,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB,CAAC;CAAG"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface StorySnippets {
|
|
2
|
+
readonly title: string | undefined;
|
|
3
|
+
readonly proofs: ReadonlyMap<string, string>;
|
|
4
|
+
readonly orderedProofs: readonly string[];
|
|
5
|
+
}
|
|
6
|
+
export interface ExtractedSnippets {
|
|
7
|
+
readonly setup: string | null;
|
|
8
|
+
readonly stories: readonly StorySnippets[];
|
|
9
|
+
}
|
|
10
|
+
export declare function extractSnippets(path: string, source: string): ExtractedSnippets;
|
|
11
|
+
export declare function storySnippets(extracted: ExtractedSnippets, title: string): StorySnippets;
|
|
12
|
+
//# sourceMappingURL=extract-snippets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract-snippets.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/run-stories/extract-snippets.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7C,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3C;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,SAAS,aAAa,EAAE,CAAC;CAC5C;AAeD,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,GACb,iBAAiB,CAsBnB;AAED,wBAAgB,aAAa,CAC3B,SAAS,EAAE,iBAAiB,EAC5B,KAAK,EAAE,MAAM,GACZ,aAAa,CAIf"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { parseSync } from 'oxc-parser';
|
|
2
|
+
export function extractSnippets(path, source) {
|
|
3
|
+
const program = parseSync(path, source).program;
|
|
4
|
+
const setupParts = [];
|
|
5
|
+
for (const statement of program.body) {
|
|
6
|
+
if (statement.type.startsWith('TSImport'))
|
|
7
|
+
continue;
|
|
8
|
+
if (statement.type === 'ImportDeclaration')
|
|
9
|
+
continue;
|
|
10
|
+
if (containsStoryCall(statement))
|
|
11
|
+
continue;
|
|
12
|
+
setupParts.push(source.slice(statement.start, statement.end));
|
|
13
|
+
}
|
|
14
|
+
const unscoped = newBucket(undefined);
|
|
15
|
+
const scoped = [];
|
|
16
|
+
collectProofs(program.body, source, unscoped, scoped);
|
|
17
|
+
const stories = [
|
|
18
|
+
...scoped,
|
|
19
|
+
...(unscoped.orderedProofs.length === 0 ? [] : [unscoped]),
|
|
20
|
+
];
|
|
21
|
+
return {
|
|
22
|
+
setup: setupParts.length === 0 ? null : setupParts.join('\n\n'),
|
|
23
|
+
stories,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export function storySnippets(extracted, title) {
|
|
27
|
+
const matches = extracted.stories.filter((story) => story.title === title);
|
|
28
|
+
if (matches.length === 1)
|
|
29
|
+
return matches[0];
|
|
30
|
+
return mergeSnippets(matches.length > 1 ? matches : extracted.stories);
|
|
31
|
+
}
|
|
32
|
+
function mergeSnippets(stories) {
|
|
33
|
+
const merged = newBucket(undefined);
|
|
34
|
+
for (const story of stories) {
|
|
35
|
+
merged.orderedProofs.push(...story.orderedProofs);
|
|
36
|
+
for (const [question, proof] of story.proofs) {
|
|
37
|
+
merged.proofs.set(question, proof);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return merged;
|
|
41
|
+
}
|
|
42
|
+
function newBucket(title) {
|
|
43
|
+
return { title, proofs: new Map(), orderedProofs: [] };
|
|
44
|
+
}
|
|
45
|
+
function collectProofs(node, source, bucket, stories) {
|
|
46
|
+
if (Array.isArray(node)) {
|
|
47
|
+
for (const item of node)
|
|
48
|
+
collectProofs(item, source, bucket, stories);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (typeof node !== 'object' || node === null)
|
|
52
|
+
return;
|
|
53
|
+
const ast = node;
|
|
54
|
+
if (typeof ast.type !== 'string')
|
|
55
|
+
return;
|
|
56
|
+
let target = bucket;
|
|
57
|
+
if (isStoryCall(ast, 'make')) {
|
|
58
|
+
target = newBucket(storyTitle(ast));
|
|
59
|
+
stories.push(target);
|
|
60
|
+
}
|
|
61
|
+
else if (isStoryCall(ast, 'question')) {
|
|
62
|
+
const proof = questionProofSource(ast, source);
|
|
63
|
+
if (proof !== undefined) {
|
|
64
|
+
target.orderedProofs.push(proof);
|
|
65
|
+
const question = questionLiteral(ast);
|
|
66
|
+
if (question !== undefined)
|
|
67
|
+
target.proofs.set(question, proof);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
for (const [key, value] of Object.entries(ast)) {
|
|
71
|
+
if (key === 'type' || key === 'start' || key === 'end')
|
|
72
|
+
continue;
|
|
73
|
+
collectProofs(value, source, target, stories);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function storyTitle(call) {
|
|
77
|
+
const argument = call.arguments?.[0];
|
|
78
|
+
if (argument?.type !== 'ObjectExpression')
|
|
79
|
+
return undefined;
|
|
80
|
+
for (const property of argument.properties ?? []) {
|
|
81
|
+
if (property.type !== 'Property')
|
|
82
|
+
continue;
|
|
83
|
+
if (propertyName(property) !== 'title')
|
|
84
|
+
continue;
|
|
85
|
+
return stringLiteral(property.value);
|
|
86
|
+
}
|
|
87
|
+
return undefined;
|
|
88
|
+
}
|
|
89
|
+
function isStoryCall(node, method) {
|
|
90
|
+
if (node.type !== 'CallExpression')
|
|
91
|
+
return false;
|
|
92
|
+
const callee = node.callee;
|
|
93
|
+
if (callee?.type !== 'MemberExpression')
|
|
94
|
+
return false;
|
|
95
|
+
const object = callee.object;
|
|
96
|
+
const property = callee.property;
|
|
97
|
+
return (object?.type === 'Identifier' &&
|
|
98
|
+
object.name === 'Story' &&
|
|
99
|
+
property?.type === 'Identifier' &&
|
|
100
|
+
property.name === method);
|
|
101
|
+
}
|
|
102
|
+
function propertyName(property) {
|
|
103
|
+
const key = property.key;
|
|
104
|
+
if (key?.type === 'Identifier')
|
|
105
|
+
return key.name;
|
|
106
|
+
if (key?.type === 'Literal')
|
|
107
|
+
return String(key.value);
|
|
108
|
+
return undefined;
|
|
109
|
+
}
|
|
110
|
+
function stringLiteral(node) {
|
|
111
|
+
if (node?.type === 'Literal') {
|
|
112
|
+
const value = node.value;
|
|
113
|
+
return typeof value === 'string' ? value : undefined;
|
|
114
|
+
}
|
|
115
|
+
if (node?.type === 'TemplateLiteral') {
|
|
116
|
+
const quasis = node.quasis;
|
|
117
|
+
if (quasis?.length === 1) {
|
|
118
|
+
const cooked = quasis[0]?.value?.cooked ?? quasis[0]?.cooked;
|
|
119
|
+
return typeof cooked === 'string' ? cooked : undefined;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return undefined;
|
|
123
|
+
}
|
|
124
|
+
function containsStoryCall(statement) {
|
|
125
|
+
let found = false;
|
|
126
|
+
const visit = (node) => {
|
|
127
|
+
if (found)
|
|
128
|
+
return;
|
|
129
|
+
if (Array.isArray(node)) {
|
|
130
|
+
for (const item of node)
|
|
131
|
+
visit(item);
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
if (typeof node !== 'object' || node === null)
|
|
135
|
+
return;
|
|
136
|
+
const ast = node;
|
|
137
|
+
if (ast.type === 'MemberExpression' &&
|
|
138
|
+
ast.object?.type === 'Identifier' &&
|
|
139
|
+
ast.object.name === 'Story') {
|
|
140
|
+
found = true;
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
for (const [key, value] of Object.entries(ast)) {
|
|
144
|
+
if (key === 'type' || key === 'start' || key === 'end')
|
|
145
|
+
continue;
|
|
146
|
+
visit(value);
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
visit(statement);
|
|
150
|
+
return found;
|
|
151
|
+
}
|
|
152
|
+
function questionLiteral(call) {
|
|
153
|
+
return stringLiteral(call.arguments?.[0]);
|
|
154
|
+
}
|
|
155
|
+
function questionProofSource(call, source) {
|
|
156
|
+
const options = call.arguments?.[1];
|
|
157
|
+
if (options?.type !== 'ObjectExpression')
|
|
158
|
+
return undefined;
|
|
159
|
+
for (const property of options.properties ?? []) {
|
|
160
|
+
if (property.type !== 'Property')
|
|
161
|
+
continue;
|
|
162
|
+
if (propertyName(property) !== 'proof')
|
|
163
|
+
continue;
|
|
164
|
+
const value = property.value;
|
|
165
|
+
if (value === undefined)
|
|
166
|
+
return undefined;
|
|
167
|
+
return dedent(source.slice(value.start, value.end));
|
|
168
|
+
}
|
|
169
|
+
return undefined;
|
|
170
|
+
}
|
|
171
|
+
function dedent(snippet) {
|
|
172
|
+
const lines = snippet.split('\n');
|
|
173
|
+
const indents = lines
|
|
174
|
+
.slice(1)
|
|
175
|
+
.filter((line) => line.trim().length > 0)
|
|
176
|
+
.map((line) => /^\s*/.exec(line)[0].length);
|
|
177
|
+
if (indents.length === 0)
|
|
178
|
+
return snippet;
|
|
179
|
+
const strip = Math.min(...indents);
|
|
180
|
+
return [lines[0], ...lines.slice(1).map((line) => line.slice(strip))].join('\n');
|
|
181
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/run-stories/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Effect, Stream } from 'effect';
|
|
2
|
+
import type { StoryReport, StoryTree } from '../../story/schema/index.js';
|
|
3
|
+
import type { ConfigError } from '../../services/config/index.js';
|
|
4
|
+
import { StoriesError } from './errors.js';
|
|
5
|
+
export declare function getStoryTree(configPath: string): Effect.Effect<StoryTree, ConfigError | StoriesError>;
|
|
6
|
+
export interface RunStoriesOptions {
|
|
7
|
+
readonly scope?: string | undefined;
|
|
8
|
+
readonly concurrency?: number | undefined;
|
|
9
|
+
}
|
|
10
|
+
export interface StoriesRun {
|
|
11
|
+
readonly total: number;
|
|
12
|
+
readonly reports: Stream.Stream<StoryReport>;
|
|
13
|
+
}
|
|
14
|
+
export declare function planStories(configPath: string, options?: RunStoriesOptions): Effect.Effect<StoriesRun, ConfigError | StoriesError>;
|
|
15
|
+
export declare function runStories(configPath: string, options?: RunStoriesOptions): Stream.Stream<StoryReport, ConfigError | StoriesError>;
|
|
16
|
+
//# sourceMappingURL=run-stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-stories.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/run-stories/run-stories.ts"],"names":[],"mappings":"AAIA,OAAO,EAAS,MAAM,EAAQ,MAAM,EAAE,MAAM,QAAQ,CAAC;AAWrD,OAAO,KAAK,EAOV,WAAW,EAEX,SAAS,EAEV,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAUlE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAO3C,wBAAgB,YAAY,CAC1B,UAAU,EAAE,MAAM,GACjB,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,WAAW,GAAG,YAAY,CAAC,CAEtD;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3C;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;CAC9C;AAID,wBAAgB,WAAW,CACzB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,iBAAiB,GAC1B,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,WAAW,GAAG,YAAY,CAAC,CAYvD;AAED,wBAAgB,UAAU,CACxB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,iBAAiB,GAC1B,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,WAAW,GAAG,YAAY,CAAC,CAIxD"}
|