ddd-ts-kit 0.1.1 → 0.3.0
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 +136 -23
- package/dist/alias/compiler-resolution-of.d.ts +10 -0
- package/dist/alias/compiler-resolution-of.d.ts.map +1 -0
- package/dist/alias/compiler-resolution-of.js +13 -0
- package/dist/alias/compiler-resolution-of.js.map +1 -0
- package/dist/alias/compiler-resolution.d.ts +8 -0
- package/dist/alias/compiler-resolution.d.ts.map +1 -0
- package/dist/alias/compiler-resolution.js +2 -0
- package/dist/alias/compiler-resolution.js.map +1 -0
- package/dist/alias/index.d.ts +3 -1
- package/dist/alias/index.d.ts.map +1 -1
- package/dist/alias/index.js +3 -1
- package/dist/alias/index.js.map +1 -1
- package/dist/alias/module-name-mapper.d.ts +4 -3
- package/dist/alias/module-name-mapper.d.ts.map +1 -1
- package/dist/alias/module-name-mapper.js +6 -4
- package/dist/alias/module-name-mapper.js.map +1 -1
- package/dist/alias/specifier-of.d.ts +7 -0
- package/dist/alias/specifier-of.d.ts.map +1 -0
- package/dist/alias/specifier-of.js +17 -0
- package/dist/alias/specifier-of.js.map +1 -0
- package/dist/alias/specifier-suffix.d.ts +6 -0
- package/dist/alias/specifier-suffix.d.ts.map +1 -0
- package/dist/alias/specifier-suffix.js +8 -0
- package/dist/alias/specifier-suffix.js.map +1 -0
- package/dist/alias/to-alias.d.ts +3 -2
- package/dist/alias/to-alias.d.ts.map +1 -1
- package/dist/alias/to-alias.js +4 -3
- package/dist/alias/to-alias.js.map +1 -1
- package/dist/build/emitted-place.d.ts +2 -0
- package/dist/build/emitted-place.d.ts.map +1 -1
- package/dist/build/emitted-specifier.d.ts +3 -2
- package/dist/build/emitted-specifier.d.ts.map +1 -1
- package/dist/build/emitted-specifier.js +6 -12
- package/dist/build/emitted-specifier.js.map +1 -1
- package/dist/build/emitted-target.d.ts +9 -0
- package/dist/build/emitted-target.d.ts.map +1 -0
- package/dist/build/emitted-target.js +18 -0
- package/dist/build/emitted-target.js.map +1 -0
- package/dist/build/rewrite-aliases.d.ts +5 -3
- package/dist/build/rewrite-aliases.d.ts.map +1 -1
- package/dist/build/rewrite-aliases.js +12 -7
- package/dist/build/rewrite-aliases.js.map +1 -1
- package/dist/build/rewrite-specifiers.d.ts +3 -1
- package/dist/build/rewrite-specifiers.d.ts.map +1 -1
- package/dist/build/rewrite-specifiers.js +2 -2
- package/dist/build/rewrite-specifiers.js.map +1 -1
- package/dist/build/unresolved-problem.d.ts +4 -0
- package/dist/build/unresolved-problem.d.ts.map +1 -0
- package/dist/build/unresolved-problem.js +16 -0
- package/dist/build/unresolved-problem.js.map +1 -0
- package/dist/check/alias/compiler-resolution.d.ts +10 -0
- package/dist/check/alias/compiler-resolution.d.ts.map +1 -0
- package/dist/check/alias/compiler-resolution.js +47 -0
- package/dist/check/alias/compiler-resolution.js.map +1 -0
- package/dist/check/alias/test-runners.js +4 -4
- package/dist/check/alias/test-runners.js.map +1 -1
- package/dist/check/canonical/roles.d.ts.map +1 -1
- package/dist/check/canonical/roles.js +6 -0
- package/dist/check/canonical/roles.js.map +1 -1
- package/dist/check/catalogue/architecture-rules.d.ts.map +1 -1
- package/dist/check/catalogue/architecture-rules.js +8 -0
- package/dist/check/catalogue/architecture-rules.js.map +1 -1
- package/dist/check/catalogue/eslint-only-rules.d.ts.map +1 -1
- package/dist/check/catalogue/eslint-only-rules.js +12 -0
- package/dist/check/catalogue/eslint-only-rules.js.map +1 -1
- package/dist/check/configuration/config-inspection.d.ts +2 -0
- package/dist/check/configuration/config-inspection.d.ts.map +1 -1
- package/dist/check/configuration/config-inspection.js +11 -1
- package/dist/check/configuration/config-inspection.js.map +1 -1
- package/dist/check/declarations/classes-of.js +1 -1
- package/dist/check/declarations/classes-of.js.map +1 -1
- package/dist/check/errors/builds-through-factories.d.ts +4 -0
- package/dist/check/errors/builds-through-factories.d.ts.map +1 -0
- package/dist/check/errors/builds-through-factories.js +5 -0
- package/dist/check/errors/builds-through-factories.js.map +1 -0
- package/dist/check/errors/error-code.d.ts +6 -0
- package/dist/check/errors/error-code.d.ts.map +1 -0
- package/dist/check/errors/error-code.js +2 -0
- package/dist/check/errors/error-code.js.map +1 -0
- package/dist/check/errors/error-codes.d.ts +8 -0
- package/dist/check/errors/error-codes.d.ts.map +1 -0
- package/dist/check/errors/error-codes.js +21 -0
- package/dist/check/errors/error-codes.js.map +1 -0
- package/dist/check/errors/kit-error-codes.d.ts +3 -0
- package/dist/check/errors/kit-error-codes.d.ts.map +1 -0
- package/dist/check/errors/kit-error-codes.js +17 -0
- package/dist/check/errors/kit-error-codes.js.map +1 -0
- package/dist/check/explain/context-docs.js +7 -7
- package/dist/check/explain/context-docs.js.map +1 -1
- package/dist/check/explain/errors-docs.d.ts +3 -0
- package/dist/check/explain/errors-docs.d.ts.map +1 -0
- package/dist/check/explain/errors-docs.js +30 -0
- package/dist/check/explain/errors-docs.js.map +1 -0
- package/dist/check/explain/imports-docs.d.ts.map +1 -1
- package/dist/check/explain/imports-docs.js +24 -9
- package/dist/check/explain/imports-docs.js.map +1 -1
- package/dist/check/explain/layer-docs.js +7 -7
- package/dist/check/explain/layer-docs.js.map +1 -1
- package/dist/check/explain/ports-docs.d.ts.map +1 -1
- package/dist/check/explain/ports-docs.js +15 -7
- package/dist/check/explain/ports-docs.js.map +1 -1
- package/dist/check/explain/rule-docs.d.ts.map +1 -1
- package/dist/check/explain/rule-docs.js +2 -0
- package/dist/check/explain/rule-docs.js.map +1 -1
- package/dist/check/explain/scheduling-docs.js +1 -1
- package/dist/check/explain/wiring-docs.d.ts.map +1 -1
- package/dist/check/explain/wiring-docs.js +35 -10
- package/dist/check/explain/wiring-docs.js.map +1 -1
- package/dist/check/fixtures/alias-declared-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/alias-declared-fixtures.js +32 -1
- package/dist/check/fixtures/alias-declared-fixtures.js.map +1 -1
- package/dist/check/fixtures/config-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/config-fixtures.js +6 -0
- package/dist/check/fixtures/config-fixtures.js.map +1 -1
- package/dist/check/fixtures/constructor-injection-fixtures.d.ts +3 -0
- package/dist/check/fixtures/constructor-injection-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/constructor-injection-fixtures.js +111 -0
- package/dist/check/fixtures/constructor-injection-fixtures.js.map +1 -0
- package/dist/check/fixtures/declared-project.d.ts.map +1 -1
- package/dist/check/fixtures/declared-project.js +4 -1
- package/dist/check/fixtures/declared-project.js.map +1 -1
- package/dist/check/fixtures/errors-fixtures.d.ts +3 -0
- package/dist/check/fixtures/errors-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/errors-fixtures.js +126 -0
- package/dist/check/fixtures/errors-fixtures.js.map +1 -0
- package/dist/check/fixtures/extension-fixtures.d.ts +3 -0
- package/dist/check/fixtures/extension-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/extension-fixtures.js +77 -0
- package/dist/check/fixtures/extension-fixtures.js.map +1 -0
- package/dist/check/fixtures/fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/fixtures.js +6 -0
- package/dist/check/fixtures/fixtures.js.map +1 -1
- package/dist/check/fixtures/signature-project.d.ts +11 -0
- package/dist/check/fixtures/signature-project.d.ts.map +1 -0
- package/dist/check/fixtures/signature-project.js +21 -0
- package/dist/check/fixtures/signature-project.js.map +1 -0
- package/dist/check/fixtures/signature.d.ts +13 -0
- package/dist/check/fixtures/signature.d.ts.map +1 -0
- package/dist/check/fixtures/signature.js +24 -0
- package/dist/check/fixtures/signature.js.map +1 -0
- package/dist/check/project/beside-the-sources.d.ts +5 -0
- package/dist/check/project/beside-the-sources.d.ts.map +1 -0
- package/dist/check/project/beside-the-sources.js +21 -0
- package/dist/check/project/beside-the-sources.js.map +1 -0
- package/dist/check/project/resolve-import.d.ts.map +1 -1
- package/dist/check/project/resolve-import.js +4 -1
- package/dist/check/project/resolve-import.js.map +1 -1
- package/dist/check/rules/clean-one-export-per-file.d.ts.map +1 -1
- package/dist/check/rules/clean-one-export-per-file.js +14 -8
- package/dist/check/rules/clean-one-export-per-file.js.map +1 -1
- package/dist/check/rules/config-valid.d.ts.map +1 -1
- package/dist/check/rules/config-valid.js +2 -1
- package/dist/check/rules/config-valid.js.map +1 -1
- package/dist/check/rules/declarations-barrel-current.d.ts.map +1 -1
- package/dist/check/rules/declarations-barrel-current.js +34 -32
- package/dist/check/rules/declarations-barrel-current.js.map +1 -1
- package/dist/check/rules/declarations-constructor-injection.d.ts +3 -0
- package/dist/check/rules/declarations-constructor-injection.d.ts.map +1 -0
- package/dist/check/rules/declarations-constructor-injection.js +58 -0
- package/dist/check/rules/declarations-constructor-injection.js.map +1 -0
- package/dist/check/rules/errors-code-unique.d.ts +3 -0
- package/dist/check/rules/errors-code-unique.d.ts.map +1 -0
- package/dist/check/rules/errors-code-unique.js +34 -0
- package/dist/check/rules/errors-code-unique.js.map +1 -0
- package/dist/check/rules/errors-known-code.d.ts +3 -0
- package/dist/check/rules/errors-known-code.d.ts.map +1 -0
- package/dist/check/rules/errors-known-code.js +51 -0
- package/dist/check/rules/errors-known-code.js.map +1 -0
- package/dist/check/rules/imports-alias-declared.d.ts.map +1 -1
- package/dist/check/rules/imports-alias-declared.js +3 -1
- package/dist/check/rules/imports-alias-declared.js.map +1 -1
- package/dist/check/rules/imports-alias-only.d.ts.map +1 -1
- package/dist/check/rules/imports-alias-only.js +16 -29
- package/dist/check/rules/imports-alias-only.js.map +1 -1
- package/dist/check/rules/imports-extension.d.ts +3 -0
- package/dist/check/rules/imports-extension.d.ts.map +1 -0
- package/dist/check/rules/imports-extension.js +65 -0
- package/dist/check/rules/imports-extension.js.map +1 -0
- package/dist/check/rules/language-glossary-term.d.ts.map +1 -1
- package/dist/check/rules/language-glossary-term.js +7 -5
- package/dist/check/rules/language-glossary-term.js.map +1 -1
- package/dist/check/rules/ports-no-concrete-dependency.d.ts.map +1 -1
- package/dist/check/rules/ports-no-concrete-dependency.js +43 -15
- package/dist/check/rules/ports-no-concrete-dependency.js.map +1 -1
- package/dist/check/rules/tree-closed.js +6 -4
- package/dist/check/rules/tree-closed.js.map +1 -1
- package/dist/commands/build-aliases.d.ts.map +1 -1
- package/dist/commands/build-aliases.js +5 -3
- package/dist/commands/build-aliases.js.map +1 -1
- package/dist/commands/docs.d.ts.map +1 -1
- package/dist/commands/docs.js +17 -2
- package/dist/commands/docs.js.map +1 -1
- package/dist/commands/error-factories.d.ts +7 -0
- package/dist/commands/error-factories.d.ts.map +1 -0
- package/dist/commands/error-factories.js +65 -0
- package/dist/commands/error-factories.js.map +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +6 -4
- package/dist/commands/init.js.map +1 -1
- package/dist/commit/is-derived.d.ts.map +1 -1
- package/dist/commit/is-derived.js +5 -2
- package/dist/commit/is-derived.js.map +1 -1
- package/dist/config/config.d.ts +2 -0
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/default-import-extension.d.ts +3 -0
- package/dist/config/default-import-extension.d.ts.map +1 -0
- package/dist/config/default-import-extension.js +3 -0
- package/dist/config/default-import-extension.js.map +1 -0
- package/dist/config/import-extensions.d.ts +3 -0
- package/dist/config/import-extensions.d.ts.map +1 -0
- package/dist/config/import-extensions.js +3 -0
- package/dist/config/import-extensions.js.map +1 -0
- package/dist/config/index.d.ts +4 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +4 -1
- package/dist/config/index.js.map +1 -1
- package/dist/config/parse-config.d.ts.map +1 -1
- package/dist/config/parse-config.js +2 -0
- package/dist/config/parse-config.js.map +1 -1
- package/dist/config/parse-stack.d.ts.map +1 -1
- package/dist/config/parse-stack.js +3 -1
- package/dist/config/parse-stack.js.map +1 -1
- package/dist/config/restack-config-text.d.ts +11 -0
- package/dist/config/restack-config-text.d.ts.map +1 -0
- package/dist/config/restack-config-text.js +31 -0
- package/dist/config/restack-config-text.js.map +1 -0
- package/dist/config/serialize-config.d.ts.map +1 -1
- package/dist/config/serialize-config.js +3 -6
- package/dist/config/serialize-config.js.map +1 -1
- package/dist/config/stack.d.ts +17 -0
- package/dist/config/stack.d.ts.map +1 -1
- package/dist/config/stack.js +2 -0
- package/dist/config/stack.js.map +1 -1
- package/dist/config/unwritten-import-extension.d.ts +3 -0
- package/dist/config/unwritten-import-extension.d.ts.map +1 -0
- package/dist/config/unwritten-import-extension.js +3 -0
- package/dist/config/unwritten-import-extension.js.map +1 -0
- package/dist/config/written-stack.d.ts +8 -0
- package/dist/config/written-stack.d.ts.map +1 -0
- package/dist/config/written-stack.js +10 -0
- package/dist/config/written-stack.js.map +1 -0
- package/dist/declared/declared-role.d.ts.map +1 -1
- package/dist/declared/declared-role.js +1 -0
- package/dist/declared/declared-role.js.map +1 -1
- package/dist/declared/dependencies-file.d.ts +7 -0
- package/dist/declared/dependencies-file.d.ts.map +1 -0
- package/dist/declared/dependencies-file.js +9 -0
- package/dist/declared/dependencies-file.js.map +1 -0
- package/dist/declared/generated-drift.d.ts +7 -0
- package/dist/declared/generated-drift.d.ts.map +1 -0
- package/dist/declared/generated-drift.js +47 -0
- package/dist/declared/generated-drift.js.map +1 -0
- package/dist/declared/index.d.ts +8 -1
- package/dist/declared/index.d.ts.map +1 -1
- package/dist/declared/index.js +6 -1
- package/dist/declared/index.js.map +1 -1
- package/dist/declared/injection/class-injection.d.ts +19 -0
- package/dist/declared/injection/class-injection.d.ts.map +1 -0
- package/dist/declared/injection/class-injection.js +2 -0
- package/dist/declared/injection/class-injection.js.map +1 -0
- package/dist/declared/injection/constructor-of.d.ts +16 -0
- package/dist/declared/injection/constructor-of.d.ts.map +1 -0
- package/dist/declared/injection/constructor-of.js +33 -0
- package/dist/declared/injection/constructor-of.js.map +1 -0
- package/dist/declared/injection/context-injections.d.ts +8 -0
- package/dist/declared/injection/context-injections.d.ts.map +1 -0
- package/dist/declared/injection/context-injections.js +14 -0
- package/dist/declared/injection/context-injections.js.map +1 -0
- package/dist/declared/injection/declared-kind-of.d.ts +8 -0
- package/dist/declared/injection/declared-kind-of.d.ts.map +1 -0
- package/dist/declared/injection/declared-kind-of.js +12 -0
- package/dist/declared/injection/declared-kind-of.js.map +1 -0
- package/dist/declared/injection/exported-name-of.d.ts +4 -0
- package/dist/declared/injection/exported-name-of.d.ts.map +1 -0
- package/dist/declared/injection/exported-name-of.js +17 -0
- package/dist/declared/injection/exported-name-of.js.map +1 -0
- package/dist/declared/injection/language-types.d.ts +3 -0
- package/dist/declared/injection/language-types.d.ts.map +1 -0
- package/dist/declared/injection/language-types.js +32 -0
- package/dist/declared/injection/language-types.js.map +1 -0
- package/dist/declared/injection/local-names.d.ts +17 -0
- package/dist/declared/injection/local-names.d.ts.map +1 -0
- package/dist/declared/injection/local-names.js +41 -0
- package/dist/declared/injection/local-names.js.map +1 -0
- package/dist/declared/injection/parameter-shape.d.ts +11 -0
- package/dist/declared/injection/parameter-shape.d.ts.map +1 -0
- package/dist/declared/injection/parameter-shape.js +58 -0
- package/dist/declared/injection/parameter-shape.js.map +1 -0
- package/dist/declared/injection/raw-class-name.d.ts +7 -0
- package/dist/declared/injection/raw-class-name.d.ts.map +1 -0
- package/dist/declared/injection/raw-class-name.js +28 -0
- package/dist/declared/injection/raw-class-name.js.map +1 -0
- package/dist/declared/injection/read-constructor.d.ts +10 -0
- package/dist/declared/injection/read-constructor.d.ts.map +1 -0
- package/dist/declared/injection/read-constructor.js +2 -0
- package/dist/declared/injection/read-constructor.js.map +1 -0
- package/dist/declared/injection/read-injections.d.ts +6 -0
- package/dist/declared/injection/read-injections.d.ts.map +1 -0
- package/dist/declared/injection/read-injections.js +75 -0
- package/dist/declared/injection/read-injections.js.map +1 -0
- package/dist/declared/injection/render-injections.d.ts +11 -0
- package/dist/declared/injection/render-injections.d.ts.map +1 -0
- package/dist/declared/injection/render-injections.js +51 -0
- package/dist/declared/injection/render-injections.js.map +1 -0
- package/dist/declared/injection/rendered-injections.d.ts +8 -0
- package/dist/declared/injection/rendered-injections.d.ts.map +1 -0
- package/dist/declared/injection/rendered-injections.js +2 -0
- package/dist/declared/injection/rendered-injections.js.map +1 -0
- package/dist/declared/injection/resolve-token.d.ts +18 -0
- package/dist/declared/injection/resolve-token.d.ts.map +1 -0
- package/dist/declared/injection/resolve-token.js +46 -0
- package/dist/declared/injection/resolve-token.js.map +1 -0
- package/dist/declared/injection/resolved-token.d.ts +10 -0
- package/dist/declared/injection/resolved-token.d.ts.map +1 -0
- package/dist/declared/injection/resolved-token.js +2 -0
- package/dist/declared/injection/resolved-token.js.map +1 -0
- package/dist/declared/injection/sources.d.ts +4 -0
- package/dist/declared/injection/sources.d.ts.map +1 -0
- package/dist/declared/injection/sources.js +2 -0
- package/dist/declared/injection/sources.js.map +1 -0
- package/dist/declared/injection/token-reference.d.ts +14 -0
- package/dist/declared/injection/token-reference.d.ts.map +1 -0
- package/dist/declared/injection/token-reference.js +2 -0
- package/dist/declared/injection/token-reference.js.map +1 -0
- package/dist/declared/render-barrel.d.ts +8 -5
- package/dist/declared/render-barrel.d.ts.map +1 -1
- package/dist/declared/render-barrel.js +13 -6
- package/dist/declared/render-barrel.js.map +1 -1
- package/dist/declared/render-dependencies-file.d.ts +8 -0
- package/dist/declared/render-dependencies-file.d.ts.map +1 -0
- package/dist/declared/render-dependencies-file.js +12 -0
- package/dist/declared/render-dependencies-file.js.map +1 -0
- package/dist/depcruise/hygiene-rules.js +2 -1
- package/dist/depcruise/hygiene-rules.js.map +1 -1
- package/dist/describe/context-description.d.ts +22 -0
- package/dist/describe/context-description.d.ts.map +1 -1
- package/dist/describe/describe-context.d.ts.map +1 -1
- package/dist/describe/describe-context.js +4 -0
- package/dist/describe/describe-context.js.map +1 -1
- package/dist/describe/format-description.d.ts.map +1 -1
- package/dist/describe/format-description.js +9 -0
- package/dist/describe/format-description.js.map +1 -1
- package/dist/describe/read-errors.d.ts +8 -0
- package/dist/describe/read-errors.d.ts.map +1 -0
- package/dist/describe/read-errors.js +52 -0
- package/dist/describe/read-errors.js.map +1 -0
- package/dist/describe/read-projections.d.ts +5 -0
- package/dist/describe/read-projections.d.ts.map +1 -0
- package/dist/describe/read-projections.js +19 -0
- package/dist/describe/read-projections.js.map +1 -0
- package/dist/describe/reference-lines.js +23 -1
- package/dist/describe/reference-lines.js.map +1 -1
- package/dist/dev/refresh-declarations.d.ts +9 -0
- package/dist/dev/refresh-declarations.d.ts.map +1 -0
- package/dist/dev/refresh-declarations.js +28 -0
- package/dist/dev/refresh-declarations.js.map +1 -0
- package/dist/generate/access-vars.js +3 -3
- package/dist/generate/access-vars.js.map +1 -1
- package/dist/generate/errors/add-factory.d.ts +13 -0
- package/dist/generate/errors/add-factory.d.ts.map +1 -0
- package/dist/generate/errors/add-factory.js +30 -0
- package/dist/generate/errors/add-factory.js.map +1 -0
- package/dist/generate/errors/add-spec-case.d.ts +6 -0
- package/dist/generate/errors/add-spec-case.d.ts.map +1 -0
- package/dist/generate/errors/add-spec-case.js +26 -0
- package/dist/generate/errors/add-spec-case.js.map +1 -0
- package/dist/generate/errors/class-body.d.ts +8 -0
- package/dist/generate/errors/class-body.d.ts.map +1 -0
- package/dist/generate/errors/class-body.js +11 -0
- package/dist/generate/errors/class-body.js.map +1 -0
- package/dist/generate/errors/codes-of-context.d.ts +4 -0
- package/dist/generate/errors/codes-of-context.d.ts.map +1 -0
- package/dist/generate/errors/codes-of-context.js +17 -0
- package/dist/generate/errors/codes-of-context.js.map +1 -0
- package/dist/generate/errors/refusal-code.d.ts +13 -0
- package/dist/generate/errors/refusal-code.d.ts.map +1 -0
- package/dist/generate/errors/refusal-code.js +19 -0
- package/dist/generate/errors/refusal-code.js.map +1 -0
- package/dist/generate/errors/refusal-name.d.ts +4 -0
- package/dist/generate/errors/refusal-name.d.ts.map +1 -0
- package/dist/generate/errors/refusal-name.js +15 -0
- package/dist/generate/errors/refusal-name.js.map +1 -0
- package/dist/generate/errors/static-methods.d.ts +10 -0
- package/dist/generate/errors/static-methods.d.ts.map +1 -0
- package/dist/generate/errors/static-methods.js +13 -0
- package/dist/generate/errors/static-methods.js.map +1 -0
- package/dist/generate/errors/vague-refusal-names.d.ts +3 -0
- package/dist/generate/errors/vague-refusal-names.d.ts.map +1 -0
- package/dist/generate/errors/vague-refusal-names.js +15 -0
- package/dist/generate/errors/vague-refusal-names.js.map +1 -0
- package/dist/generate/kinds/context-plan.d.ts +10 -0
- package/dist/generate/kinds/context-plan.d.ts.map +1 -0
- package/dist/generate/kinds/context-plan.js +2 -0
- package/dist/generate/kinds/context-plan.js.map +1 -0
- package/dist/generate/kinds/declare-context-entries.d.ts +3 -1
- package/dist/generate/kinds/declare-context-entries.d.ts.map +1 -1
- package/dist/generate/kinds/declare-context-entries.js +4 -2
- package/dist/generate/kinds/declare-context-entries.js.map +1 -1
- package/dist/generate/kinds/domain-error-kind.d.ts.map +1 -1
- package/dist/generate/kinds/domain-error-kind.js +4 -1
- package/dist/generate/kinds/domain-error-kind.js.map +1 -1
- package/dist/generate/kinds/error-kind.d.ts +3 -0
- package/dist/generate/kinds/error-kind.d.ts.map +1 -0
- package/dist/generate/kinds/error-kind.js +75 -0
- package/dist/generate/kinds/error-kind.js.map +1 -0
- package/dist/generate/kinds/extraction/service-selection.js +8 -11
- package/dist/generate/kinds/extraction/service-selection.js.map +1 -1
- package/dist/generate/kinds/job/job-vars.d.ts.map +1 -1
- package/dist/generate/kinds/job/job-vars.js +5 -3
- package/dist/generate/kinds/job/job-vars.js.map +1 -1
- package/dist/generate/kinds/plan-vars.d.ts +5 -0
- package/dist/generate/kinds/plan-vars.d.ts.map +1 -0
- package/dist/generate/kinds/plan-vars.js +24 -0
- package/dist/generate/kinds/plan-vars.js.map +1 -0
- package/dist/generate/kinds/projection-kind.d.ts +3 -0
- package/dist/generate/kinds/projection-kind.d.ts.map +1 -0
- package/dist/generate/kinds/projection-kind.js +72 -0
- package/dist/generate/kinds/projection-kind.js.map +1 -0
- package/dist/generate/kinds/publish-in-index.js +2 -2
- package/dist/generate/kinds/publish-in-index.js.map +1 -1
- package/dist/generate/kinds/route/route-vars.d.ts.map +1 -1
- package/dist/generate/kinds/route/route-vars.js +7 -6
- package/dist/generate/kinds/route/route-vars.js.map +1 -1
- package/dist/generate/kinds/wire-context.d.ts +10 -0
- package/dist/generate/kinds/wire-context.d.ts.map +1 -0
- package/dist/generate/kinds/wire-context.js +36 -0
- package/dist/generate/kinds/wire-context.js.map +1 -0
- package/dist/generate/kinds/write-context-files.d.ts +1 -8
- package/dist/generate/kinds/write-context-files.d.ts.map +1 -1
- package/dist/generate/kinds/write-context-files.js +3 -40
- package/dist/generate/kinds/write-context-files.js.map +1 -1
- package/dist/generate/kinds.d.ts.map +1 -1
- package/dist/generate/kinds.js +4 -0
- package/dist/generate/kinds.js.map +1 -1
- package/dist/generate/refresh-barrels.d.ts +4 -3
- package/dist/generate/refresh-barrels.d.ts.map +1 -1
- package/dist/generate/refresh-barrels.js +41 -16
- package/dist/generate/refresh-barrels.js.map +1 -1
- package/dist/generate/spec-vars.js +4 -4
- package/dist/generate/spec-vars.js.map +1 -1
- package/dist/generate/storage-vars.d.ts +2 -2
- package/dist/generate/storage-vars.d.ts.map +1 -1
- package/dist/generate/storage-vars.js +6 -10
- package/dist/generate/storage-vars.js.map +1 -1
- package/dist/generate/workspace-sources.d.ts +6 -0
- package/dist/generate/workspace-sources.d.ts.map +1 -0
- package/dist/generate/workspace-sources.js +13 -0
- package/dist/generate/workspace-sources.js.map +1 -0
- package/dist/init/manifest/scripts-for.js +6 -1
- package/dist/init/manifest/scripts-for.js.map +1 -1
- package/dist/init/manifest/versions.js +23 -23
- package/dist/init/run-init.d.ts.map +1 -1
- package/dist/init/run-init.js +32 -3
- package/dist/init/run-init.js.map +1 -1
- package/dist/init/stack/recorded-options.d.ts +11 -0
- package/dist/init/stack/recorded-options.d.ts.map +1 -0
- package/dist/init/stack/recorded-options.js +19 -0
- package/dist/init/stack/recorded-options.js.map +1 -0
- package/dist/init/stack/resolve-stack.d.ts +6 -1
- package/dist/init/stack/resolve-stack.d.ts.map +1 -1
- package/dist/init/stack/resolve-stack.js +48 -9
- package/dist/init/stack/resolve-stack.js.map +1 -1
- package/dist/init/stack/resolve-style.d.ts +3 -5
- package/dist/init/stack/resolve-style.d.ts.map +1 -1
- package/dist/init/stack/resolve-style.js +11 -3
- package/dist/init/stack/resolve-style.js.map +1 -1
- package/dist/init/stack/stack-options.d.ts +4 -0
- package/dist/init/stack/stack-options.d.ts.map +1 -1
- package/dist/init/write-agent-settings.js +4 -3
- package/dist/init/write-agent-settings.js.map +1 -1
- package/dist/init/write-type-script-configs.d.ts +2 -1
- package/dist/init/write-type-script-configs.d.ts.map +1 -1
- package/dist/init/write-type-script-configs.js +4 -4
- package/dist/init/write-type-script-configs.js.map +1 -1
- package/dist/refresh-declarations.d.ts +3 -0
- package/dist/refresh-declarations.d.ts.map +1 -0
- package/dist/refresh-declarations.js +4 -0
- package/dist/refresh-declarations.js.map +1 -0
- package/dist/refusals/apply-plan.d.ts +17 -0
- package/dist/refusals/apply-plan.d.ts.map +1 -0
- package/dist/refusals/apply-plan.js +118 -0
- package/dist/refusals/apply-plan.js.map +1 -0
- package/dist/refusals/factory-name-for.d.ts +7 -0
- package/dist/refusals/factory-name-for.d.ts.map +1 -0
- package/dist/refusals/factory-name-for.js +16 -0
- package/dist/refusals/factory-name-for.js.map +1 -0
- package/dist/refusals/legacy-error.d.ts +21 -0
- package/dist/refusals/legacy-error.d.ts.map +1 -0
- package/dist/refusals/legacy-error.js +2 -0
- package/dist/refusals/legacy-error.js.map +1 -0
- package/dist/refusals/legacy-errors.d.ts +6 -0
- package/dist/refusals/legacy-errors.d.ts.map +1 -0
- package/dist/refusals/legacy-errors.js +16 -0
- package/dist/refusals/legacy-errors.js.map +1 -0
- package/dist/refusals/migration-draft.d.ts +15 -0
- package/dist/refusals/migration-draft.d.ts.map +1 -0
- package/dist/refusals/migration-draft.js +41 -0
- package/dist/refusals/migration-draft.js.map +1 -0
- package/dist/refusals/migration-plan.d.ts +6 -0
- package/dist/refusals/migration-plan.d.ts.map +1 -0
- package/dist/refusals/migration-plan.js +2 -0
- package/dist/refusals/migration-plan.js.map +1 -0
- package/dist/refusals/move.d.ts +15 -0
- package/dist/refusals/move.d.ts.map +1 -0
- package/dist/refusals/move.js +2 -0
- package/dist/refusals/move.js.map +1 -0
- package/dist/refusals/nested-cases.d.ts +3 -0
- package/dist/refusals/nested-cases.d.ts.map +1 -0
- package/dist/refusals/nested-cases.js +9 -0
- package/dist/refusals/nested-cases.js.map +1 -0
- package/dist/refusals/plan-file.d.ts +3 -0
- package/dist/refusals/plan-file.d.ts.map +1 -0
- package/dist/refusals/plan-file.js +3 -0
- package/dist/refusals/plan-file.js.map +1 -0
- package/dist/refusals/planned-factory.d.ts +11 -0
- package/dist/refusals/planned-factory.d.ts.map +1 -0
- package/dist/refusals/planned-factory.js +2 -0
- package/dist/refusals/planned-factory.js.map +1 -0
- package/dist/refusals/planned-move.d.ts +8 -0
- package/dist/refusals/planned-move.d.ts.map +1 -0
- package/dist/refusals/planned-move.js +2 -0
- package/dist/refusals/planned-move.js.map +1 -0
- package/dist/refusals/project-sources.d.ts +5 -0
- package/dist/refusals/project-sources.d.ts.map +1 -0
- package/dist/refusals/project-sources.js +13 -0
- package/dist/refusals/project-sources.js.map +1 -0
- package/dist/refusals/propose-plan.d.ts +16 -0
- package/dist/refusals/propose-plan.d.ts.map +1 -0
- package/dist/refusals/propose-plan.js +39 -0
- package/dist/refusals/propose-plan.js.map +1 -0
- package/dist/refusals/read-legacy-error.d.ts +9 -0
- package/dist/refusals/read-legacy-error.d.ts.map +1 -0
- package/dist/refusals/read-legacy-error.js +75 -0
- package/dist/refusals/read-legacy-error.js.map +1 -0
- package/dist/refusals/read-plan.d.ts +4 -0
- package/dist/refusals/read-plan.d.ts.map +1 -0
- package/dist/refusals/read-plan.js +43 -0
- package/dist/refusals/read-plan.js.map +1 -0
- package/dist/refusals/render-factory.d.ts +5 -0
- package/dist/refusals/render-factory.d.ts.map +1 -0
- package/dist/refusals/render-factory.js +14 -0
- package/dist/refusals/render-factory.js.map +1 -0
- package/dist/refusals/replace-in-code.d.ts +16 -0
- package/dist/refusals/replace-in-code.d.ts.map +1 -0
- package/dist/refusals/replace-in-code.js +20 -0
- package/dist/refusals/replace-in-code.js.map +1 -0
- package/dist/refusals/rewrite-usages.d.ts +6 -0
- package/dist/refusals/rewrite-usages.d.ts.map +1 -0
- package/dist/refusals/rewrite-usages.js +80 -0
- package/dist/refusals/rewrite-usages.js.map +1 -0
- package/dist/refusals/spec-parts.d.ts +8 -0
- package/dist/refusals/spec-parts.d.ts.map +1 -0
- package/dist/refusals/spec-parts.js +14 -0
- package/dist/refusals/spec-parts.js.map +1 -0
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +8 -0
- package/dist/run.js.map +1 -1
- package/dist/stack/alias-vars.d.ts +2 -1
- package/dist/stack/alias-vars.d.ts.map +1 -1
- package/dist/stack/alias-vars.js +6 -3
- package/dist/stack/alias-vars.js.map +1 -1
- package/dist/stack/stack-vars.d.ts.map +1 -1
- package/dist/stack/stack-vars.js +2 -1
- package/dist/stack/stack-vars.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -3
- package/templates/acl/translator.spec.ts.tpl +1 -1
- package/templates/adapter/adapter.declared.ts.tpl +3 -3
- package/templates/adapter/adapter.spec.ts.tpl +1 -1
- package/templates/adapter/adapter.ts.tpl +1 -1
- package/templates/adapter/wiring.tsyringe.tpl +3 -3
- package/templates/aggregate/aggregate.spec.ts.tpl +2 -2
- package/templates/aggregate/aggregate.ts.tpl +5 -0
- package/templates/architecture/extractable.declared.spec.ts.tpl +1 -1
- package/templates/architecture/extractable.manual.spec.ts.tpl +4 -4
- package/templates/architecture/extractable.tsyringe.spec.ts.tpl +1 -1
- package/templates/architecture/wiring.declared.tpl +1 -1
- package/templates/architecture/wiring.manual.tpl +1 -1
- package/templates/architecture/wiring.tsyringe.tpl +1 -1
- package/templates/builder/builder.ts.tpl +1 -1
- package/templates/command/handler.declared.ts.tpl +12 -7
- package/templates/command/handler.spec.buses.ts.tpl +4 -4
- package/templates/command/handler.spec.tsyringe.ts.tpl +5 -5
- package/templates/command/handler.ts.tpl +9 -4
- package/templates/command/wiring.manual.tpl +2 -2
- package/templates/command/wiring.tsyringe.tpl +3 -3
- package/templates/context/module.manual.ts.tpl +1 -1
- package/templates/context/permission-set.tpl +1 -1
- package/templates/context/permissions.spec.ts.tpl +1 -1
- package/templates/context/routes.spec.ts.tpl +1 -1
- package/templates/context/wiring.declared.tpl +2 -2
- package/templates/context/wiring.manual.tpl +1 -1
- package/templates/context/wiring.tsyringe.tpl +2 -2
- package/templates/docs/openapi.json.tpl +5 -0
- package/templates/domain-error/domain-error.spec.ts.tpl +1 -1
- package/templates/domain-event/domain-event.spec.ts.tpl +1 -1
- package/templates/domain-service/domain-service.spec.ts.tpl +1 -1
- package/templates/e2e/e2e.spec.ts.tpl +2 -2
- package/templates/entity/entity.spec.ts.tpl +1 -1
- package/templates/entity/entity.ts.tpl +5 -0
- package/templates/error/case.spec.ts.tpl +8 -0
- package/templates/error/concept-error.spec.ts.tpl +7 -0
- package/templates/error/concept-error.ts.tpl +5 -0
- package/templates/error/factory.ts.tpl +4 -0
- package/templates/event-handler/event-handler.declared.ts.tpl +3 -3
- package/templates/event-handler/event-handler.spec.ts.tpl +2 -2
- package/templates/event-handler/event-handler.ts.tpl +1 -1
- package/templates/event-handler/wiring.manual.tpl +2 -2
- package/templates/event-handler/wiring.tsyringe.tpl +2 -2
- package/templates/gateway/adapter.declared.ts.tpl +3 -3
- package/templates/gateway/adapter.ts.tpl +2 -2
- package/templates/gateway/contract.spec.ts.tpl +3 -3
- package/templates/gateway/fake.ts.tpl +1 -1
- package/templates/gateway/platform-test.declared.tpl +1 -1
- package/templates/gateway/platform.declared.tpl +1 -1
- package/templates/gateway/wiring.tsyringe.tpl +3 -3
- package/templates/init/CLAUDE.md.tpl +5 -2
- package/templates/init/README.md.tpl +15 -10
- package/templates/init/e2e/create-credentials.jwt.ts.tpl +1 -1
- package/templates/init/e2e/create-credentials.keycloak.ts.tpl +1 -1
- package/templates/init/e2e/create-credentials.none.ts.tpl +2 -2
- package/templates/init/e2e/start-application.database.ts.tpl +16 -16
- package/templates/init/e2e/start-application.memory.ts.tpl +16 -16
- package/templates/init/e2e/test-environment.ts.tpl +1 -1
- package/templates/init/jest.config.js.tpl +7 -0
- package/templates/init/main.ts.tpl +11 -11
- package/templates/init/platform/audit/audit.module.manual.ts.tpl +5 -5
- package/templates/init/platform/audit/audit.module.tsyringe.ts.tpl +4 -4
- package/templates/init/platform/audit/create-audit.ts.tpl +5 -5
- package/templates/init/platform/audit/search-audit-entries.handler.ts.tpl +1 -1
- package/templates/init/platform/audit/search-audit-entries.route.ts.tpl +1 -1
- package/templates/init/platform/auth/authorization.tsyringe.ts.tpl +2 -2
- package/templates/init/platform/auth/create-authenticator.jwt.ts.tpl +1 -1
- package/templates/init/platform/auth/create-authenticator.keycloak.ts.tpl +1 -1
- package/templates/init/platform/auth/create-authenticator.none.ts.tpl +2 -2
- package/templates/init/platform/auth/create-authorizer.abac.ts.tpl +1 -1
- package/templates/init/platform/auth/create-authorizer.custom.ts.tpl +2 -2
- package/templates/init/platform/auth/create-authorizer.rbac.ts.tpl +1 -1
- package/templates/init/platform/auth/create-authorizer.rebac.ts.tpl +3 -3
- package/templates/init/platform/auth/create-tuple-store.contract.spec.ts.tpl +1 -1
- package/templates/init/platform/auth/custom-authorizer.contract.spec.ts.tpl +1 -1
- package/templates/init/platform/auth/http-boundary.ts.tpl +1 -1
- package/templates/init/platform/auth/permission-mapping.ts.tpl +1 -1
- package/templates/init/platform/auth/permissions.ts.tpl +1 -1
- package/templates/init/platform/auth/principal-of.none.ts.tpl +1 -1
- package/templates/init/platform/auth/relate-system-actors.ts.tpl +1 -1
- package/templates/init/platform/auth/relation-tuples.ts.tpl +2 -2
- package/templates/init/platform/auth/security-schemes.none.ts.tpl +1 -1
- package/templates/init/platform/buses/create-command-bus.ts.tpl +2 -2
- package/templates/init/platform/buses/create-query-bus.ts.tpl +1 -1
- package/templates/init/platform/compose-application.manual.ts.tpl +6 -6
- package/templates/init/platform/compose-application.tsyringe.ts.tpl +10 -10
- package/templates/init/platform/config/app-config.ts.tpl +2 -2
- package/templates/init/platform/config/load-config.ts.tpl +3 -3
- package/templates/init/platform/create-platform.manual.ts.tpl +16 -16
- package/templates/init/platform/database/create-client.prisma.ts.tpl +1 -1
- package/templates/init/platform/database/create-data-source.typeorm.ts.tpl +1 -1
- package/templates/init/platform/database/data-source.typeorm.ts.tpl +1 -1
- package/templates/init/platform/database/database.drizzle.ts.tpl +1 -1
- package/templates/init/platform/database/database.prisma.ts.tpl +2 -2
- package/templates/init/platform/database/inert-persistence.memory.ts.tpl +2 -2
- package/templates/init/platform/database/inert-persistence.pooled.ts.tpl +2 -2
- package/templates/init/platform/database/inert-persistence.prisma.ts.tpl +3 -3
- package/templates/init/platform/database/inert-persistence.typeorm.ts.tpl +3 -3
- package/templates/init/platform/database/open-persistence.contract.spec.ts.tpl +1 -1
- package/templates/init/platform/database/open-persistence.memory.ts.tpl +1 -1
- package/templates/init/platform/database/open-persistence.pooled.ts.tpl +3 -3
- package/templates/init/platform/database/open-persistence.prisma.ts.tpl +3 -3
- package/templates/init/platform/database/open-persistence.typeorm.ts.tpl +3 -3
- package/templates/init/platform/database/open-test-database.drizzle.ts.tpl +4 -4
- package/templates/init/platform/database/open-test-database.knex.ts.tpl +5 -5
- package/templates/init/platform/database/open-test-database.prisma.ts.tpl +4 -4
- package/templates/init/platform/database/open-test-database.typeorm.ts.tpl +3 -3
- package/templates/init/platform/database/persistence-over.drizzle.ts.tpl +2 -2
- package/templates/init/platform/database/persistence-over.knex.ts.tpl +2 -2
- package/templates/init/platform/database/persistence-over.prisma.ts.tpl +2 -2
- package/templates/init/platform/database/persistence-over.typeorm.ts.tpl +2 -2
- package/templates/init/platform/database/persistence.orm.ts.tpl +1 -1
- package/templates/init/platform/errors.ts.tpl +1 -1
- package/templates/init/platform/events/create-event-provider.custom.ts.tpl +2 -2
- package/templates/init/platform/events/create-event-provider.kafka.ts.tpl +3 -3
- package/templates/init/platform/events/create-event-provider.nats.ts.tpl +2 -2
- package/templates/init/platform/events/create-event-provider.rabbitmq.ts.tpl +2 -2
- package/templates/init/platform/events/create-event-provider.redis.ts.tpl +2 -2
- package/templates/init/platform/events/custom-event-bus.contract.spec.ts.tpl +1 -1
- package/templates/init/platform/events/in-process-events.ts.tpl +1 -1
- package/templates/init/platform/events/start-outbox-relay.ts.tpl +1 -1
- package/templates/init/platform/http/create-app-module.ts.tpl +1 -1
- package/templates/init/platform/http/start-http-server.express.ts.tpl +4 -4
- package/templates/init/platform/http/start-http-server.fastify.ts.tpl +4 -4
- package/templates/init/platform/http/start-http-server.nest.ts.tpl +5 -5
- package/templates/init/platform/http/with-documentation.ts.tpl +2 -2
- package/templates/init/platform/lay-foundations.tsyringe.ts.tpl +5 -5
- package/templates/init/platform/platform-test.module.tsyringe.ts.tpl +1 -1
- package/templates/init/platform/platform.manual.ts.tpl +3 -3
- package/templates/init/platform/platform.module.tsyringe.ts.tpl +8 -8
- package/templates/init/platform/resilience/adapter-aspects.ts.tpl +2 -2
- package/templates/init/platform/resilience/default-resilience.ts.tpl +1 -1
- package/templates/init/platform/resilience/own-policy.ts.tpl +1 -1
- package/templates/init/platform/tracing.ts.tpl +2 -2
- package/templates/init/rules/application.md.tpl +8 -2
- package/templates/init/rules/domain.md.tpl +11 -0
- package/templates/init/rules/infrastructure.md.tpl +3 -3
- package/templates/init/rules/presentation.md.tpl +5 -0
- package/templates/init/scripts/openapi.ts.tpl +5 -5
- package/templates/integration-event/audited.tpl +1 -1
- package/templates/integration-event/integration-event.class-validator.ts.tpl +1 -1
- package/templates/integration-event/integration-event.custom.ts.tpl +1 -1
- package/templates/integration-event/publisher.declared.ts.tpl +4 -4
- package/templates/integration-event/publisher.spec.ts.tpl +2 -2
- package/templates/integration-event/publisher.ts.tpl +2 -2
- package/templates/integration-event/wiring.manual.tpl +2 -2
- package/templates/integration-event/wiring.tsyringe.tpl +2 -2
- package/templates/integration-handler/integration-handler.declared.ts.tpl +3 -3
- package/templates/integration-handler/integration-handler.spec.ts.tpl +2 -2
- package/templates/integration-handler/integration-handler.ts.tpl +1 -1
- package/templates/integration-handler/wiring.manual.tpl +3 -3
- package/templates/integration-handler/wiring.tsyringe.tpl +2 -2
- package/templates/job/job.declared.ts.tpl +3 -3
- package/templates/job/job.spec.buses.ts.tpl +2 -2
- package/templates/job/job.spec.tsyringe.ts.tpl +2 -2
- package/templates/job/job.ts.tpl +1 -1
- package/templates/job/wiring.manual.tpl +1 -1
- package/templates/job/wiring.tsyringe.tpl +1 -1
- package/templates/pipeline/package-scripts.json +1 -1
- package/templates/policy/policy.declared.ts.tpl +1 -1
- package/templates/policy/policy.spec.declared.ts.tpl +1 -1
- package/templates/policy/policy.spec.ts.tpl +1 -1
- package/templates/policy/policy.ts.tpl +1 -1
- package/templates/policy/registration.tpl +1 -1
- package/templates/port/fake.ts.tpl +1 -1
- package/templates/projection/projection.spec.ts.tpl +17 -0
- package/templates/projection/projection.ts.tpl +11 -0
- package/templates/query/handler.declared.ts.tpl +4 -4
- package/templates/query/handler.spec.buses.ts.tpl +5 -5
- package/templates/query/handler.spec.tsyringe.ts.tpl +6 -6
- package/templates/query/handler.ts.tpl +3 -3
- package/templates/query/query.ts.tpl +1 -1
- package/templates/query/reader.fake.ts.tpl +2 -2
- package/templates/query/reader.in-memory.ts.tpl +4 -4
- package/templates/query/reader.port.ts.tpl +2 -2
- package/templates/query/search.handler.declared.ts.tpl +6 -6
- package/templates/query/search.handler.spec.buses.ts.tpl +5 -5
- package/templates/query/search.handler.spec.tsyringe.ts.tpl +6 -6
- package/templates/query/search.handler.ts.tpl +4 -4
- package/templates/query/search.query.ts.tpl +1 -1
- package/templates/query/search.reader.fake.ts.tpl +2 -2
- package/templates/query/search.reader.in-memory.ts.tpl +3 -3
- package/templates/query/search.reader.port.ts.tpl +1 -1
- package/templates/query/search.reader.spec.ts.tpl +2 -2
- package/templates/query/search.wiring.manual.tpl +3 -3
- package/templates/query/search.wiring.tsyringe.tpl +4 -4
- package/templates/query/wiring.manual.tpl +3 -3
- package/templates/query/wiring.tsyringe.tpl +4 -4
- package/templates/repository/contract.spec.ts.tpl +5 -5
- package/templates/repository/drizzle/mapper.ts.tpl +2 -2
- package/templates/repository/drizzle/repository.ts.tpl +9 -17
- package/templates/repository/drizzle/schema-export.tpl +1 -1
- package/templates/repository/fake.ts.tpl +2 -2
- package/templates/repository/knex/mapper.ts.tpl +2 -2
- package/templates/repository/knex/repository.ts.tpl +10 -30
- package/templates/repository/knex/schema-export.tpl +1 -1
- package/templates/repository/knex/tables.ts.tpl +1 -1
- package/templates/repository/none/repository.ts.tpl +3 -3
- package/templates/repository/prisma/mapper.ts.tpl +2 -2
- package/templates/repository/prisma/repository.ts.tpl +6 -9
- package/templates/repository/repository.ts.tpl +1 -1
- package/templates/repository/typeorm/mapper.ts.tpl +2 -2
- package/templates/repository/typeorm/repository.ts.tpl +9 -12
- package/templates/repository/typeorm/schema-export.tpl +1 -1
- package/templates/repository/typeorm/table.tpl +1 -1
- package/templates/repository/wiring.manual.tpl +1 -1
- package/templates/repository/wiring.tsyringe.tpl +2 -2
- package/templates/route/route.class-validator.ts.tpl +1 -1
- package/templates/route/route.none.ts.tpl +1 -1
- package/templates/route/route.search.ts.tpl +2 -2
- package/templates/route/route.spec.ts.tpl +1 -1
- package/templates/route/route.standard-schema.ts.tpl +1 -1
- package/templates/route/route.zod.ts.tpl +1 -1
- package/templates/route/routes.on-tsyringe.tpl +1 -1
- package/templates/route/wiring.manual.tpl +1 -1
- package/templates/service/main.ts.tpl +11 -11
- package/templates/value-object/value-object.spec.ts.tpl +1 -1
- package/templates/value-object/value-object.ts.tpl +5 -0
- package/templates/worker/main.ts.tpl +9 -9
- package/dist/alias/platform-alias.d.ts +0 -4
- package/dist/alias/platform-alias.d.ts.map +0 -1
- package/dist/alias/platform-alias.js +0 -7
- package/dist/alias/platform-alias.js.map +0 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** A handler whose constructor states its dependencies, and what the generated files of its context then hold. */
|
|
2
|
+
export declare const SIGNATURE: {
|
|
3
|
+
readonly handler: string;
|
|
4
|
+
readonly handlerOf: typeof handler;
|
|
5
|
+
readonly ports: string[];
|
|
6
|
+
readonly taken: string[];
|
|
7
|
+
readonly barrel: string;
|
|
8
|
+
readonly dependencies: string;
|
|
9
|
+
};
|
|
10
|
+
/** The issue-invoice handler, declared with `decorator`, importing `imports` and taking `parameters`. */
|
|
11
|
+
declare function handler(decorator: string, imports: readonly string[], parameters: readonly string[]): string;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=signature.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/signature.ts"],"names":[],"mappings":"AAcA,kHAAkH;AAClH,eAAO,MAAM,SAAS;aACpB,OAAO;aACP,SAAS;aACT,KAAK;aACL,KAAK;aACL,MAAM;aAWN,YAAY;CAQJ,CAAC;AAEX,yGAAyG;AACzG,iBAAS,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,UAAU,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAarG"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { source } from './source.js';
|
|
2
|
+
const DECLARATIONS = "'@ddd-ts-kit/kernel/declarations'";
|
|
3
|
+
const COMMAND = "'@/contexts/billing/application/commands/issue-invoice/issue-invoice.command.js'";
|
|
4
|
+
const HANDLER = "'@/contexts/billing/application/commands/issue-invoice/issue-invoice.handler.js'";
|
|
5
|
+
const REPOSITORY = "'@/contexts/billing/domain/repositories/invoice.repository.js'";
|
|
6
|
+
const PORTS = [
|
|
7
|
+
"import type { Clock } from '@ddd-ts-kit/kernel';",
|
|
8
|
+
`import type { InvoiceRepository } from ${REPOSITORY};`,
|
|
9
|
+
];
|
|
10
|
+
const TAKEN = ['private readonly invoiceRepository: InvoiceRepository', 'private readonly clock: Clock'];
|
|
11
|
+
/** A handler whose constructor states its dependencies, and what the generated files of its context then hold. */
|
|
12
|
+
export const SIGNATURE = {
|
|
13
|
+
handler: handler('@CommandHandler(IssueInvoiceCommand)', PORTS, TAKEN),
|
|
14
|
+
handlerOf: handler,
|
|
15
|
+
ports: PORTS,
|
|
16
|
+
taken: TAKEN,
|
|
17
|
+
barrel: source(`import { injected } from ${DECLARATIONS};`, `import { IssueInvoiceHandler } from ${HANDLER};`, `import { InvoiceRepository } from ${REPOSITORY};`, "import { Clock } from '@ddd-ts-kit/kernel';", '', `export * from ${COMMAND};`, `export * from ${HANDLER};`, '', 'injected(IssueInvoiceHandler, [InvoiceRepository, Clock]);'),
|
|
18
|
+
dependencies: source(`import { injected } from ${DECLARATIONS};`, `import { IssueInvoiceHandler } from ${HANDLER};`, `import { InvoiceRepository } from ${REPOSITORY};`, "import { Clock } from '@ddd-ts-kit/kernel';", '', 'injected(IssueInvoiceHandler, [InvoiceRepository, Clock]);'),
|
|
19
|
+
};
|
|
20
|
+
/** The issue-invoice handler, declared with `decorator`, importing `imports` and taking `parameters`. */
|
|
21
|
+
function handler(decorator, imports, parameters) {
|
|
22
|
+
return source(...imports, `import { CommandHandler } from ${DECLARATIONS};`, `import { IssueInvoiceCommand } from ${COMMAND};`, '', decorator, 'export class IssueInvoiceHandler implements CommandHandler<IssueInvoiceCommand> {', ' constructor(', ...parameters.map((parameter) => ` ${parameter},`), ' ) {}', '}');
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=signature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signature.js","sourceRoot":"","sources":["../../../src/check/fixtures/signature.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,YAAY,GAAG,mCAAmC,CAAC;AACzD,MAAM,OAAO,GAAG,kFAAkF,CAAC;AACn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.js';
|
|
3
|
+
/** The TypeScript sources of the tests and of the scripts, which live next to the source root. */
|
|
4
|
+
export declare function besideTheSources(project: Pick<Project, 'root' | 'config'>): SourceFile[];
|
|
5
|
+
//# sourceMappingURL=beside-the-sources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"beside-the-sources.d.ts","sourceRoot":"","sources":["../../../src/check/project/beside-the-sources.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAQ1D,kGAAkG;AAClG,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,CAAC,GAAG,UAAU,EAAE,CAYxF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { FIXED_ALIAS_ROOTS } from '../../alias/index.js';
|
|
4
|
+
import { isSource } from './is-source.js';
|
|
5
|
+
import { loadSourceFile } from './load-source-file.js';
|
|
6
|
+
import { walkDirectory } from './walk-directory.js';
|
|
7
|
+
/** The trees `check` does not walk for the other rules: their files are read for their imports only. */
|
|
8
|
+
const BESIDE_THE_SOURCES = [FIXED_ALIAS_ROOTS.test.directory, FIXED_ALIAS_ROOTS.scripts.directory];
|
|
9
|
+
/** The TypeScript sources of the tests and of the scripts, which live next to the source root. */
|
|
10
|
+
export function besideTheSources(project) {
|
|
11
|
+
const files = [];
|
|
12
|
+
for (const directory of BESIDE_THE_SOURCES) {
|
|
13
|
+
walkDirectory(project.root, directory, (file, isDirectory) => {
|
|
14
|
+
if (!isDirectory && isSource(file)) {
|
|
15
|
+
files.push(loadSourceFile(project.config, file, fs.readFileSync(path.join(project.root, file), 'utf8')));
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return files;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=beside-the-sources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"beside-the-sources.js","sourceRoot":"","sources":["../../../src/check/project/beside-the-sources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,wGAAwG;AACxG,MAAM,kBAAkB,GAAG,CAAC,iBAAiB,CAAC,IAAI,CAAC,SAAS,EAAE,iBAAiB,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAEnG,kGAAkG;AAClG,MAAM,UAAU,gBAAgB,CAAC,OAAyC;IACxE,MAAM,KAAK,GAAiB,EAAE,CAAC;IAE/B,KAAK,MAAM,SAAS,IAAI,kBAAkB,EAAE,CAAC;QAC3C,aAAa,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE;YAC3D,IAAI,CAAC,WAAW,IAAI,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;gBACnC,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;YAC3G,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-import.d.ts","sourceRoot":"","sources":["../../../src/check/project/resolve-import.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"resolve-import.d.ts","sourceRoot":"","sources":["../../../src/check/project/resolve-import.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAQ9D,iGAAiG;AACjG,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,YAAY,CAoB/F"}
|
|
@@ -3,6 +3,8 @@ import path from 'node:path';
|
|
|
3
3
|
import { aliasRoots } from '../../alias/index.js';
|
|
4
4
|
import { locate } from './locate.js';
|
|
5
5
|
const SOURCE = /\.(?:ts|mts|cts)$/;
|
|
6
|
+
/** A file that is not a module of the project, named with its own extension. */
|
|
7
|
+
const ASSET = /\.(?:json|node|wasm|[jt]sx)$/;
|
|
6
8
|
const BUILTINS = new Set(builtinModules);
|
|
7
9
|
/** Classifies by path alone: the imported file does not have to exist for a rule to judge it. */
|
|
8
10
|
export function resolveImport(config, fromFile, specifier) {
|
|
@@ -23,7 +25,8 @@ export function resolveImport(config, fromFile, specifier) {
|
|
|
23
25
|
}
|
|
24
26
|
function asFile(config, target) {
|
|
25
27
|
const clean = path.posix.normalize(target).replace(/\.(?:js|mjs|cjs)$/, '.ts');
|
|
26
|
-
|
|
28
|
+
// Written without its extension, a module is named by what remains, dots included: `invoice.aggregate` is `invoice.aggregate.ts`.
|
|
29
|
+
const withExtension = SOURCE.test(clean) || ASSET.test(clean) ? clean : `${clean}.ts`;
|
|
27
30
|
return { kind: 'file', path: withExtension, location: locate(config, withExtension) };
|
|
28
31
|
}
|
|
29
32
|
function packageName(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EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,EAAE,CAAC;AACxF,CAAC;AAED,SAAS,WAAW,CAAC,SAAiB;IACpC,MAAM,CAAC,KAAK,GAAG,EAAE,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAElD,OAAO,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;AACtF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clean-one-export-per-file.d.ts","sourceRoot":"","sources":["../../../src/check/rules/clean-one-export-per-file.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAgB7C,eAAO,MAAM,qBAAqB,EAAE,
|
|
1
|
+
{"version":3,"file":"clean-one-export-per-file.d.ts","sourceRoot":"","sources":["../../../src/check/rules/clean-one-export-per-file.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAgB7C,eAAO,MAAM,qBAAqB,EAAE,IAkBnC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
|
-
import { barrelFile } from '../../declared/index.js';
|
|
2
|
+
import { barrelFile, dependenciesFile } from '../../declared/index.js';
|
|
3
3
|
import { judgeExports } from '../exports/judge-exports.js';
|
|
4
4
|
import { kebabCaseOf } from '../exports/kebab-case-of.js';
|
|
5
5
|
import { matchesGlob } from '../exports/matches-glob.js';
|
|
@@ -19,6 +19,9 @@ export const cleanOneExportPerFile = {
|
|
|
19
19
|
if (!isJudged(file, project)) {
|
|
20
20
|
return [];
|
|
21
21
|
}
|
|
22
|
+
if (isGenerated(file)) {
|
|
23
|
+
return [];
|
|
24
|
+
}
|
|
22
25
|
return isEntry(file) ? declaredInEntry(file) : judged(file, project);
|
|
23
26
|
});
|
|
24
27
|
},
|
|
@@ -32,15 +35,18 @@ function isJudged(file, project) {
|
|
|
32
35
|
}
|
|
33
36
|
return file.path.startsWith(`${root}/`) || segments.slice(0, -1).includes(path.posix.basename(root));
|
|
34
37
|
}
|
|
35
|
-
/**
|
|
36
|
-
function
|
|
38
|
+
/** The generated files of a declared context: `declarations/barrel-current` holds every line of them. */
|
|
39
|
+
function isGenerated(file) {
|
|
37
40
|
const name = path.posix.basename(file.path);
|
|
38
41
|
const { location } = file;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
if (location.area !== 'context' || location.layer !== 'root' || location.inside.length > 0) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
return name === barrelFile(location.context) || name === dependenciesFile(location.context);
|
|
46
|
+
}
|
|
47
|
+
/** `index.ts` at any depth. */
|
|
48
|
+
function isEntry(file) {
|
|
49
|
+
return /^index\.[cm]?ts$/.test(path.posix.basename(file.path));
|
|
44
50
|
}
|
|
45
51
|
/** Everything of an entry file that is not a re-export, an import without binding or the empty `export {};`. */
|
|
46
52
|
function declaredInEntry(file) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clean-one-export-per-file.js","sourceRoot":"","sources":["../../../src/check/rules/clean-one-export-per-file.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"clean-one-export-per-file.js","sourceRoot":"","sources":["../../../src/check/rules/clean-one-export-per-file.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEv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AI,EAAE,KAAK,CAAC,IAAI;YAChB,OAAO,EAAE,IAAI,IAAI,yCAAyC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;YACtG,GAAG,EAAE,mBAAmB,QAAQ,QAAQ,QAAQ,uKAAuK;SACxN;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-valid.d.ts","sourceRoot":"","sources":["../../../src/check/rules/config-valid.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAG7C,eAAO,MAAM,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"config-valid.d.ts","sourceRoot":"","sources":["../../../src/check/rules/config-valid.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAG7C,eAAO,MAAM,WAAW,EAAE,IAsBzB,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { ConfigInspection } from '../configuration/config-inspection.js';
|
|
|
3
3
|
import { reporter } from '../support/reporter.js';
|
|
4
4
|
export const configValid = {
|
|
5
5
|
id: 'config/valid',
|
|
6
|
-
description: 'ddd-ts-kit.config.json is consistent: known contexts, classifications, relationships, rule ids and
|
|
6
|
+
description: 'ddd-ts-kit.config.json is consistent: known contexts, classifications, relationships, rule ids, guard mode and import extension, the same contexts as on disk, a function limit within the ceiling, complete onePerFile.allow entries, positive commit limits and coverage thresholds that are percentages.',
|
|
7
7
|
scope: 'project',
|
|
8
8
|
run(project) {
|
|
9
9
|
const inspection = new ConfigInspection(project, reporter(project, this.id));
|
|
@@ -12,6 +12,7 @@ export const configValid = {
|
|
|
12
12
|
...inspection.undeclaredDirectories(),
|
|
13
13
|
...inspection.ruleSettings(KNOWN_RULE_IDS),
|
|
14
14
|
...inspection.guardMode(),
|
|
15
|
+
...inspection.importExtension(),
|
|
15
16
|
...inspection.functionLinesLimit(),
|
|
16
17
|
...inspection.onePerFileAllowances(),
|
|
17
18
|
...inspection.commitLimits(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-valid.js","sourceRoot":"","sources":["../../../src/check/rules/config-valid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAEzE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,MAAM,CAAC,MAAM,WAAW,GAAS;IAC/B,EAAE,EAAE,cAAc;IAClB,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"config-valid.js","sourceRoot":"","sources":["../../../src/check/rules/config-valid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAEzE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,MAAM,CAAC,MAAM,WAAW,GAAS;IAC/B,EAAE,EAAE,cAAc;IAClB,WAAW,EACT,6SAA6S;IAC/S,KAAK,EAAE,SAAS;IAChB,GAAG,CAAC,OAAO;QACT,MAAM,UAAU,GAAG,IAAI,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;QAE7E,OAAO;YACL,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE,CACrE,UAAU,CAAC,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC,CAC1C;YACD,GAAG,UAAU,CAAC,qBAAqB,EAAE;YACrC,GAAG,UAAU,CAAC,YAAY,CAAC,cAAc,CAAC;YAC1C,GAAG,UAAU,CAAC,SAAS,EAAE;YACzB,GAAG,UAAU,CAAC,eAAe,EAAE;YAC/B,GAAG,UAAU,CAAC,kBAAkB,EAAE;YAClC,GAAG,UAAU,CAAC,oBAAoB,EAAE;YACpC,GAAG,UAAU,CAAC,YAAY,EAAE;YAC5B,GAAG,UAAU,CAAC,kBAAkB,EAAE;SACnC,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declarations-barrel-current.d.ts","sourceRoot":"","sources":["../../../src/check/rules/declarations-barrel-current.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"declarations-barrel-current.d.ts","sourceRoot":"","sources":["../../../src/check/rules/declarations-barrel-current.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAa7C,eAAO,MAAM,yBAAyB,EAAE,IAiBvC,CAAC"}
|
|
@@ -1,44 +1,59 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { barrelFile, renderBarrel } from '../../declared/index.js';
|
|
1
|
+
import { specifierOf } from '../../alias/index.js';
|
|
2
|
+
import { barrelFile, contextInjections, dependenciesFile, generatedDrift, renderBarrel, renderDependenciesFile, renderInjections, } from '../../declared/index.js';
|
|
3
|
+
import { sourceAt } from '../project/source-at.js';
|
|
3
4
|
import { isDeclaredStyle } from '../support/is-declared-style.js';
|
|
4
5
|
import { reporter } from '../support/reporter.js';
|
|
5
|
-
const REGENERATE = 'Run `ddd-ts-kit
|
|
6
|
-
const EXPORT = /^export \* from '(.+)';$/;
|
|
6
|
+
const REGENERATE = 'Run `ddd-ts-kit docs`, or `ddd-ts-kit generate` again, which rewrite it: the file is derived from the role files of the context and from their constructor signatures, and never edited by hand.';
|
|
7
7
|
export const declarationsBarrelCurrent = {
|
|
8
8
|
id: 'declarations/barrel-current',
|
|
9
|
-
description: 'In the declared style
|
|
9
|
+
description: 'In the declared style, the generated file of a context is what its tree says: <context>.declarations.ts lists exactly its role files and registers the dependency list read from each constructor; under discovery <context>.dependencies.ts registers the lists alone.',
|
|
10
10
|
scope: 'project',
|
|
11
11
|
run(project) {
|
|
12
12
|
if (!isDeclaredStyle(project)) {
|
|
13
13
|
return [];
|
|
14
14
|
}
|
|
15
15
|
const report = reporter(project, this.id);
|
|
16
|
-
const { contextsDir, contexts } = project.config;
|
|
17
16
|
return project.contextsOnDisk
|
|
18
|
-
.filter((context) => contexts[context] !== undefined)
|
|
19
|
-
.flatMap((context) =>
|
|
20
|
-
|
|
21
|
-
const flaw = judge(project, context, file);
|
|
22
|
-
return flaw === undefined ? [] : [report({ file, line: 1 }, flaw.message, flaw.fix)];
|
|
23
|
-
});
|
|
17
|
+
.filter((context) => project.config.contexts[context] !== undefined)
|
|
18
|
+
.flatMap((context) => judge(project, context))
|
|
19
|
+
.flatMap(({ file, flaw }) => (flaw === undefined ? [] : [report({ file, line: 1 }, flaw.message, flaw.fix)]));
|
|
24
20
|
},
|
|
25
21
|
};
|
|
26
|
-
function judge(project, context
|
|
27
|
-
const
|
|
22
|
+
function judge(project, context) {
|
|
23
|
+
const directory = `${project.config.contextsDir}/${context}`;
|
|
24
|
+
const barrel = `${directory}/${barrelFile(context)}`;
|
|
25
|
+
const entries = entriesOf(project, context);
|
|
26
|
+
const injections = contextInjections((file) => sourceAt(project, file), directory, entries);
|
|
27
|
+
const injected = renderInjections(injections, (file) => specifierOf(project.config, file));
|
|
28
28
|
if (project.config.stack.assembly === 'discovery') {
|
|
29
|
-
|
|
29
|
+
const lists = { name: 'dependency lists', expected: renderDependenciesFile(injected), optional: true };
|
|
30
|
+
return [
|
|
31
|
+
{ file: barrel, flaw: writtenIn(project, barrel) === undefined ? undefined : leftBehind(context) },
|
|
32
|
+
{ file: `${directory}/${dependenciesFile(context)}`, flaw: stale(project, context, lists) },
|
|
33
|
+
];
|
|
30
34
|
}
|
|
31
|
-
const expected = renderBarrel(
|
|
32
|
-
|
|
35
|
+
const expected = renderBarrel(entries, (entry) => specifierOf(project.config, `${directory}/${entry}`), injected);
|
|
36
|
+
return [{ file: barrel, flaw: stale(project, context, { name: 'barrel', expected, optional: false }) }];
|
|
37
|
+
}
|
|
38
|
+
function stale(project, context, { name, expected, optional }) {
|
|
39
|
+
const file = name === 'barrel' ? barrelFile(context) : dependenciesFile(context);
|
|
40
|
+
const written = writtenIn(project, `${project.config.contextsDir}/${context}/${file}`);
|
|
41
|
+
if (written === expected || (written === undefined && optional && expected === 'export {};\n')) {
|
|
33
42
|
return undefined;
|
|
34
43
|
}
|
|
35
44
|
if (written === undefined) {
|
|
36
45
|
return {
|
|
37
|
-
message: `The
|
|
46
|
+
message: `The ${name} of "${context}" ${name === 'barrel' ? 'is' : 'are'} missing: the composition root has nothing to ${name === 'barrel' ? 'assemble the context from' : 'inject its constructors from'}.`,
|
|
38
47
|
fix: REGENERATE,
|
|
39
48
|
};
|
|
40
49
|
}
|
|
41
|
-
return {
|
|
50
|
+
return {
|
|
51
|
+
message: `The ${name} of "${context}" ${name === 'barrel' ? 'is' : 'are'} stale: ${generatedDrift(written, expected)}.`,
|
|
52
|
+
fix: REGENERATE,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function writtenIn(project, file) {
|
|
56
|
+
return project.files.find((candidate) => candidate.path === file)?.text.replaceAll('\r\n', '\n');
|
|
42
57
|
}
|
|
43
58
|
function leftBehind(context) {
|
|
44
59
|
return {
|
|
@@ -53,17 +68,4 @@ function entriesOf(project, context) {
|
|
|
53
68
|
.filter((entry) => entry.startsWith(prefix) && !entry.endsWith('/'))
|
|
54
69
|
.map((entry) => entry.slice(prefix.length));
|
|
55
70
|
}
|
|
56
|
-
/** The first thing that tells the written barrel from the expected one, in words. */
|
|
57
|
-
function difference(written, expected) {
|
|
58
|
-
const exportsOf = (barrel) => barrel.split('\n').flatMap((line) => EXPORT.exec(line)?.[1] ?? []);
|
|
59
|
-
const missing = exportsOf(expected).find((specifier) => !exportsOf(written).includes(specifier));
|
|
60
|
-
if (missing !== undefined) {
|
|
61
|
-
return `it does not export ${missing}, so the class declared there is registered nowhere`;
|
|
62
|
-
}
|
|
63
|
-
const extra = exportsOf(written).find((specifier) => !exportsOf(expected).includes(specifier));
|
|
64
|
-
if (extra !== undefined) {
|
|
65
|
-
return `it exports ${extra}, which is not a role file of the context`;
|
|
66
|
-
}
|
|
67
|
-
return 'it holds something else than one `export * from` per role file, sorted by path';
|
|
68
|
-
}
|
|
69
71
|
//# sourceMappingURL=declarations-barrel-current.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declarations-barrel-current.js","sourceRoot":"","sources":["../../../src/check/rules/declarations-barrel-current.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"declarations-barrel-current.js","sourceRoot":"","sources":["../../../src/check/rules/declarations-barrel-current.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,MAAM,UAAU,GACd,kMAAkM,CAAC;AAOrM,MAAM,CAAC,MAAM,yBAAyB,GAAS;IAC7C,EAAE,EAAE,6BAA6B;IACjC,WAAW,EACT,yQAAyQ;IAC3Q,KAAK,EAAE,SAAS;IAChB,GAAG,CAAC,OAAO;QACT,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC;YAC9B,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,E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AK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;SACnE,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declarations-constructor-injection.d.ts","sourceRoot":"","sources":["../../../src/check/rules/declarations-constructor-injection.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAO7C,eAAO,MAAM,gCAAgC,EAAE,IAwB9C,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { declaredRoleOf } from '../../declared/declared-role-of.js';
|
|
2
|
+
import { readInjections } from '../../declared/injection/read-injections.js';
|
|
3
|
+
import { sourceAt } from '../project/source-at.js';
|
|
4
|
+
import { inContext } from '../support/in-context.js';
|
|
5
|
+
import { isDeclaredStyle } from '../support/is-declared-style.js';
|
|
6
|
+
import { pathInContext } from '../support/path-in-context.js';
|
|
7
|
+
import { perFile } from '../support/per-file.js';
|
|
8
|
+
export const declarationsConstructorInjection = {
|
|
9
|
+
id: 'declarations/constructor-injection',
|
|
10
|
+
description: 'In the declared style, a class whose decorator lists no dependency states them in its constructor: each parameter is typed by one class, with no `?`, default value, rest or destructuring, and an inherited constructor is one the project can read. Under "stack.dependencies": "signature" a decorator carries no list.',
|
|
11
|
+
scope: 'file',
|
|
12
|
+
run(project) {
|
|
13
|
+
if (!isDeclaredStyle(project)) {
|
|
14
|
+
return [];
|
|
15
|
+
}
|
|
16
|
+
return perFile(project, this.id, (file) => {
|
|
17
|
+
if (!inContext(file.location) ||
|
|
18
|
+
file.isTest ||
|
|
19
|
+
declaredRoleOf(pathInContext(project, file) ?? '') === undefined) {
|
|
20
|
+
return [];
|
|
21
|
+
}
|
|
22
|
+
return readInjections((path) => sourceAt(project, path), file).flatMap((injection) => injection.listed === undefined ? unstated(project, injection) : listed(project, injection));
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* What keeps a constructor from stating the dependencies. A project that lists them in its
|
|
28
|
+
* decorators wrote its classes before the signature was read: there, a class that inherits a
|
|
29
|
+
* constructor nothing can read and lists nothing takes nothing, as it always did.
|
|
30
|
+
*/
|
|
31
|
+
function unstated(project, { problems, readable }) {
|
|
32
|
+
return readable || project.config.stack.dependencies === 'signature' ? problems : [];
|
|
33
|
+
}
|
|
34
|
+
/** A list in a decorator: the statement of a 0.1 project, a second statement where the constructor is the one. */
|
|
35
|
+
function listed(project, injection) {
|
|
36
|
+
const { className, line, listed: names = [], dependencies, readable } = injection;
|
|
37
|
+
if (project.config.stack.dependencies !== 'signature' || !readable) {
|
|
38
|
+
return [];
|
|
39
|
+
}
|
|
40
|
+
const typed = dependencies?.map(({ name }) => name);
|
|
41
|
+
if (typed !== undefined && typed.join(',') === names.join(',')) {
|
|
42
|
+
return [
|
|
43
|
+
{
|
|
44
|
+
line,
|
|
45
|
+
message: `The decorator of ${className} lists [${names.join(', ')}], which its constructor already states.`,
|
|
46
|
+
fix: 'Remove the list from the decorator (`eslint --fix` does it) and import the ports that are now only types with `import type`: the constructor signature is the one statement of what a class depends on.',
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
}
|
|
50
|
+
return [
|
|
51
|
+
{
|
|
52
|
+
line,
|
|
53
|
+
message: `The decorator of ${className} lists [${names.join(', ')}] and its constructor says something else: the list wins at run time, so the signature lies.`,
|
|
54
|
+
fix: 'Type each constructor parameter by the class its list entry names (the token is the type), then remove the list from the decorator: the constructor signature is the one statement of what a class depends on.',
|
|
55
|
+
},
|
|
56
|
+
];
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=declarations-constructor-injection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declarations-constructor-injection.js","sourceRoot":"","sources":["../../../src/check/rules/declarations-constructor-injection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEpE,OAAO,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAI7E,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,MAAM,CAAC,MAAM,gCAAgC,GAAS;IACpD,EAAE,EAAE,oCAAoC;IACxC,WAAW,EACT,4TAA4T;IAC9T,KAAK,EAAE,MAAM;IACb,GAAG,CAAC,OAAO;QACT,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC;YAC9B,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,OAAO,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE;YACxC,IACE,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;gBACzB,IAAI,CAAC,MAAM;gBACX,cAAc,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,SAAS,EAChE,CAAC;gBACD,OAAO,EAAE,CAAC;YACZ,CAAC;YAED,OAAO,cAAc,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE,CACnF,SAAS,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,M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1 @@
|
|
|
1
|
+
{"version":3,"file":"errors-code-unique.d.ts","sourceRoot":"","sources":["../../../src/check/rules/errors-code-unique.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAO7C,eAAO,MAAM,gBAAgB,EAAE,IAe9B,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { buildsThroughFactories } from '../errors/builds-through-factories.js';
|
|
2
|
+
import { errorCodes } from '../errors/error-codes.js';
|
|
3
|
+
import { perFile } from '../support/per-file.js';
|
|
4
|
+
const FIX = 'Give each refusal of a context its own code, or call the factory that already sets this one: the HTTP mapping, the OpenAPI document, the audit trail and the tests know a refusal by its code alone.';
|
|
5
|
+
export const errorsCodeUnique = {
|
|
6
|
+
id: 'errors/code-unique',
|
|
7
|
+
description: 'Under "stack.refusals": "factories", a code is given to one refusal of a context: no two factories, and no two error classes, of the domain/errors/ of a context set the same code.',
|
|
8
|
+
scope: 'project',
|
|
9
|
+
run(project) {
|
|
10
|
+
if (!buildsThroughFactories(project)) {
|
|
11
|
+
return [];
|
|
12
|
+
}
|
|
13
|
+
// Remembers, across the error files of a context, where each code was first written.
|
|
14
|
+
const firstUse = new Map();
|
|
15
|
+
return perFile(project, this.id, (file) => codesTaken(file, firstUse));
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
function codesTaken(file, firstUse) {
|
|
19
|
+
const { location } = file;
|
|
20
|
+
if (location.area !== 'context' || location.layer !== 'domain' || location.inside[0] !== 'errors' || file.isTest) {
|
|
21
|
+
return [];
|
|
22
|
+
}
|
|
23
|
+
return errorCodes(file.scan).flatMap(({ code, line }) => {
|
|
24
|
+
const key = `${location.context} ${code}`;
|
|
25
|
+
const first = firstUse.get(key);
|
|
26
|
+
if (first === undefined) {
|
|
27
|
+
firstUse.set(key, `${file.path}:${line}`);
|
|
28
|
+
}
|
|
29
|
+
return first === undefined
|
|
30
|
+
? []
|
|
31
|
+
: [{ line, message: `The code "${code}" is already set in ${first}, in the same context.`, fix: FIX }];
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=errors-code-unique.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors-code-unique.js","sourceRoot":"","sources":["../../../src/check/rules/errors-code-unique.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAItD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,MAAM,GAAG,GACP,sMAAsM,CAAC;AAEzM,MAAM,CAAC,MAAM,gBAAgB,GAAS;IACpC,EAAE,EAAE,oBAAoB;IACxB,WAAW,EACT,qLAAqL;IACvL,KAAK,EAAE,SAAS;IAChB,GAAG,CAAC,OAAO;QACT,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,EAAE,CAAC;YACrC,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,qFAAqF;QACrF,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAkB,CAAC;QAE3C,OAAO,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;IACzE,CAAC;CACF,CAAC;AAEF,SAAS,UAAU,CAAC,IAAgB,EAAE,QAA6B;IACjE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IAE1B,IAAI,QAAQ,CAAC,IAAI,KAAK,SAAS,IAAI,QAAQ,CAAC,KAAK,KAAK,QAAQ,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QACjH,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE;QACtD,MAAM,GAAG,GAAG,GAAG,QAAQ,CAAC,OAAO,IAAI,IAAI,EAAE,CAAC;QAC1C,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAEhC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC;QAC5C,CAAC;QAED,OAAO,KAAK,KAAK,SAAS;YACxB,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,aAAa,IAAI,uBAAuB,KAAK,wBAAwB,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;IAC3G,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors-known-code.d.ts","sourceRoot":"","sources":["../../../src/check/rules/errors-known-code.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAO7C,eAAO,MAAM,eAAe,EAAE,IAc7B,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { buildsThroughFactories } from '../errors/builds-through-factories.js';
|
|
2
|
+
import { errorCodes } from '../errors/error-codes.js';
|
|
3
|
+
import { KIT_ERROR_CODES } from '../errors/kit-error-codes.js';
|
|
4
|
+
import { perFile } from '../support/per-file.js';
|
|
5
|
+
import { matchingBracket } from '../text/matching-bracket.js';
|
|
6
|
+
const ERRORS_LIST = /(?<![\w$.])errors\s*:\s*\[/g;
|
|
7
|
+
export const errorsKnownCode = {
|
|
8
|
+
id: 'errors/known-code',
|
|
9
|
+
description: 'Under "stack.refusals": "factories", every code a route declares in `errors` exists: a factory or an error class of its context sets it, a class outside the contexts does, or it is a code of the kit.',
|
|
10
|
+
scope: 'project',
|
|
11
|
+
run(project) {
|
|
12
|
+
if (!buildsThroughFactories(project)) {
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
const known = knownCodes(project);
|
|
16
|
+
return perFile(project, this.id, (file) => (isRouteFile(file) ? unknownCodes(file, known) : []));
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
/** The codes set outside the contexts (platform, shared kernel) under the key `*`, and those of each context under its name. */
|
|
20
|
+
function knownCodes(project) {
|
|
21
|
+
const known = new Map([['*', new Set(KIT_ERROR_CODES)]]);
|
|
22
|
+
for (const file of project.files.filter((candidate) => !candidate.isTest)) {
|
|
23
|
+
const owner = file.location.area === 'context' ? file.location.context : '*';
|
|
24
|
+
const codes = known.get(owner) ?? new Set();
|
|
25
|
+
for (const { code } of errorCodes(file.scan)) {
|
|
26
|
+
codes.add(code);
|
|
27
|
+
}
|
|
28
|
+
known.set(owner, codes);
|
|
29
|
+
}
|
|
30
|
+
return known;
|
|
31
|
+
}
|
|
32
|
+
function isRouteFile(file) {
|
|
33
|
+
return !file.isTest && file.path.endsWith('.route.ts');
|
|
34
|
+
}
|
|
35
|
+
function unknownCodes(file, known) {
|
|
36
|
+
const { scan, location } = file;
|
|
37
|
+
const context = location.area === 'context' ? location.context : '*';
|
|
38
|
+
const exists = (code) => known.get('*')?.has(code) === true || known.get(context)?.has(code) === true;
|
|
39
|
+
return [...scan.code.matchAll(ERRORS_LIST)].flatMap((match) => {
|
|
40
|
+
const open = match.index + match[0].length - 1;
|
|
41
|
+
const close = matchingBracket(scan.code, open);
|
|
42
|
+
return scan.strings
|
|
43
|
+
.filter((literal) => literal.start > open && literal.end <= close && !exists(literal.value))
|
|
44
|
+
.map((literal) => ({
|
|
45
|
+
line: scan.lineAt(literal.start),
|
|
46
|
+
message: `The route declares the error code "${literal.value}", which no refusal ${context === '*' ? 'of the project' : `of the context "${context}"`} sets.`,
|
|
47
|
+
fix: `Write the code as its factory sets it, or add the refusal: \`ddd-ts-kit generate error ${context === '*' ? '<context>' : context} <Concept> <refusal>\`. A code declared and never raised is a promise the contract makes for nothing.`,
|
|
48
|
+
}));
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=errors-known-code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors-known-code.js","sourceRoot":"","sources":["../../../src/check/rules/errors-known-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAK/D,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,MAAM,WAAW,GAAG,6BAA6B,CAAC;AAElD,MAAM,CAAC,MAAM,eAAe,GAAS;IACnC,EAAE,EAAE,mBAAmB;IACvB,WAAW,EACT,yMAAyM;IAC3M,KAAK,EAAE,SAAS;IAChB,GAAG,CAAC,OAAO;QACT,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,EAAE,CAAC;YACrC,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;QAElC,OAAO,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACnG,CAAC;CACF,CAAC;AAEF,gIAAgI;AAChI,SAAS,UAAU,CAAC,OAAgB;IAClC,MAAM,KAAK,GAAG,IAAI,GAAG,CAAsB,CAAC,CAAC,GAAG,EAAE,IAAI,GAAG,CAAC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C,IAAI,CAAC,KAAK,IAAI,CAAC;IAE/E,OAAO,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QAC5D,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;QAC/C,MAAM,KAAK,GAAG,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAE/C,OAAO,IAAI,CAAC,OAAO;aAChB,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,GAAG,IAAI,IAAI,OAAO,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;aAC3F,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YACjB,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;YAChC,OAAO,EAAE,sCAAsC,OAAO,CAAC,KAAK,uBAAuB,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,mBAAmB,OAAO,GAAG,QAAQ;YAC7J,GAAG,EAAE,0FAA0F,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,uGAAuG;SAC9O,CAAC,CAAC,CAAC;IACR,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imports-alias-declared.d.ts","sourceRoot":"","sources":["../../../src/check/rules/imports-alias-declared.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"imports-alias-declared.d.ts","sourceRoot":"","sources":["../../../src/check/rules/imports-alias-declared.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAG7C,eAAO,MAAM,oBAAoB,EAAE,IAsBlC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { aliasRoots } from '../../alias/index.js';
|
|
2
2
|
import { buildScripts } from '../alias/build-scripts.js';
|
|
3
3
|
import { compilerPaths } from '../alias/compiler-paths.js';
|
|
4
|
+
import { compilerResolution } from '../alias/compiler-resolution.js';
|
|
4
5
|
import { configuredAlias } from '../alias/configured-alias.js';
|
|
5
6
|
import { graphTools } from '../alias/graph-tools.js';
|
|
6
7
|
import { sourceRunners } from '../alias/source-runners.js';
|
|
@@ -8,7 +9,7 @@ import { testRunners } from '../alias/test-runners.js';
|
|
|
8
9
|
import { reporter } from '../support/reporter.js';
|
|
9
10
|
export const importsAliasDeclared = {
|
|
10
11
|
id: 'imports/alias-declared',
|
|
11
|
-
description: 'The import alias has one source, "importAlias", and every tool follows
|
|
12
|
+
description: 'The import alias has one source, "importAlias", and the ending of an import another, "importExtension"; every tool follows them: tsconfig "paths" is exactly what the alias gives, "module" and "moduleResolution" are what the ending needs, vitest and dependency-cruiser read tsconfig, jest repeats the same mapping, no knip "paths" adds another, and the build rewrites the aliases after the compiler.',
|
|
12
13
|
scope: 'project',
|
|
13
14
|
run(project) {
|
|
14
15
|
const inspected = { project, roots: aliasRoots(project.config), report: reporter(project, this.id) };
|
|
@@ -18,6 +19,7 @@ export const importsAliasDeclared = {
|
|
|
18
19
|
}
|
|
19
20
|
return [
|
|
20
21
|
...compilerPaths(inspected),
|
|
22
|
+
...compilerResolution(inspected),
|
|
21
23
|
...buildScripts(inspected),
|
|
22
24
|
...sourceRunners(inspected),
|
|
23
25
|
...testRunners(inspected),
|