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,19 @@
|
|
|
1
|
+
/** `init` offers two ways of publishing events: a third one written by hand in the config is kept as it is. */
|
|
2
|
+
const OFFERED_EVENTS = ['in-memory', 'outbox'];
|
|
3
|
+
/**
|
|
4
|
+
* The stack a config records, as the flags of `init` would ask for it: what `init --force` starts
|
|
5
|
+
* from, so that a flag changes the choice it names and nothing else. The reason of a recorded
|
|
6
|
+
* run without the outbox is given again with it.
|
|
7
|
+
*/
|
|
8
|
+
export function recordedOptions({ stack, deviations }) {
|
|
9
|
+
const { events, style, assembly, dependencies, ...choices } = stack;
|
|
10
|
+
const noOutbox = deviations.find(({ what }) => what === 'stack.events')?.reason;
|
|
11
|
+
return {
|
|
12
|
+
...choices,
|
|
13
|
+
style,
|
|
14
|
+
...(style === 'declared' ? { assembly, dependencies } : {}),
|
|
15
|
+
...(OFFERED_EVENTS.includes(events) ? { events } : {}),
|
|
16
|
+
...(noOutbox === undefined ? {} : { allowNoOutbox: noOutbox }),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=recorded-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recorded-options.js","sourceRoot":"","sources":["../../../src/init/stack/recorded-options.ts"],"names":[],"mappings":"AAGA,+GAA+G;AAC/G,MAAM,cAAc,GAAG,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;AAI/C;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,EAAE,KAAK,EAAE,UAAU,EAAwC;IACzF,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,OAAO,EAAE,GAAG,KAAK,CAAC;IACpE,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,KAAK,cAAc,CAAC,EAAE,MAAM,CAAC;IAEhF,OAAO;QACL,GAAG,OAAO;QACV,KAAK;QACL,GAAG,CAAC,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3D,GAAG,CAAC,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACtD,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAC;KAC/D,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { type Config } from '../../config/index.js';
|
|
2
2
|
import type { StackOptions } from './stack-options.js';
|
|
3
3
|
export type { StackOptions } from './stack-options.js';
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* The config of the project. Already initialised, it is the one on disk: `init` run again keeps
|
|
6
|
+
* it, and `init --force` changes in it the choices its flags name and nothing else, so the
|
|
7
|
+
* contexts, the rules and every other key a team declared survive. A new project gets the stack
|
|
8
|
+
* the flags ask for.
|
|
9
|
+
*/
|
|
5
10
|
export declare function resolveStack(root: string, options: StackOptions): Config;
|
|
6
11
|
//# sourceMappingURL=resolve-stack.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-stack.d.ts","sourceRoot":"","sources":["../../../src/init/stack/resolve-stack.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"resolve-stack.d.ts","sourceRoot":"","sources":["../../../src/init/stack/resolve-stack.ts"],"names":[],"mappings":"AAEA,OAAO,EAsBL,KAAK,MAAM,EACZ,MAAM,uBAAuB,CAAC;AAQ/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,GAAG,MAAM,CAgBxE"}
|
|
@@ -1,24 +1,64 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import { AUDIT_MODES, AUTHN_STACKS, AUTHZ_STACKS, BROKER_STACKS, CACHE_STACKS, CI_PLATFORMS, CONFIG_FILE, DEFAULT_IMPORT_ALIAS, DI_STACKS, DOCS_UIS, ERROR_REPORTERS, HTTP_STACKS, LOGGERS, PACKAGE_MANAGERS, parseConfig, readConfig, TEST_STACKS, VALIDATION_STACKS, } from '../../config/index.js';
|
|
3
|
+
import { AUDIT_MODES, AUTHN_STACKS, AUTHZ_STACKS, BROKER_STACKS, CACHE_STACKS, CI_PLATFORMS, CONFIG_FILE, DEFAULT_IMPORT_ALIAS, DEFAULT_IMPORT_EXTENSION, DI_STACKS, DOCS_UIS, ERROR_REPORTERS, HTTP_STACKS, IMPORT_EXTENSIONS, LOGGERS, REFUSAL_FORMS, PACKAGE_MANAGERS, parseConfig, readConfig, TEST_STACKS, VALIDATION_STACKS, } from '../../config/index.js';
|
|
4
4
|
import { aliasProblem } from '../../alias/index.js';
|
|
5
5
|
import { DEFAULT_PACKAGE_MANAGER } from '../../package-manager/default-package-manager.js';
|
|
6
6
|
import { CliError } from '../../cli-error.js';
|
|
7
7
|
import { choose } from './choose.js';
|
|
8
|
+
import { recordedOptions } from './recorded-options.js';
|
|
8
9
|
import { resolvePersistence } from './resolve-persistence.js';
|
|
9
10
|
import { resolveStyle } from './resolve-style.js';
|
|
10
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* The config of the project. Already initialised, it is the one on disk: `init` run again keeps
|
|
13
|
+
* it, and `init --force` changes in it the choices its flags name and nothing else, so the
|
|
14
|
+
* contexts, the rules and every other key a team declared survive. A new project gets the stack
|
|
15
|
+
* the flags ask for.
|
|
16
|
+
*/
|
|
11
17
|
export function resolveStack(root, options) {
|
|
12
|
-
|
|
13
|
-
|
|
18
|
+
const recorded = recordedConfig(root, options.force);
|
|
19
|
+
if (recorded !== undefined && !options.force) {
|
|
20
|
+
return supportedAlias(recorded);
|
|
21
|
+
}
|
|
22
|
+
const asked = recorded === undefined ? options : { ...recordedOptions(recorded), ...options };
|
|
23
|
+
const fresh = parseConfig({ ...spelling(asked, recorded), stack: stackOf(asked), contexts: {}, rules: {} });
|
|
24
|
+
const { importAlias, importExtension } = fresh;
|
|
25
|
+
// No flag and nothing to ask again: the config publishes its events in a way `init` does not offer, written by hand.
|
|
26
|
+
const events = recorded !== undefined && asked.events === undefined ? recorded.stack.events : fresh.stack.events;
|
|
27
|
+
const stack = { ...fresh.stack, events };
|
|
28
|
+
const config = supportedAlias({ ...(recorded ?? fresh), importAlias, importExtension, stack });
|
|
29
|
+
return { ...config, worker: config.worker || hasWorker(root, config) };
|
|
30
|
+
}
|
|
31
|
+
/** Nothing for a new project, and for a config `--force` is about to replace because it cannot be read. */
|
|
32
|
+
function recordedConfig(root, force) {
|
|
33
|
+
if (!fs.existsSync(path.join(root, CONFIG_FILE))) {
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
return readConfig(root).config;
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
if (force) {
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
throw error;
|
|
14
44
|
}
|
|
45
|
+
}
|
|
46
|
+
/** How the imports are written: what a flag asks, else what the project already does, else the defaults of a new project. */
|
|
47
|
+
function spelling(options, recorded) {
|
|
48
|
+
const extension = choose(IMPORT_EXTENSIONS, options.importExtension, 'import-extension');
|
|
49
|
+
return {
|
|
50
|
+
importAlias: options.importAlias ?? recorded?.importAlias ?? DEFAULT_IMPORT_ALIAS,
|
|
51
|
+
importExtension: extension ?? recorded?.importExtension ?? DEFAULT_IMPORT_EXTENSION,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function stackOf(options) {
|
|
15
55
|
const http = choose(HTTP_STACKS, options.http, 'http') ?? 'express';
|
|
16
56
|
const di = choose(DI_STACKS, options.di, 'di') ?? (http === 'nest' ? 'nest' : 'tsyringe');
|
|
17
57
|
assertNestGoesWithNest(http, di);
|
|
18
58
|
const docsUi = http === 'none' ? 'none' : (choose(DOCS_UIS, options.docsUi, 'docs-ui') ?? 'swagger');
|
|
19
59
|
const persistence = resolvePersistence(options);
|
|
20
60
|
const broker = resolveBroker(options, persistence.orm);
|
|
21
|
-
|
|
61
|
+
return {
|
|
22
62
|
http,
|
|
23
63
|
di,
|
|
24
64
|
...resolveTooling(options),
|
|
@@ -29,9 +69,6 @@ export function resolveStack(root, options) {
|
|
|
29
69
|
...resolveOperations(options, persistence.orm),
|
|
30
70
|
...resolveStyle(options, di),
|
|
31
71
|
};
|
|
32
|
-
const alias = options.importAlias === undefined ? {} : { importAlias: options.importAlias };
|
|
33
|
-
const config = supportedAlias(parseConfig({ ...alias, stack, contexts: {}, rules: {} }));
|
|
34
|
-
return { ...config, worker: hasWorker(root, config) };
|
|
35
72
|
}
|
|
36
73
|
/** Every file `init` writes imports by the alias: one that some tool cannot resolve is refused before anything is written. */
|
|
37
74
|
function supportedAlias(config) {
|
|
@@ -41,7 +78,7 @@ function supportedAlias(config) {
|
|
|
41
78
|
}
|
|
42
79
|
throw new CliError(`The import alias "${config.importAlias}" is not supported: ${problem}.`, `Use "${DEFAULT_IMPORT_ALIAS}" or "$<name>/" (--import-alias, or "importAlias" in ${CONFIG_FILE}).`);
|
|
43
80
|
}
|
|
44
|
-
/**
|
|
81
|
+
/** A worker that is already there keeps the jobs, so the API still starts with its jobs off, whatever the config says of it. */
|
|
45
82
|
function hasWorker(root, config) {
|
|
46
83
|
return fs.existsSync(path.join(root, config.sourceRoot, 'apps/worker/main.ts'));
|
|
47
84
|
}
|
|
@@ -58,6 +95,8 @@ function resolveOperations(options, orm) {
|
|
|
58
95
|
audit: choose(AUDIT_MODES, options.audit, 'audit') ?? (orm === 'none' ? 'off' : 'on'),
|
|
59
96
|
errors: choose(ERROR_REPORTERS, options.errors, 'errors') ?? 'none',
|
|
60
97
|
logger: choose(LOGGERS, options.logger, 'logger') ?? 'stdout',
|
|
98
|
+
// A new project builds its domain errors through factories; a recorded one keeps the form it says, or the one of 0.2.
|
|
99
|
+
refusals: choose(REFUSAL_FORMS, options.refusals, 'refusals') ?? 'factories',
|
|
61
100
|
};
|
|
62
101
|
}
|
|
63
102
|
function resolveSecurity(options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-stack.js","sourceRoot":"","sources":["../../../src/init/stack/resolve-stack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,oBAAoB,EACpB,SAAS,EACT,QAAQ,EACR,eAAe,EACf,WAAW,EACX,OAAO,EACP,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,WAAW,EACX,iBAAiB,GAElB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kDAAkD,CAAC;AAC3F,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAKlD
|
|
1
|
+
{"version":3,"file":"resolve-stack.js","sourceRoot":"","sources":["../../../src/init/stack/resolve-stack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,WAAW,EACX,YAAY,EACZ,YAAY,E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,MAAM;KAC9D,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,OAAqB,EAAE,GAAW;IACvD,MAAM,MAAM,GAAG,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC;IAEzE,IAAI,MAAM,KAAK,MAAM,IAAI,GAAG,KAAK,MAAM,EAAE,CAAC;QACxC,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,IAAI,QAAQ,CAChB,YAAY,MAAM,sCAAsC,EACxD,mHAAmH,CACpH,CAAC;AACJ,CAAC;AAID,SAAS,cAAc,CAAC,OAAqB;IAC3C,OAAO;QACL,UAAU,EAAE,MAAM,CAAC,iBAAiB,EAAE,OAAO,CAAC,UAAU,EAAE,YAAY,CAAC,IAAI,KAAK;QAChF,KAAK,EAAE,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,QAAQ;QAC9D,EAAE,EAAE,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,QAAQ;QACtD,cAAc,EAAE,MAAM,CAAC,gBAAgB,EAAE,OAAO,CAAC,cAAc,EAAE,iBAAiB,CAAC,IAAI,uBAAuB;KAC/G,CAAC;AACJ,CAAC;AAED,SAAS,sBAAsB,CAAC,IAAY,EAAE,EAAU;IACtD,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,KAAK,CAAC,EAAE,KAAK,MAAM,CAAC,EAAE,CAAC;QAC1C,OAAO;IACT,CAAC;IAED,MAAM,IAAI,QAAQ,CAChB,UAAU,IAAI,iCAAiC,EAAE,GAAG,EACpD,uIAAuI,CACxI,CAAC;AACJ,CAAC"}
|
|
@@ -3,10 +3,8 @@ import type { StackOptions } from './stack-options.js';
|
|
|
3
3
|
* A class declares what it is wherever something reads the declarations: `@ddd-ts-kit/di`, on
|
|
4
4
|
* tsyringe. Hand wiring and a NestJS container read none of them, so their contexts keep a
|
|
5
5
|
* module file. A declared context is assembled from its barrel or by discovery, with or
|
|
6
|
-
* without a broker: its subscriber is the one of its name either way.
|
|
6
|
+
* without a broker: its subscriber is the one of its name either way. A new declared project
|
|
7
|
+
* states dependencies in constructor signatures; an explicit one lists them in its module file.
|
|
7
8
|
*/
|
|
8
|
-
export declare function resolveStyle(options: StackOptions, di: string):
|
|
9
|
-
style: string;
|
|
10
|
-
assembly: string;
|
|
11
|
-
};
|
|
9
|
+
export declare function resolveStyle(options: StackOptions, di: string): Record<'style' | 'assembly' | 'dependencies', string>;
|
|
12
10
|
//# sourceMappingURL=resolve-style.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-style.d.ts","sourceRoot":"","sources":["../../../src/init/stack/resolve-style.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD
|
|
1
|
+
{"version":3,"file":"resolve-style.d.ts","sourceRoot":"","sources":["../../../src/init/stack/resolve-style.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,cAAc,EAAE,MAAM,CAAC,CAoBrH"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { ASSEMBLIES, STYLES } from '../../config/index.js';
|
|
1
|
+
import { ASSEMBLIES, DEPENDENCY_STATEMENTS, STYLES } from '../../config/index.js';
|
|
2
2
|
import { CliError } from '../../cli-error.js';
|
|
3
3
|
import { choose } from './choose.js';
|
|
4
4
|
/**
|
|
5
5
|
* A class declares what it is wherever something reads the declarations: `@ddd-ts-kit/di`, on
|
|
6
6
|
* tsyringe. Hand wiring and a NestJS container read none of them, so their contexts keep a
|
|
7
7
|
* module file. A declared context is assembled from its barrel or by discovery, with or
|
|
8
|
-
* without a broker: its subscriber is the one of its name either way.
|
|
8
|
+
* without a broker: its subscriber is the one of its name either way. A new declared project
|
|
9
|
+
* states dependencies in constructor signatures; an explicit one lists them in its module file.
|
|
9
10
|
*/
|
|
10
11
|
export function resolveStyle(options, di) {
|
|
11
12
|
const style = choose(STYLES, options.style, 'style') ?? (di === 'tsyringe' ? 'declared' : 'explicit');
|
|
@@ -16,6 +17,13 @@ export function resolveStyle(options, di) {
|
|
|
16
17
|
if (assembly !== undefined && style !== 'declared') {
|
|
17
18
|
throw new CliError(`--assembly ${assembly} cannot be combined with --style explicit.`, 'An explicit context is assembled by its module file: drop --assembly, or use --style declared.');
|
|
18
19
|
}
|
|
19
|
-
return { style, assembly: assembly ?? 'barrel' };
|
|
20
|
+
return { style, assembly: assembly ?? 'barrel', dependencies: dependenciesOf(options, style) };
|
|
21
|
+
}
|
|
22
|
+
function dependenciesOf(options, style) {
|
|
23
|
+
const dependencies = choose(DEPENDENCY_STATEMENTS, options.dependencies, 'dependencies');
|
|
24
|
+
if (dependencies !== undefined && style !== 'declared') {
|
|
25
|
+
throw new CliError(`--dependencies ${dependencies} cannot be combined with --style explicit.`, 'An explicit context lists what each class is given in its module file: drop --dependencies, or use --style declared.');
|
|
26
|
+
}
|
|
27
|
+
return dependencies ?? (style === 'declared' ? 'signature' : 'listed');
|
|
20
28
|
}
|
|
21
29
|
//# sourceMappingURL=resolve-style.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-style.js","sourceRoot":"","sources":["../../../src/init/stack/resolve-style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"resolve-style.js","sourceRoot":"","sources":["../../../src/init/stack/resolve-style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAClF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U,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;AACzE,CAAC"}
|
|
@@ -18,9 +18,13 @@ export interface StackOptions {
|
|
|
18
18
|
readonly logger?: string;
|
|
19
19
|
readonly style?: string;
|
|
20
20
|
readonly assembly?: string;
|
|
21
|
+
readonly dependencies?: string;
|
|
22
|
+
readonly refusals?: string;
|
|
21
23
|
readonly packageManager?: string;
|
|
22
24
|
/** The prefix of the source root in imports, when it is not the default. */
|
|
23
25
|
readonly importAlias?: string;
|
|
26
|
+
/** `none` or `js`: whether an import of a file of the project ends with the extension of the emitted file. */
|
|
27
|
+
readonly importExtension?: string;
|
|
24
28
|
/** The reason given for running an ORM without the transactional outbox. */
|
|
25
29
|
readonly allowNoOutbox?: string;
|
|
26
30
|
readonly force: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stack-options.d.ts","sourceRoot":"","sources":["../../../src/init/stack/stack-options.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CA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QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,4EAA4E;IAC5E,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,8GAA8G;IAC9G,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,4EAA4E;IAC5E,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB"}
|
|
@@ -64,7 +64,7 @@ export function writeAgentSettings(ws) {
|
|
|
64
64
|
ws.note(`${AGENT_SETTINGS} is not a JSON object: it was left as it is.`);
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
|
-
const merged = mergePermissions(settings);
|
|
67
|
+
const merged = mergePermissions(settings, (rule) => ws.spoken(rule));
|
|
68
68
|
ws.update(AGENT_SETTINGS, serialize(merged.settings));
|
|
69
69
|
if (merged.added.length > 0) {
|
|
70
70
|
ws.note(`${AGENT_SETTINGS} gained ${merged.added.length} permission(s): ${merged.added.join(', ')}.`);
|
|
@@ -80,13 +80,14 @@ function parse(text) {
|
|
|
80
80
|
return undefined;
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
|
|
83
|
+
/** A rule is compared as the project says it: its settings name the package manager it runs, not npm. */
|
|
84
|
+
function mergePermissions(settings, spoken) {
|
|
84
85
|
const current = isRecord(settings['permissions']) ? settings['permissions'] : {};
|
|
85
86
|
const added = [];
|
|
86
87
|
const permissions = { ...current };
|
|
87
88
|
for (const [kind, wanted] of Object.entries(PERMISSIONS)) {
|
|
88
89
|
const present = Array.isArray(current[kind]) ? current[kind] : [];
|
|
89
|
-
const missing = wanted.filter((rule) => !present.includes(rule));
|
|
90
|
+
const missing = wanted.map(spoken).filter((rule) => !present.includes(rule));
|
|
90
91
|
permissions[kind] = [...present, ...missing];
|
|
91
92
|
added.push(...missing.map((rule) => `${kind} ${rule}`));
|
|
92
93
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-agent-settings.js","sourceRoot":"","sources":["../../src/init/write-agent-settings.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,MAAM,cAAc,GAAG,uBAAuB,CAAC;AAI/C;;;GAGG;AACH,MAAM,WAAW,GAAgB;IAC/B,KAAK,EAAE;QACL,8BAA8B;QAC9B,6BAA6B;QAC7B,iCAAiC;QACjC,6BAA6B;QAC7B,gCAAgC;QAChC,4BAA4B;QAC5B,sBAAsB;QACtB,yBAAyB;QACzB,sBAAsB;QACtB,kBAAkB;QAClB,0BAA0B;QAC1B,6BAA6B;QAC7B,0BAA0B;QAC1B,gCAAgC;QAChC,6BAA6B;QAC7B,+BAA+B;QAC/B,4BAA4B;KAC7B;IACD,wFAAwF;IACxF,kFAAkF;IAClF,6EAA6E;IAC7E,IAAI,EAAE;QACJ,cAAc;QACd,gBAAgB;QAChB,uBAAuB;QACvB,8BAA8B;QAC9B,wCAAwC;QACxC,2CAA2C;KAC5C;IACD,yFAAyF;IACzF,4EAA4E;IAC5E,GAAG,EAAE;QACH,kBAAkB;QAClB,qBAAqB;QACrB,gCAAgC;Q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,OAAO,CAAC,CAAC;QAC7C,KAAK,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC;IAC1D,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,EAAE,GAAG,QAAQ,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,CAAC;AAC3D,CAAC"}
|
|
@@ -3,7 +3,8 @@ import type { Workspace } from '../workspace/index.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* `tsconfig.json` for the editor and the type check, `tsconfig.build.json` for what ships: no test,
|
|
5
5
|
* no test database. `paths` declares the import alias for the compiler and for every tool that
|
|
6
|
-
* reads tsconfig; the build config extends the other, so the two cannot disagree.
|
|
6
|
+
* reads tsconfig; the build config extends the other, so the two cannot disagree. How a specifier
|
|
7
|
+
* is resolved follows "importExtension".
|
|
7
8
|
*/
|
|
8
9
|
export declare function writeTypeScriptConfigs(ws: Workspace, config: Config): void;
|
|
9
10
|
//# sourceMappingURL=write-type-script-configs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-type-script-configs.d.ts","sourceRoot":"","sources":["../../src/init/write-type-script-configs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGvD
|
|
1
|
+
{"version":3,"file":"write-type-script-configs.d.ts","sourceRoot":"","sources":["../../src/init/write-type-script-configs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGvD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAY1E"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { aliasRoots, compilerPaths, DEFAULT_BUILD_LAYOUT } from '../alias/index.js';
|
|
1
|
+
import { aliasRoots, compilerPaths, compilerResolutionOf, DEFAULT_BUILD_LAYOUT } from '../alias/index.js';
|
|
2
2
|
import { usesLegacyDecorators } from '../stack/uses-legacy-decorators.js';
|
|
3
3
|
import { formatJson } from '../json/format-json.js';
|
|
4
4
|
/**
|
|
5
5
|
* `tsconfig.json` for the editor and the type check, `tsconfig.build.json` for what ships: no test,
|
|
6
6
|
* no test database. `paths` declares the import alias for the compiler and for every tool that
|
|
7
|
-
* reads tsconfig; the build config extends the other, so the two cannot disagree.
|
|
7
|
+
* reads tsconfig; the build config extends the other, so the two cannot disagree. How a specifier
|
|
8
|
+
* is resolved follows "importExtension".
|
|
8
9
|
*/
|
|
9
10
|
export function writeTypeScriptConfigs(ws, config) {
|
|
10
11
|
const include = [config.sourceRoot, 'scripts', 'test', ...(config.stack.orm === 'prisma' ? ['generated'] : [])];
|
|
@@ -18,8 +19,7 @@ function compilerOptions(config) {
|
|
|
18
19
|
return {
|
|
19
20
|
target: 'ES2023',
|
|
20
21
|
lib: ['ES2023'],
|
|
21
|
-
|
|
22
|
-
moduleResolution: 'NodeNext',
|
|
22
|
+
...compilerResolutionOf(config.importExtension),
|
|
23
23
|
strict: true,
|
|
24
24
|
noUncheckedIndexedAccess: true,
|
|
25
25
|
exactOptionalPropertyTypes: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-type-script-configs.js","sourceRoot":"","sources":["../../src/init/write-type-script-configs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"write-type-script-configs.js","sourceRoot":"","sources":["../../src/init/write-type-script-configs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,oB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EAAE,CAAC,MAAM,CAAC;QACf,OAAO,EAAE,oBAAoB,CAAC,OAAO;QACrC,MAAM,EAAE,oBAAoB,CAAC,MAAM;QACnC,KAAK,EAAE,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;KACzC,CAAC;AACJ,CAAC;AAED,SAAS,SAAS,CAAC,KAAc;IAC/B,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refresh-declarations.d.ts","sourceRoot":"","sources":["../src/refresh-declarations.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refresh-declarations.js","sourceRoot":"","sources":["../src/refresh-declarations.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,mBAAmB,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Config } from '../config/index.js';
|
|
2
|
+
import type { Workspace } from '../workspace/index.js';
|
|
3
|
+
import type { MigrationDraft } from './migration-draft.js';
|
|
4
|
+
import type { MigrationPlan } from './migration-plan.js';
|
|
5
|
+
import type { PlannedMove } from './planned-move.js';
|
|
6
|
+
interface Tree {
|
|
7
|
+
readonly ws: Workspace;
|
|
8
|
+
readonly config: Config;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Follows the plan: each class per error becomes a factory of the error class of its concept,
|
|
12
|
+
* its spec becomes cases of the spec of that class, every file that named it follows, and the
|
|
13
|
+
* config says the project builds its refusals through factories. Answers the moves it made.
|
|
14
|
+
*/
|
|
15
|
+
export declare function applyPlan(tree: Tree, plan: MigrationPlan, draft: MigrationDraft): PlannedMove[];
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=apply-plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply-plan.d.ts","sourceRoot":"","sources":["../../src/refusals/apply-plan.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAM9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAMrD,UAAU,IAAI;IACZ,QAAQ,CAAC,EAAE,EAAE,SAAS,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,cAAc,GAAG,WAAW,EAAE,CAgC/F"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { CONFIG_FILE, editConfigText } from '../config/index.js';
|
|
2
|
+
import { isRecord } from '../check/support/is-record.js';
|
|
3
|
+
import { addFactory } from '../generate/errors/add-factory.js';
|
|
4
|
+
import { addSpecCase } from '../generate/errors/add-spec-case.js';
|
|
5
|
+
import { fitSource } from '../layout/index.js';
|
|
6
|
+
import { toName } from '../naming/index.js';
|
|
7
|
+
import { legacyErrors } from './legacy-errors.js';
|
|
8
|
+
import { nestedCases } from './nested-cases.js';
|
|
9
|
+
import { projectSources } from './project-sources.js';
|
|
10
|
+
import { renderFactory } from './render-factory.js';
|
|
11
|
+
import { rewriteUsages } from './rewrite-usages.js';
|
|
12
|
+
import { specParts } from './spec-parts.js';
|
|
13
|
+
/**
|
|
14
|
+
* Follows the plan: each class per error becomes a factory of the error class of its concept,
|
|
15
|
+
* its spec becomes cases of the spec of that class, every file that named it follows, and the
|
|
16
|
+
* config says the project builds its refusals through factories. Answers the moves it made.
|
|
17
|
+
*/
|
|
18
|
+
export function applyPlan(tree, plan, draft) {
|
|
19
|
+
const moves = plannedMoves(tree, plan, draft);
|
|
20
|
+
for (const planned of moves) {
|
|
21
|
+
moveClass(tree, planned, draft);
|
|
22
|
+
}
|
|
23
|
+
const all = moves.map(({ move }) => move);
|
|
24
|
+
const gone = new Set(draft.removed);
|
|
25
|
+
for (const file of projectSources(tree.ws, tree.config).filter((candidate) => !gone.has(candidate))) {
|
|
26
|
+
const told = (className, conceptClass) => {
|
|
27
|
+
draft.manual.push(`${file}: ${conceptClass} stands where ${className} stood as a value: assert the code of the refusal there.`);
|
|
28
|
+
};
|
|
29
|
+
const source = draft.read(file) ?? '';
|
|
30
|
+
draft.write(file, rewriteUsages(source, all.filter((move) => concerns(move, { file, source }, tree.config)), told));
|
|
31
|
+
}
|
|
32
|
+
draft.write(CONFIG_FILE, editConfigText(draft.read(CONFIG_FILE) ?? '{}', sayFactories));
|
|
33
|
+
return moves;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Two contexts may name a class the same way: a move concerns the files of its own context, and
|
|
37
|
+
* elsewhere the files that import the class from that context.
|
|
38
|
+
*/
|
|
39
|
+
function concerns(move, { file, source }, config) {
|
|
40
|
+
const contexts = `${config.contextsDir}/`;
|
|
41
|
+
return file.startsWith(contexts)
|
|
42
|
+
? file.startsWith(`${contexts}${move.context}/`)
|
|
43
|
+
: source.includes(`/${move.legacyPath}`);
|
|
44
|
+
}
|
|
45
|
+
function sayFactories(raw) {
|
|
46
|
+
raw['stack'] = { ...(isRecord(raw['stack']) ? raw['stack'] : {}), refusals: 'factories' };
|
|
47
|
+
}
|
|
48
|
+
/** The classes still there whose plan entry says where they go; one that cannot move mechanically is said, and left. */
|
|
49
|
+
function plannedMoves({ ws, config }, plan, draft) {
|
|
50
|
+
return legacyErrors(ws, config).flatMap((error) => {
|
|
51
|
+
const entry = (plan.contexts[error.context] ?? []).find((candidate) => candidate.class === error.className && candidate.file === error.file);
|
|
52
|
+
if (entry === undefined || `${entry.concept}Error` === error.className) {
|
|
53
|
+
return [];
|
|
54
|
+
}
|
|
55
|
+
if (error.manual !== undefined) {
|
|
56
|
+
draft.manual.push(`${error.file}: ${error.className} is left as it is, ${error.manual}.`);
|
|
57
|
+
return [];
|
|
58
|
+
}
|
|
59
|
+
const move = {
|
|
60
|
+
className: error.className,
|
|
61
|
+
conceptClass: `${entry.concept}Error`,
|
|
62
|
+
conceptFile: `${toName(entry.concept).kebab}.error`,
|
|
63
|
+
factory: entry.factory,
|
|
64
|
+
code: error.code,
|
|
65
|
+
context: error.context,
|
|
66
|
+
legacyPath: `${error.context}/domain/errors/${baseName(error.file).replace(/\.ts$/, '')}`,
|
|
67
|
+
};
|
|
68
|
+
return [{ error, move }];
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function moveClass({ config }, { error, move }, draft) {
|
|
72
|
+
const context = `${config.contextsDir}/${error.context}`;
|
|
73
|
+
const target = `${context}/domain/errors/${move.conceptFile}.ts`;
|
|
74
|
+
const factory = renderFactory(error, move);
|
|
75
|
+
const empty = `import { ConceptError } from '@ddd-ts-kit/kernel';\n\nexport class ${move.conceptClass} extends ConceptError {}\n`;
|
|
76
|
+
const next = addFactory(draft.read(target) ?? empty, {
|
|
77
|
+
className: move.conceptClass,
|
|
78
|
+
name: move.factory,
|
|
79
|
+
text: factory,
|
|
80
|
+
});
|
|
81
|
+
if (error.parameters.length > 3) {
|
|
82
|
+
draft.manual.push(`${target}: ${move.conceptClass}.${move.factory} takes more than three parameters, give it one typed object.`);
|
|
83
|
+
}
|
|
84
|
+
for (const property of error.properties) {
|
|
85
|
+
draft.manual.push(`${error.className}.${property} was a property of the error: read \`error.facts.${property}\` where it was read.`);
|
|
86
|
+
}
|
|
87
|
+
draft.remove(error.file);
|
|
88
|
+
draft.write(target, fitSource(next ?? empty));
|
|
89
|
+
moveSpec(context, { error, move }, draft);
|
|
90
|
+
}
|
|
91
|
+
/** The spec of the class, rewritten as any other file, becomes the cases of its factory in the spec of the concept class. */
|
|
92
|
+
function moveSpec(context, { error, move }, draft) {
|
|
93
|
+
const old = `${context}/test/unit/${baseName(error.file).replace(/\.ts$/, '.spec.ts')}`;
|
|
94
|
+
const source = draft.read(old);
|
|
95
|
+
if (source === undefined) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const { imports, cases } = specParts(rewriteUsages(source, [move]));
|
|
99
|
+
const target = `${context}/test/unit/${move.conceptFile}.spec.ts`;
|
|
100
|
+
if (cases === undefined) {
|
|
101
|
+
draft.manual.push(`${old}: no describe block was found, move its cases to ${target} by hand.`);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
const existing = draft.read(target) ?? `${imports.join('')}\ndescribe('${move.conceptClass}', () => {\n});\n`;
|
|
105
|
+
const merged = addSpecCase(withImports(existing, imports), `describe('${move.factory}'`, nestedCases(move.factory, cases));
|
|
106
|
+
draft.remove(old);
|
|
107
|
+
draft.write(target, merged ?? existing);
|
|
108
|
+
}
|
|
109
|
+
function withImports(spec, imports) {
|
|
110
|
+
const missing = imports.filter((line) => !spec.includes(line));
|
|
111
|
+
const last = [...spec.matchAll(/^import [^;]+;\n/gm)].at(-1);
|
|
112
|
+
const at = last === undefined ? 0 : last.index + last[0].length;
|
|
113
|
+
return spec.slice(0, at) + missing.join('') + spec.slice(at);
|
|
114
|
+
}
|
|
115
|
+
function baseName(file) {
|
|
116
|
+
return file.slice(file.lastIndexOf('/') + 1);
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=apply-plan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply-plan.js","sourceRoot":"","sources":["../../src/refusals/apply-plan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAe,MAAM,oBAAoB,CAAC;AAC9E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AAC,GAAG,CAAC,CAAC;IAClB,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,IAAI,QAAQ,CAAC,CAAC;AAC1C,CAAC;AAED,SAAS,WAAW,CAAC,IAAY,EAAE,OAA0B;IAC3D,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IAC/D,MAAM,IAAI,GAAG,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7D,MAAM,EAAE,GAAG,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IAEhE,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAC/D,CAAC;AAED,SAAS,QAAQ,CAAC,IAAY;IAC5B,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The factory name whose code is `code` on the error class of `concept`: the code without the
|
|
3
|
+
* name of the concept at either end (`APPOINTMENT_NOT_FOUND` gives `notFound`), or the whole
|
|
4
|
+
* code when what is left would say nothing.
|
|
5
|
+
*/
|
|
6
|
+
export declare function factoryNameFor(code: string, concept: string): string;
|
|
7
|
+
//# sourceMappingURL=factory-name-for.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory-name-for.d.ts","sourceRoot":"","sources":["../../src/refusals/factory-name-for.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CASpE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { VAGUE_REFUSAL_NAMES } from '../generate/errors/vague-refusal-names.js';
|
|
2
|
+
import { toName } from '../naming/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* The factory name whose code is `code` on the error class of `concept`: the code without the
|
|
5
|
+
* name of the concept at either end (`APPOINTMENT_NOT_FOUND` gives `notFound`), or the whole
|
|
6
|
+
* code when what is left would say nothing.
|
|
7
|
+
*/
|
|
8
|
+
export function factoryNameFor(code, concept) {
|
|
9
|
+
const subject = toName(concept).constant;
|
|
10
|
+
const whole = toName(code).camel;
|
|
11
|
+
const rest = [new RegExp(`^${subject}_`), new RegExp(`_${subject}$`)]
|
|
12
|
+
.filter((edge) => subject !== '' && edge.test(code))
|
|
13
|
+
.map((edge) => toName(code.replace(edge, '')).camel)[0];
|
|
14
|
+
return rest === undefined || rest === '' || VAGUE_REFUSAL_NAMES.includes(rest.toLowerCase()) ? whole : rest;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=factory-name-for.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory-name-for.js","sourceRoot":"","sources":["../../src/refusals/factory-name-for.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY,EAAE,OAAe;IAC1D,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC;IACzC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC;IAEjC,MAAM,IAAI,GAAG,CAAC,IAAI,MAAM,CAAC,IAAI,OAAO,GAAG,CAAC,EAAE,IAAI,MAAM,CAAC,IAAI,OAAO,GAAG,CAAC,CAAC;SAClE,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,KAAK,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACnD,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAE1D,OAAO,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,EAAE,IAAI,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;AAC9G,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** One parameter of the constructor of a class per error, modifiers removed. */
|
|
2
|
+
export interface LegacyParameter {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
/** As written after the colon, or `unknown` when the parameter has no type. */
|
|
5
|
+
readonly type: string;
|
|
6
|
+
}
|
|
7
|
+
/** A class per error of 0.2, as much of it as a factory needs. */
|
|
8
|
+
export interface LegacyError {
|
|
9
|
+
readonly file: string;
|
|
10
|
+
readonly context: string;
|
|
11
|
+
readonly className: string;
|
|
12
|
+
readonly code: string;
|
|
13
|
+
readonly parameters: readonly LegacyParameter[];
|
|
14
|
+
/** The parameters that were also properties of the error (`readonly personId: string`): the facts carry them now. */
|
|
15
|
+
readonly properties: readonly string[];
|
|
16
|
+
/** The expression given to `super(..)`, as written. */
|
|
17
|
+
readonly message: string;
|
|
18
|
+
/** Why the class cannot be turned into a factory mechanically, when it cannot. */
|
|
19
|
+
readonly manual?: string;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=legacy-error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-error.d.ts","sourceRoot":"","sources":["../../src/refusals/legacy-error.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,+EAA+E;IAC/E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,kEAAkE;AAClE,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,SAAS,eAAe,EAAE,CAAC;IAChD,qHAAqH;IACrH,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,uDAAuD;IACvD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,kFAAkF;IAClF,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-error.js","sourceRoot":"","sources":["../../src/refusals/legacy-error.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
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
|
+
/** Every class per error of the `domain/errors/` of every context, in the order of their files. */
|
|
5
|
+
export declare function legacyErrors(ws: Workspace, config: Config): LegacyError[];
|
|
6
|
+
//# sourceMappingURL=legacy-errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-errors.d.ts","sourceRoot":"","sources":["../../src/refusals/legacy-errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,mGAAmG;AACnG,wBAAgB,YAAY,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,EAAE,CAczE"}
|