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
package/README.md
CHANGED
|
@@ -47,8 +47,10 @@ ddd-ts-kit init [--http express|fastify|nest|none]
|
|
|
47
47
|
[--broker none|rabbitmq|kafka|nats|redis|custom] [--cache none|redis] [--audit on|off]
|
|
48
48
|
[--errors none|sentry] [--logger stdout|pino|winston]
|
|
49
49
|
[--style declared|explicit] [--assembly barrel|discovery]
|
|
50
|
+
[--dependencies signature|listed] [--refusals factories|classes]
|
|
50
51
|
[--package-manager npm|pnpm]
|
|
51
52
|
[--allow-no-outbox "<reason>"] [--import-alias '$<name>/']
|
|
53
|
+
[--import-extension none|js]
|
|
52
54
|
[--context <name>:<core|supporting|generic>]...
|
|
53
55
|
[--dry-run] [--force]
|
|
54
56
|
```
|
|
@@ -62,6 +64,22 @@ left alone, `--force` included. An existing `package.json` is merged: missing sc
|
|
|
62
64
|
dependencies are added, yours are kept and mentioned in the notes. Run again later, `init` keeps
|
|
63
65
|
the stack recorded in the config.
|
|
64
66
|
|
|
67
|
+
`init --force` on a project that is already initialised rewrites the files `init` owns and keeps
|
|
68
|
+
the config: the contexts and their upstreams, the rules, the limits, the deviations and every
|
|
69
|
+
other key stay as written, and the stack changes only where a flag names a choice
|
|
70
|
+
(`init --force --logger pino` changes the logger; a combination the recorded stack cannot take
|
|
71
|
+
is refused as for a new project). The composition root, the proof that each context wires alone
|
|
72
|
+
and the registry of permissions are rewritten from their templates, then the declared contexts
|
|
73
|
+
are wired into them again; what another generator had added to a file of the platform (the
|
|
74
|
+
value of a gateway, the settings of a job) is not, and a note says so. A config that cannot be
|
|
75
|
+
read is replaced.
|
|
76
|
+
|
|
77
|
+
An import of a file of the project is written without an extension
|
|
78
|
+
(`@/contexts/billing/domain/aggregates/invoice.aggregate`): `init` records
|
|
79
|
+
`"importExtension": "none"`, and `--import-extension js` asks for the `.js` of the emitted file
|
|
80
|
+
instead. A config without the key is read as `js`, so a project generated before the key
|
|
81
|
+
existed keeps its spelling. See [docs/CONFIG.md](../../docs/CONFIG.md).
|
|
82
|
+
|
|
65
83
|
Defaults: `express`, `zod`, `tsyringe` (`nest` with `--http nest`, and only then), `vitest`,
|
|
66
84
|
`drizzle` on `postgres`, `outbox` when there is an ORM, `swagger`, `github`, `jwt`, `rbac`, no broker,
|
|
67
85
|
the cache in the process, the audit trail `on` when there is an ORM, unexpected failures reported
|
|
@@ -101,11 +119,32 @@ A config written before `stack.style` existed is explicit.
|
|
|
101
119
|
**A port is an abstract class and its own injection token.** `application/ports/<name>.port.ts`
|
|
102
120
|
and `domain/repositories/<name>.repository.ts` hold one abstract class each. Generated code holds
|
|
103
121
|
no `token()`, no UPPER_SNAKE injection constant, no `<context>.ports.ts` and no
|
|
104
|
-
`platform/tokens.ts`: a
|
|
105
|
-
kernel ports are value imports wherever they are named in a
|
|
106
|
-
|
|
122
|
+
`platform/tokens.ts`: a constructor parameter typed by a port class names what is injected
|
|
123
|
+
(`private readonly clock: Clock`), kernel ports are value imports wherever they are named in a
|
|
124
|
+
list or a binding and type imports where they only type a parameter, an adapter `implements`
|
|
125
|
+
its port.
|
|
126
|
+
|
|
127
|
+
**The constructor states the dependencies.** In the declared style a generated class lists
|
|
128
|
+
nothing in its decorator (`@CommandHandler(IssueInvoiceCommand)`): each constructor parameter
|
|
129
|
+
is typed by one class, its token (`declarations/constructor-injection`). `generate`, `docs` and
|
|
130
|
+
the `dev` script read the signatures, with the zero-dependency scanner of the checker and no
|
|
131
|
+
compiler, and write `injected(Class, [Tokens])` statements in the generated file of each
|
|
132
|
+
context: the barrel `<context>.declarations.ts`, or `<context>.dependencies.ts` under
|
|
133
|
+
discovery. `@ddd-ts-kit/di` injects from there. `emitDecoratorMetadata` is never relied on: it
|
|
134
|
+
is absent with standard decorators and under `tsx`. `init` writes
|
|
135
|
+
`"stack.dependencies": "signature"`; a config without the key is `listed`, the 0.1 form
|
|
136
|
+
(`@CommandHandler(M, [Ports])`), which keeps working untouched, and
|
|
137
|
+
`--dependencies listed` asks for it. The explicit style stays explicit: its module file lists
|
|
138
|
+
what each class is given. Every generated file exports one class, interface or function and is named
|
|
107
139
|
after it.
|
|
108
140
|
|
|
141
|
+
**Domain errors are built by factories.** `init` writes `"stack.refusals": "factories"`: a
|
|
142
|
+
context has one error class per concept, extending `ConceptError` of the kernel, and
|
|
143
|
+
`generate error <context> <Concept> <refusal>` adds a static factory to it. The `errors/*`
|
|
144
|
+
rules hold that form. `--refusals classes`, or a config without the key, keeps one class per
|
|
145
|
+
error built with `new`, as 0.1 and 0.2 wrote them; `error-factories` moves a project from one
|
|
146
|
+
to the other.
|
|
147
|
+
|
|
109
148
|
**Domain events leave with the save.** A generated command handler builds or loads its aggregate,
|
|
110
149
|
calls one intention method, `await repository.save(aggregate)` and returns: no `pullEvents()`, and
|
|
111
150
|
no `DomainEventDispatcher` in a handler or in a repository adapter, which only persists. The events
|
|
@@ -164,7 +203,7 @@ to its lists, everything else is kept, and the notes of the command list what wa
|
|
|
164
203
|
denied and `Read(!./.env.example)`, a negation placed after it in the same list, takes the
|
|
165
204
|
example file back out.
|
|
166
205
|
|
|
167
|
-
Every `.ts` file `init` and `generate` write imports by the alias (`@/platform/errors
|
|
206
|
+
Every `.ts` file `init` and `generate` write imports by the alias (`@/platform/errors`),
|
|
168
207
|
never by a relative path; the barrel and a published-language index re-export by it too.
|
|
169
208
|
|
|
170
209
|
Scripts: `dev` (`tsx watch`, which resolves an alias from the `paths` of `tsconfig.json`,
|
|
@@ -200,7 +239,8 @@ ddd-ts-kit generate --help --json
|
|
|
200
239
|
| `entity` | `<context> <Name>` | entity, spec |
|
|
201
240
|
| `value-object` (`vo`) | `<context> <Name>` | value object, spec |
|
|
202
241
|
| `domain-event` | `<context> <Aggregate> <Fact>` | event named `<context>.<aggregate>.<fact>`, spec |
|
|
203
|
-
| `
|
|
242
|
+
| `error` (`refusal`) | `<context> <Concept> <refusal> [--code CODE] [--term ...]...` | a static factory `<refusal>` on `domain/errors/<concept>.error.ts`, the class of the errors of that concept (created when absent, extending `ConceptError`), and its case in `test/unit/<concept>.error.spec.ts`. The factory is added after the last one; run again, the command changes nothing. `<Concept>` is a term of the glossary (`--term` adds it). The code is the name of the refusal in constant case, with the concept before it when the name is one word or a code of the kit (`Appointment notFound` sets `APPOINTMENT_NOT_FOUND`); `--code` takes one of the forms `errors/factory-name` accepts. Refused: a name such as `create` or `error1`, and a code already set in the context |
|
|
243
|
+
| `domain-error` | `<context> <Name> [--code CODE]` | one class per error with a stable code, spec: the form of a project whose config says `"stack.refusals": "classes"` or nothing. Refused under `factories`, with the `generate error` command to run instead |
|
|
204
244
|
| `domain-service` | `<context> <Name>` | service, spec |
|
|
205
245
|
| `repository` | `<context> <Aggregate> [--tenant-scoped]` | the port `domain/repositories/<name>.repository.ts` (`abstract class <Name>Repository extends Repository<<Name>>`), the adapter of the project's ORM (`implements` the port) with its mapper and table (or model), a fake, one `repositoryContract` spec run on both, registration |
|
|
206
246
|
| `command` | `<context> <UseCaseName> (--permission <aggregate>.<action> \| --public) [--aggregate <Name>]` | `<use-case>.command.ts` on `AuthorizedCommand` (plain `Command` when public), `<use-case>.handler.ts` (it builds the aggregate, saves it and answers: the events leave with the save), spec through the bus with the refusal of an actor who lacks the permission, registration with `.requires(...)` or `.public()` (and the repository when missing). A generated command answers `void` or the identifier of its aggregate, so no `<use-case>.result.ts` is written |
|
|
@@ -210,6 +250,7 @@ ddd-ts-kit generate --help --json
|
|
|
210
250
|
| `integration-event` | `<context> <Aggregate> <Fact> [--version n]` | `defineIntegrationEvent` declaration in the published language (its payload in `<event>.v<n>.payload.ts` with class-validator or a schema of your own), index export, the publisher `application/integration/publishers/<event>.publisher.ts`, spec, registration, a line of `platform/audit/audited-events.ts` |
|
|
211
251
|
| `integration-handler` (`consumer`) | `<context> <upstreamContext> <eventType>` | `application/integration/handlers/<name>.integration-handler.ts`, a class `<Name>IntegrationHandler` depending on `CommandBus`, its spec, its idempotent subscription under the consumer name `<context>.<name>`; refused unless the upstream is declared |
|
|
212
252
|
| `event-handler` | `<context> <Aggregate> <Fact> [--phase after-commit]` | reaction to a domain event of the context, spec, subscription; before the commit of the unit of work by default, after it with `--phase after-commit` (an effect no transaction covers, at most once), and the spec runs the reaction in that phase |
|
|
253
|
+
| `projection` (`projector`) | `<context> <Name> <event-type>` | a projector in `application/projections/<name>.projection.ts`, declared with `@Projection('<context>.<name>')` and one `@On(definition)` method for the integration event, which the context itself or a declared upstream publishes, and its spec; declared style only. It keeps one read model: its port is received in the constructor |
|
|
213
254
|
| `job` | `<context> <Name> (--every <duration> \| --cron "<expression>" [--time-zone <zone>]) --command <UseCaseName>` | `application/scheduling/<name>.job.ts`, a class `<Name>Job implements ScheduledJob` that sends the command, as `systemActor('<context>.<name>')` when it is protected, with `execution.scheduledAt` when the command takes it; `test/unit/<name>.job.spec.ts`, which runs the job (by name on tsyringe, `application.jobs.runNow`; `job.run(occurrence)` with hand wiring) and asserts the command it sent; its registration; its switch in `platform/job-settings.ts`; the grant of its system actor (below) |
|
|
214
255
|
| `acl` | `<context> <upstreamOrSystemName>` | translator in `infrastructure/anti-corruption/`, spec |
|
|
215
256
|
| `e2e` | `<context> <UseCaseName>` | `test/e2e/<use-case>.e2e.spec.ts` driving the route of the use case: 401 without a credential, 403 without the permission, the documented status with it; for a command, one more test asserts the trace of the request, exact on names and structure, with `installTestTracing()` and `expectSpanTree(storyOf(trace), [...])` of `@ddd-ts-kit/tracing/testing` (`POST /invoices`, then `command IssueInvoiceCommand`, then `repository InvoiceRepository.save`); needs the route |
|
|
@@ -222,17 +263,17 @@ ddd-ts-kit generate --help --json
|
|
|
222
263
|
|
|
223
264
|
- **The declared style, kind by kind.** No token anywhere: a list names port classes. `command`
|
|
224
265
|
and `query` put `@Requires(<permissions>[...])` or `@Public()` on the message and
|
|
225
|
-
`@CommandHandler(Message
|
|
266
|
+
`@CommandHandler(Message)` or
|
|
226
267
|
`@QueryHandler(Message, [<UseCase>Reader])` on the handler; `repository` writes
|
|
227
268
|
`@Repository(InvoiceRepository, [<storage>, ExecutionScope, Clock])`, the storage being
|
|
228
269
|
`Database` of the platform (drizzle, prisma), `KnexContext` or `TypeOrmContext`; the in-memory
|
|
229
270
|
adapter of a read port is `in-memory-<name>-reader.repository.ts`, a role file with
|
|
230
271
|
`@Repository(<UseCase>Reader)`; `integration-handler` writes
|
|
231
|
-
`@IntegrationEventHandler(definition, { consumer }
|
|
272
|
+
`@IntegrationEventHandler(definition, { consumer })` and is refused when the
|
|
232
273
|
upstream does not declare the event; `event-handler` and the publisher of `integration-event`
|
|
233
274
|
write `@DomainEventHandler(Event, { name })` (the publisher with
|
|
234
275
|
`[IntegrationEventPublisher, IdGenerator]`), and both are found like any role file: the
|
|
235
|
-
composition root lists no publisher; `job` writes `@Scheduled('<context>.<name>', schedule
|
|
276
|
+
composition root lists no publisher; `job` writes `@Scheduled('<context>.<name>', schedule)`;
|
|
236
277
|
`policy` writes a class with `@Policy(permission, { name })` and registers nothing; `gateway`
|
|
237
278
|
writes `@Gateway(<Name>Gateway, [<Name>Contract])` and binds the upstream value in the marker
|
|
238
279
|
regions of `platform/platform.module.ts` and `platform/platform-test.module.ts`: a value or a
|
|
@@ -271,8 +312,16 @@ ddd-ts-kit generate --help --json
|
|
|
271
312
|
relationship schema or a permission the generator cannot read, nothing is written and the job
|
|
272
313
|
file carries the `TODO(domain)` naming the actor and the permission.
|
|
273
314
|
- **The barrel is derived.** `<context>.declarations.ts` holds one `export *` per role file, sorted
|
|
274
|
-
by path
|
|
275
|
-
|
|
315
|
+
by path, then one `injected(Class, [Tokens])` per class whose constructor takes something,
|
|
316
|
+
read from its signature, with the imports they need. Every `generate`, and `docs`, rewrite it;
|
|
317
|
+
`docs --check` and `check` (`declarations/barrel-current`) report one that a role file written
|
|
318
|
+
by hand left behind or whose constructor changed since, naming the class
|
|
319
|
+
(`stale src/contexts/billing/billing.declarations.ts: the dependency list of IssueInvoiceHandler is stale: ...`).
|
|
320
|
+
The `dev` script loads `ddd-ts-kit/dist/refresh-declarations.js` before the application, on
|
|
321
|
+
every start and reload of `tsx watch`: a port added to a constructor is injected on the
|
|
322
|
+
reload that follows the save. The same module is the binary `ddd-ts-kit-refresh-declarations`.
|
|
323
|
+
It is laid out as Biome lays it out at a line width of 120; a project that formats at another
|
|
324
|
+
width leaves `**/*.declarations.ts` and `**/*.dependencies.ts` out of its formatter.
|
|
276
325
|
- **Deny by default.** `command` and `query` are refused without `--permission` or `--public`. A new
|
|
277
326
|
permission joins `<context>.permissions.ts`; its words are checked against the glossary like any
|
|
278
327
|
other name. With `--authz rebac` the requirement names the context as its resource, a starting
|
|
@@ -349,7 +398,9 @@ Regenerates what is derived from the config and the code, and nothing else:
|
|
|
349
398
|
kept; on first creation the four written sections are laid out with hints.
|
|
350
399
|
- the generated lists of every `CONTEXT.md` (aggregates, published events, permissions, scheduled
|
|
351
400
|
jobs as a table of name, schedule and command, relationships);
|
|
352
|
-
- the
|
|
401
|
+
- the generated file of every declared context: the barrel `<context>.declarations.ts`, with
|
|
402
|
+
what each constructor is injected, read from its signature, or under discovery
|
|
403
|
+
`<context>.dependencies.ts`, which holds that alone;
|
|
353
404
|
- the reference of every `CONTEXT.md`: the facts of `describe`, as tables under `## Reference`,
|
|
354
405
|
between `ddd-ts-kit:reference` markers; a `CONTEXT.md` that has no such section gets it after its
|
|
355
406
|
last generated list;
|
|
@@ -371,6 +422,48 @@ published languages, declared upstreams, allowed packages, cycles and orphans. `
|
|
|
371
422
|
it as `.dependency-cruiser.cjs`; `--check` exits 1 when the file is missing or stale, which is
|
|
372
423
|
what `npm run depcruise` runs first. Edit the config, not the file.
|
|
373
424
|
|
|
425
|
+
## error-factories
|
|
426
|
+
|
|
427
|
+
```
|
|
428
|
+
ddd-ts-kit error-factories --plan
|
|
429
|
+
ddd-ts-kit error-factories --apply [--dry-run]
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
Moves a project from one class per error (`new SlotTakenError(..)`) to static factories on one
|
|
433
|
+
error class per concept (`AppointmentError.slotTaken(..)`), in two steps, because which concept
|
|
434
|
+
a refusal is about is a decision of the model.
|
|
435
|
+
|
|
436
|
+
`--plan` writes `error-factories.plan.json`: per context, one entry per class of
|
|
437
|
+
`domain/errors/` that extends `DomainError`, with its code, the concept proposed for it (the
|
|
438
|
+
aggregate its name starts or ends with, empty when none does) and the factory name that says
|
|
439
|
+
its code (`APPOINTMENT_NOT_FOUND` on `Appointment` gives `notFound`). Edit it: every entry
|
|
440
|
+
needs a `concept`, a term of the glossary.
|
|
441
|
+
|
|
442
|
+
`--apply` follows the plan and refuses an entry without a concept, a vague factory name or one
|
|
443
|
+
that does not say the code. It:
|
|
444
|
+
|
|
445
|
+
- writes `domain/errors/<concept>.error.ts`, a class extending `ConceptError` with one factory
|
|
446
|
+
per class moved there: the parameters of the constructor, the message it gave to `super`, and
|
|
447
|
+
as facts the parameters that are plain data (text, numbers, booleans, dates);
|
|
448
|
+
- removes each class and its spec, whose cases go under `describe('<factory>')` in
|
|
449
|
+
`test/unit/<concept>.error.spec.ts`;
|
|
450
|
+
- rewrites every file under the source root and `test/`: `new X(..)` becomes
|
|
451
|
+
`<Concept>Error.<factory>(..)`, `thenError(X)` and `thenError(X, code)` become
|
|
452
|
+
`thenError('<CODE>')`, `toThrow(X)` and `expect.any(X)` become an assertion on the code,
|
|
453
|
+
`toBeInstanceOf(X)` becomes `toMatchObject({ code })`, `e instanceof X` becomes
|
|
454
|
+
`<Concept>Error.is(e, '<CODE>')`, an import of the class becomes the import of its concept
|
|
455
|
+
class, and a type names the concept class. A class of the same name in two contexts goes to
|
|
456
|
+
the concept of its own. Comments and strings are left alone;
|
|
457
|
+
- sets `"stack.refusals": "factories"` in the config.
|
|
458
|
+
|
|
459
|
+
It leaves, and says: a class that has members of its own, reads `this` in its constructor or
|
|
460
|
+
gives options to `super` (written by hand); a place where a class stood as a value it cannot
|
|
461
|
+
translate; a property of the error that became a fact (`error.personId` is now
|
|
462
|
+
`error.facts.personId`); a factory with more than three parameters. And always: which facts a
|
|
463
|
+
client may read (none is exposed), the factories that still take a sentence as only parameter,
|
|
464
|
+
and the facts to assert in the specs. Run the formatter afterwards. Run again, it finds nothing
|
|
465
|
+
left to move. `--json` answers `{ dryRun, moved, written, removed, manual }`.
|
|
466
|
+
|
|
374
467
|
## build-aliases
|
|
375
468
|
|
|
376
469
|
```
|
|
@@ -378,10 +471,14 @@ ddd-ts-kit build-aliases [--project <tsconfig>]
|
|
|
378
471
|
```
|
|
379
472
|
|
|
380
473
|
The second step of `npm run build`, after the compiler. The compiler emits an import alias as
|
|
381
|
-
it was written (`@/platform/errors
|
|
382
|
-
every `.js`, `.mjs`, `.cjs`, `.d.ts`, `.d.mts` and `.d.cts` under the
|
|
383
|
-
tsconfig (`tsconfig.build.json` by default), each alias specifier into
|
|
384
|
-
emitted file it names,
|
|
474
|
+
it was written (`@/platform/errors`), and Node resolves no alias and completes no extension:
|
|
475
|
+
this command rewrites, in every `.js`, `.mjs`, `.cjs`, `.d.ts`, `.d.mts` and `.d.cts` under the
|
|
476
|
+
output directory of the tsconfig (`tsconfig.build.json` by default), each alias specifier into
|
|
477
|
+
the relative path of the emitted file it names, with its `.js` extension
|
|
478
|
+
(`../../platform/errors.js`), so that `node dist/src/main.js` runs with no loader and no flag.
|
|
479
|
+
It reads `importAlias` and `importExtension` of the config: `@/platform/errors` names
|
|
480
|
+
`platform/errors.js` under `none`, `@/platform/errors.js` names it under `js`, and no other
|
|
481
|
+
spelling is guessed.
|
|
385
482
|
|
|
386
483
|
- Rewritten: the specifier of `import ... from`, `export ... from`, a bare `import`,
|
|
387
484
|
`import('...')` and `require('...')` with a string literal, `import.meta.resolve('...')`, and
|
|
@@ -390,9 +487,13 @@ emitted file it names, so that `node dist/src/main.js` runs with no loader and n
|
|
|
390
487
|
code, a comment, a template or a regular expression, is left alone. Lines never move and the
|
|
391
488
|
source maps are not touched.
|
|
392
489
|
- Idempotent: a second run rewrites nothing.
|
|
393
|
-
- It exits 2 and writes nothing when an alias names no emitted file, when
|
|
394
|
-
an alias
|
|
395
|
-
the
|
|
490
|
+
- It exits 2 and writes nothing when an alias names no emitted file, when it names a directory
|
|
491
|
+
(an alias names one file: `.../published-language/index`), when it is written in the spelling
|
|
492
|
+
the config does not ask for, when `import()` is given an alias completed at run time (a
|
|
493
|
+
template with an interpolation, a concatenation), or when the output directory does not
|
|
494
|
+
exist. Each refusal says the file, the line and what to write instead.
|
|
495
|
+
- A package is never touched, whatever its subpath ends with (`zod/v4/core.js`,
|
|
496
|
+
`@scope/package/file.js`, `node:fs`).
|
|
396
497
|
|
|
397
498
|
`--json` answers `{ outDir, files, changed, specifiers }`. `ddd-ts-kit check` reports a script
|
|
398
499
|
that compiles without this step (`imports/alias-declared`). The whole mechanism:
|
|
@@ -541,7 +642,7 @@ saying what to do instead. Exit code 1 when there is at least one error.
|
|
|
541
642
|
| `test/builder-required` | an aggregate without `test/builders/<name>.builder.ts` |
|
|
542
643
|
| `events/name-format` | an event name that is not `<context>.<aggregate>.<fact>` in kebab-case with the right context |
|
|
543
644
|
| `events/defined-in-published-language` | `defineIntegrationEvent` outside a published language, without a payload, twice for one version; an event described by hand |
|
|
544
|
-
| `language/glossary-term` | a class of the model named with a word the glossary of its context does not define; an empty glossary |
|
|
645
|
+
| `language/glossary-term` | a class of the model named with a word the glossary of its context does not define; an empty glossary; under `"stack.refusals": "factories"`, an error class of `domain/errors/` too |
|
|
545
646
|
| `language/no-technical-name` | `Manager`, `Helper`, `Util`, `Utils`, `Data`, `Info`, `Processor`, `Wrapper`, `Impl`, `Base`, `Abstract`, `Dto`, `Entity`, `Model` in a type declared under `domain/` or in a use case folder |
|
|
546
647
|
| `purity/no-system-clock` | `new Date()` without argument, `Date.now()`, `performance.now()` in `domain/` or `application/` |
|
|
547
648
|
| `purity/no-ambient-randomness` | `Math.random`, the random source of `crypto`, an id library |
|
|
@@ -559,8 +660,9 @@ saying what to do instead. Exit code 1 when there is at least one error.
|
|
|
559
660
|
| `clean/file-size` | a file of more than 350 lines, sources and tests; a path with a segment `generated` and declaration files are exempt |
|
|
560
661
|
| `composition/only-in-module` | `new X`, or `bind(..).toClass(X, ..)` and `rebind(..).toClass(X, ..)`, of a class imported from `infrastructure/`, outside the module file, `main.ts`, the platform and tests; in a file importing `@ddd-ts-kit/di`, a call of `contextModule`, `discoverContext` or `.include(` outside those places and `apps/<context>/main.ts` |
|
|
561
662
|
| `imports/alias-only` | under the source root, `test/` and `scripts/`: an `import`, `export ... from` or `import()` with a relative specifier, the same directory included (the fix names the alias to write; `eslint --fix` writes it); an alias specifier with a `.` or `..` segment |
|
|
562
|
-
| `imports/
|
|
563
|
-
| `
|
|
663
|
+
| `imports/extension` | under the source root, `test/` and `scripts/`: with `importExtension` `none`, an alias specifier that ends with `.js`, `.mjs`, `.cjs`, `.ts`, `.mts` or `.cts`, or that names a directory holding an `index.ts`; with `js` (or no key), an alias specifier that does not end with `.js` (the fix names the specifier to write; `eslint --fix` writes it). A package subpath is never judged |
|
|
664
|
+
| `imports/alias-declared` | an `importAlias` that is not `@/` or `$<name>/`, or that is `$test/`, `$scripts/`, `$generated/`; a `paths` entry of `tsconfig.json` missing or different from what `importAlias` gives (the fix gives the entry); another `paths` entry under an alias; a `baseUrl`; a `tsconfig.build.json` whose `paths` differ; `paths` of `knip.json` mapping an alias; a script that compiles (`tsc` without `--noEmit`) and does not run `ddd-ts-kit build-aliases` afterwards; a script running `tsx --tsconfig` on another file; a `vitest` config at the root without `tsconfigPaths: true`, a `jest` config without the derived `moduleNameMapper` entries, or `.dependency-cruiser.cjs` without `tsConfig`; `module` and `moduleResolution` of `tsconfig.json` (or of a `tsconfig.build.json` that sets its own) that are not what `importExtension` gives: `ESNext`, `Bundler` and `customConditions` holding `node` under `none`, and under `js` a written value that is not a Node resolution; a jest mapping whose pattern does not end as the imports do. A project without `package.json` is not judged |
|
|
665
|
+
| `config/valid` | unknown upstream, classification, relationship, rule id, `guard` mode or `importExtension`; a context missing on disk or in the config; a `commit` limit that is not a positive integer |
|
|
564
666
|
| `config/suppression-needs-reason` | a suppression without a rule id or a reason (kept as an alias next to `governance/recorded-deviation`, which judges the reason) |
|
|
565
667
|
| `authz/declared` | in a module file, `builder.command(X)` or `builder.query(X)` without `.requires(` or `.public(` in its chain, unless the message class carries `@Requires` or `@Public` of `@ddd-ts-kit/kernel/declarations`; with manual or nest wiring, a command or query class absent from every `requires(X, ...)` and `publicUseCase(X)` of the module file and of `application/authorization/`; a `defineRoute` without `security` (the route type refuses it already, and an empty list too: this is the text-level net for a definition built loosely); in the declared style, the exported class of a `*.command.ts` or `*.query.ts` file carrying neither `@Requires` nor `@Public` |
|
|
566
668
|
| `authz/in-application` | `presentation/`: a test on roles, `isAdmin`, the import of an authorizer or of `Access`; `infrastructure/`: `authorize(` or `check(` on an authorizer or access, `ForbiddenError`; `domain/`: any import of `@ddd-ts-kit/auth`, of the actor types of the kernel (`Actor`, `ActorContext`, `Session`, `ExecutionContext`, the authorized messages), a read of `.roles` or `.permissions` on an actor. The request glue of `@ddd-ts-kit/auth` (`actorOf`, `sessionOf`, `resolveSession`, `SessionAuthenticator`) is free in `presentation/`. `presentation/` and `infrastructure/`: the import of `Requires`, `Public` or `Policy` from `@ddd-ts-kit/kernel/declarations`, or of the ports `Access` and `PolicyAccess` from `@ddd-ts-kit/auth`; they are free in `application/` |
|
|
@@ -575,14 +677,17 @@ saying what to do instead. Exit code 1 when there is at least one error.
|
|
|
575
677
|
| `context/extractable` | a module file importing another context outside its published language; persistence importing another context's infrastructure or naming its schema; a handler importing another context's repository; `export let` or an exported `new Map`, `Set`, `WeakMap` at module level; `deployable: true` without `apps/<context>/main.ts`; in the declared style, a role file importing anything of a port file of another context |
|
|
576
678
|
| `governance/recorded-deviation` | a `ddd-ts-kit-disable` or `eslint-disable` comment whose reason names no `ADR-<number>` with a file `docs/adr/<number>-*.md`; a rule set to `off` (or to `warn` below its default), an extra directory, an extra allowed package, a `guard` other than `enforce` or `stack.events` off the outbox, without a `deviations` entry `{ what, adr, reason }` pointing to an existing record |
|
|
577
679
|
| `declarations/role-declared` | declared style only: a role file (other than `*.command.ts` and `*.query.ts`, held by `authz/declared`; `*.job.ts` under `application/scheduling/` with `@Scheduled` and `*.publisher.ts` with `@DomainEventHandler` are roles) exporting no class with the decorator of its suffix and folder, or one carrying another declaration; a declared class in a file that is not a role file; a `consumer` or `name` option that is missing, empty, a variable, a concatenation or a template with a substitution; a `@DomainEventHandler` name that differs from the `name` literal of the imported event class; any declaration decorator on a class under `domain/` |
|
|
578
|
-
| `declarations/barrel-current` | declared style only: with `stack.assembly: barrel`, a missing `<context>.declarations.ts` or one that differs from one `export *` per role file sorted by path; with `discovery`, a barrel that still exists. It needs the tree, so `check-file` does not run it |
|
|
680
|
+
| `declarations/barrel-current` | declared style only: with `stack.assembly: barrel`, a missing `<context>.declarations.ts` or one that differs from one `export *` per role file sorted by path followed by one `injected(Class, [Tokens])` per class whose constructor takes something (read from the signatures, with their imports); with `discovery`, a barrel that still exists, and a `<context>.dependencies.ts` that differs from those `injected` statements (absent is accepted while it would hold none). The message names the missing role file or the class whose list is stale. It needs the tree, so `check-file` does not run it |
|
|
681
|
+
| `declarations/constructor-injection` | declared style only, in a role file: on a class whose decorator lists nothing, a constructor parameter that is optional, has a default value, is a rest parameter or is destructured, has no type, or is typed by anything but one class name (type arguments aside): a union, an intersection, an array, a qualified name, a type of the language, an interface, a type alias, an enum or an unexported class of the file or of the file of the project it is imported from; a class that inherits its constructor from a class the project cannot read. Under `stack.dependencies: signature`, a decorator that carries a list although the constructor can be read: one that repeats it, one that differs |
|
|
579
682
|
| `ports/abstract-class` | in a port file (`domain/repositories/*.repository.ts`, `application/ports/*.port.ts`): a class that is not `abstract`; a member that is not an abstract method or property (`static readonly tokenKey = '<text>'` apart): a constructor, a body, an initializer, a `private`, `protected` or `#` member; an exported `interface` (a `type` alias, a data shape, is not reported) |
|
|
580
683
|
| `ports/implements-never-extends` | a class carrying `@Repository(P)`, `@Gateway(P)` or `@Adapter(P)`, or given to `bind(P).toClass(C)` or `rebind(P).toClass(C)`, without `implements P` or with `extends P`; under `infrastructure/`, a class extending a class imported from a port file |
|
|
581
684
|
| `ports/no-token-constant` | a call of `token` imported from a `@ddd-ts-kit/*` package; `Symbol(..)`, `Symbol.for(..)` or a string literal as the first argument of `bind`, `rebind`, `resolve`, `fake` or `override` in a file importing `@ddd-ts-kit/di`; an UPPER_SNAKE_CASE name in a dependency list; a file named `*.ports.ts` or `tokens.ts` |
|
|
582
|
-
| `ports/no-concrete-dependency` | a dependency list naming a class imported from `infrastructure/` or from `test/fakes/` of a context |
|
|
685
|
+
| `ports/no-concrete-dependency` | a dependency list naming a class imported from `infrastructure/` or from `test/fakes/` of a context; in the declared style, a constructor parameter of a declared class that lists nothing, typed by such a class |
|
|
583
686
|
| `ports/value-import` | a class named in a dependency list, or given to `bind` or `rebind`, imported with `import type` or `import { type X }` |
|
|
584
687
|
| `scheduling/job-triggers-use-case` | in `application/scheduling/*.job.ts`: an exported class that does not implement `ScheduledJob`; a `run` that sends no command (no `.execute(` call); a repository in the dependency list or the constructor; an import from `domain/aggregates/`, `domain/entities/`, `domain/services/` or `infrastructure/`. A `builder.job(..)` registration of a class that lives elsewhere |
|
|
585
688
|
| `scheduling/job-name` | the first argument of `@Scheduled(..)` or `.job(..)` that is not a string literal `<context>.<job-name>` in lower-case kebab-case with the context of its file; a `systemActor(..)` of a job file passing another name; one job name used twice in the project |
|
|
689
|
+
| `errors/code-unique` | under `"stack.refusals": "factories"`, in the `domain/errors/` of a context: a code set a second time, by a factory (`refusal('CODE', ..)`) or by a class (`readonly code = 'CODE'`), with the file and line of the first. The same code in two contexts is not reported |
|
|
690
|
+
| `errors/known-code` | under `"stack.refusals": "factories"`, in a `*.route.ts`: a code of the `errors` list that no refusal of the context of the route sets, that no class outside the contexts sets, and that is not a code of the kit |
|
|
586
691
|
|
|
587
692
|
Five more ids belong to `@ddd-ts-kit/eslint-plugin`, which reads the syntax tree where this
|
|
588
693
|
checker reads text: `domain/aggregate-encapsulation`, `domain/value-object-immutability`,
|
|
@@ -692,6 +797,14 @@ import is judged by every boundary rule exactly as the relative path to the same
|
|
|
692
797
|
`override` are binding calls only in a file that imports `@ddd-ts-kit/di`.
|
|
693
798
|
`ports/implements-never-extends` reads the bound class through one direct relative or alias
|
|
694
799
|
import; a class of a package or behind a barrel is not judged.
|
|
800
|
+
- The constructor of a declared class is read as text, by the scanner of the checker: the
|
|
801
|
+
constructor of the exported class that carries the decorator of its role file, its own or
|
|
802
|
+
the nearest one it inherits through imports of the project. A type imported from a package
|
|
803
|
+
is trusted to be a class (the compiler judges the generated file, which imports it as a
|
|
804
|
+
value); a type reached through a barrel is trusted too. A constructor overloaded by
|
|
805
|
+
signatures without a body, or built by a mixin, is not read: write one plain constructor.
|
|
806
|
+
`declarations/barrel-current` compares text exactly, so the generated file is never
|
|
807
|
+
reformatted by hand.
|
|
695
808
|
- `scheduling/job-triggers-use-case` takes any `.execute(` call in `run` for a command sent; a job
|
|
696
809
|
that executes something else, or sends its command from a helper, is misjudged.
|
|
697
810
|
`scheduling/job-name` compares literal names: a job registered under a computed name is reported
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CompilerResolution } from './compiler-resolution.js';
|
|
2
|
+
/**
|
|
3
|
+
* What `init` writes in tsconfig.json for "importExtension". `Bundler` resolves a specifier
|
|
4
|
+
* without its extension and still reports one that names no file; it reads the `exports` of a
|
|
5
|
+
* package without the `node` condition, which is given back to it so that the compiler and Node
|
|
6
|
+
* take the same entry. `NodeNext` resolves as Node does and requires the extension. Both emit
|
|
7
|
+
* ECMAScript modules, which `build-aliases` completes.
|
|
8
|
+
*/
|
|
9
|
+
export declare function compilerResolutionOf(importExtension: string): CompilerResolution;
|
|
10
|
+
//# sourceMappingURL=compiler-resolution-of.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compiler-resolution-of.d.ts","sourceRoot":"","sources":["../../src/alias/compiler-resolution-of.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnE;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,eAAe,EAAE,MAAM,GAAG,kBAAkB,CAIhF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What `init` writes in tsconfig.json for "importExtension". `Bundler` resolves a specifier
|
|
3
|
+
* without its extension and still reports one that names no file; it reads the `exports` of a
|
|
4
|
+
* package without the `node` condition, which is given back to it so that the compiler and Node
|
|
5
|
+
* take the same entry. `NodeNext` resolves as Node does and requires the extension. Both emit
|
|
6
|
+
* ECMAScript modules, which `build-aliases` completes.
|
|
7
|
+
*/
|
|
8
|
+
export function compilerResolutionOf(importExtension) {
|
|
9
|
+
return importExtension === 'none'
|
|
10
|
+
? { module: 'ESNext', moduleResolution: 'Bundler', customConditions: ['node'] }
|
|
11
|
+
: { module: 'NodeNext', moduleResolution: 'NodeNext' };
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=compiler-resolution-of.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compiler-resolution-of.js","sourceRoot":"","sources":["../../src/alias/compiler-resolution-of.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,eAAuB;IAC1D,OAAO,eAAe,KAAK,MAAM;QAC/B,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC,MAAM,CAAC,EAAE;QAC/E,CAAC,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,gBAAgB,EAAE,UAAU,EAAE,CAAC;AAC3D,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** The compiler options that decide how a specifier is resolved and what the compiler emits for it. */
|
|
2
|
+
export interface CompilerResolution {
|
|
3
|
+
readonly module: string;
|
|
4
|
+
readonly moduleResolution: string;
|
|
5
|
+
/** The conditions added to the ones the resolution reads in the `exports` of a package. */
|
|
6
|
+
readonly customConditions?: readonly string[];
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=compiler-resolution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compiler-resolution.d.ts","sourceRoot":"","sources":["../../src/alias/compiler-resolution.ts"],"names":[],"mappings":"AAAA,uGAAuG;AACvG,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,2FAA2F;IAC3F,QAAQ,CAAC,gBAAgB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC/C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compiler-resolution.js","sourceRoot":"","sources":["../../src/alias/compiler-resolution.ts"],"names":[],"mappings":""}
|
package/dist/alias/index.d.ts
CHANGED
|
@@ -2,12 +2,14 @@ export { aliasProblem } from './alias-problem.js';
|
|
|
2
2
|
export type { AliasRoot } from './alias-root.js';
|
|
3
3
|
export { aliasRoots } from './alias-roots.js';
|
|
4
4
|
export { compilerPaths } from './compiler-paths.js';
|
|
5
|
+
export { compilerResolutionOf } from './compiler-resolution-of.js';
|
|
5
6
|
export { contextAlias } from './context-alias.js';
|
|
6
7
|
export type { BuildLayout } from './build-layout.js';
|
|
7
8
|
export { DEFAULT_BUILD_LAYOUT } from './default-build-layout.js';
|
|
8
9
|
export { directoryAlias } from './directory-alias.js';
|
|
9
10
|
export { FIXED_ALIAS_ROOTS } from './fixed-alias-roots.js';
|
|
10
11
|
export { moduleNameMapper } from './module-name-mapper.js';
|
|
11
|
-
export {
|
|
12
|
+
export { specifierOf } from './specifier-of.js';
|
|
13
|
+
export { specifierSuffix } from './specifier-suffix.js';
|
|
12
14
|
export { toAlias } from './to-alias.js';
|
|
13
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/alias/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/alias/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/alias/index.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
export { aliasProblem } from './alias-problem.js';
|
|
2
2
|
export { aliasRoots } from './alias-roots.js';
|
|
3
3
|
export { compilerPaths } from './compiler-paths.js';
|
|
4
|
+
export { compilerResolutionOf } from './compiler-resolution-of.js';
|
|
4
5
|
export { contextAlias } from './context-alias.js';
|
|
5
6
|
export { DEFAULT_BUILD_LAYOUT } from './default-build-layout.js';
|
|
6
7
|
export { directoryAlias } from './directory-alias.js';
|
|
7
8
|
export { FIXED_ALIAS_ROOTS } from './fixed-alias-roots.js';
|
|
8
9
|
export { moduleNameMapper } from './module-name-mapper.js';
|
|
9
|
-
export {
|
|
10
|
+
export { specifierOf } from './specifier-of.js';
|
|
11
|
+
export { specifierSuffix } from './specifier-suffix.js';
|
|
10
12
|
export { toAlias } from './to-alias.js';
|
|
11
13
|
//# sourceMappingURL=index.js.map
|
package/dist/alias/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/alias/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/alias/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { AliasRoot } from './alias-root.js';
|
|
2
2
|
/**
|
|
3
|
-
* The `moduleNameMapper` of jest for these roots, which does not read tsconfig: an alias
|
|
4
|
-
* written with the `.js`
|
|
3
|
+
* The `moduleNameMapper` of jest for these roots, which does not read tsconfig: an alias
|
|
4
|
+
* specifier, written with `suffix` (the `.js` of the compiled file, or nothing), answers the
|
|
5
|
+
* TypeScript source and nothing else.
|
|
5
6
|
*/
|
|
6
|
-
export declare function moduleNameMapper(roots: readonly AliasRoot[]): Record<string, string>;
|
|
7
|
+
export declare function moduleNameMapper(roots: readonly AliasRoot[], suffix: string): Record<string, string>;
|
|
7
8
|
//# sourceMappingURL=module-name-mapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-name-mapper.d.ts","sourceRoot":"","sources":["../../src/alias/module-name-mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAIjD
|
|
1
|
+
{"version":3,"file":"module-name-mapper.d.ts","sourceRoot":"","sources":["../../src/alias/module-name-mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAIjD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CASpG"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
const SPECIAL = /[.*+?^${}()|[\]\\]/g;
|
|
2
2
|
/**
|
|
3
|
-
* The `moduleNameMapper` of jest for these roots, which does not read tsconfig: an alias
|
|
4
|
-
* written with the `.js`
|
|
3
|
+
* The `moduleNameMapper` of jest for these roots, which does not read tsconfig: an alias
|
|
4
|
+
* specifier, written with `suffix` (the `.js` of the compiled file, or nothing), answers the
|
|
5
|
+
* TypeScript source and nothing else.
|
|
5
6
|
*/
|
|
6
|
-
export function moduleNameMapper(roots) {
|
|
7
|
+
export function moduleNameMapper(roots, suffix) {
|
|
8
|
+
const ending = suffix.replace(SPECIAL, String.raw `\$&`);
|
|
7
9
|
return Object.fromEntries(roots.map(({ prefix, directory }) => [
|
|
8
|
-
|
|
10
|
+
`^${prefix.replace(SPECIAL, String.raw `\$&`)}(.*)${ending}$`,
|
|
9
11
|
`<rootDir>/${directory}/$1.ts`,
|
|
10
12
|
]));
|
|
11
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-name-mapper.js","sourceRoot":"","sources":["../../src/alias/module-name-mapper.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,GAAG,qBAAqB,CAAC;AAEtC
|
|
1
|
+
{"version":3,"file":"module-name-mapper.js","sourceRoot":"","sources":["../../src/alias/module-name-mapper.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,GAAG,qBAAqB,CAAC;AAEtC;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAA2B,EAAE,MAAc;IAC1E,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,CAAA,KAAK,CAAC,CAAC;IAExD,OAAO,MAAM,CAAC,WAAW,CACvB,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;QACnC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,CAAA,KAAK,CAAC,OAAO,MAAM,GAAG;QAC5D,aAAa,SAAS,QAAQ;KAC/B,CAAC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Config } from '../config/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* How a generated import names a file of the project, given from the project root with or
|
|
4
|
+
* without its extension: by its alias, ending as "importExtension" says.
|
|
5
|
+
*/
|
|
6
|
+
export declare function specifierOf(config: Config, file: string): string;
|
|
7
|
+
//# sourceMappingURL=specifier-of.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"specifier-of.d.ts","sourceRoot":"","sources":["../../src/alias/specifier-of.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAK9D;;;GAGG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAWhE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CliError } from '../cli-error.js';
|
|
2
|
+
import { CONFIG_FILE } from '../config/index.js';
|
|
3
|
+
import { aliasRoots } from './alias-roots.js';
|
|
4
|
+
import { specifierSuffix } from './specifier-suffix.js';
|
|
5
|
+
import { toAlias } from './to-alias.js';
|
|
6
|
+
/**
|
|
7
|
+
* How a generated import names a file of the project, given from the project root with or
|
|
8
|
+
* without its extension: by its alias, ending as "importExtension" says.
|
|
9
|
+
*/
|
|
10
|
+
export function specifierOf(config, file) {
|
|
11
|
+
const specifier = toAlias(aliasRoots(config), file, specifierSuffix(config.importExtension));
|
|
12
|
+
if (specifier === undefined) {
|
|
13
|
+
throw new CliError(`${file} is under no directory an import alias names.`, `Keep it under the source root in ${CONFIG_FILE}: a file is imported by an alias, never by a relative path.`);
|
|
14
|
+
}
|
|
15
|
+
return specifier;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=specifier-of.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"specifier-of.js","sourceRoot":"","sources":["../../src/alias/specifier-of.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAe,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,MAAc,EAAE,IAAY;IACtD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,eAAe,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC;IAE7F,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC5B,MAAM,IAAI,QAAQ,CAChB,GAAG,IAAI,+CAA+C,EACtD,oCAAoC,WAAW,6DAA6D,CAC7G,CAAC;IACJ,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What an alias specifier ends with under "importExtension": nothing for `none`, `.js` otherwise.
|
|
3
|
+
* A value `check` reports as wrong is read as `js`, which is what a config without the key means.
|
|
4
|
+
*/
|
|
5
|
+
export declare function specifierSuffix(importExtension: string): '' | '.js';
|
|
6
|
+
//# sourceMappingURL=specifier-suffix.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"specifier-suffix.d.ts","sourceRoot":"","sources":["../../src/alias/specifier-suffix.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,eAAe,CAAC,eAAe,EAAE,MAAM,GAAG,EAAE,GAAG,KAAK,CAEnE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What an alias specifier ends with under "importExtension": nothing for `none`, `.js` otherwise.
|
|
3
|
+
* A value `check` reports as wrong is read as `js`, which is what a config without the key means.
|
|
4
|
+
*/
|
|
5
|
+
export function specifierSuffix(importExtension) {
|
|
6
|
+
return importExtension === 'none' ? '' : '.js';
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=specifier-suffix.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"specifier-suffix.js","sourceRoot":"","sources":["../../src/alias/specifier-suffix.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,eAAuB;IACrD,OAAO,eAAe,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;AACjD,CAAC"}
|
package/dist/alias/to-alias.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { AliasRoot } from './alias-root.js';
|
|
2
2
|
/**
|
|
3
3
|
* The specifier that names a file of the project, given by its path from the project root with
|
|
4
|
-
* or without its extension; nothing when the file is
|
|
4
|
+
* or without its extension, ending with `suffix` (`.js`, or nothing); nothing when the file is
|
|
5
|
+
* under no aliased tree.
|
|
5
6
|
*/
|
|
6
|
-
export declare function toAlias(roots: readonly AliasRoot[], file: string): string | undefined;
|
|
7
|
+
export declare function toAlias(roots: readonly AliasRoot[], file: string, suffix: string): string | undefined;
|
|
7
8
|
//# sourceMappingURL=to-alias.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to-alias.d.ts","sourceRoot":"","sources":["../../src/alias/to-alias.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAIjD
|
|
1
|
+
{"version":3,"file":"to-alias.d.ts","sourceRoot":"","sources":["../../src/alias/to-alias.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAIjD;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAQrG"}
|
package/dist/alias/to-alias.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
const EXTENSION = /\.(?:ts|js)$/;
|
|
2
2
|
/**
|
|
3
3
|
* The specifier that names a file of the project, given by its path from the project root with
|
|
4
|
-
* or without its extension; nothing when the file is
|
|
4
|
+
* or without its extension, ending with `suffix` (`.js`, or nothing); nothing when the file is
|
|
5
|
+
* under no aliased tree.
|
|
5
6
|
*/
|
|
6
|
-
export function toAlias(roots, file) {
|
|
7
|
+
export function toAlias(roots, file, suffix) {
|
|
7
8
|
const root = roots.find(({ directory }) => file.startsWith(`${directory}/`));
|
|
8
9
|
if (root === undefined) {
|
|
9
10
|
return undefined;
|
|
10
11
|
}
|
|
11
|
-
return `${root.prefix}${file.slice(root.directory.length + 1).replace(EXTENSION, '')}
|
|
12
|
+
return `${root.prefix}${file.slice(root.directory.length + 1).replace(EXTENSION, '')}${suffix}`;
|
|
12
13
|
}
|
|
13
14
|
//# sourceMappingURL=to-alias.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to-alias.js","sourceRoot":"","sources":["../../src/alias/to-alias.ts"],"names":[],"mappings":"AAEA,MAAM,SAAS,GAAG,cAAc,CAAC;AAEjC
|
|
1
|
+
{"version":3,"file":"to-alias.js","sourceRoot":"","sources":["../../src/alias/to-alias.ts"],"names":[],"mappings":"AAEA,MAAM,SAAS,GAAG,cAAc,CAAC;AAEjC;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAC,KAA2B,EAAE,IAAY,EAAE,MAAc;IAC/E,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,SAAS,GAAG,CAAC,CAAC,CAAC;IAE7E,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,GAAG,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC;AAClG,CAAC"}
|
|
@@ -3,6 +3,8 @@ import type { AliasRoot, BuildLayout } from '../alias/index.js';
|
|
|
3
3
|
export interface EmittedPlace {
|
|
4
4
|
readonly roots: readonly AliasRoot[];
|
|
5
5
|
readonly layout: BuildLayout;
|
|
6
|
+
/** What an alias specifier ends with in the sources: `.js`, or nothing. */
|
|
7
|
+
readonly suffix: string;
|
|
6
8
|
/** Whether a path, given from the project root, is a file. */
|
|
7
9
|
readonly isFile: (file: string) => boolean;
|
|
8
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emitted-place.d.ts","sourceRoot":"","sources":["../../src/build/emitted-place.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhE,yDAAyD;AACzD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,CAAC;IACrC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,8DAA8D;IAC9D,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;CAC5C"}
|
|
1
|
+
{"version":3,"file":"emitted-place.d.ts","sourceRoot":"","sources":["../../src/build/emitted-place.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhE,yDAAyD;AACzD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,CAAC;IACrC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,2EAA2E;IAC3E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,8DAA8D;IAC9D,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;CAC5C"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { EmittedPlace } from './emitted-place.js';
|
|
2
2
|
/**
|
|
3
3
|
* The relative specifier that names, from an emitted file, the emitted file an alias specifier
|
|
4
|
-
* stands for, with its `.js` extension
|
|
5
|
-
*
|
|
4
|
+
* stands for, always with its `.js` extension: Node resolves no other spelling. Nothing when the
|
|
5
|
+
* build emitted no such file, or when the specifier is not written as the project writes its
|
|
6
|
+
* imports. Both files are given from the project root.
|
|
6
7
|
*/
|
|
7
8
|
export declare function emittedSpecifier(place: EmittedPlace, file: string, specifier: string): string | undefined;
|
|
8
9
|
//# sourceMappingURL=emitted-specifier.d.ts.map
|