ddd-ts-kit 0.1.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +136 -23
- package/dist/alias/compiler-resolution-of.d.ts +10 -0
- package/dist/alias/compiler-resolution-of.d.ts.map +1 -0
- package/dist/alias/compiler-resolution-of.js +13 -0
- package/dist/alias/compiler-resolution-of.js.map +1 -0
- package/dist/alias/compiler-resolution.d.ts +8 -0
- package/dist/alias/compiler-resolution.d.ts.map +1 -0
- package/dist/alias/compiler-resolution.js +2 -0
- package/dist/alias/compiler-resolution.js.map +1 -0
- package/dist/alias/index.d.ts +3 -1
- package/dist/alias/index.d.ts.map +1 -1
- package/dist/alias/index.js +3 -1
- package/dist/alias/index.js.map +1 -1
- package/dist/alias/module-name-mapper.d.ts +4 -3
- package/dist/alias/module-name-mapper.d.ts.map +1 -1
- package/dist/alias/module-name-mapper.js +6 -4
- package/dist/alias/module-name-mapper.js.map +1 -1
- package/dist/alias/specifier-of.d.ts +7 -0
- package/dist/alias/specifier-of.d.ts.map +1 -0
- package/dist/alias/specifier-of.js +17 -0
- package/dist/alias/specifier-of.js.map +1 -0
- package/dist/alias/specifier-suffix.d.ts +6 -0
- package/dist/alias/specifier-suffix.d.ts.map +1 -0
- package/dist/alias/specifier-suffix.js +8 -0
- package/dist/alias/specifier-suffix.js.map +1 -0
- package/dist/alias/to-alias.d.ts +3 -2
- package/dist/alias/to-alias.d.ts.map +1 -1
- package/dist/alias/to-alias.js +4 -3
- package/dist/alias/to-alias.js.map +1 -1
- package/dist/build/emitted-place.d.ts +2 -0
- package/dist/build/emitted-place.d.ts.map +1 -1
- package/dist/build/emitted-specifier.d.ts +3 -2
- package/dist/build/emitted-specifier.d.ts.map +1 -1
- package/dist/build/emitted-specifier.js +6 -12
- package/dist/build/emitted-specifier.js.map +1 -1
- package/dist/build/emitted-target.d.ts +9 -0
- package/dist/build/emitted-target.d.ts.map +1 -0
- package/dist/build/emitted-target.js +18 -0
- package/dist/build/emitted-target.js.map +1 -0
- package/dist/build/rewrite-aliases.d.ts +5 -3
- package/dist/build/rewrite-aliases.d.ts.map +1 -1
- package/dist/build/rewrite-aliases.js +12 -7
- package/dist/build/rewrite-aliases.js.map +1 -1
- package/dist/build/rewrite-specifiers.d.ts +3 -1
- package/dist/build/rewrite-specifiers.d.ts.map +1 -1
- package/dist/build/rewrite-specifiers.js +2 -2
- package/dist/build/rewrite-specifiers.js.map +1 -1
- package/dist/build/unresolved-problem.d.ts +4 -0
- package/dist/build/unresolved-problem.d.ts.map +1 -0
- package/dist/build/unresolved-problem.js +16 -0
- package/dist/build/unresolved-problem.js.map +1 -0
- package/dist/check/alias/compiler-resolution.d.ts +10 -0
- package/dist/check/alias/compiler-resolution.d.ts.map +1 -0
- package/dist/check/alias/compiler-resolution.js +47 -0
- package/dist/check/alias/compiler-resolution.js.map +1 -0
- package/dist/check/alias/test-runners.js +4 -4
- package/dist/check/alias/test-runners.js.map +1 -1
- package/dist/check/canonical/roles.d.ts.map +1 -1
- package/dist/check/canonical/roles.js +6 -0
- package/dist/check/canonical/roles.js.map +1 -1
- package/dist/check/catalogue/architecture-rules.d.ts.map +1 -1
- package/dist/check/catalogue/architecture-rules.js +8 -0
- package/dist/check/catalogue/architecture-rules.js.map +1 -1
- package/dist/check/catalogue/eslint-only-rules.d.ts.map +1 -1
- package/dist/check/catalogue/eslint-only-rules.js +12 -0
- package/dist/check/catalogue/eslint-only-rules.js.map +1 -1
- package/dist/check/configuration/config-inspection.d.ts +2 -0
- package/dist/check/configuration/config-inspection.d.ts.map +1 -1
- package/dist/check/configuration/config-inspection.js +11 -1
- package/dist/check/configuration/config-inspection.js.map +1 -1
- package/dist/check/declarations/classes-of.js +1 -1
- package/dist/check/declarations/classes-of.js.map +1 -1
- package/dist/check/errors/builds-through-factories.d.ts +4 -0
- package/dist/check/errors/builds-through-factories.d.ts.map +1 -0
- package/dist/check/errors/builds-through-factories.js +5 -0
- package/dist/check/errors/builds-through-factories.js.map +1 -0
- package/dist/check/errors/error-code.d.ts +6 -0
- package/dist/check/errors/error-code.d.ts.map +1 -0
- package/dist/check/errors/error-code.js +2 -0
- package/dist/check/errors/error-code.js.map +1 -0
- package/dist/check/errors/error-codes.d.ts +8 -0
- package/dist/check/errors/error-codes.d.ts.map +1 -0
- package/dist/check/errors/error-codes.js +21 -0
- package/dist/check/errors/error-codes.js.map +1 -0
- package/dist/check/errors/kit-error-codes.d.ts +3 -0
- package/dist/check/errors/kit-error-codes.d.ts.map +1 -0
- package/dist/check/errors/kit-error-codes.js +17 -0
- package/dist/check/errors/kit-error-codes.js.map +1 -0
- package/dist/check/explain/context-docs.js +7 -7
- package/dist/check/explain/context-docs.js.map +1 -1
- package/dist/check/explain/errors-docs.d.ts +3 -0
- package/dist/check/explain/errors-docs.d.ts.map +1 -0
- package/dist/check/explain/errors-docs.js +30 -0
- package/dist/check/explain/errors-docs.js.map +1 -0
- package/dist/check/explain/imports-docs.d.ts.map +1 -1
- package/dist/check/explain/imports-docs.js +24 -9
- package/dist/check/explain/imports-docs.js.map +1 -1
- package/dist/check/explain/layer-docs.js +7 -7
- package/dist/check/explain/layer-docs.js.map +1 -1
- package/dist/check/explain/ports-docs.d.ts.map +1 -1
- package/dist/check/explain/ports-docs.js +15 -7
- package/dist/check/explain/ports-docs.js.map +1 -1
- package/dist/check/explain/rule-docs.d.ts.map +1 -1
- package/dist/check/explain/rule-docs.js +2 -0
- package/dist/check/explain/rule-docs.js.map +1 -1
- package/dist/check/explain/scheduling-docs.js +1 -1
- package/dist/check/explain/wiring-docs.d.ts.map +1 -1
- package/dist/check/explain/wiring-docs.js +35 -10
- package/dist/check/explain/wiring-docs.js.map +1 -1
- package/dist/check/fixtures/alias-declared-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/alias-declared-fixtures.js +32 -1
- package/dist/check/fixtures/alias-declared-fixtures.js.map +1 -1
- package/dist/check/fixtures/config-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/config-fixtures.js +6 -0
- package/dist/check/fixtures/config-fixtures.js.map +1 -1
- package/dist/check/fixtures/constructor-injection-fixtures.d.ts +3 -0
- package/dist/check/fixtures/constructor-injection-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/constructor-injection-fixtures.js +111 -0
- package/dist/check/fixtures/constructor-injection-fixtures.js.map +1 -0
- package/dist/check/fixtures/declared-project.d.ts.map +1 -1
- package/dist/check/fixtures/declared-project.js +4 -1
- package/dist/check/fixtures/declared-project.js.map +1 -1
- package/dist/check/fixtures/errors-fixtures.d.ts +3 -0
- package/dist/check/fixtures/errors-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/errors-fixtures.js +126 -0
- package/dist/check/fixtures/errors-fixtures.js.map +1 -0
- package/dist/check/fixtures/extension-fixtures.d.ts +3 -0
- package/dist/check/fixtures/extension-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/extension-fixtures.js +77 -0
- package/dist/check/fixtures/extension-fixtures.js.map +1 -0
- package/dist/check/fixtures/fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/fixtures.js +6 -0
- package/dist/check/fixtures/fixtures.js.map +1 -1
- package/dist/check/fixtures/signature-project.d.ts +11 -0
- package/dist/check/fixtures/signature-project.d.ts.map +1 -0
- package/dist/check/fixtures/signature-project.js +21 -0
- package/dist/check/fixtures/signature-project.js.map +1 -0
- package/dist/check/fixtures/signature.d.ts +13 -0
- package/dist/check/fixtures/signature.d.ts.map +1 -0
- package/dist/check/fixtures/signature.js +24 -0
- package/dist/check/fixtures/signature.js.map +1 -0
- package/dist/check/project/beside-the-sources.d.ts +5 -0
- package/dist/check/project/beside-the-sources.d.ts.map +1 -0
- package/dist/check/project/beside-the-sources.js +21 -0
- package/dist/check/project/beside-the-sources.js.map +1 -0
- package/dist/check/project/resolve-import.d.ts.map +1 -1
- package/dist/check/project/resolve-import.js +4 -1
- package/dist/check/project/resolve-import.js.map +1 -1
- package/dist/check/rules/clean-one-export-per-file.d.ts.map +1 -1
- package/dist/check/rules/clean-one-export-per-file.js +14 -8
- package/dist/check/rules/clean-one-export-per-file.js.map +1 -1
- package/dist/check/rules/config-valid.d.ts.map +1 -1
- package/dist/check/rules/config-valid.js +2 -1
- package/dist/check/rules/config-valid.js.map +1 -1
- package/dist/check/rules/declarations-barrel-current.d.ts.map +1 -1
- package/dist/check/rules/declarations-barrel-current.js +34 -32
- package/dist/check/rules/declarations-barrel-current.js.map +1 -1
- package/dist/check/rules/declarations-constructor-injection.d.ts +3 -0
- package/dist/check/rules/declarations-constructor-injection.d.ts.map +1 -0
- package/dist/check/rules/declarations-constructor-injection.js +58 -0
- package/dist/check/rules/declarations-constructor-injection.js.map +1 -0
- package/dist/check/rules/errors-code-unique.d.ts +3 -0
- package/dist/check/rules/errors-code-unique.d.ts.map +1 -0
- package/dist/check/rules/errors-code-unique.js +34 -0
- package/dist/check/rules/errors-code-unique.js.map +1 -0
- package/dist/check/rules/errors-known-code.d.ts +3 -0
- package/dist/check/rules/errors-known-code.d.ts.map +1 -0
- package/dist/check/rules/errors-known-code.js +51 -0
- package/dist/check/rules/errors-known-code.js.map +1 -0
- package/dist/check/rules/imports-alias-declared.d.ts.map +1 -1
- package/dist/check/rules/imports-alias-declared.js +3 -1
- package/dist/check/rules/imports-alias-declared.js.map +1 -1
- package/dist/check/rules/imports-alias-only.d.ts.map +1 -1
- package/dist/check/rules/imports-alias-only.js +16 -29
- package/dist/check/rules/imports-alias-only.js.map +1 -1
- package/dist/check/rules/imports-extension.d.ts +3 -0
- package/dist/check/rules/imports-extension.d.ts.map +1 -0
- package/dist/check/rules/imports-extension.js +65 -0
- package/dist/check/rules/imports-extension.js.map +1 -0
- package/dist/check/rules/language-glossary-term.d.ts.map +1 -1
- package/dist/check/rules/language-glossary-term.js +7 -5
- package/dist/check/rules/language-glossary-term.js.map +1 -1
- package/dist/check/rules/ports-no-concrete-dependency.d.ts.map +1 -1
- package/dist/check/rules/ports-no-concrete-dependency.js +43 -15
- package/dist/check/rules/ports-no-concrete-dependency.js.map +1 -1
- package/dist/check/rules/tree-closed.js +6 -4
- package/dist/check/rules/tree-closed.js.map +1 -1
- package/dist/commands/build-aliases.d.ts.map +1 -1
- package/dist/commands/build-aliases.js +5 -3
- package/dist/commands/build-aliases.js.map +1 -1
- package/dist/commands/docs.d.ts.map +1 -1
- package/dist/commands/docs.js +17 -2
- package/dist/commands/docs.js.map +1 -1
- package/dist/commands/error-factories.d.ts +7 -0
- package/dist/commands/error-factories.d.ts.map +1 -0
- package/dist/commands/error-factories.js +65 -0
- package/dist/commands/error-factories.js.map +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +6 -4
- package/dist/commands/init.js.map +1 -1
- package/dist/commit/is-derived.d.ts.map +1 -1
- package/dist/commit/is-derived.js +5 -2
- package/dist/commit/is-derived.js.map +1 -1
- package/dist/config/config.d.ts +2 -0
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/default-import-extension.d.ts +3 -0
- package/dist/config/default-import-extension.d.ts.map +1 -0
- package/dist/config/default-import-extension.js +3 -0
- package/dist/config/default-import-extension.js.map +1 -0
- package/dist/config/import-extensions.d.ts +3 -0
- package/dist/config/import-extensions.d.ts.map +1 -0
- package/dist/config/import-extensions.js +3 -0
- package/dist/config/import-extensions.js.map +1 -0
- package/dist/config/index.d.ts +4 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +4 -1
- package/dist/config/index.js.map +1 -1
- package/dist/config/parse-config.d.ts.map +1 -1
- package/dist/config/parse-config.js +2 -0
- package/dist/config/parse-config.js.map +1 -1
- package/dist/config/parse-stack.d.ts.map +1 -1
- package/dist/config/parse-stack.js +3 -1
- package/dist/config/parse-stack.js.map +1 -1
- package/dist/config/restack-config-text.d.ts +11 -0
- package/dist/config/restack-config-text.d.ts.map +1 -0
- package/dist/config/restack-config-text.js +31 -0
- package/dist/config/restack-config-text.js.map +1 -0
- package/dist/config/serialize-config.d.ts.map +1 -1
- package/dist/config/serialize-config.js +3 -6
- package/dist/config/serialize-config.js.map +1 -1
- package/dist/config/stack.d.ts +17 -0
- package/dist/config/stack.d.ts.map +1 -1
- package/dist/config/stack.js +2 -0
- package/dist/config/stack.js.map +1 -1
- package/dist/config/unwritten-import-extension.d.ts +3 -0
- package/dist/config/unwritten-import-extension.d.ts.map +1 -0
- package/dist/config/unwritten-import-extension.js +3 -0
- package/dist/config/unwritten-import-extension.js.map +1 -0
- package/dist/config/written-stack.d.ts +8 -0
- package/dist/config/written-stack.d.ts.map +1 -0
- package/dist/config/written-stack.js +10 -0
- package/dist/config/written-stack.js.map +1 -0
- package/dist/declared/declared-role.d.ts.map +1 -1
- package/dist/declared/declared-role.js +1 -0
- package/dist/declared/declared-role.js.map +1 -1
- package/dist/declared/dependencies-file.d.ts +7 -0
- package/dist/declared/dependencies-file.d.ts.map +1 -0
- package/dist/declared/dependencies-file.js +9 -0
- package/dist/declared/dependencies-file.js.map +1 -0
- package/dist/declared/generated-drift.d.ts +7 -0
- package/dist/declared/generated-drift.d.ts.map +1 -0
- package/dist/declared/generated-drift.js +47 -0
- package/dist/declared/generated-drift.js.map +1 -0
- package/dist/declared/index.d.ts +8 -1
- package/dist/declared/index.d.ts.map +1 -1
- package/dist/declared/index.js +6 -1
- package/dist/declared/index.js.map +1 -1
- package/dist/declared/injection/class-injection.d.ts +19 -0
- package/dist/declared/injection/class-injection.d.ts.map +1 -0
- package/dist/declared/injection/class-injection.js +2 -0
- package/dist/declared/injection/class-injection.js.map +1 -0
- package/dist/declared/injection/constructor-of.d.ts +16 -0
- package/dist/declared/injection/constructor-of.d.ts.map +1 -0
- package/dist/declared/injection/constructor-of.js +33 -0
- package/dist/declared/injection/constructor-of.js.map +1 -0
- package/dist/declared/injection/context-injections.d.ts +8 -0
- package/dist/declared/injection/context-injections.d.ts.map +1 -0
- package/dist/declared/injection/context-injections.js +14 -0
- package/dist/declared/injection/context-injections.js.map +1 -0
- package/dist/declared/injection/declared-kind-of.d.ts +8 -0
- package/dist/declared/injection/declared-kind-of.d.ts.map +1 -0
- package/dist/declared/injection/declared-kind-of.js +12 -0
- package/dist/declared/injection/declared-kind-of.js.map +1 -0
- package/dist/declared/injection/exported-name-of.d.ts +4 -0
- package/dist/declared/injection/exported-name-of.d.ts.map +1 -0
- package/dist/declared/injection/exported-name-of.js +17 -0
- package/dist/declared/injection/exported-name-of.js.map +1 -0
- package/dist/declared/injection/language-types.d.ts +3 -0
- package/dist/declared/injection/language-types.d.ts.map +1 -0
- package/dist/declared/injection/language-types.js +32 -0
- package/dist/declared/injection/language-types.js.map +1 -0
- package/dist/declared/injection/local-names.d.ts +17 -0
- package/dist/declared/injection/local-names.d.ts.map +1 -0
- package/dist/declared/injection/local-names.js +41 -0
- package/dist/declared/injection/local-names.js.map +1 -0
- package/dist/declared/injection/parameter-shape.d.ts +11 -0
- package/dist/declared/injection/parameter-shape.d.ts.map +1 -0
- package/dist/declared/injection/parameter-shape.js +58 -0
- package/dist/declared/injection/parameter-shape.js.map +1 -0
- package/dist/declared/injection/raw-class-name.d.ts +7 -0
- package/dist/declared/injection/raw-class-name.d.ts.map +1 -0
- package/dist/declared/injection/raw-class-name.js +28 -0
- package/dist/declared/injection/raw-class-name.js.map +1 -0
- package/dist/declared/injection/read-constructor.d.ts +10 -0
- package/dist/declared/injection/read-constructor.d.ts.map +1 -0
- package/dist/declared/injection/read-constructor.js +2 -0
- package/dist/declared/injection/read-constructor.js.map +1 -0
- package/dist/declared/injection/read-injections.d.ts +6 -0
- package/dist/declared/injection/read-injections.d.ts.map +1 -0
- package/dist/declared/injection/read-injections.js +75 -0
- package/dist/declared/injection/read-injections.js.map +1 -0
- package/dist/declared/injection/render-injections.d.ts +11 -0
- package/dist/declared/injection/render-injections.d.ts.map +1 -0
- package/dist/declared/injection/render-injections.js +51 -0
- package/dist/declared/injection/render-injections.js.map +1 -0
- package/dist/declared/injection/rendered-injections.d.ts +8 -0
- package/dist/declared/injection/rendered-injections.d.ts.map +1 -0
- package/dist/declared/injection/rendered-injections.js +2 -0
- package/dist/declared/injection/rendered-injections.js.map +1 -0
- package/dist/declared/injection/resolve-token.d.ts +18 -0
- package/dist/declared/injection/resolve-token.d.ts.map +1 -0
- package/dist/declared/injection/resolve-token.js +46 -0
- package/dist/declared/injection/resolve-token.js.map +1 -0
- package/dist/declared/injection/resolved-token.d.ts +10 -0
- package/dist/declared/injection/resolved-token.d.ts.map +1 -0
- package/dist/declared/injection/resolved-token.js +2 -0
- package/dist/declared/injection/resolved-token.js.map +1 -0
- package/dist/declared/injection/sources.d.ts +4 -0
- package/dist/declared/injection/sources.d.ts.map +1 -0
- package/dist/declared/injection/sources.js +2 -0
- package/dist/declared/injection/sources.js.map +1 -0
- package/dist/declared/injection/token-reference.d.ts +14 -0
- package/dist/declared/injection/token-reference.d.ts.map +1 -0
- package/dist/declared/injection/token-reference.js +2 -0
- package/dist/declared/injection/token-reference.js.map +1 -0
- package/dist/declared/render-barrel.d.ts +8 -5
- package/dist/declared/render-barrel.d.ts.map +1 -1
- package/dist/declared/render-barrel.js +13 -6
- package/dist/declared/render-barrel.js.map +1 -1
- package/dist/declared/render-dependencies-file.d.ts +8 -0
- package/dist/declared/render-dependencies-file.d.ts.map +1 -0
- package/dist/declared/render-dependencies-file.js +12 -0
- package/dist/declared/render-dependencies-file.js.map +1 -0
- package/dist/depcruise/hygiene-rules.js +2 -1
- package/dist/depcruise/hygiene-rules.js.map +1 -1
- package/dist/describe/context-description.d.ts +22 -0
- package/dist/describe/context-description.d.ts.map +1 -1
- package/dist/describe/describe-context.d.ts.map +1 -1
- package/dist/describe/describe-context.js +4 -0
- package/dist/describe/describe-context.js.map +1 -1
- package/dist/describe/format-description.d.ts.map +1 -1
- package/dist/describe/format-description.js +9 -0
- package/dist/describe/format-description.js.map +1 -1
- package/dist/describe/read-errors.d.ts +8 -0
- package/dist/describe/read-errors.d.ts.map +1 -0
- package/dist/describe/read-errors.js +52 -0
- package/dist/describe/read-errors.js.map +1 -0
- package/dist/describe/read-projections.d.ts +5 -0
- package/dist/describe/read-projections.d.ts.map +1 -0
- package/dist/describe/read-projections.js +19 -0
- package/dist/describe/read-projections.js.map +1 -0
- package/dist/describe/reference-lines.js +23 -1
- package/dist/describe/reference-lines.js.map +1 -1
- package/dist/dev/refresh-declarations.d.ts +9 -0
- package/dist/dev/refresh-declarations.d.ts.map +1 -0
- package/dist/dev/refresh-declarations.js +28 -0
- package/dist/dev/refresh-declarations.js.map +1 -0
- package/dist/generate/access-vars.js +3 -3
- package/dist/generate/access-vars.js.map +1 -1
- package/dist/generate/errors/add-factory.d.ts +13 -0
- package/dist/generate/errors/add-factory.d.ts.map +1 -0
- package/dist/generate/errors/add-factory.js +30 -0
- package/dist/generate/errors/add-factory.js.map +1 -0
- package/dist/generate/errors/add-spec-case.d.ts +6 -0
- package/dist/generate/errors/add-spec-case.d.ts.map +1 -0
- package/dist/generate/errors/add-spec-case.js +26 -0
- package/dist/generate/errors/add-spec-case.js.map +1 -0
- package/dist/generate/errors/class-body.d.ts +8 -0
- package/dist/generate/errors/class-body.d.ts.map +1 -0
- package/dist/generate/errors/class-body.js +11 -0
- package/dist/generate/errors/class-body.js.map +1 -0
- package/dist/generate/errors/codes-of-context.d.ts +4 -0
- package/dist/generate/errors/codes-of-context.d.ts.map +1 -0
- package/dist/generate/errors/codes-of-context.js +17 -0
- package/dist/generate/errors/codes-of-context.js.map +1 -0
- package/dist/generate/errors/refusal-code.d.ts +13 -0
- package/dist/generate/errors/refusal-code.d.ts.map +1 -0
- package/dist/generate/errors/refusal-code.js +19 -0
- package/dist/generate/errors/refusal-code.js.map +1 -0
- package/dist/generate/errors/refusal-name.d.ts +4 -0
- package/dist/generate/errors/refusal-name.d.ts.map +1 -0
- package/dist/generate/errors/refusal-name.js +15 -0
- package/dist/generate/errors/refusal-name.js.map +1 -0
- package/dist/generate/errors/static-methods.d.ts +10 -0
- package/dist/generate/errors/static-methods.d.ts.map +1 -0
- package/dist/generate/errors/static-methods.js +13 -0
- package/dist/generate/errors/static-methods.js.map +1 -0
- package/dist/generate/errors/vague-refusal-names.d.ts +3 -0
- package/dist/generate/errors/vague-refusal-names.d.ts.map +1 -0
- package/dist/generate/errors/vague-refusal-names.js +15 -0
- package/dist/generate/errors/vague-refusal-names.js.map +1 -0
- package/dist/generate/kinds/context-plan.d.ts +10 -0
- package/dist/generate/kinds/context-plan.d.ts.map +1 -0
- package/dist/generate/kinds/context-plan.js +2 -0
- package/dist/generate/kinds/context-plan.js.map +1 -0
- package/dist/generate/kinds/declare-context-entries.d.ts +3 -1
- package/dist/generate/kinds/declare-context-entries.d.ts.map +1 -1
- package/dist/generate/kinds/declare-context-entries.js +4 -2
- package/dist/generate/kinds/declare-context-entries.js.map +1 -1
- package/dist/generate/kinds/domain-error-kind.d.ts.map +1 -1
- package/dist/generate/kinds/domain-error-kind.js +4 -1
- package/dist/generate/kinds/domain-error-kind.js.map +1 -1
- package/dist/generate/kinds/error-kind.d.ts +3 -0
- package/dist/generate/kinds/error-kind.d.ts.map +1 -0
- package/dist/generate/kinds/error-kind.js +75 -0
- package/dist/generate/kinds/error-kind.js.map +1 -0
- package/dist/generate/kinds/extraction/service-selection.js +8 -11
- package/dist/generate/kinds/extraction/service-selection.js.map +1 -1
- package/dist/generate/kinds/job/job-vars.d.ts.map +1 -1
- package/dist/generate/kinds/job/job-vars.js +5 -3
- package/dist/generate/kinds/job/job-vars.js.map +1 -1
- package/dist/generate/kinds/plan-vars.d.ts +5 -0
- package/dist/generate/kinds/plan-vars.d.ts.map +1 -0
- package/dist/generate/kinds/plan-vars.js +24 -0
- package/dist/generate/kinds/plan-vars.js.map +1 -0
- package/dist/generate/kinds/projection-kind.d.ts +3 -0
- package/dist/generate/kinds/projection-kind.d.ts.map +1 -0
- package/dist/generate/kinds/projection-kind.js +72 -0
- package/dist/generate/kinds/projection-kind.js.map +1 -0
- package/dist/generate/kinds/publish-in-index.js +2 -2
- package/dist/generate/kinds/publish-in-index.js.map +1 -1
- package/dist/generate/kinds/route/route-vars.d.ts.map +1 -1
- package/dist/generate/kinds/route/route-vars.js +7 -6
- package/dist/generate/kinds/route/route-vars.js.map +1 -1
- package/dist/generate/kinds/wire-context.d.ts +10 -0
- package/dist/generate/kinds/wire-context.d.ts.map +1 -0
- package/dist/generate/kinds/wire-context.js +36 -0
- package/dist/generate/kinds/wire-context.js.map +1 -0
- package/dist/generate/kinds/write-context-files.d.ts +1 -8
- package/dist/generate/kinds/write-context-files.d.ts.map +1 -1
- package/dist/generate/kinds/write-context-files.js +3 -40
- package/dist/generate/kinds/write-context-files.js.map +1 -1
- package/dist/generate/kinds.d.ts.map +1 -1
- package/dist/generate/kinds.js +4 -0
- package/dist/generate/kinds.js.map +1 -1
- package/dist/generate/refresh-barrels.d.ts +4 -3
- package/dist/generate/refresh-barrels.d.ts.map +1 -1
- package/dist/generate/refresh-barrels.js +41 -16
- package/dist/generate/refresh-barrels.js.map +1 -1
- package/dist/generate/spec-vars.js +4 -4
- package/dist/generate/spec-vars.js.map +1 -1
- package/dist/generate/storage-vars.d.ts +2 -2
- package/dist/generate/storage-vars.d.ts.map +1 -1
- package/dist/generate/storage-vars.js +6 -10
- package/dist/generate/storage-vars.js.map +1 -1
- package/dist/generate/workspace-sources.d.ts +6 -0
- package/dist/generate/workspace-sources.d.ts.map +1 -0
- package/dist/generate/workspace-sources.js +13 -0
- package/dist/generate/workspace-sources.js.map +1 -0
- package/dist/init/manifest/scripts-for.js +6 -1
- package/dist/init/manifest/scripts-for.js.map +1 -1
- package/dist/init/manifest/versions.js +23 -23
- package/dist/init/run-init.d.ts.map +1 -1
- package/dist/init/run-init.js +32 -3
- package/dist/init/run-init.js.map +1 -1
- package/dist/init/stack/recorded-options.d.ts +11 -0
- package/dist/init/stack/recorded-options.d.ts.map +1 -0
- package/dist/init/stack/recorded-options.js +19 -0
- package/dist/init/stack/recorded-options.js.map +1 -0
- package/dist/init/stack/resolve-stack.d.ts +6 -1
- package/dist/init/stack/resolve-stack.d.ts.map +1 -1
- package/dist/init/stack/resolve-stack.js +48 -9
- package/dist/init/stack/resolve-stack.js.map +1 -1
- package/dist/init/stack/resolve-style.d.ts +3 -5
- package/dist/init/stack/resolve-style.d.ts.map +1 -1
- package/dist/init/stack/resolve-style.js +11 -3
- package/dist/init/stack/resolve-style.js.map +1 -1
- package/dist/init/stack/stack-options.d.ts +4 -0
- package/dist/init/stack/stack-options.d.ts.map +1 -1
- package/dist/init/write-agent-settings.js +4 -3
- package/dist/init/write-agent-settings.js.map +1 -1
- package/dist/init/write-type-script-configs.d.ts +2 -1
- package/dist/init/write-type-script-configs.d.ts.map +1 -1
- package/dist/init/write-type-script-configs.js +4 -4
- package/dist/init/write-type-script-configs.js.map +1 -1
- package/dist/refresh-declarations.d.ts +3 -0
- package/dist/refresh-declarations.d.ts.map +1 -0
- package/dist/refresh-declarations.js +4 -0
- package/dist/refresh-declarations.js.map +1 -0
- package/dist/refusals/apply-plan.d.ts +17 -0
- package/dist/refusals/apply-plan.d.ts.map +1 -0
- package/dist/refusals/apply-plan.js +118 -0
- package/dist/refusals/apply-plan.js.map +1 -0
- package/dist/refusals/factory-name-for.d.ts +7 -0
- package/dist/refusals/factory-name-for.d.ts.map +1 -0
- package/dist/refusals/factory-name-for.js +16 -0
- package/dist/refusals/factory-name-for.js.map +1 -0
- package/dist/refusals/legacy-error.d.ts +21 -0
- package/dist/refusals/legacy-error.d.ts.map +1 -0
- package/dist/refusals/legacy-error.js +2 -0
- package/dist/refusals/legacy-error.js.map +1 -0
- package/dist/refusals/legacy-errors.d.ts +6 -0
- package/dist/refusals/legacy-errors.d.ts.map +1 -0
- package/dist/refusals/legacy-errors.js +16 -0
- package/dist/refusals/legacy-errors.js.map +1 -0
- package/dist/refusals/migration-draft.d.ts +15 -0
- package/dist/refusals/migration-draft.d.ts.map +1 -0
- package/dist/refusals/migration-draft.js +41 -0
- package/dist/refusals/migration-draft.js.map +1 -0
- package/dist/refusals/migration-plan.d.ts +6 -0
- package/dist/refusals/migration-plan.d.ts.map +1 -0
- package/dist/refusals/migration-plan.js +2 -0
- package/dist/refusals/migration-plan.js.map +1 -0
- package/dist/refusals/move.d.ts +15 -0
- package/dist/refusals/move.d.ts.map +1 -0
- package/dist/refusals/move.js +2 -0
- package/dist/refusals/move.js.map +1 -0
- package/dist/refusals/nested-cases.d.ts +3 -0
- package/dist/refusals/nested-cases.d.ts.map +1 -0
- package/dist/refusals/nested-cases.js +9 -0
- package/dist/refusals/nested-cases.js.map +1 -0
- package/dist/refusals/plan-file.d.ts +3 -0
- package/dist/refusals/plan-file.d.ts.map +1 -0
- package/dist/refusals/plan-file.js +3 -0
- package/dist/refusals/plan-file.js.map +1 -0
- package/dist/refusals/planned-factory.d.ts +11 -0
- package/dist/refusals/planned-factory.d.ts.map +1 -0
- package/dist/refusals/planned-factory.js +2 -0
- package/dist/refusals/planned-factory.js.map +1 -0
- package/dist/refusals/planned-move.d.ts +8 -0
- package/dist/refusals/planned-move.d.ts.map +1 -0
- package/dist/refusals/planned-move.js +2 -0
- package/dist/refusals/planned-move.js.map +1 -0
- package/dist/refusals/project-sources.d.ts +5 -0
- package/dist/refusals/project-sources.d.ts.map +1 -0
- package/dist/refusals/project-sources.js +13 -0
- package/dist/refusals/project-sources.js.map +1 -0
- package/dist/refusals/propose-plan.d.ts +16 -0
- package/dist/refusals/propose-plan.d.ts.map +1 -0
- package/dist/refusals/propose-plan.js +39 -0
- package/dist/refusals/propose-plan.js.map +1 -0
- package/dist/refusals/read-legacy-error.d.ts +9 -0
- package/dist/refusals/read-legacy-error.d.ts.map +1 -0
- package/dist/refusals/read-legacy-error.js +75 -0
- package/dist/refusals/read-legacy-error.js.map +1 -0
- package/dist/refusals/read-plan.d.ts +4 -0
- package/dist/refusals/read-plan.d.ts.map +1 -0
- package/dist/refusals/read-plan.js +43 -0
- package/dist/refusals/read-plan.js.map +1 -0
- package/dist/refusals/render-factory.d.ts +5 -0
- package/dist/refusals/render-factory.d.ts.map +1 -0
- package/dist/refusals/render-factory.js +14 -0
- package/dist/refusals/render-factory.js.map +1 -0
- package/dist/refusals/replace-in-code.d.ts +16 -0
- package/dist/refusals/replace-in-code.d.ts.map +1 -0
- package/dist/refusals/replace-in-code.js +20 -0
- package/dist/refusals/replace-in-code.js.map +1 -0
- package/dist/refusals/rewrite-usages.d.ts +6 -0
- package/dist/refusals/rewrite-usages.d.ts.map +1 -0
- package/dist/refusals/rewrite-usages.js +80 -0
- package/dist/refusals/rewrite-usages.js.map +1 -0
- package/dist/refusals/spec-parts.d.ts +8 -0
- package/dist/refusals/spec-parts.d.ts.map +1 -0
- package/dist/refusals/spec-parts.js +14 -0
- package/dist/refusals/spec-parts.js.map +1 -0
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +8 -0
- package/dist/run.js.map +1 -1
- package/dist/stack/alias-vars.d.ts +2 -1
- package/dist/stack/alias-vars.d.ts.map +1 -1
- package/dist/stack/alias-vars.js +6 -3
- package/dist/stack/alias-vars.js.map +1 -1
- package/dist/stack/stack-vars.d.ts.map +1 -1
- package/dist/stack/stack-vars.js +2 -1
- package/dist/stack/stack-vars.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -3
- package/templates/acl/translator.spec.ts.tpl +1 -1
- package/templates/adapter/adapter.declared.ts.tpl +3 -3
- package/templates/adapter/adapter.spec.ts.tpl +1 -1
- package/templates/adapter/adapter.ts.tpl +1 -1
- package/templates/adapter/wiring.tsyringe.tpl +3 -3
- package/templates/aggregate/aggregate.spec.ts.tpl +2 -2
- package/templates/aggregate/aggregate.ts.tpl +5 -0
- package/templates/architecture/extractable.declared.spec.ts.tpl +1 -1
- package/templates/architecture/extractable.manual.spec.ts.tpl +4 -4
- package/templates/architecture/extractable.tsyringe.spec.ts.tpl +1 -1
- package/templates/architecture/wiring.declared.tpl +1 -1
- package/templates/architecture/wiring.manual.tpl +1 -1
- package/templates/architecture/wiring.tsyringe.tpl +1 -1
- package/templates/builder/builder.ts.tpl +1 -1
- package/templates/command/handler.declared.ts.tpl +12 -7
- package/templates/command/handler.spec.buses.ts.tpl +4 -4
- package/templates/command/handler.spec.tsyringe.ts.tpl +5 -5
- package/templates/command/handler.ts.tpl +9 -4
- package/templates/command/wiring.manual.tpl +2 -2
- package/templates/command/wiring.tsyringe.tpl +3 -3
- package/templates/context/module.manual.ts.tpl +1 -1
- package/templates/context/permission-set.tpl +1 -1
- package/templates/context/permissions.spec.ts.tpl +1 -1
- package/templates/context/routes.spec.ts.tpl +1 -1
- package/templates/context/wiring.declared.tpl +2 -2
- package/templates/context/wiring.manual.tpl +1 -1
- package/templates/context/wiring.tsyringe.tpl +2 -2
- package/templates/docs/openapi.json.tpl +5 -0
- package/templates/domain-error/domain-error.spec.ts.tpl +1 -1
- package/templates/domain-event/domain-event.spec.ts.tpl +1 -1
- package/templates/domain-service/domain-service.spec.ts.tpl +1 -1
- package/templates/e2e/e2e.spec.ts.tpl +2 -2
- package/templates/entity/entity.spec.ts.tpl +1 -1
- package/templates/entity/entity.ts.tpl +5 -0
- package/templates/error/case.spec.ts.tpl +8 -0
- package/templates/error/concept-error.spec.ts.tpl +7 -0
- package/templates/error/concept-error.ts.tpl +5 -0
- package/templates/error/factory.ts.tpl +4 -0
- package/templates/event-handler/event-handler.declared.ts.tpl +3 -3
- package/templates/event-handler/event-handler.spec.ts.tpl +2 -2
- package/templates/event-handler/event-handler.ts.tpl +1 -1
- package/templates/event-handler/wiring.manual.tpl +2 -2
- package/templates/event-handler/wiring.tsyringe.tpl +2 -2
- package/templates/gateway/adapter.declared.ts.tpl +3 -3
- package/templates/gateway/adapter.ts.tpl +2 -2
- package/templates/gateway/contract.spec.ts.tpl +3 -3
- package/templates/gateway/fake.ts.tpl +1 -1
- package/templates/gateway/platform-test.declared.tpl +1 -1
- package/templates/gateway/platform.declared.tpl +1 -1
- package/templates/gateway/wiring.tsyringe.tpl +3 -3
- package/templates/init/CLAUDE.md.tpl +5 -2
- package/templates/init/README.md.tpl +15 -10
- package/templates/init/e2e/create-credentials.jwt.ts.tpl +1 -1
- package/templates/init/e2e/create-credentials.keycloak.ts.tpl +1 -1
- package/templates/init/e2e/create-credentials.none.ts.tpl +2 -2
- package/templates/init/e2e/start-application.database.ts.tpl +16 -16
- package/templates/init/e2e/start-application.memory.ts.tpl +16 -16
- package/templates/init/e2e/test-environment.ts.tpl +1 -1
- package/templates/init/jest.config.js.tpl +7 -0
- package/templates/init/main.ts.tpl +11 -11
- package/templates/init/platform/audit/audit.module.manual.ts.tpl +5 -5
- package/templates/init/platform/audit/audit.module.tsyringe.ts.tpl +4 -4
- package/templates/init/platform/audit/create-audit.ts.tpl +5 -5
- package/templates/init/platform/audit/search-audit-entries.handler.ts.tpl +1 -1
- package/templates/init/platform/audit/search-audit-entries.route.ts.tpl +1 -1
- package/templates/init/platform/auth/authorization.tsyringe.ts.tpl +2 -2
- package/templates/init/platform/auth/create-authenticator.jwt.ts.tpl +1 -1
- package/templates/init/platform/auth/create-authenticator.keycloak.ts.tpl +1 -1
- package/templates/init/platform/auth/create-authenticator.none.ts.tpl +2 -2
- package/templates/init/platform/auth/create-authorizer.abac.ts.tpl +1 -1
- package/templates/init/platform/auth/create-authorizer.custom.ts.tpl +2 -2
- package/templates/init/platform/auth/create-authorizer.rbac.ts.tpl +1 -1
- package/templates/init/platform/auth/create-authorizer.rebac.ts.tpl +3 -3
- package/templates/init/platform/auth/create-tuple-store.contract.spec.ts.tpl +1 -1
- package/templates/init/platform/auth/custom-authorizer.contract.spec.ts.tpl +1 -1
- package/templates/init/platform/auth/http-boundary.ts.tpl +1 -1
- package/templates/init/platform/auth/permission-mapping.ts.tpl +1 -1
- package/templates/init/platform/auth/permissions.ts.tpl +1 -1
- package/templates/init/platform/auth/principal-of.none.ts.tpl +1 -1
- package/templates/init/platform/auth/relate-system-actors.ts.tpl +1 -1
- package/templates/init/platform/auth/relation-tuples.ts.tpl +2 -2
- package/templates/init/platform/auth/security-schemes.none.ts.tpl +1 -1
- package/templates/init/platform/buses/create-command-bus.ts.tpl +2 -2
- package/templates/init/platform/buses/create-query-bus.ts.tpl +1 -1
- package/templates/init/platform/compose-application.manual.ts.tpl +6 -6
- package/templates/init/platform/compose-application.tsyringe.ts.tpl +10 -10
- package/templates/init/platform/config/app-config.ts.tpl +2 -2
- package/templates/init/platform/config/load-config.ts.tpl +3 -3
- package/templates/init/platform/create-platform.manual.ts.tpl +16 -16
- package/templates/init/platform/database/create-client.prisma.ts.tpl +1 -1
- package/templates/init/platform/database/create-data-source.typeorm.ts.tpl +1 -1
- package/templates/init/platform/database/data-source.typeorm.ts.tpl +1 -1
- package/templates/init/platform/database/database.drizzle.ts.tpl +1 -1
- package/templates/init/platform/database/database.prisma.ts.tpl +2 -2
- package/templates/init/platform/database/inert-persistence.memory.ts.tpl +2 -2
- package/templates/init/platform/database/inert-persistence.pooled.ts.tpl +2 -2
- package/templates/init/platform/database/inert-persistence.prisma.ts.tpl +3 -3
- package/templates/init/platform/database/inert-persistence.typeorm.ts.tpl +3 -3
- package/templates/init/platform/database/open-persistence.contract.spec.ts.tpl +1 -1
- package/templates/init/platform/database/open-persistence.memory.ts.tpl +1 -1
- package/templates/init/platform/database/open-persistence.pooled.ts.tpl +3 -3
- package/templates/init/platform/database/open-persistence.prisma.ts.tpl +3 -3
- package/templates/init/platform/database/open-persistence.typeorm.ts.tpl +3 -3
- package/templates/init/platform/database/open-test-database.drizzle.ts.tpl +4 -4
- package/templates/init/platform/database/open-test-database.knex.ts.tpl +5 -5
- package/templates/init/platform/database/open-test-database.prisma.ts.tpl +4 -4
- package/templates/init/platform/database/open-test-database.typeorm.ts.tpl +3 -3
- package/templates/init/platform/database/persistence-over.drizzle.ts.tpl +2 -2
- package/templates/init/platform/database/persistence-over.knex.ts.tpl +2 -2
- package/templates/init/platform/database/persistence-over.prisma.ts.tpl +2 -2
- package/templates/init/platform/database/persistence-over.typeorm.ts.tpl +2 -2
- package/templates/init/platform/database/persistence.orm.ts.tpl +1 -1
- package/templates/init/platform/errors.ts.tpl +1 -1
- package/templates/init/platform/events/create-event-provider.custom.ts.tpl +2 -2
- package/templates/init/platform/events/create-event-provider.kafka.ts.tpl +3 -3
- package/templates/init/platform/events/create-event-provider.nats.ts.tpl +2 -2
- package/templates/init/platform/events/create-event-provider.rabbitmq.ts.tpl +2 -2
- package/templates/init/platform/events/create-event-provider.redis.ts.tpl +2 -2
- package/templates/init/platform/events/custom-event-bus.contract.spec.ts.tpl +1 -1
- package/templates/init/platform/events/in-process-events.ts.tpl +1 -1
- package/templates/init/platform/events/start-outbox-relay.ts.tpl +1 -1
- package/templates/init/platform/http/create-app-module.ts.tpl +1 -1
- package/templates/init/platform/http/start-http-server.express.ts.tpl +4 -4
- package/templates/init/platform/http/start-http-server.fastify.ts.tpl +4 -4
- package/templates/init/platform/http/start-http-server.nest.ts.tpl +5 -5
- package/templates/init/platform/http/with-documentation.ts.tpl +2 -2
- package/templates/init/platform/lay-foundations.tsyringe.ts.tpl +5 -5
- package/templates/init/platform/platform-test.module.tsyringe.ts.tpl +1 -1
- package/templates/init/platform/platform.manual.ts.tpl +3 -3
- package/templates/init/platform/platform.module.tsyringe.ts.tpl +8 -8
- package/templates/init/platform/resilience/adapter-aspects.ts.tpl +2 -2
- package/templates/init/platform/resilience/default-resilience.ts.tpl +1 -1
- package/templates/init/platform/resilience/own-policy.ts.tpl +1 -1
- package/templates/init/platform/tracing.ts.tpl +2 -2
- package/templates/init/rules/application.md.tpl +8 -2
- package/templates/init/rules/domain.md.tpl +11 -0
- package/templates/init/rules/infrastructure.md.tpl +3 -3
- package/templates/init/rules/presentation.md.tpl +5 -0
- package/templates/init/scripts/openapi.ts.tpl +5 -5
- package/templates/integration-event/audited.tpl +1 -1
- package/templates/integration-event/integration-event.class-validator.ts.tpl +1 -1
- package/templates/integration-event/integration-event.custom.ts.tpl +1 -1
- package/templates/integration-event/publisher.declared.ts.tpl +4 -4
- package/templates/integration-event/publisher.spec.ts.tpl +2 -2
- package/templates/integration-event/publisher.ts.tpl +2 -2
- package/templates/integration-event/wiring.manual.tpl +2 -2
- package/templates/integration-event/wiring.tsyringe.tpl +2 -2
- package/templates/integration-handler/integration-handler.declared.ts.tpl +3 -3
- package/templates/integration-handler/integration-handler.spec.ts.tpl +2 -2
- package/templates/integration-handler/integration-handler.ts.tpl +1 -1
- package/templates/integration-handler/wiring.manual.tpl +3 -3
- package/templates/integration-handler/wiring.tsyringe.tpl +2 -2
- package/templates/job/job.declared.ts.tpl +3 -3
- package/templates/job/job.spec.buses.ts.tpl +2 -2
- package/templates/job/job.spec.tsyringe.ts.tpl +2 -2
- package/templates/job/job.ts.tpl +1 -1
- package/templates/job/wiring.manual.tpl +1 -1
- package/templates/job/wiring.tsyringe.tpl +1 -1
- package/templates/pipeline/package-scripts.json +1 -1
- package/templates/policy/policy.declared.ts.tpl +1 -1
- package/templates/policy/policy.spec.declared.ts.tpl +1 -1
- package/templates/policy/policy.spec.ts.tpl +1 -1
- package/templates/policy/policy.ts.tpl +1 -1
- package/templates/policy/registration.tpl +1 -1
- package/templates/port/fake.ts.tpl +1 -1
- package/templates/projection/projection.spec.ts.tpl +17 -0
- package/templates/projection/projection.ts.tpl +11 -0
- package/templates/query/handler.declared.ts.tpl +4 -4
- package/templates/query/handler.spec.buses.ts.tpl +5 -5
- package/templates/query/handler.spec.tsyringe.ts.tpl +6 -6
- package/templates/query/handler.ts.tpl +3 -3
- package/templates/query/query.ts.tpl +1 -1
- package/templates/query/reader.fake.ts.tpl +2 -2
- package/templates/query/reader.in-memory.ts.tpl +4 -4
- package/templates/query/reader.port.ts.tpl +2 -2
- package/templates/query/search.handler.declared.ts.tpl +6 -6
- package/templates/query/search.handler.spec.buses.ts.tpl +5 -5
- package/templates/query/search.handler.spec.tsyringe.ts.tpl +6 -6
- package/templates/query/search.handler.ts.tpl +4 -4
- package/templates/query/search.query.ts.tpl +1 -1
- package/templates/query/search.reader.fake.ts.tpl +2 -2
- package/templates/query/search.reader.in-memory.ts.tpl +3 -3
- package/templates/query/search.reader.port.ts.tpl +1 -1
- package/templates/query/search.reader.spec.ts.tpl +2 -2
- package/templates/query/search.wiring.manual.tpl +3 -3
- package/templates/query/search.wiring.tsyringe.tpl +4 -4
- package/templates/query/wiring.manual.tpl +3 -3
- package/templates/query/wiring.tsyringe.tpl +4 -4
- package/templates/repository/contract.spec.ts.tpl +5 -5
- package/templates/repository/drizzle/mapper.ts.tpl +2 -2
- package/templates/repository/drizzle/repository.ts.tpl +9 -17
- package/templates/repository/drizzle/schema-export.tpl +1 -1
- package/templates/repository/fake.ts.tpl +2 -2
- package/templates/repository/knex/mapper.ts.tpl +2 -2
- package/templates/repository/knex/repository.ts.tpl +10 -30
- package/templates/repository/knex/schema-export.tpl +1 -1
- package/templates/repository/knex/tables.ts.tpl +1 -1
- package/templates/repository/none/repository.ts.tpl +3 -3
- package/templates/repository/prisma/mapper.ts.tpl +2 -2
- package/templates/repository/prisma/repository.ts.tpl +6 -9
- package/templates/repository/repository.ts.tpl +1 -1
- package/templates/repository/typeorm/mapper.ts.tpl +2 -2
- package/templates/repository/typeorm/repository.ts.tpl +9 -12
- package/templates/repository/typeorm/schema-export.tpl +1 -1
- package/templates/repository/typeorm/table.tpl +1 -1
- package/templates/repository/wiring.manual.tpl +1 -1
- package/templates/repository/wiring.tsyringe.tpl +2 -2
- package/templates/route/route.class-validator.ts.tpl +1 -1
- package/templates/route/route.none.ts.tpl +1 -1
- package/templates/route/route.search.ts.tpl +2 -2
- package/templates/route/route.spec.ts.tpl +1 -1
- package/templates/route/route.standard-schema.ts.tpl +1 -1
- package/templates/route/route.zod.ts.tpl +1 -1
- package/templates/route/routes.on-tsyringe.tpl +1 -1
- package/templates/route/wiring.manual.tpl +1 -1
- package/templates/service/main.ts.tpl +11 -11
- package/templates/value-object/value-object.spec.ts.tpl +1 -1
- package/templates/value-object/value-object.ts.tpl +5 -0
- package/templates/worker/main.ts.tpl +9 -9
- package/dist/alias/platform-alias.d.ts +0 -4
- package/dist/alias/platform-alias.d.ts.map +0 -1
- package/dist/alias/platform-alias.js +0 -7
- package/dist/alias/platform-alias.js.map +0 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { readLegacyError } from './read-legacy-error.js';
|
|
2
|
+
/** Every class per error of the `domain/errors/` of every context, in the order of their files. */
|
|
3
|
+
export function legacyErrors(ws, config) {
|
|
4
|
+
return Object.keys(config.contexts).flatMap((context) => {
|
|
5
|
+
const directory = `${config.contextsDir}/${context}/domain/errors`;
|
|
6
|
+
return ws
|
|
7
|
+
.list(directory)
|
|
8
|
+
.filter((name) => name.endsWith('.error.ts'))
|
|
9
|
+
.flatMap((name) => {
|
|
10
|
+
const file = `${directory}/${name}`;
|
|
11
|
+
const read = readLegacyError(ws.read(file) ?? '', { file, context });
|
|
12
|
+
return read === undefined ? [] : [read];
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=legacy-errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-errors.js","sourceRoot":"","sources":["../../src/refusals/legacy-errors.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,mGAAmG;AACnG,MAAM,UAAU,YAAY,CAAC,EAAa,EAAE,MAAc;IACxD,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QACtD,MAAM,SAAS,GAAG,GAAG,MAAM,CAAC,WAAW,IAAI,OAAO,gBAAgB,CAAC;QAEnE,OAAO,EAAE;aACN,IAAI,CAAC,SAAS,CAAC;aACf,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;aAC5C,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YAChB,MAAM,IAAI,GAAG,GAAG,SAAS,IAAI,IAAI,EAAE,CAAC;YACpC,MAAM,IAAI,GAAG,eAAe,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;YAErE,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAC1C,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Workspace } from '../workspace/index.js';
|
|
2
|
+
/** The files a migration writes and removes, kept in memory until it is committed: a dry run commits nothing. */
|
|
3
|
+
export declare class MigrationDraft {
|
|
4
|
+
private readonly ws;
|
|
5
|
+
readonly manual: string[];
|
|
6
|
+
private readonly files;
|
|
7
|
+
constructor(ws: Workspace);
|
|
8
|
+
read(file: string): string | undefined;
|
|
9
|
+
write(file: string, content: string): void;
|
|
10
|
+
remove(file: string): void;
|
|
11
|
+
get written(): string[];
|
|
12
|
+
get removed(): string[];
|
|
13
|
+
commit(): void;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=migration-draft.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migration-draft.d.ts","sourceRoot":"","sources":["../../src/refusals/migration-draft.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,iHAAiH;AACjH,qBAAa,cAAc;IAKb,OAAO,CAAC,QAAQ,CAAC,EAAE;IAJ/B,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,CAAM;IAE/B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAyC;IAE/D,YAA6B,EAAE,EAAE,SAAS,EAAI;IAE9C,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAErC;IAED,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAIzC;IAED,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAEzB;IAED,IAAI,OAAO,IAAI,MAAM,EAAE,CAEtB;IAED,IAAI,OAAO,IAAI,MAAM,EAAE,CAEtB;IAED,MAAM,IAAI,IAAI,CAWb;CACF"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
/** The files a migration writes and removes, kept in memory until it is committed: a dry run commits nothing. */
|
|
4
|
+
export class MigrationDraft {
|
|
5
|
+
ws;
|
|
6
|
+
manual = [];
|
|
7
|
+
files = new Map();
|
|
8
|
+
constructor(ws) {
|
|
9
|
+
this.ws = ws;
|
|
10
|
+
}
|
|
11
|
+
read(file) {
|
|
12
|
+
return this.files.has(file) ? this.files.get(file) : this.ws.read(file);
|
|
13
|
+
}
|
|
14
|
+
write(file, content) {
|
|
15
|
+
if (this.read(file) !== content) {
|
|
16
|
+
this.files.set(file, content);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
remove(file) {
|
|
20
|
+
this.files.set(file, undefined);
|
|
21
|
+
}
|
|
22
|
+
get written() {
|
|
23
|
+
return [...this.files].filter(([, content]) => content !== undefined).map(([file]) => file);
|
|
24
|
+
}
|
|
25
|
+
get removed() {
|
|
26
|
+
return [...this.files].filter(([, content]) => content === undefined).map(([file]) => file);
|
|
27
|
+
}
|
|
28
|
+
commit() {
|
|
29
|
+
for (const [file, content] of this.files) {
|
|
30
|
+
const target = path.join(this.ws.root, file);
|
|
31
|
+
if (content === undefined) {
|
|
32
|
+
fs.rmSync(target, { force: true });
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
fs.mkdirSync(path.dirname(target), { recursive: true });
|
|
36
|
+
fs.writeFileSync(target, content);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=migration-draft.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migration-draft.js","sourceRoot":"","sources":["../../src/refusals/migration-draft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CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;IAC9F,CAAC;IAED,MAAM;QACJ,KAAK,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACzC,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAE7C,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;gBAC1B,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YACrC,CAAC;iBAAM,CAAC;gBACN,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;gBACxD,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YACpC,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { PlannedFactory } from './planned-factory.js';
|
|
2
|
+
/** What `error-factories --plan` proposes and `--apply` follows: per context, where each class per error goes. */
|
|
3
|
+
export interface MigrationPlan {
|
|
4
|
+
readonly contexts: Readonly<Record<string, readonly PlannedFactory[]>>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=migration-plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migration-plan.d.ts","sourceRoot":"","sources":["../../src/refusals/migration-plan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,kHAAkH;AAClH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,cAAc,EAAE,CAAC,CAAC,CAAC;CACxE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migration-plan.js","sourceRoot":"","sources":["../../src/refusals/migration-plan.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** One class per error on its way to a factory: what replaces it wherever it is named. */
|
|
2
|
+
export interface Move {
|
|
3
|
+
/** The class that disappears, for example `SlotTakenError`. */
|
|
4
|
+
readonly className: string;
|
|
5
|
+
/** The error class of the concept, for example `AppointmentError`. */
|
|
6
|
+
readonly conceptClass: string;
|
|
7
|
+
/** The file name of that class without its extension, for example `appointment.error`. */
|
|
8
|
+
readonly conceptFile: string;
|
|
9
|
+
readonly factory: string;
|
|
10
|
+
/** The context the class belongs to, and the path of its file from the contexts directory, without extension. */
|
|
11
|
+
readonly context: string;
|
|
12
|
+
readonly legacyPath: string;
|
|
13
|
+
readonly code: string;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=move.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"move.d.ts","sourceRoot":"","sources":["../../src/refusals/move.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,MAAM,WAAW,IAAI;IACnB,+DAA+D;IAC/D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,sEAAsE;IACtE,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,0FAA0F;IAC1F,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,iHAAiH;IACjH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"move.js","sourceRoot":"","sources":["../../src/refusals/move.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nested-cases.d.ts","sourceRoot":"","sources":["../../src/refusals/nested-cases.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAOlE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** The cases of one factory, under a `describe` of its name, one level deeper. */
|
|
2
|
+
export function nestedCases(factory, cases) {
|
|
3
|
+
const deeper = cases
|
|
4
|
+
.split('\n')
|
|
5
|
+
.map((line) => (line === '' ? line : ` ${line}`))
|
|
6
|
+
.join('\n');
|
|
7
|
+
return ` describe('${factory}', () => {\n${deeper}\n });`;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=nested-cases.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nested-cases.js","sourceRoot":"","sources":["../../src/refusals/nested-cases.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,MAAM,UAAU,WAAW,CAAC,OAAe,EAAE,KAAa;IACxD,MAAM,MAAM,GAAG,KAAK;SACjB,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;SACjD,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,OAAO,eAAe,OAAO,eAAe,MAAM,SAAS,CAAC;AAC9D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan-file.d.ts","sourceRoot":"","sources":["../../src/refusals/plan-file.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,eAAO,MAAM,SAAS,8BAA8B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan-file.js","sourceRoot":"","sources":["../../src/refusals/plan-file.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,MAAM,CAAC,MAAM,SAAS,GAAG,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** The decision about one class per error: the concept whose error class takes it, and the name of its factory. */
|
|
2
|
+
export interface PlannedFactory {
|
|
3
|
+
/** The class to replace, for example `SlotTakenError`. */
|
|
4
|
+
readonly class: string;
|
|
5
|
+
readonly file: string;
|
|
6
|
+
readonly code: string;
|
|
7
|
+
/** The concept of the glossary, without `Error`: empty until somebody decides. */
|
|
8
|
+
readonly concept: string;
|
|
9
|
+
readonly factory: string;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=planned-factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planned-factory.d.ts","sourceRoot":"","sources":["../../src/refusals/planned-factory.ts"],"names":[],"mappings":"AAAA,mHAAmH;AACnH,MAAM,WAAW,cAAc;IAC7B,0DAA0D;IAC1D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,kFAAkF;IAClF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planned-factory.js","sourceRoot":"","sources":["../../src/refusals/planned-factory.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { LegacyError } from './legacy-error.js';
|
|
2
|
+
import type { Move } from './move.js';
|
|
3
|
+
/** A class per error with the decision taken about it. */
|
|
4
|
+
export interface PlannedMove {
|
|
5
|
+
readonly error: LegacyError;
|
|
6
|
+
readonly move: Move;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=planned-move.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planned-move.d.ts","sourceRoot":"","sources":["../../src/refusals/planned-move.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC,0DAA0D;AAC1D,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planned-move.js","sourceRoot":"","sources":["../../src/refusals/planned-move.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Config } from '../config/index.js';
|
|
2
|
+
import type { Workspace } from '../workspace/index.js';
|
|
3
|
+
/** Every TypeScript file under the source root and under `test/` at the root of the project. */
|
|
4
|
+
export declare function projectSources(ws: Workspace, config: Config): string[];
|
|
5
|
+
//# sourceMappingURL=project-sources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-sources.d.ts","sourceRoot":"","sources":["../../src/refusals/project-sources.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,gGAAgG;AAChG,wBAAgB,cAAc,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAEtE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Every TypeScript file under the source root and under `test/` at the root of the project. */
|
|
2
|
+
export function projectSources(ws, config) {
|
|
3
|
+
return [config.sourceRoot, 'test'].flatMap((directory) => sourcesUnder(ws, directory));
|
|
4
|
+
}
|
|
5
|
+
function sourcesUnder(ws, directory) {
|
|
6
|
+
const here = ws.list(directory).filter((name) => /\.(?:ts|tsx|mts)$/.test(name) && !name.endsWith('.d.ts'));
|
|
7
|
+
const below = ws
|
|
8
|
+
.directories(directory)
|
|
9
|
+
.filter((name) => name !== 'node_modules' && name !== 'dist' && name !== 'generated')
|
|
10
|
+
.flatMap((name) => sourcesUnder(ws, `${directory}/${name}`));
|
|
11
|
+
return [...here.map((name) => `${directory}/${name}`), ...below];
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=project-sources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-sources.js","sourceRoot":"","sources":["../../src/refusals/project-sources.ts"],"names":[],"mappings":"AAGA,gGAAgG;AAChG,MAAM,UAAU,cAAc,CAAC,EAAa,EAAE,MAAc;IAC1D,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,YAAY,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC,CAAC;AACzF,CAAC;AAED,SAAS,YAAY,CAAC,EAAa,EAAE,SAAiB;IACpD,MAAM,IAAI,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;IAE5G,MAAM,KAAK,GAAG,EAAE;SACb,WAAW,CAAC,SAAS,CAAC;SACtB,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,cAAc,IAAI,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,WAAW,CAAC;SACpF,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,EAAE,EAAE,GAAG,SAAS,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC;IAE/D,OAAO,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,SAAS,IAAI,IAAI,EAAE,CAAC,EAAE,GAAG,KAAK,CAAC,CAAC;AACnE,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Config } from '../config/index.js';
|
|
2
|
+
import type { Workspace } from '../workspace/index.js';
|
|
3
|
+
import type { LegacyError } from './legacy-error.js';
|
|
4
|
+
import type { MigrationPlan } from './migration-plan.js';
|
|
5
|
+
interface Tree {
|
|
6
|
+
readonly ws: Workspace;
|
|
7
|
+
readonly config: Config;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A proposal: each class per error goes to the aggregate its name or its code starts or ends
|
|
11
|
+
* with, and to nothing when none does. Which concept a refusal is about is a decision of the
|
|
12
|
+
* model: the proposal is edited before it is applied.
|
|
13
|
+
*/
|
|
14
|
+
export declare function proposePlan(errors: readonly LegacyError[], tree: Tree): MigrationPlan;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=propose-plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"propose-plan.d.ts","sourceRoot":"","sources":["../../src/refusals/propose-plan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGzD,UAAU,IAAI;IACZ,QAAQ,CAAC,EAAE,EAAE,SAAS,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,WAAW,EAAE,EAAE,IAAI,EAAE,IAAI,GAAG,aAAa,CAgBrF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { splitWords, toName } from '../naming/index.js';
|
|
2
|
+
import { factoryNameFor } from './factory-name-for.js';
|
|
3
|
+
/**
|
|
4
|
+
* A proposal: each class per error goes to the aggregate its name or its code starts or ends
|
|
5
|
+
* with, and to nothing when none does. Which concept a refusal is about is a decision of the
|
|
6
|
+
* model: the proposal is edited before it is applied.
|
|
7
|
+
*/
|
|
8
|
+
export function proposePlan(errors, tree) {
|
|
9
|
+
const contexts = {};
|
|
10
|
+
for (const error of errors) {
|
|
11
|
+
const concept = conceptOf(error, aggregatesOf(tree, error.context));
|
|
12
|
+
(contexts[error.context] ??= []).push({
|
|
13
|
+
class: error.className,
|
|
14
|
+
file: error.file,
|
|
15
|
+
code: error.code,
|
|
16
|
+
concept,
|
|
17
|
+
factory: factoryNameFor(error.code, concept),
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return { contexts };
|
|
21
|
+
}
|
|
22
|
+
function aggregatesOf({ ws, config }, context) {
|
|
23
|
+
return ws
|
|
24
|
+
.list(`${config.contextsDir}/${context}/domain/aggregates`)
|
|
25
|
+
.filter((name) => name.endsWith('.aggregate.ts'))
|
|
26
|
+
.map((name) => toName(name.replace(/\.aggregate\.ts$/, '')).pascal);
|
|
27
|
+
}
|
|
28
|
+
/** The longest aggregate name the words of the class start or end with. */
|
|
29
|
+
function conceptOf(error, aggregates) {
|
|
30
|
+
const words = splitWords(error.className.replace(/Error$/, '')).join(' ');
|
|
31
|
+
const named = aggregates
|
|
32
|
+
.filter((aggregate) => {
|
|
33
|
+
const subject = splitWords(aggregate).join(' ');
|
|
34
|
+
return words === subject || words.startsWith(`${subject} `) || words.endsWith(` ${subject}`);
|
|
35
|
+
})
|
|
36
|
+
.sort((a, b) => b.length - a.length);
|
|
37
|
+
return named[0] ?? '';
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=propose-plan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"propose-plan.js","sourceRoot":"","sources":["../../src/refusals/propose-plan.ts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KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAE1E,MAAM,KAAK,GAAG,UAAU;SACrB,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE;QACpB,MAAM,OAAO,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAEhD,OAAO,KAAK,KAAK,OAAO,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,OAAO,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,OAAO,EAAE,CAAC,CAAC;IAC/F,CAAC,CAAC;SACD,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC;IAEvC,OAAO,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AACxB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { LegacyError } from './legacy-error.js';
|
|
2
|
+
interface Origin {
|
|
3
|
+
readonly file: string;
|
|
4
|
+
readonly context: string;
|
|
5
|
+
}
|
|
6
|
+
/** Reads a class per error: its code, the parameters of its constructor and the message it gives to `super`. Undefined when the file holds none. */
|
|
7
|
+
export declare function readLegacyError(source: string, origin: Origin): LegacyError | undefined;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=read-legacy-error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-legacy-error.d.ts","sourceRoot":"","sources":["../../src/refusals/read-legacy-error.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAmB,MAAM,mBAAmB,CAAC;AAQtE,UAAU,MAAM;IACd,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,oJAAoJ;AACpJ,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAcvF"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { errorCodes } from '../check/errors/error-codes.js';
|
|
2
|
+
import { scan } from '../check/scan/scan.js';
|
|
3
|
+
import { callArguments } from '../check/text/call-arguments.js';
|
|
4
|
+
import { matchingBracket } from '../check/text/matching-bracket.js';
|
|
5
|
+
import { splitTopLevel } from '../check/text/split-top-level.js';
|
|
6
|
+
const CLASS = /export\s+class\s+([A-Za-z_$][\w$]*)\s+extends\s+DomainError\b/;
|
|
7
|
+
const CONSTRUCTOR = /(?<![\w$.])constructor\s*\(/;
|
|
8
|
+
const SUPER = /(?<![\w$.])super\s*\(/;
|
|
9
|
+
const MODIFIERS = /^(?:(?:public|private|protected|readonly|override)\s+)*/;
|
|
10
|
+
const MEMBER = /^\s{2}(?!readonly code\b|constructor\b)[A-Za-z_$#]/m;
|
|
11
|
+
/** Reads a class per error: its code, the parameters of its constructor and the message it gives to `super`. Undefined when the file holds none. */
|
|
12
|
+
export function readLegacyError(source, origin) {
|
|
13
|
+
const scanned = scan(source);
|
|
14
|
+
const declared = CLASS.exec(scanned.code);
|
|
15
|
+
const [code] = errorCodes(scanned);
|
|
16
|
+
if (declared === null || code === undefined) {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
const head = { ...origin, className: declared[1] ?? '', code: code.code };
|
|
20
|
+
const open = scanned.code.indexOf('{', declared.index);
|
|
21
|
+
const body = { text: source, scanned, open, close: matchingBracket(scanned.code, open) };
|
|
22
|
+
return { ...head, ...constructorOf(body), ...manualReason(body) };
|
|
23
|
+
}
|
|
24
|
+
/** A class without a constructor inherits the one of `DomainError`: the caller writes the message. */
|
|
25
|
+
function constructorOf({ text, scanned, open, close, }) {
|
|
26
|
+
const { code } = scanned;
|
|
27
|
+
const declared = CONSTRUCTOR.exec(code.slice(open, close));
|
|
28
|
+
if (declared === null) {
|
|
29
|
+
return { parameters: [{ name: 'message', type: 'string' }], properties: [], message: 'message' };
|
|
30
|
+
}
|
|
31
|
+
const list = open + declared.index + declared[0].length - 1;
|
|
32
|
+
const block = code.indexOf('{', matchingBracket(code, list));
|
|
33
|
+
const called = SUPER.exec(code.slice(block, matchingBracket(code, block)));
|
|
34
|
+
const given = called === null ? [] : callArguments(code, block + called.index + called[0].length - 1);
|
|
35
|
+
const [message] = given;
|
|
36
|
+
const written = splitTopLevel(code.slice(list + 1, matchingBracket(code, list))).map((part) => part.code);
|
|
37
|
+
return {
|
|
38
|
+
parameters: written.flatMap(parameterOf),
|
|
39
|
+
properties: written
|
|
40
|
+
.filter((part) => MODIFIERS.exec(part)?.[0] !== '')
|
|
41
|
+
.flatMap(parameterOf)
|
|
42
|
+
.map(({ name }) => name),
|
|
43
|
+
message: message === undefined ? "''" : text.slice(message.start, message.start + message.code.length),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function parameterOf(written) {
|
|
47
|
+
const bare = written.replace(MODIFIERS, '').trim();
|
|
48
|
+
const [, name, type] = /^([A-Za-z_$][\w$]*)\??\s*(?::\s*([^=]+))?/.exec(bare) ?? [];
|
|
49
|
+
return name === undefined ? [] : [{ name, type: type?.trim() ?? 'unknown' }];
|
|
50
|
+
}
|
|
51
|
+
function manualReason({ text, scanned, open, close }) {
|
|
52
|
+
const { code } = scanned;
|
|
53
|
+
const inside = code.slice(open + 1, close);
|
|
54
|
+
const called = SUPER.exec(inside);
|
|
55
|
+
const given = called === null ? [] : callArguments(code, open + 1 + called.index + called[0].length - 1);
|
|
56
|
+
if (given.length > 1) {
|
|
57
|
+
return { manual: 'its constructor gives options to super(..): write the factory by hand, with .causedBy(..)' };
|
|
58
|
+
}
|
|
59
|
+
if (/\bthis\./.test(inside)) {
|
|
60
|
+
return { manual: 'its constructor reads or writes `this`: write the factory by hand' };
|
|
61
|
+
}
|
|
62
|
+
// A member other than the code and the constructor: text is read so that a field holding a string counts.
|
|
63
|
+
return MEMBER.test(withoutConstructor(text.slice(open + 1, close)))
|
|
64
|
+
? { manual: 'it has members of its own: write the factory by hand and decide where they go' }
|
|
65
|
+
: {};
|
|
66
|
+
}
|
|
67
|
+
function withoutConstructor(body) {
|
|
68
|
+
const at = body.search(CONSTRUCTOR);
|
|
69
|
+
if (at === -1) {
|
|
70
|
+
return body;
|
|
71
|
+
}
|
|
72
|
+
const block = body.indexOf('{', matchingBracket(body, body.indexOf('(', at)));
|
|
73
|
+
return body.slice(0, at) + body.slice(matchingBracket(body, block) + 1);
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=read-legacy-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-legacy-error.js","sourceRoot":"","sources":["../../src/refusals/read-legacy-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAa,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAGjE,MAAM,KAAK,GAAG,+DAA+D,CAAC;AAC9E,MAAM,WAAW,GAAG,6BAA6B,CAAC;AAClD,MAAM,KAAK,GAAG,uBAAuB,CAAC;AACtC,MAAM,SAAS,GAAG,yDAAyD,CAAC;AAC5E,MAAM,MAAM,GAAG,qDAAqD,CAAC;AAOrE,oJAAoJ;AACpJ,MAAM,UAAU,eAAe,CAAC,MAAc,EAAE,MAAc;IAC5D,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;IAC7B,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,MAAM,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,OAAO,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AAK,CAAC,IAAI,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;QACjE,CAAC,CAAC,EAAE,MAAM,EAAE,+EAA+E,EAAE;QAC7F,CAAC,CAAC,EAAE,CAAC;AACT,CAAC;AAED,SAAS,kBAAkB,CAAC,IAAY;IACtC,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAEpC,IAAI,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC;QACd,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IAE9E,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AAC1E,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { MigrationPlan } from './migration-plan.js';
|
|
2
|
+
/** The decisions of the plan file, each one checked: a concept, a factory name that says the code. */
|
|
3
|
+
export declare function readPlan(text: string | undefined): MigrationPlan;
|
|
4
|
+
//# sourceMappingURL=read-plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-plan.d.ts","sourceRoot":"","sources":["../../src/refusals/read-plan.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAMzD,sGAAsG;AACtG,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa,CAgBhE"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { isRecord } from '../check/support/is-record.js';
|
|
2
|
+
import { CliError } from '../cli-error.js';
|
|
3
|
+
import { refusalCode } from '../generate/errors/refusal-code.js';
|
|
4
|
+
import { refusalName } from '../generate/errors/refusal-name.js';
|
|
5
|
+
import { toName } from '../naming/index.js';
|
|
6
|
+
import { PLAN_FILE } from './plan-file.js';
|
|
7
|
+
const FIX = `Run \`ddd-ts-kit error-factories --plan\` to write ${PLAN_FILE} again, then give each entry its concept.`;
|
|
8
|
+
/** The decisions of the plan file, each one checked: a concept, a factory name that says the code. */
|
|
9
|
+
export function readPlan(text) {
|
|
10
|
+
const raw = text === undefined ? undefined : JSON.parse(text);
|
|
11
|
+
const contexts = isRecord(raw) && isRecord(raw['contexts']) ? raw['contexts'] : undefined;
|
|
12
|
+
if (contexts === undefined) {
|
|
13
|
+
throw new CliError(`${PLAN_FILE} holds no plan.`, FIX);
|
|
14
|
+
}
|
|
15
|
+
return {
|
|
16
|
+
contexts: Object.fromEntries(Object.entries(contexts).map(([context, entries]) => [
|
|
17
|
+
context,
|
|
18
|
+
(Array.isArray(entries) ? entries : []).map(entryOf),
|
|
19
|
+
])),
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function entryOf(raw) {
|
|
23
|
+
const text = (key) => (isRecord(raw) && typeof raw[key] === 'string' ? raw[key] : '');
|
|
24
|
+
const entry = {
|
|
25
|
+
class: text('class'),
|
|
26
|
+
file: text('file'),
|
|
27
|
+
code: text('code'),
|
|
28
|
+
concept: text('concept'),
|
|
29
|
+
factory: text('factory'),
|
|
30
|
+
};
|
|
31
|
+
if (entry.class === '' || entry.file === '' || entry.code === '') {
|
|
32
|
+
throw new CliError(`${PLAN_FILE} has an entry without its class, file or code.`, FIX);
|
|
33
|
+
}
|
|
34
|
+
if (entry.concept === '') {
|
|
35
|
+
throw new CliError(`${PLAN_FILE}: ${entry.class} has no concept.`, `Set "concept" to the term of the glossary this refusal is about (for example the aggregate it is refused on): ${entry.class} becomes a factory of <Concept>Error.`);
|
|
36
|
+
}
|
|
37
|
+
const concept = toName(entry.concept.replace(/Error$/, ''));
|
|
38
|
+
const refusal = refusalName(entry.factory);
|
|
39
|
+
// Refuses a name that does not say the code, with the names that would.
|
|
40
|
+
refusalCode({ concept, refusal }, entry.code);
|
|
41
|
+
return { ...entry, concept: concept.pascal, factory: refusal.camel };
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=read-plan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-plan.js","sourceRoot":"","sources":["../../src/refusals/read-plan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG3C,MAAM,GAAG,GAAG,sDAAsD,SAAS,2CAA2C,CAAC;AAEvH,sGAAsG;AACtG,MAAM,UAAU,QAAQ,CAAC,IAAwB;IAC/C,MAAM,GAAG,GAAY,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACvE,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAE1F,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,MAAM,IAAI,QAAQ,CAAC,GAAG,SAAS,iBAAiB,EAAE,GAAG,CAAC,CAAC;IACzD,CAAC;IAED,OAAO;QACL,QAAQ,EAAE,MAAM,CAAC,WAAW,CAC1B,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,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,EAAE,CAAC,CAAC,CAAC;IAC5D,MAAM,OAAO,GAAG,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAE3C,wEAAwE;IACxE,WAAW,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAE9C,OAAO,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC;AACvE,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { LegacyError } from './legacy-error.js';
|
|
2
|
+
import type { Move } from './move.js';
|
|
3
|
+
/** The static factory that replaces the constructor of a class per error: same parameters, same message, its plain parameters as facts. */
|
|
4
|
+
export declare function renderFactory(error: LegacyError, move: Move): string;
|
|
5
|
+
//# sourceMappingURL=render-factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-factory.d.ts","sourceRoot":"","sources":["../../src/refusals/render-factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAKtC,2IAA2I;AAC3I,wBAAgB,aAAa,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,GAAG,MAAM,CAUpE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** A type a fact may have: plain data, as `RefusalFact` of the kernel says. */
|
|
2
|
+
const FACT_TYPE = /^(?:readonly\s+)?(?:string|number|boolean|Date)(?:\[\])?$/;
|
|
3
|
+
/** The static factory that replaces the constructor of a class per error: same parameters, same message, its plain parameters as facts. */
|
|
4
|
+
export function renderFactory(error, move) {
|
|
5
|
+
const parameters = error.parameters.map(({ name, type }) => `${name}: ${type}`).join(', ');
|
|
6
|
+
const facts = error.parameters.filter(({ type }) => FACT_TYPE.test(type)).map(({ name }) => name);
|
|
7
|
+
const given = facts.length === 0 ? '' : `, { ${facts.join(', ')} }`;
|
|
8
|
+
return [
|
|
9
|
+
` static ${move.factory}(${parameters}) {`,
|
|
10
|
+
` return ${move.conceptClass}.refusal('${move.code}', ${error.message}${given});`,
|
|
11
|
+
' }',
|
|
12
|
+
].join('\n');
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=render-factory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-factory.js","sourceRoot":"","sources":["../../src/refusals/render-factory.ts"],"names":[],"mappings":"AAGA,+EAA+E;AAC/E,MAAM,SAAS,GAAG,2DAA2D,CAAC;AAE9E,2IAA2I;AAC3I,MAAM,UAAU,aAAa,CAAC,KAAkB,EAAE,IAAU;IAC1D,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,GAAG,IAAI,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3F,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;IAClG,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;IAEpE,OAAO;QACL,YAAY,IAAI,CAAC,OAAO,IAAI,UAAU,KAAK;QAC3C,cAAc,IAAI,CAAC,YAAY,aAAa,IAAI,CAAC,IAAI,MAAM,KAAK,CAAC,OAAO,GAAG,KAAK,IAAI;QACpF,KAAK;KACN,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Scan } from '../check/scan/scan.js';
|
|
2
|
+
export interface CodeMatch {
|
|
3
|
+
readonly match: RegExpExecArray;
|
|
4
|
+
readonly scanned: Scan;
|
|
5
|
+
/** The source between two offsets: what a group matched in the code, with its strings. */
|
|
6
|
+
slice(start: number, end: number): string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Replaces what `pattern` matches in the code of a source, comments and the contents of strings
|
|
10
|
+
* left alone. A replacement answers the text and where it ends, or undefined to keep the match.
|
|
11
|
+
*/
|
|
12
|
+
export declare function replaceInCode(source: string, pattern: RegExp, replace: (found: CodeMatch) => {
|
|
13
|
+
text: string;
|
|
14
|
+
end?: number;
|
|
15
|
+
} | undefined): string;
|
|
16
|
+
//# sourceMappingURL=replace-in-code.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replace-in-code.d.ts","sourceRoot":"","sources":["../../src/refusals/replace-in-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC;IACvB,0FAA0F;IAC1F,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CAC3C;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,GACxE,MAAM,CAgBR"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { scan } from '../check/scan/scan.js';
|
|
2
|
+
/**
|
|
3
|
+
* Replaces what `pattern` matches in the code of a source, comments and the contents of strings
|
|
4
|
+
* left alone. A replacement answers the text and where it ends, or undefined to keep the match.
|
|
5
|
+
*/
|
|
6
|
+
export function replaceInCode(source, pattern, replace) {
|
|
7
|
+
const scanned = scan(source);
|
|
8
|
+
const slice = (start, end) => source.slice(start, end);
|
|
9
|
+
let result = '';
|
|
10
|
+
let cursor = 0;
|
|
11
|
+
for (const match of scanned.code.matchAll(pattern)) {
|
|
12
|
+
const replaced = match.index < cursor ? undefined : replace({ match, scanned, slice });
|
|
13
|
+
if (replaced !== undefined) {
|
|
14
|
+
result += source.slice(cursor, match.index) + replaced.text;
|
|
15
|
+
cursor = replaced.end ?? match.index + match[0].length;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return result + source.slice(cursor);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=replace-in-code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replace-in-code.js","sourceRoot":"","sources":["../../src/refusals/replace-in-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAa,MAAM,uBAAuB,CAAC;AASxD;;;GAGG;AACH,MAAM,UAAU,aAAa,CAC3B,MAAc,EACd,OAAe,EACf,OAAyE;IAEzE,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;IAC7B,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,GAAW,EAAU,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC/E,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,MAAM,GAAG,CAAC,CAAC;IAEf,KAAK,MAAM,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QACnD,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;QAEvF,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,MAAM,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC;YAC5D,MAAM,GAAG,QAAQ,CAAC,GAAG,IAAI,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QACzD,CAAC;IACH,CAAC;IAED,OAAO,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Move } from './move.js';
|
|
2
|
+
/** Told when a class per error stood as a value where nothing above knew what to write: the concept class stands there now. */
|
|
3
|
+
export type OnValue = (className: string, conceptClass: string) => void;
|
|
4
|
+
/** A file where no class per error is named any more: constructions, assertions, imports and types follow the moves. */
|
|
5
|
+
export declare function rewriteUsages(source: string, moves: readonly Move[], onValue?: OnValue): string;
|
|
6
|
+
//# sourceMappingURL=rewrite-usages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rewrite-usages.d.ts","sourceRoot":"","sources":["../../src/refusals/rewrite-usages.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAOtC,+HAA+H;AAC/H,MAAM,MAAM,OAAO,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;AAExE,wHAAwH;AACxH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,IAAI,EAAE,EAAE,OAAO,GAAE,OAAyB,GAAG,MAAM,CAWhH"}
|