ddd-ts-kit 0.1.0 → 0.2.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 +124 -24
- package/dist/affected/changed-paths.d.ts +8 -0
- package/dist/affected/changed-paths.d.ts.map +1 -0
- package/dist/affected/changed-paths.js +21 -0
- package/dist/affected/changed-paths.js.map +1 -0
- package/dist/affected/downstreams-of.d.ts +4 -0
- package/dist/affected/downstreams-of.d.ts.map +1 -0
- package/dist/affected/downstreams-of.js +16 -0
- package/dist/affected/downstreams-of.js.map +1 -0
- package/dist/affected/everything.d.ts +5 -0
- package/dist/affected/everything.d.ts.map +1 -0
- package/dist/affected/everything.js +5 -0
- package/dist/affected/everything.js.map +1 -0
- package/dist/affected/format-selection.d.ts +10 -0
- package/dist/affected/format-selection.d.ts.map +1 -0
- package/dist/affected/format-selection.js +45 -0
- package/dist/affected/format-selection.js.map +1 -0
- package/dist/affected/path-reach.d.ts +12 -0
- package/dist/affected/path-reach.d.ts.map +1 -0
- package/dist/affected/path-reach.js +2 -0
- package/dist/affected/path-reach.js.map +1 -0
- package/dist/affected/reach-of.d.ts +10 -0
- package/dist/affected/reach-of.d.ts.map +1 -0
- package/dist/affected/reach-of.js +30 -0
- package/dist/affected/reach-of.js.map +1 -0
- package/dist/affected/select-affected.d.ts +11 -0
- package/dist/affected/select-affected.d.ts.map +1 -0
- package/dist/affected/select-affected.js +39 -0
- package/dist/affected/select-affected.js.map +1 -0
- package/dist/affected/selection.d.ts +14 -0
- package/dist/affected/selection.d.ts.map +1 -0
- package/dist/affected/selection.js +2 -0
- package/dist/affected/selection.js.map +1 -0
- 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 +4 -0
- package/dist/check/catalogue/architecture-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/explain/context-docs.js +7 -7
- package/dist/check/explain/context-docs.js.map +1 -1
- 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/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/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 +4 -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/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/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/affected.d.ts +8 -0
- package/dist/commands/affected.d.ts.map +1 -0
- package/dist/commands/affected.js +38 -0
- package/dist/commands/affected.js.map +1 -0
- 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 +19 -2
- package/dist/commands/docs.js.map +1 -1
- package/dist/commands/generate.d.ts.map +1 -1
- package/dist/commands/generate.js +5 -0
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +7 -1
- 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 +15 -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/cruise-configuration.js +3 -1
- package/dist/depcruise/cruise-configuration.js.map +1 -1
- package/dist/depcruise/hygiene-rules.js +2 -1
- package/dist/depcruise/hygiene-rules.js.map +1 -1
- package/dist/describe/context-description.d.ts +10 -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 +2 -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 +4 -0
- package/dist/describe/format-description.js.map +1 -1
- 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 +9 -0
- 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/apply-wiring.js +1 -1
- package/dist/generate/apply-wiring.js.map +1 -1
- package/dist/generate/kinds/adapter-kind.d.ts.map +1 -1
- package/dist/generate/kinds/adapter-kind.js +5 -2
- package/dist/generate/kinds/adapter-kind.js.map +1 -1
- 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 +12 -0
- package/dist/generate/kinds/declare-context-entries.d.ts.map +1 -0
- package/dist/generate/kinds/declare-context-entries.js +33 -0
- package/dist/generate/kinds/declare-context-entries.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/generate-context.d.ts.map +1 -1
- package/dist/generate/kinds/generate-context.js +2 -0
- package/dist/generate/kinds/generate-context.js.map +1 -1
- package/dist/generate/kinds/import-assembler.d.ts +9 -0
- package/dist/generate/kinds/import-assembler.d.ts.map +1 -0
- package/dist/generate/kinds/import-assembler.js +29 -0
- package/dist/generate/kinds/import-assembler.js.map +1 -0
- 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 -32
- package/dist/generate/kinds/write-context-files.js.map +1 -1
- package/dist/generate/kinds/write-own-policy.d.ts +9 -0
- package/dist/generate/kinds/write-own-policy.d.ts.map +1 -0
- package/dist/generate/kinds/write-own-policy.js +13 -0
- package/dist/generate/kinds/write-own-policy.js.map +1 -0
- package/dist/generate/kinds.d.ts.map +1 -1
- package/dist/generate/kinds.js +2 -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/shared-writes.d.ts.map +1 -1
- package/dist/generate/shared-writes.js +6 -0
- package/dist/generate/shared-writes.js.map +1 -1
- package/dist/generate/spec-vars.js +4 -4
- package/dist/generate/spec-vars.js.map +1 -1
- package/dist/generate/stop-ignoring-validation.d.ts +9 -0
- package/dist/generate/stop-ignoring-validation.d.ts.map +1 -0
- package/dist/generate/stop-ignoring-validation.js +36 -0
- package/dist/generate/stop-ignoring-validation.js.map +1 -0
- 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/files/architecture-files.d.ts +9 -0
- package/dist/init/files/architecture-files.d.ts.map +1 -0
- package/dist/init/files/architecture-files.js +10 -0
- package/dist/init/files/architecture-files.js.map +1 -0
- package/dist/init/files/init-files.d.ts.map +1 -1
- package/dist/init/files/init-files.js +2 -0
- package/dist/init/files/init-files.js.map +1 -1
- package/dist/init/files/persistence-files.d.ts.map +1 -1
- package/dist/init/files/persistence-files.js +5 -1
- package/dist/init/files/persistence-files.js.map +1 -1
- package/dist/init/files/pipeline-files.d.ts.map +1 -1
- package/dist/init/files/pipeline-files.js +5 -1
- package/dist/init/files/pipeline-files.js.map +1 -1
- package/dist/init/files/platform-files.d.ts.map +1 -1
- package/dist/init/files/platform-files.js +3 -1
- package/dist/init/files/platform-files.js.map +1 -1
- package/dist/init/files/project-files.d.ts.map +1 -1
- package/dist/init/files/project-files.js +3 -1
- package/dist/init/files/project-files.js.map +1 -1
- package/dist/init/knip-vars.d.ts +3 -3
- package/dist/init/knip-vars.d.ts.map +1 -1
- package/dist/init/knip-vars.js +27 -5
- package/dist/init/knip-vars.js.map +1 -1
- package/dist/init/manifest/documentation-scripts.d.ts.map +1 -1
- package/dist/init/manifest/documentation-scripts.js +2 -0
- package/dist/init/manifest/documentation-scripts.js.map +1 -1
- package/dist/init/manifest/scripts-for.d.ts +5 -1
- package/dist/init/manifest/scripts-for.d.ts.map +1 -1
- package/dist/init/manifest/scripts-for.js +16 -2
- package/dist/init/manifest/scripts-for.js.map +1 -1
- package/dist/init/manifest/versions.js +23 -23
- package/dist/init/manifest/write-manifest.d.ts.map +1 -1
- package/dist/init/manifest/write-manifest.js +18 -1
- package/dist/init/manifest/write-manifest.js.map +1 -1
- package/dist/init/run-init.d.ts.map +1 -1
- package/dist/init/run-init.js +56 -7
- 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/template-vars.d.ts.map +1 -1
- package/dist/init/template-vars.js +2 -0
- package/dist/init/template-vars.js.map +1 -1
- package/dist/init/validation-dependencies.d.ts +10 -0
- package/dist/init/validation-dependencies.d.ts.map +1 -0
- package/dist/init/validation-dependencies.js +23 -0
- package/dist/init/validation-dependencies.js.map +1 -0
- package/dist/init/write-agent-settings.js +4 -3
- package/dist/init/write-agent-settings.js.map +1 -1
- package/dist/init/write-contracts.d.ts +10 -0
- package/dist/init/write-contracts.d.ts.map +1 -0
- package/dist/init/write-contracts.js +33 -0
- package/dist/init/write-contracts.js.map +1 -0
- 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/package-manager/default-package-manager.d.ts +8 -0
- package/dist/package-manager/default-package-manager.d.ts.map +1 -0
- package/dist/package-manager/default-package-manager.js +7 -0
- package/dist/package-manager/default-package-manager.js.map +1 -0
- package/dist/package-manager/dialect.d.ts +3 -0
- package/dist/package-manager/dialect.d.ts.map +1 -0
- package/dist/package-manager/dialect.js +2 -0
- package/dist/package-manager/dialect.js.map +1 -0
- package/dist/package-manager/dialects.d.ts +5 -0
- package/dist/package-manager/dialects.d.ts.map +1 -0
- package/dist/package-manager/dialects.js +21 -0
- package/dist/package-manager/dialects.js.map +1 -0
- package/dist/package-manager/in-dialect.d.ts +8 -0
- package/dist/package-manager/in-dialect.d.ts.map +1 -0
- package/dist/package-manager/in-dialect.js +10 -0
- package/dist/package-manager/in-dialect.js.map +1 -0
- package/dist/package-manager/lockfiles.d.ts +4 -0
- package/dist/package-manager/lockfiles.d.ts.map +1 -0
- package/dist/package-manager/lockfiles.js +6 -0
- package/dist/package-manager/lockfiles.js.map +1 -0
- package/dist/package-manager/package-manager-of.d.ts +4 -0
- package/dist/package-manager/package-manager-of.d.ts.map +1 -0
- package/dist/package-manager/package-manager-of.js +15 -0
- package/dist/package-manager/package-manager-of.js.map +1 -0
- package/dist/package-manager/package-manager-vars.d.ts +5 -0
- package/dist/package-manager/package-manager-vars.d.ts.map +1 -0
- package/dist/package-manager/package-manager-vars.js +13 -0
- package/dist/package-manager/package-manager-vars.js.map +1 -0
- package/dist/package-manager/pinned-package-managers.d.ts +7 -0
- package/dist/package-manager/pinned-package-managers.d.ts.map +1 -0
- package/dist/package-manager/pinned-package-managers.js +9 -0
- package/dist/package-manager/pinned-package-managers.js.map +1 -0
- 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/run.d.ts.map +1 -1
- package/dist/run.js +10 -2
- 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/templating/render.d.ts.map +1 -1
- package/dist/templating/render.js +2 -1
- package/dist/templating/render.js.map +1 -1
- package/dist/templating/rendering.js +1 -1
- package/dist/templating/rendering.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/workspace/workspace.d.ts +5 -1
- package/dist/workspace/workspace.d.ts.map +1 -1
- package/dist/workspace/workspace.js +13 -3
- package/dist/workspace/workspace.js.map +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/architecture/extractable.declared.spec.ts.tpl +7 -7
- package/templates/architecture/extractable.manual.spec.ts.tpl +8 -4
- package/templates/architecture/extractable.tsyringe.spec.ts.tpl +7 -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 +7 -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 +4 -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/asyncapi.json.tpl +12 -0
- package/templates/docs/event-catalog.md +3 -0
- package/templates/docs/openapi.json.tpl +354 -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/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 +16 -10
- package/templates/init/docker/Dockerfile.tpl +9 -2
- 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 +3 -1
- 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 -16
- 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/journal.drizzle.json +5 -0
- 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/pnpm-workspace.yaml +8 -0
- package/templates/init/rules/application.md.tpl +8 -2
- package/templates/init/rules/infrastructure.md.tpl +3 -3
- package/templates/init/scripts/events.ts.tpl +1 -1
- package/templates/init/scripts/openapi.ts.tpl +6 -6
- 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/biome.json.tpl +2 -1
- package/templates/pipeline/github/actions/setup/action.yml.tpl +37 -0
- package/templates/pipeline/github/scripts/start-postgres.sh +47 -0
- package/templates/pipeline/github/workflows/ci.yml +68 -110
- package/templates/pipeline/github/workflows/pr-title.yml +1 -5
- package/templates/pipeline/gitlab/{gitlab-ci.yml → gitlab-ci.yml.tpl} +59 -31
- package/templates/pipeline/knip.json.tpl +9 -10
- package/templates/pipeline/package-scripts.json +1 -1
- package/templates/pipeline/vitest.config.ts.tpl +7 -3
- 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.search.ts.tpl +1 -1
- package/templates/route/route.spec.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/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 @@
|
|
|
1
|
+
{"version":3,"file":"context-plan.js","sourceRoot":"","sources":["../../../src/generate/kinds/context-plan.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Config } from '../../config/index.js';
|
|
2
|
+
import type { Workspace } from '../../workspace/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* What knip enters a context by, told to it with the first context: before one exists the
|
|
5
|
+
* patterns match nothing, which knip reports. A module file where the wiring is written; under
|
|
6
|
+
* discovery the role files nothing imports (handlers, publishers, jobs, adapters...), in one
|
|
7
|
+
* pattern with the published language, which every context has from its first minute, and with
|
|
8
|
+
* the generated file that registers what their constructors take, which discovery loads with
|
|
9
|
+
* them and which a context has once one of its classes takes something.
|
|
10
|
+
*/
|
|
11
|
+
export declare function declareContextEntries(ws: Workspace, config: Config): void;
|
|
12
|
+
//# sourceMappingURL=declare-context-entries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declare-context-entries.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/declare-context-entries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAO1D;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAYzE"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { DISCOVERED_SUFFIXES } from '../../declared/index.js';
|
|
2
|
+
import { isDeclared } from '../is-declared.js';
|
|
3
|
+
import { editJson } from './extraction/edit-json.js';
|
|
4
|
+
const KNIP_FILE = 'knip.json';
|
|
5
|
+
const PUBLISHED_LANGUAGE = 'published-language/index';
|
|
6
|
+
/**
|
|
7
|
+
* What knip enters a context by, told to it with the first context: before one exists the
|
|
8
|
+
* patterns match nothing, which knip reports. A module file where the wiring is written; under
|
|
9
|
+
* discovery the role files nothing imports (handlers, publishers, jobs, adapters...), in one
|
|
10
|
+
* pattern with the published language, which every context has from its first minute, and with
|
|
11
|
+
* the generated file that registers what their constructors take, which discovery loads with
|
|
12
|
+
* them and which a context has once one of its classes takes something.
|
|
13
|
+
*/
|
|
14
|
+
export function declareContextEntries(ws, config) {
|
|
15
|
+
if (ws.read(KNIP_FILE) === undefined) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
editJson(ws, KNIP_FILE, (knip) => {
|
|
19
|
+
const entries = Array.isArray(knip['entry']) ? knip['entry'] : [];
|
|
20
|
+
if (!entries.some((entry) => typeof entry === 'string' && entry.includes(PUBLISHED_LANGUAGE))) {
|
|
21
|
+
knip['entry'] = [...contextEntries(config), ...entries];
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function contextEntries(config) {
|
|
26
|
+
const contexts = `${config.contextsDir}/*`;
|
|
27
|
+
if (config.stack.assembly === 'discovery' && isDeclared(config)) {
|
|
28
|
+
const roles = `{application,infrastructure}/**/*.{${DISCOVERED_SUFFIXES.join(',')}}`;
|
|
29
|
+
return [`${contexts}/{${PUBLISHED_LANGUAGE},*.dependencies,${roles}}.ts`];
|
|
30
|
+
}
|
|
31
|
+
return [...(isDeclared(config) ? [] : [`${contexts}/*.module.ts`]), `${contexts}/${PUBLISHED_LANGUAGE}.ts`];
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=declare-context-entries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declare-context-entries.js","sourceRoot":"","sources":["../../../src/generate/kinds/declare-context-entries.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAErD,MAAM,SAAS,GAAG,WAAW,CAAC;AAC9B,MAAM,kBAAkB,GAAG,0BAA0B,CAAC;AAEtD;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB,CAAC,EAAa,EAAE,MAAc;IACjE,IAAI,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,SAAS,EAAE,CAAC;QACrC,OAAO;IACT,CAAC;IAED,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE;QAC/B,MAAM,OAAO,GAAc,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAE7E,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,EAAE,CAAC;YAC9F,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,cAAc,CAAC,MAAM,CAAC,EAAE,GAAG,OAAO,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,cAAc,CAAC,MAAc;IACpC,MAAM,QAAQ,GAAG,GAAG,MAAM,CAAC,WAAW,IAAI,CAAC;IAE3C,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,KAAK,WAAW,IAAI,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QAChE,MAAM,KAAK,GAAG,sCAAsC,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;QAErF,OAAO,CAAC,GAAG,QAAQ,KAAK,kBAAkB,mBAAmB,KAAK,MAAM,CAAC,CAAC;IAC5E,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,cAAc,CAAC,CAAC,EAAE,GAAG,QAAQ,IAAI,kBAAkB,KAAK,CAAC,CAAC;AAC9G,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { specifierOf } from '../../../alias/index.js';
|
|
2
2
|
import { barrelFile, routesFile } from '../../../declared/index.js';
|
|
3
3
|
import { fitStatement } from '../../../layout/index.js';
|
|
4
4
|
import { assembledContext } from '../../assembled-context.js';
|
|
@@ -9,36 +9,33 @@ export function serviceSelection(scope) {
|
|
|
9
9
|
const { context, config } = scope;
|
|
10
10
|
const directory = `${relativeTo(`${config.sourceRoot}/apps/${context.kebab}`, config.contextsDir)}/${context.kebab}`;
|
|
11
11
|
const module = assembledContext(scope, `${directory}/`);
|
|
12
|
-
const
|
|
12
|
+
const inContext = (file) => specifierOf(config, `${config.contextsDir}/${context.kebab}/${file}`);
|
|
13
13
|
if (config.stack.di !== 'tsyringe') {
|
|
14
|
-
return { selection: argument(`[${module}]`), imports: moduleImports(scope,
|
|
14
|
+
return { selection: argument(`[${module}]`), imports: moduleImports(scope, inContext).join('\n') };
|
|
15
15
|
}
|
|
16
16
|
const withRoutes = config.stack.http !== 'none';
|
|
17
17
|
const routes = withRoutes
|
|
18
|
-
? [`import { ${context.camel}Routes } from '${
|
|
18
|
+
? [`import { ${context.camel}Routes } from '${inContext(routesFile(context.kebab))}';`]
|
|
19
19
|
: [];
|
|
20
20
|
return {
|
|
21
21
|
selection: argument(`{ modules: [${module}]${withRoutes ? `, routes: [${context.camel}Routes]` : ''} }`),
|
|
22
|
-
imports: [...moduleImports(scope,
|
|
22
|
+
imports: [...moduleImports(scope, inContext), ...routes].join('\n'),
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
function argument(selection) {
|
|
26
26
|
return fitStatement(`${selection},`, ' ').join('\n').trimStart();
|
|
27
27
|
}
|
|
28
28
|
/** The same imports as in the composition root of the whole application, for this context alone. */
|
|
29
|
-
function moduleImports({ context, config },
|
|
29
|
+
function moduleImports({ context, config }, inContext) {
|
|
30
30
|
if (!isDeclared(config)) {
|
|
31
|
-
return [`import { ${context.camel}Module } from '${
|
|
31
|
+
return [`import { ${context.camel}Module } from '${inContext(`${context.kebab}.module.ts`)}';`];
|
|
32
32
|
}
|
|
33
33
|
if (config.stack.assembly === 'discovery') {
|
|
34
34
|
return ["import { discoverContext } from '@ddd-ts-kit/di/discovery';"];
|
|
35
35
|
}
|
|
36
36
|
return [
|
|
37
37
|
...hostImports(config),
|
|
38
|
-
`import * as ${context.camel}Declarations from '${
|
|
38
|
+
`import * as ${context.camel}Declarations from '${inContext(barrelFile(context.kebab))}';`,
|
|
39
39
|
];
|
|
40
40
|
}
|
|
41
|
-
function compiled(file) {
|
|
42
|
-
return file.replace(/\.ts$/, '.js');
|
|
43
|
-
}
|
|
44
41
|
//# sourceMappingURL=service-selection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-selection.js","sourceRoot":"","sources":["../../../../src/generate/kinds/extraction/service-selection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"service-selection.js","sourceRoot":"","sources":["../../../../src/generate/kinds/extraction/service-selection.ts"],"names":[],"mappings":"AAAA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"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,MAAM,EAEZ,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"generate-context.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/generate-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,MAAM,EAEZ,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAI3D,wFAAwF;AACxF,wBAAgB,eAAe,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,MAAM,CAyB9F"}
|
|
@@ -2,6 +2,7 @@ import { addContextToConfigText, CLASSIFICATIONS, CONFIG_FILE, isOneOf, } from '
|
|
|
2
2
|
import { refreshContextDoc } from '../../docs/refresh-context-doc.js';
|
|
3
3
|
import { CliError } from '../../cli-error.js';
|
|
4
4
|
import { parseContextName } from '../../naming/index.js';
|
|
5
|
+
import { declareContextEntries } from './declare-context-entries.js';
|
|
5
6
|
import { writeContextFiles } from './write-context-files.js';
|
|
6
7
|
/** Shared by `generate context` and `init`, so both create exactly the same context. */
|
|
7
8
|
export function generateContext(ws, config, request) {
|
|
@@ -15,6 +16,7 @@ export function generateContext(ws, config, request) {
|
|
|
15
16
|
declareInConfig(ws, context, entry);
|
|
16
17
|
}
|
|
17
18
|
writeContextFiles(ws, { config: next, context, request });
|
|
19
|
+
declareContextEntries(ws, next);
|
|
18
20
|
// An upstream gains a downstream line in its own CONTEXT.md.
|
|
19
21
|
for (const upstream of entry.upstreams) {
|
|
20
22
|
refreshContextDoc(ws, next, upstream.context);
|
|
@@ -1 +1 @@
|
|
|
1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YACpD,MAAM,IAAI,QAAQ,CAChB,yBAAyB,QAAQ,CAAC,OAAO,oBAAoB,EAC7D,sDAAsD,QAAQ,CAAC,OAAO,gDAAgD,CACvH,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CAAC,EAAa,EAAE,OAAa,EAAE,KAAiC;IACtF,MAAM,IAAI,GAAG,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAElC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,sBAAsB,CAAC,IAAI,EAAE,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;IAC7E,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Config } from '../../config/index.js';
|
|
2
|
+
import type { Workspace } from '../../workspace/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* What turns the declarations of a context into its module (`contextModule`, or `discoverContext`
|
|
5
|
+
* under discovery) is imported by the file that assembles the contexts with the first of them:
|
|
6
|
+
* before it nothing names the function, and the linter reports an import nobody uses.
|
|
7
|
+
*/
|
|
8
|
+
export declare function importAssembler(ws: Workspace, config: Config, file: string): void;
|
|
9
|
+
//# sourceMappingURL=import-assembler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import-assembler.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/import-assembler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAM1D;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAgBjF"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { applyWiring } from '../apply-wiring.js';
|
|
2
|
+
const DI = '@ddd-ts-kit/di';
|
|
3
|
+
const DI_IMPORT = /import \{(\s*)([^}]*)\} from '@ddd-ts-kit\/di';\n/;
|
|
4
|
+
/**
|
|
5
|
+
* What turns the declarations of a context into its module (`contextModule`, or `discoverContext`
|
|
6
|
+
* under discovery) is imported by the file that assembles the contexts with the first of them:
|
|
7
|
+
* before it nothing names the function, and the linter reports an import nobody uses.
|
|
8
|
+
*/
|
|
9
|
+
export function importAssembler(ws, config, file) {
|
|
10
|
+
const content = ws.read(file);
|
|
11
|
+
const discovered = config.stack.assembly === 'discovery';
|
|
12
|
+
const name = discovered ? 'discoverContext' : 'contextModule';
|
|
13
|
+
if (content === undefined || new RegExp(`\\b${name}\\b`).test(content)) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
if (!DI_IMPORT.test(content)) {
|
|
17
|
+
applyWiring(ws, file, `@@imports\nimport { ${name} } from '${discovered ? `${DI}/discovery` : DI}';\n`);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
ws.update(file, discovered ? followedByDiscovery(content) : namedFirst(content, name));
|
|
21
|
+
}
|
|
22
|
+
/** The name joins the statement that already imports from the package, first, on a line of its own when the others are. */
|
|
23
|
+
function namedFirst(content, name) {
|
|
24
|
+
return content.replace(DI_IMPORT, (_statement, gap, names) => `import {${gap}${name},${gap}${names}} from '${DI}';\n`);
|
|
25
|
+
}
|
|
26
|
+
function followedByDiscovery(content) {
|
|
27
|
+
return content.replace(DI_IMPORT, (statement) => `${statement}import { discoverContext } from '${DI}/discovery';\n`);
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=import-assembler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import-assembler.js","sourceRoot":"","sources":["../../../src/generate/kinds/import-assembler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,EAAE,GAAG,gBAAgB,CA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AAiB,EAAE,EAAE,CAAC,GAAG,SAAS,oCAAoC,EAAE,gBAAgB,CAC1F,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"job-vars.d.ts","sourceRoot":"","sources":["../../../../src/generate/kinds/job/job-vars.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAElE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAE5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKrD,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,4CAA4C;IAC5C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;CAC/B;AAED,qHAAqH;AACrH,wBAAgB,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,QAAQ,GAAG,aAAa,
|
|
1
|
+
{"version":3,"file":"job-vars.d.ts","sourceRoot":"","sources":["../../../../src/generate/kinds/job/job-vars.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAElE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAE5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKrD,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,4CAA4C;IAC5C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;CAC/B;AAED,qHAAqH;AACrH,wBAAgB,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,QAAQ,GAAG,aAAa,CAwB1F"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { specifierOf } from '../../../alias/index.js';
|
|
2
2
|
import { permissionsFile } from '../../permissions-file.js';
|
|
3
3
|
import { grantSystemActor } from './grant-system-actor.js';
|
|
4
4
|
const PERIOD = 'which period the work is for is said by `execution.scheduledAt`, never by the clock: an occurrence may run late, or twice';
|
|
@@ -16,7 +16,9 @@ export function jobVars(scope, { name, schedule, command }) {
|
|
|
16
16
|
commandWords: command.name.words,
|
|
17
17
|
protected: command.isProtected,
|
|
18
18
|
asActor: command.isProtected ? ' as the system actor of the job' : '',
|
|
19
|
-
|
|
19
|
+
kernelImport: command.isProtected
|
|
20
|
+
? "import { systemActor, type CommandBus } from '@ddd-ts-kit/kernel';"
|
|
21
|
+
: "import type { CommandBus } from '@ddd-ts-kit/kernel';",
|
|
20
22
|
systemActorValueImport: command.isProtected ? 'systemActor, ' : '',
|
|
21
23
|
arguments: [...actor, ...(command.takesInstant ? ['execution.scheduledAt'] : [])].join(', '),
|
|
22
24
|
todo: todoOf(command),
|
|
@@ -43,7 +45,7 @@ function grantedInSpec(scope, command) {
|
|
|
43
45
|
}
|
|
44
46
|
return {
|
|
45
47
|
granted: `${set}['${key}']`,
|
|
46
|
-
permissionsImport: `import { ${set} } from '${
|
|
48
|
+
permissionsImport: `import { ${set} } from '${specifierOf(scope.config, `${scope.config.contextsDir}/${scope.context.kebab}/${permissionsFile(scope.context)}`)}';`,
|
|
47
49
|
};
|
|
48
50
|
}
|
|
49
51
|
//# sourceMappingURL=job-vars.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"job-vars.js","sourceRoot":"","sources":["../../../../src/generate/kinds/job/job-vars.ts"],"names":[],"mapp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EAAE,iBAAiB,EAAE,EAAE,EAAE,CAAC;IACnD,CAAC;IAED,OAAO;QACL,OAAO,EAAE,GAAG,GAAG,KAAK,GAAG,IAAI;QAC3B,iBAAiB,EAAE,YAAY,GAAG,YAAY,WAAW,CAAC,KAAK,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,WAAW,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,IAAI,eAAe,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI;KACpK,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { RenderContext } from '../../templating/index.js';
|
|
2
|
+
import type { ContextPlan } from './context-plan.js';
|
|
3
|
+
/** What the templates of a context read: the stack, the context, how it is assembled and what its document opens with. */
|
|
4
|
+
export declare function planVars({ config, context, request }: ContextPlan): RenderContext;
|
|
5
|
+
//# sourceMappingURL=plan-vars.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan-vars.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/plan-vars.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAI/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAQrD,0HAA0H;AAC1H,wBAAgB,QAAQ,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,WAAW,GAAG,aAAa,CAiBjF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { assembledContext } from '../assembled-context.js';
|
|
2
|
+
import { contextVars } from '../context-vars.js';
|
|
3
|
+
import { relativeTo } from '../relative-to.js';
|
|
4
|
+
const GLOSSARY_TODO = 'TODO(domain): define the ubiquitous language first: one row per term the domain experts use here, with the meaning it has in this context only. Every class, method and event is then named after these terms.';
|
|
5
|
+
const PURPOSE_TODO = 'TODO(domain): say in two sentences which business capability this context owns and for whom; the first sentence is reused in the context map.';
|
|
6
|
+
/** What the templates of a context read: the stack, the context, how it is assembled and what its document opens with. */
|
|
7
|
+
export function planVars({ config, context, request }) {
|
|
8
|
+
const terms = request.terms ?? [];
|
|
9
|
+
const toContext = (from) => `${relativeTo(from, config.contextsDir)}/${context.kebab}/`;
|
|
10
|
+
return {
|
|
11
|
+
...contextVars(config, context),
|
|
12
|
+
assembled: {
|
|
13
|
+
module: assembledContext({ config, context }, toContext(config.platformDir)),
|
|
14
|
+
proofModule: assembledContext({ config, context }, toContext('test/architecture')),
|
|
15
|
+
},
|
|
16
|
+
doc: {
|
|
17
|
+
classification: config.contexts[context.kebab]?.classification ?? '',
|
|
18
|
+
purpose: request.purpose?.trim() || PURPOSE_TODO,
|
|
19
|
+
glossaryHint: terms.length > 0 ? '' : `\n${GLOSSARY_TODO}\n`,
|
|
20
|
+
glossaryRows: terms.map((row) => `\n| ${row.term} | ${row.meaning} | |`).join(''),
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=plan-vars.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan-vars.js","sourceRoot":"","sources":["../../../src/generate/kinds/plan-vars.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG/C,MAAM,aAAa,GACjB,gNAAgN,CAAC;AAEnN,MAAM,YAAY,GAChB,+IAA+I,CAAC;AAElJ,0HAA0H;AAC1H,MAAM,UAAU,QAAQ,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAe;IAChE,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC;IAClC,MAAM,SAAS,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,GAAG,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,IAAI,OAAO,CAAC,KAAK,GAAG,CAAC;IAExG,OAAO;QACL,GAAG,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC;QAC/B,SAAS,EAAE;YACT,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;YAC5E,WAAW,EAAE,gBAAgB,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,SAAS,CAAC,mBAAmB,CAAC,CAAC;SACnF;QACD,GAAG,EAAE;YACH,cAAc,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,cAAc,IAAI,EAAE;YACpE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,YAAY;YAChD,YAAY,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,aAAa,IAAI;YAC5D,YAAY,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,GAAG,CAAC,IAAI,MAAM,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;SACnF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projection-kind.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/projection-kind.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AASvC,eAAO,MAAM,cAAc,EAAE,IAuC5B,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { CONFIG_FILE } from '../../config/index.js';
|
|
2
|
+
import { CliError } from '../../cli-error.js';
|
|
3
|
+
import { parseConceptName, parseContextName, toName } from '../../naming/index.js';
|
|
4
|
+
import { emit } from '../emit.js';
|
|
5
|
+
import { isDeclared } from '../is-declared.js';
|
|
6
|
+
import { learnTerms } from '../learn-terms.js';
|
|
7
|
+
import { named } from '../named.js';
|
|
8
|
+
import { openScope } from '../open-scope.js';
|
|
9
|
+
import { vars } from '../vars.js';
|
|
10
|
+
import { findEventDeclaration } from './find-event-declaration.js';
|
|
11
|
+
export const projectionKind = {
|
|
12
|
+
name: 'projection',
|
|
13
|
+
aliases: ['projector'],
|
|
14
|
+
usage: 'projection <context> <Name> <eventType> [--term "<Term>=<meaning>"]...',
|
|
15
|
+
summary: 'A projector, the class that keeps one read model up to date from integration events of its own context or of a declared upstream, and its spec: declared style only.',
|
|
16
|
+
positionals: ['context', 'Name', 'eventType'],
|
|
17
|
+
writesShared: false,
|
|
18
|
+
run: (request) => {
|
|
19
|
+
const scope = openScope(request);
|
|
20
|
+
if (!isDeclared(scope.config)) {
|
|
21
|
+
throw explicitStyle();
|
|
22
|
+
}
|
|
23
|
+
learnTerms(scope);
|
|
24
|
+
const name = parseConceptName(request.args[1] ?? '', 'projection', {
|
|
25
|
+
allowName: scope.flags.allowName,
|
|
26
|
+
strip: ['projection', 'projector'],
|
|
27
|
+
});
|
|
28
|
+
const eventType = request.args[2] ?? '';
|
|
29
|
+
const publisher = publisherOf(scope, eventType);
|
|
30
|
+
const declaration = findEventDeclaration(scope, publisher.kebab, eventType);
|
|
31
|
+
if (declaration === undefined) {
|
|
32
|
+
throw undeclaredEvent(publisher, eventType);
|
|
33
|
+
}
|
|
34
|
+
emit(scope, vars(scope, { name: named(name), publisher: named(publisher), event: eventVars(eventType, declaration) }), [
|
|
35
|
+
['projection/projection.ts.tpl', `application/projections/${name.kebab}.projection.ts`],
|
|
36
|
+
['projection/projection.spec.ts.tpl', `test/unit/${name.kebab}.projection.spec.ts`],
|
|
37
|
+
]);
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
function explicitStyle() {
|
|
41
|
+
return new CliError('A projection declares itself with @Projection, which only the declared style assembles.', `Set "stack.style" to "declared" in ${CONFIG_FILE}, or write the class by hand in application/projections/ and add it to the module file of its context with \`builder.include(<Name>Projection)\`.`);
|
|
42
|
+
}
|
|
43
|
+
/** The context that publishes the event: this one, or one of its declared upstreams. */
|
|
44
|
+
function publisherOf(scope, eventType) {
|
|
45
|
+
const parts = eventType.split('.');
|
|
46
|
+
if (parts.length !== 3 || !parts.every((part) => /^[a-z0-9]+(-[a-z0-9]+)*$/.test(part))) {
|
|
47
|
+
throw new CliError(`"${eventType}" is not the type of an integration event.`, `Pass the type as published, <context>.<aggregate>.<fact> in kebab-case, for example ${scope.context.kebab}.invoice.issued.`);
|
|
48
|
+
}
|
|
49
|
+
const publisher = parseContextName(parts[0] ?? '');
|
|
50
|
+
const upstreams = scope.config.contexts[scope.context.kebab]?.upstreams ?? [];
|
|
51
|
+
if (publisher.kebab === scope.context.kebab || upstreams.some(({ context }) => context === publisher.kebab)) {
|
|
52
|
+
return publisher;
|
|
53
|
+
}
|
|
54
|
+
throw new CliError(`"${scope.context.kebab}" does not declare "${publisher.kebab}" as an upstream.`, `If ${scope.context.kebab} really keeps a read model from what ${publisher.kebab} announces, add { "context": "${publisher.kebab}", "relationship": "published-language" } to contexts.${scope.context.kebab}.upstreams in ${CONFIG_FILE}, then run the command again.`);
|
|
55
|
+
}
|
|
56
|
+
function undeclaredEvent(publisher, eventType) {
|
|
57
|
+
const [, aggregate = '', fact = ''] = eventType.split('.');
|
|
58
|
+
return new CliError(`${publisher.kebab} declares no ${eventType} in its published language.`, `A projection applies an event through its declaration, @On(<definition>): create it first with \`ddd-ts-kit generate integration-event ${publisher.kebab} ${toName(aggregate).pascal} ${toName(fact).pascal}\`, then run the command again.`);
|
|
59
|
+
}
|
|
60
|
+
function eventVars(eventType, declaration) {
|
|
61
|
+
const [, aggregate = '', fact = ''] = eventType.split('.');
|
|
62
|
+
return {
|
|
63
|
+
type: eventType,
|
|
64
|
+
definition: declaration.definition,
|
|
65
|
+
typeName: declaration.typeName,
|
|
66
|
+
method: toName(fact).camel,
|
|
67
|
+
// The one field a generated declaration starts with: the spec builds its sample event from it.
|
|
68
|
+
payloadKey: `${toName(aggregate).camel}Id`,
|
|
69
|
+
payloadSample: `${aggregate}-1`,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=projection-kind.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projection-kind.js","sourceRoot":"","sources":["../../../src/generate/kinds/projection-kind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,EAAa,MAAM,uBAAuB,CAAC;AAE9F,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,MAAM,CAAC,MAAM,cAAc,GAAS;IAClC,IAAI,EAAE,YAAY;IAClB,OAAO,EAAE,CAAC,WAAW,CAAC;IACtB,KAAK,EAAE,wEAAwE;IAC/E,OAAO,EACL,sKAAsK;IACxK,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,CAAC;IAC7C,YAAY,EAAE,KAAK;IACnB,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE;QACf,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;QAEjC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,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AAO,IAAI,QAAQ,CACjB,GAAG,SAAS,CAAC,KAAK,gBAAgB,SAAS,6BAA6B,EACxE,0IAA0I,SAAS,CAAC,KAAK,IAAI,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,iCAAiC,CAC9O,CAAC;AACJ,CAAC;AAED,SAAS,SAAS,CAAC,SAAiB,EAAE,WAA6B;IACjE,MAAM,CAAC,EAAE,SAAS,GAAG,EAAE,EAAE,IAAI,GAAG,EAAE,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAE3D,OAAO;QACL,IAAI,EAAE,SAAS;QACf,UAAU,EAAE,WAAW,CAAC,UAAU;QAClC,QAAQ,EAAE,WAAW,CAAC,QAAQ;QAC9B,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK;QAC1B,+FAA+F;QAC/F,UAAU,EAAE,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,KAAK,IAAI;QAC1C,aAAa,EAAE,GAAG,SAAS,IAAI;KAChC,CAAC;AACJ,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { specifierOf } from '../../alias/index.js';
|
|
2
2
|
/** Exports a file of a published language from its index, once. */
|
|
3
3
|
export function publishInIndex({ ws, config }, directory, file) {
|
|
4
4
|
const index = `${directory}/index.ts`;
|
|
5
|
-
const line = `export * from '${
|
|
5
|
+
const line = `export * from '${specifierOf(config, `${directory}/${file}.ts`)}';`;
|
|
6
6
|
const lines = (ws.read(index) ?? '')
|
|
7
7
|
.split('\n')
|
|
8
8
|
.filter((existing) => existing.trim() !== '' && existing.trim() !== 'export {};');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish-in-index.js","sourceRoot":"","sources":["../../../src/generate/kinds/publish-in-index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"publish-in-index.js","sourceRoot":"","sources":["../../../src/generate/kinds/publish-in-index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGnD,mEAAmE;AACnE,MAAM,UAAU,cAAc,CAAC,EAAE,EAAE,EAAE,MAAM,EAAgC,EAAE,SAAiB,EAAE,IAAY;IAC1G,MAAM,KAAK,GAAG,GAAG,SAAS,WAAW,CAAC;IACtC,MAAM,IAAI,GAAG,kBAAkB,WAAW,CAAC,MAAM,EAAE,GAAG,SAAS,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC;IAElF,MAAM,KAAK,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;SACjC,KAAK,CAAC,IAAI,CAAC;SACX,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,QAAQ,CAAC,IAAI,EAAE,KAAK,YAAY,CAAC,CAAC;IAEpF,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACzB,OAAO;IACT,CAAC;IAED,MAAM,OAAO,GAAG,GAAG,CAAC,GAAG,KAAK,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;IAEnD,IAAI,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;QACrB,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAC5B,CAAC;SAAM,CAAC;QACN,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAC5B,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-vars.d.ts","sourceRoot":"","sources":["../../../../src/generate/kinds/route/route-vars.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,KAAK,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KA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
import {
|
|
1
|
+
import { specifierOf } from '../../../alias/index.js';
|
|
2
2
|
import { toName } from '../../../naming/index.js';
|
|
3
3
|
import { dtoClasses } from './dto-classes.js';
|
|
4
4
|
/** What the templates of a route read: its endpoint, the use case it calls and how the stack validates. */
|
|
5
5
|
export function routeVars(scope, { name, endpoint, useCase }) {
|
|
6
6
|
const hasBody = ['POST', 'PUT', 'PATCH'].includes(endpoint.method);
|
|
7
|
-
const
|
|
7
|
+
const { config, context } = scope;
|
|
8
|
+
const inContext = (file) => specifierOf(config, `${config.contextsDir}/${context.kebab}/${file}`);
|
|
8
9
|
return {
|
|
9
10
|
method: endpoint.method,
|
|
10
11
|
path: endpoint.path,
|
|
@@ -18,10 +19,10 @@ export function routeVars(scope, { name, endpoint, useCase }) {
|
|
|
18
19
|
usesAnyObject: hasBody || useCase.isQuery,
|
|
19
20
|
usesSchema: hasBody || useCase.isQuery || useCase.returnsId,
|
|
20
21
|
dtoImports: dtoClasses(endpoint, useCase)
|
|
21
|
-
.map((role) => `import { ${name.pascal}${toName(role).pascal} } from '${
|
|
22
|
+
.map((role) => `import { ${name.pascal}${toName(role).pascal} } from '${inContext(`presentation/http/${name.kebab}-${role}.dto.ts`)}';`)
|
|
22
23
|
.join('\n'),
|
|
23
24
|
...requestVars(scope, endpoint, hasBody),
|
|
24
|
-
...busVars(useCase,
|
|
25
|
+
...busVars(useCase, inContext(`${useCase.messageFile}.ts`)),
|
|
25
26
|
...securityVars(scope, useCase),
|
|
26
27
|
...parameterVars(endpoint.parameters),
|
|
27
28
|
};
|
|
@@ -45,8 +46,8 @@ function successStatus(endpoint, useCase) {
|
|
|
45
46
|
}
|
|
46
47
|
return endpoint.method === 'POST' ? 201 : 200;
|
|
47
48
|
}
|
|
48
|
-
function busVars(useCase,
|
|
49
|
-
const message = `import { ${useCase.message} } from '${
|
|
49
|
+
function busVars(useCase, messageFile) {
|
|
50
|
+
const message = `import { ${useCase.message} } from '${messageFile}';`;
|
|
50
51
|
return {
|
|
51
52
|
input: useCase.message,
|
|
52
53
|
bus: useCase.isQuery ? 'queries' : 'commands',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-vars.js","sourceRoot":"","sources":["../../../../src/generate/kinds/route/route-vars.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"route-vars.js","sourceRoot":"","sources":["../../../../src/generate/kinds/route/route-vars.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAa,MAAM,0BAA0B,CAAC;AAG7D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAU9C,2GAA2G;AAC3G,MAAM,UAAU,SAAS,CAAC,KAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAc;IAC7E,MAAM,OAAO,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACnE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAClC,MAAM,SAAS,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,WAAW,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,WAAW,IAAI,OAAO,CAAC,KAAK,IAAI,IAAI,EAAE,CAAC,CAAC;IAElH,OAAO;QACL,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,MAAM,EAAE,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC;QACxC,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,YAAY,EAAE,OAAO,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ;QAClD,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,cAAc,EAAE,CAAC,OAAO,CAAC,OAAO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M,IAAI,CAAC,CAAC,CAAC,OAAO;QACzD,KAAK,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,kCAAkC,CAAC,CAAC,CAAC,EAAE;QACpE,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,6BAA6B,CAAC,CAAC,CAAC,EAAE;KACrE,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,UAA6B;IAClD,MAAM,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,GAAG,SAAS,MAAM,MAAM,CAAC,SAAS,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAExG,OAAO;QACL,SAAS,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,GAAG,SAAS,qBAAqB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QACtF,SAAS,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,kBAAkB,SAAS,QAAQ,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC;QAC5F,YAAY,EAAE,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,MAAM,IAAI,CAAC,CAAC,CAAC,IAAI;KAC7D,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Workspace } from '../../workspace/index.js';
|
|
2
|
+
import type { ContextPlan } from './context-plan.js';
|
|
3
|
+
/**
|
|
4
|
+
* What the shared files of the project say of one context: the composition root assembles it,
|
|
5
|
+
* the proof that each context wires alone lists it, and the registry of permissions holds its
|
|
6
|
+
* set once the context has one. Applied when the context is created, and again when
|
|
7
|
+
* `init --force` rewrote those files: a wiring that is already there is left as it is.
|
|
8
|
+
*/
|
|
9
|
+
export declare function wireContext(ws: Workspace, plan: ContextPlan): void;
|
|
10
|
+
//# sourceMappingURL=wire-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wire-context.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/wire-context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAI1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAOrD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI,CAwBlE"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { renderTemplate } from '../../templating/index.js';
|
|
2
|
+
import { applyWiring } from '../apply-wiring.js';
|
|
3
|
+
import { permissionsFile } from '../permissions-file.js';
|
|
4
|
+
import { wiringFamily } from '../wiring-family.js';
|
|
5
|
+
import { importAssembler } from './import-assembler.js';
|
|
6
|
+
import { planVars } from './plan-vars.js';
|
|
7
|
+
const PROOF = 'test/architecture/extractable.spec.ts';
|
|
8
|
+
const COMPOSITION = 'compose-application.ts';
|
|
9
|
+
/**
|
|
10
|
+
* What the shared files of the project say of one context: the composition root assembles it,
|
|
11
|
+
* the proof that each context wires alone lists it, and the registry of permissions holds its
|
|
12
|
+
* set once the context has one. Applied when the context is created, and again when
|
|
13
|
+
* `init --force` rewrote those files: a wiring that is already there is left as it is.
|
|
14
|
+
*/
|
|
15
|
+
export function wireContext(ws, plan) {
|
|
16
|
+
const { config, context } = plan;
|
|
17
|
+
const vars = planVars(plan);
|
|
18
|
+
const family = wiringFamily(config);
|
|
19
|
+
const registry = `${config.platformDir}/auth/permissions.ts`;
|
|
20
|
+
if (!ws.exists(PROOF)) {
|
|
21
|
+
ws.create(PROOF, renderTemplate(`architecture/extractable.${family}.spec.ts.tpl`, vars));
|
|
22
|
+
}
|
|
23
|
+
for (const [file, wiring] of [
|
|
24
|
+
[PROOF, `architecture/wiring.${family}.tpl`],
|
|
25
|
+
[`${config.platformDir}/${COMPOSITION}`, `context/wiring.${family}.tpl`],
|
|
26
|
+
]) {
|
|
27
|
+
if (family === 'declared') {
|
|
28
|
+
importAssembler(ws, config, file);
|
|
29
|
+
}
|
|
30
|
+
applyWiring(ws, file, renderTemplate(wiring, vars));
|
|
31
|
+
}
|
|
32
|
+
if (ws.exists(registry) && ws.exists(`${config.contextsDir}/${context.kebab}/${permissionsFile(context)}`)) {
|
|
33
|
+
applyWiring(ws, registry, renderTemplate('context/permission-set.tpl', vars));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=wire-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wire-context.js","sourceRoot":"","sources":["../../../src/generate/kinds/wire-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,MAAM,KAAK,GAAG,uCAAuC,CAAC;AACtD,MAAM,WAAW,GAAG,wBAAwB,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,EAAa,EAAE,IAAiB;IAC1D,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACjC,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC5B,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,MAAM,QAAQ,GAAG,GAAG,MAAM,CAAC,WAAW,sBAAsB,CAAC;IAE7D,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;QACtB,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,cAAc,CAAC,4BAA4B,MAAM,cAAc,EAAE,IAAI,CAAC,CAAC,CAAC;IAC3F,CAAC;IAED,KAAK,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI;QAC3B,CAAC,KAAK,EAAE,uBAAuB,MAAM,MAAM,CAAC;QAC5C,CAAC,GAAG,MAAM,CAAC,WAAW,IAAI,WAAW,EAAE,EAAE,kBAAkB,MAAM,MAAM,CAAC;KAChE,EAAE,CAAC;QACX,IAAI,MAAM,KAAK,UAAU,EAAE,CAAC;YAC1B,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QACpC,CAAC;QAED,WAAW,CAAC,EAAE,EAAE,IAAI,EAAE,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;IACtD,CAAC;IAED,IAAI,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,WAAW,IAAI,OAAO,CAAC,KAAK,IAAI,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC;QAC3G,WAAW,CAAC,EAAE,EAAE,QAAQ,EAAE,cAAc,CAAC,4BAA4B,EAAE,IAAI,CAAC,CAAC,CAAC;IAChF,CAAC;AACH,CAAC"}
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
import type { Config } from '../../config/index.js';
|
|
2
|
-
import type { Name } from '../../naming/index.js';
|
|
3
1
|
import type { Workspace } from '../../workspace/index.js';
|
|
4
|
-
import type {
|
|
5
|
-
export interface ContextPlan {
|
|
6
|
-
readonly config: Config;
|
|
7
|
-
readonly context: Name;
|
|
8
|
-
readonly request: ContextRequest;
|
|
9
|
-
}
|
|
2
|
+
import type { ContextPlan } from './context-plan.js';
|
|
10
3
|
/** The files of a new context, the document first: the language is defined before the code that speaks it. */
|
|
11
4
|
export declare function writeContextFiles(ws: Workspace, plan: ContextPlan): void;
|
|
12
5
|
//# sourceMappingURL=write-context-files.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-context-files.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/write-context-files.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"write-context-files.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/write-context-files.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAG1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD,8GAA8G;AAC9G,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI,CAUxE"}
|