ddd-ts-kit 0.97.0 → 0.98.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/CHANGELOG.md +112 -0
- package/README.fr.md +5 -5
- package/README.md +4 -4
- package/dist/check/canonical/stray-entry.d.ts.map +1 -1
- package/dist/check/canonical/stray-entry.js +14 -2
- package/dist/check/canonical/stray-entry.js.map +1 -1
- package/dist/check/domain-events/event-handlers-of.d.ts.map +1 -1
- package/dist/check/domain-events/event-handlers-of.js +21 -8
- package/dist/check/domain-events/event-handlers-of.js.map +1 -1
- package/dist/check/events/consumer-registrations.d.ts +2 -0
- package/dist/check/events/consumer-registrations.d.ts.map +1 -1
- package/dist/check/events/consumer-registrations.js +44 -2
- package/dist/check/events/consumer-registrations.js.map +1 -1
- package/dist/check/explain/events-docs.js +1 -1
- package/dist/check/explain/events-docs.js.map +1 -1
- package/dist/check/explain/tree-docs.d.ts.map +1 -1
- package/dist/check/explain/tree-docs.js +7 -4
- package/dist/check/explain/tree-docs.js.map +1 -1
- package/dist/check/explain/wiring-docs.js +1 -1
- package/dist/check/explain/wiring-docs.js.map +1 -1
- package/dist/check/fixtures/consumer-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/consumer-fixtures.js +33 -0
- package/dist/check/fixtures/consumer-fixtures.js.map +1 -1
- package/dist/check/project/locate.js +9 -3
- package/dist/check/project/locate.js.map +1 -1
- package/dist/check/rules/composition-only-in-module.js +2 -2
- package/dist/check/rules/composition-only-in-module.js.map +1 -1
- package/dist/check/rules/declarations-port-adapter-wired.js +1 -1
- package/dist/check/rules/declarations-port-adapter-wired.js.map +1 -1
- package/dist/check/rules/events-consumer-idempotent.d.ts.map +1 -1
- package/dist/check/rules/events-consumer-idempotent.js +6 -3
- package/dist/check/rules/events-consumer-idempotent.js.map +1 -1
- package/dist/check/rules/tree-closed.js +1 -1
- package/dist/check/rules/tree-closed.js.map +1 -1
- package/dist/commands/generate.js +2 -0
- package/dist/commands/generate.js.map +1 -1
- package/dist/describe/context-sources.d.ts +1 -1
- package/dist/describe/context-sources.d.ts.map +1 -1
- package/dist/describe/describe-context.js +2 -2
- package/dist/describe/describe-context.js.map +1 -1
- package/dist/docs/personal-declarations-in.js +6 -1
- package/dist/docs/personal-declarations-in.js.map +1 -1
- package/dist/docs/personal-table-cells.js +7 -1
- package/dist/docs/personal-table-cells.js.map +1 -1
- package/dist/docs/personal-table-facts.d.ts +1 -1
- package/dist/docs/personal-table-facts.d.ts.map +1 -1
- package/dist/docs/read-jobs.d.ts +1 -1
- package/dist/docs/read-jobs.d.ts.map +1 -1
- package/dist/docs/read-jobs.js +3 -3
- package/dist/docs/read-jobs.js.map +1 -1
- package/dist/generate/apply-wiring.js +1 -1
- package/dist/generate/apply-wiring.js.map +1 -1
- package/dist/generate/kind.d.ts +2 -0
- package/dist/generate/kind.d.ts.map +1 -1
- package/dist/generate/kinds/adapter-kind.js +2 -2
- package/dist/generate/kinds/adapter-kind.js.map +1 -1
- package/dist/generate/kinds/ask-policy-in-generated-use-case.d.ts.map +1 -1
- package/dist/generate/kinds/ask-policy-in-generated-use-case.js +10 -4
- package/dist/generate/kinds/ask-policy-in-generated-use-case.js.map +1 -1
- package/dist/generate/kinds/command-context.d.ts +5 -2
- package/dist/generate/kinds/command-context.d.ts.map +1 -1
- package/dist/generate/kinds/command-context.js +11 -3
- package/dist/generate/kinds/command-context.js.map +1 -1
- package/dist/generate/kinds/command-kind.d.ts.map +1 -1
- package/dist/generate/kinds/command-kind.js +9 -4
- package/dist/generate/kinds/command-kind.js.map +1 -1
- package/dist/generate/kinds/e2e/jobs-sending.d.ts +5 -0
- package/dist/generate/kinds/e2e/jobs-sending.d.ts.map +1 -0
- package/dist/generate/kinds/e2e/jobs-sending.js +11 -0
- package/dist/generate/kinds/e2e/jobs-sending.js.map +1 -0
- package/dist/generate/kinds/e2e/reaction-of.d.ts +9 -2
- package/dist/generate/kinds/e2e/reaction-of.d.ts.map +1 -1
- package/dist/generate/kinds/e2e/reaction-of.js +16 -7
- package/dist/generate/kinds/e2e/reaction-of.js.map +1 -1
- package/dist/generate/kinds/e2e-kind.d.ts.map +1 -1
- package/dist/generate/kinds/e2e-kind.js +20 -5
- package/dist/generate/kinds/e2e-kind.js.map +1 -1
- package/dist/generate/kinds/erasure-handler-kind.js +7 -0
- package/dist/generate/kinds/erasure-handler-kind.js.map +1 -1
- package/dist/generate/kinds/job/read-sent-command.d.ts.map +1 -1
- package/dist/generate/kinds/job/read-sent-command.js +2 -1
- package/dist/generate/kinds/job/read-sent-command.js.map +1 -1
- package/dist/generate/kinds/module-kind.d.ts.map +1 -1
- package/dist/generate/kinds/module-kind.js +22 -2
- package/dist/generate/kinds/module-kind.js.map +1 -1
- package/dist/generate/kinds/repository-line.d.ts +4 -0
- package/dist/generate/kinds/repository-line.d.ts.map +1 -0
- package/dist/generate/kinds/repository-line.js +5 -0
- package/dist/generate/kinds/repository-line.js.map +1 -0
- package/dist/generate/kinds/wire-repository-on-first-use.d.ts +3 -2
- package/dist/generate/kinds/wire-repository-on-first-use.d.ts.map +1 -1
- package/dist/generate/kinds/wire-repository-on-first-use.js +8 -3
- package/dist/generate/kinds/wire-repository-on-first-use.js.map +1 -1
- package/dist/generate/registration.d.ts +10 -0
- package/dist/generate/registration.d.ts.map +1 -0
- package/dist/generate/registration.js +2 -0
- package/dist/generate/registration.js.map +1 -0
- package/dist/generate/wire.d.ts +5 -2
- package/dist/generate/wire.d.ts.map +1 -1
- package/dist/generate/wire.js +6 -3
- package/dist/generate/wire.js.map +1 -1
- package/dist/generate/wirings.d.ts +2 -1
- package/dist/generate/wirings.d.ts.map +1 -1
- package/dist/generate/wirings.js +25 -4
- package/dist/generate/wirings.js.map +1 -1
- package/dist/init/files/persistence-files.d.ts.map +1 -1
- package/dist/init/files/persistence-files.js +5 -2
- package/dist/init/files/persistence-files.js.map +1 -1
- package/dist/init/manifest/versions.js +24 -24
- package/dist/model-modules/index.d.ts +4 -0
- package/dist/model-modules/index.d.ts.map +1 -1
- package/dist/model-modules/index.js +4 -0
- package/dist/model-modules/index.js.map +1 -1
- package/dist/model-modules/module-file-of.d.ts +7 -0
- package/dist/model-modules/module-file-of.d.ts.map +1 -0
- package/dist/model-modules/module-file-of.js +9 -0
- package/dist/model-modules/module-file-of.js.map +1 -0
- package/dist/model-modules/module-of-module-file.d.ts +3 -0
- package/dist/model-modules/module-of-module-file.d.ts.map +1 -0
- package/dist/model-modules/module-of-module-file.js +6 -0
- package/dist/model-modules/module-of-module-file.js.map +1 -0
- package/dist/model-modules/wiring-files-of.d.ts +4 -0
- package/dist/model-modules/wiring-files-of.d.ts.map +1 -0
- package/dist/model-modules/wiring-files-of.js +6 -0
- package/dist/model-modules/wiring-files-of.js.map +1 -0
- package/dist/model-modules/wiring-text-of.d.ts +5 -0
- package/dist/model-modules/wiring-text-of.d.ts.map +1 -0
- package/dist/model-modules/wiring-text-of.js +8 -0
- package/dist/model-modules/wiring-text-of.js.map +1 -0
- package/dist/presets/apply-preset.d.ts.map +1 -1
- package/dist/presets/apply-preset.js +5 -0
- package/dist/presets/apply-preset.js.map +1 -1
- package/dist/presets/identity-preset.d.ts.map +1 -1
- package/dist/presets/identity-preset.js +1 -0
- package/dist/presets/identity-preset.js.map +1 -1
- package/dist/presets/no-flags.d.ts.map +1 -1
- package/dist/presets/no-flags.js +1 -0
- package/dist/presets/no-flags.js.map +1 -1
- package/dist/presets/preset.d.ts +6 -0
- package/dist/presets/preset.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/workspace/workspace.d.ts +2 -1
- package/dist/workspace/workspace.d.ts.map +1 -1
- package/dist/workspace/workspace.js +6 -5
- package/dist/workspace/workspace.js.map +1 -1
- package/package.json +4 -4
- package/templates/command/handler.declared.ts.tpl +39 -1
- package/templates/command/handler.spec.buses.ts.tpl +4 -4
- package/templates/command/handler.spec.tsyringe.ts.tpl +2 -2
- package/templates/command/handler.ts.tpl +38 -1
- package/templates/command/wiring.manual.tpl +4 -1
- package/templates/command/wiring.tsyringe.tpl +7 -2
- package/templates/e2e/e2e-job-case.ts.tpl +8 -0
- package/templates/e2e/e2e-job.spec.ts.tpl +43 -0
- package/templates/init/e2e/start-application.database.ts.tpl +94 -9
- package/templates/init/e2e/start-application.memory.ts.tpl +76 -9
- package/templates/init/jest.config.js.tpl +11 -2
- package/templates/init/platform/composition/compose-application.manual.ts.tpl +11 -2
- package/templates/init/platform/composition/compose-application.tsyringe.ts.tpl +4 -0
- package/templates/init/platform/database/open-test-database.drizzle.ts.tpl +1 -5
- package/templates/init/platform/database/open-test-database.knex.ts.tpl +1 -5
- package/templates/init/platform/database/open-test-database.prisma.ts.tpl +1 -5
- package/templates/init/platform/database/open-test-database.typeorm.ts.tpl +1 -5
- package/templates/init/platform/database/test-database-teardown.ts.tpl +11 -0
- package/templates/init/platform/database/test-database-template.ts.tpl +16 -1
- package/templates/init/rules/tests.md.tpl +1 -1
- package/templates/module/module-file.manual.ts.tpl +46 -0
- package/templates/module/module-file.tsyringe.ts.tpl +14 -0
- package/templates/module/wiring.manual.tpl +14 -0
- package/templates/module/wiring.tsyringe.tpl +6 -0
- package/templates/pipeline/package-scripts.json +1 -1
- package/templates/presets/identity/context/__context__.module.explicit.ts.tpl +10 -4
- package/templates/presets/identity/e2e/support.wiring.tpl +17 -0
|
@@ -2,16 +2,21 @@ import { CLASSIFICATIONS, CONFIG_FILE, editConfigText, isOneOf } from '../../con
|
|
|
2
2
|
import { isRecord } from '../../config/values/is-record.js';
|
|
3
3
|
import { withModuleRow } from '../../check/modules/with-module-row.js';
|
|
4
4
|
import { CliError } from '../../cli-error.js';
|
|
5
|
-
import { moduleNameFlaw } from '../../model-modules/index.js';
|
|
5
|
+
import { moduleFileOf, moduleNameFlaw } from '../../model-modules/index.js';
|
|
6
|
+
import { renderTemplate } from '../../templating/index.js';
|
|
6
7
|
import { toName } from '../../naming/index.js';
|
|
7
8
|
import { learnTerms } from '../learn-terms.js';
|
|
9
|
+
import { named } from '../named.js';
|
|
8
10
|
import { openScope } from '../open-scope.js';
|
|
9
11
|
import { spokenInLanguage } from '../spoken-in-language.js';
|
|
12
|
+
import { vars } from '../vars.js';
|
|
13
|
+
import { wire } from '../wire.js';
|
|
14
|
+
import { wiringFamily } from '../wiring-family.js';
|
|
10
15
|
export const moduleKind = {
|
|
11
16
|
name: 'module',
|
|
12
17
|
aliases: [],
|
|
13
18
|
usage: 'module <context> <module> [--purpose "<what it holds>"] [--classification <core|supporting|generic>] [--term "<Term>=<meaning>"]...',
|
|
14
|
-
summary: 'A module of the model of a context (Evans, Modules): declared in contexts.<name>.modules, given its row in the "## Modules" table of CONTEXT.md, its terms added to the glossary. Run again, it adds what is missing. Generate into it with --module, move files into it with `ddd-ts-kit move-to-module`.',
|
|
19
|
+
summary: 'A module of the model of a context (Evans, Modules): declared in contexts.<name>.modules, given its row in the "## Modules" table of CONTEXT.md, its terms added to the glossary, and, in the explicit style, its module file <module>/<module>.module.ts, composed by <context>.module.ts. Run again, it adds what is missing. Generate into it with --module, move files into it with `ddd-ts-kit move-to-module`.',
|
|
15
20
|
positionals: ['context', 'module'],
|
|
16
21
|
writesShared: true,
|
|
17
22
|
writesInModules: false,
|
|
@@ -22,9 +27,24 @@ export const moduleKind = {
|
|
|
22
27
|
const doc = `${scope.dir}/CONTEXT.md`;
|
|
23
28
|
declareModule(scope, module.kebab);
|
|
24
29
|
scope.ws.update(doc, withModuleRow(scope.ws.read(doc) ?? '', module.kebab, scope.flags.purpose));
|
|
30
|
+
writeModuleFile(scope, module);
|
|
25
31
|
scope.ws.note(`Generate into the module with \`--module ${module.kebab}\`, or move files of ${scope.context.kebab} into it with \`ddd-ts-kit move-to-module ${scope.context.kebab} ${module.kebab} <path>...\`, one cluster of concepts per commit.`);
|
|
26
32
|
},
|
|
27
33
|
};
|
|
34
|
+
/**
|
|
35
|
+
* In the explicit style, the module file of the module, `<module>/<module>.module.ts`, composed by
|
|
36
|
+
* the module file of the context: what is generated with `--module` registers there, so that the
|
|
37
|
+
* module file of the context stays the size of what the context keeps at its own level.
|
|
38
|
+
*/
|
|
39
|
+
function writeModuleFile(scope, module) {
|
|
40
|
+
const family = wiringFamily(scope.config);
|
|
41
|
+
if (family === 'declared' || !scope.ws.exists(`${scope.dir}/${scope.context.kebab}.module.ts`)) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const context = vars(scope, { module: named(module) });
|
|
45
|
+
scope.ws.create(`${scope.dir}/${moduleFileOf(module.kebab)}`, renderTemplate(`module/module-file.${family}.ts.tpl`, context));
|
|
46
|
+
wire(scope, 'module', context);
|
|
47
|
+
}
|
|
28
48
|
/** A part of the model, named in the language of its context: never a role folder, never a technical grouping. */
|
|
29
49
|
function moduleName(scope, input) {
|
|
30
50
|
const name = toName(input);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-kind.js","sourceRoot":"","sources":["../../../src/generate/kinds/module-kind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACrF,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"module-kind.js","sourceRoot":"","sources":["../../../src/generate/kinds/module-kind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACrF,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EA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AAC;QAED,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACvE,MAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAE/D,OAAO,CAAC,SAAS,CAAC,GAAG;YACnB,GAAG,OAAO;YACV,CAAC,MAAM,CAAC,EAAE,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,cAAc,EAAE;SAC9E,CAAC;IACJ,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository-line.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/repository-line.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,qGAAqG;AACrG,wBAAgB,cAAc,CAAC,SAAS,EAAE,IAAI,GAAG,MAAM,CAEtD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository-line.js","sourceRoot":"","sources":["../../../src/generate/kinds/repository-line.ts"],"names":[],"mappings":"AAEA,qGAAqG;AACrG,MAAM,UAAU,cAAc,CAAC,SAAe;IAC5C,OAAO,SAAS,SAAS,CAAC,KAAK,cAAc,CAAC;AAChD,CAAC"}
|
|
@@ -3,8 +3,9 @@ import type { Scope } from '../scope.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* The repository of an aggregate, created in the module file of a hand-wired context by the first
|
|
5
5
|
* use case that needs it, and by none before: a constant no handler reads is dead code, which the
|
|
6
|
-
* lint of the project refuses. A later use case finds it there and adds nothing
|
|
7
|
-
*
|
|
6
|
+
* lint of the project refuses. A later use case finds it there and adds nothing, whatever module
|
|
7
|
+
* file of the context holds it: its handler is registered in that file too (`repositoryLine`). The
|
|
8
|
+
* other wiring families bind the repository to its port, where nothing is created before it is resolved.
|
|
8
9
|
*/
|
|
9
10
|
export declare function wireRepositoryOnFirstUse(scope: Scope, aggregate: Name): void;
|
|
10
11
|
//# sourceMappingURL=wire-repository-on-first-use.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wire-repository-on-first-use.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/wire-repository-on-first-use.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"wire-repository-on-first-use.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/wire-repository-on-first-use.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAOtC;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,GAAG,IAAI,CAS5E"}
|
|
@@ -2,14 +2,19 @@ import { named } from '../named.js';
|
|
|
2
2
|
import { vars } from '../vars.js';
|
|
3
3
|
import { wire } from '../wire.js';
|
|
4
4
|
import { isEventSourced } from './is-event-sourced.js';
|
|
5
|
+
import { repositoryLine } from './repository-line.js';
|
|
5
6
|
import { repositoryPrefix } from './repository-prefix.js';
|
|
6
7
|
/**
|
|
7
8
|
* The repository of an aggregate, created in the module file of a hand-wired context by the first
|
|
8
9
|
* use case that needs it, and by none before: a constant no handler reads is dead code, which the
|
|
9
|
-
* lint of the project refuses. A later use case finds it there and adds nothing
|
|
10
|
-
*
|
|
10
|
+
* lint of the project refuses. A later use case finds it there and adds nothing, whatever module
|
|
11
|
+
* file of the context holds it: its handler is registered in that file too (`repositoryLine`). The
|
|
12
|
+
* other wiring families bind the repository to its port, where nothing is created before it is resolved.
|
|
11
13
|
*/
|
|
12
14
|
export function wireRepositoryOnFirstUse(scope, aggregate) {
|
|
13
|
-
wire(scope,
|
|
15
|
+
wire(scope, {
|
|
16
|
+
kind: isEventSourced(scope, aggregate) ? 'repository/event-sourced-first-use' : 'repository/first-use',
|
|
17
|
+
holding: repositoryLine(aggregate),
|
|
18
|
+
}, vars(scope, { aggregate: named(aggregate), adapter: repositoryPrefix(scope.config.stack.orm) }));
|
|
14
19
|
}
|
|
15
20
|
//# sourceMappingURL=wire-repository-on-first-use.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wire-repository-on-first-use.js","sourceRoot":"","sources":["../../../src/generate/kinds/wire-repository-on-first-use.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD
|
|
1
|
+
{"version":3,"file":"wire-repository-on-first-use.js","sourceRoot":"","sources":["../../../src/generate/kinds/wire-repository-on-first-use.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAY,EAAE,SAAe;IACpE,IAAI,CACF,KAAK,EACL;QACE,IAAI,EAAE,cAAc,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,oCAAoC,CAAC,CAAC,CAAC,sBAAsB;QACtG,OAAO,EAAE,cAAc,CAAC,SAAS,CAAC;KACnC,EACD,IAAI,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,gBAAgB,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAChG,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What `wire` registers: the kind whose templates say it, and the line it needs in the same module
|
|
3
|
+
* file, when it has one, such as the constant of a repository a hand-wired handler is given; the
|
|
4
|
+
* registration then goes to the module file of the context that already holds that line.
|
|
5
|
+
*/
|
|
6
|
+
export interface Registration {
|
|
7
|
+
readonly kind: string;
|
|
8
|
+
readonly holding?: string;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=registration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registration.d.ts","sourceRoot":"","sources":["../../src/generate/registration.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registration.js","sourceRoot":"","sources":["../../src/generate/registration.ts"],"names":[],"mappings":""}
|
package/dist/generate/wire.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { RenderContext } from '../templating/index.js';
|
|
2
|
+
import type { Registration } from './registration.js';
|
|
2
3
|
import type { Scope } from './scope.js';
|
|
3
4
|
/**
|
|
4
5
|
* Registers a new element where the wiring of the project is written. A kind says what each
|
|
@@ -6,7 +7,9 @@ import type { Scope } from './scope.js';
|
|
|
6
7
|
* `<kind>/<variant>.<target>.<family>.tpl`. Targets: `wiring` is the module file of the context
|
|
7
8
|
* (explicit and manual families), `routes` the list of its routes (both styles on tsyringe),
|
|
8
9
|
* `platform` and `platform-test` the two modules of the platform that bind what a declaration
|
|
9
|
-
* cannot say.
|
|
10
|
+
* cannot say. The module file is the one of the context, or, given `--module`, the
|
|
11
|
+
* `<module>/<module>.module.ts` of that module of its model when it exists, or the one that holds
|
|
12
|
+
* the line the registration needs (`Registration`, `wirings`).
|
|
10
13
|
*/
|
|
11
|
-
export declare function wire(scope: Scope,
|
|
14
|
+
export declare function wire(scope: Scope, registration: string | Registration, context: RenderContext): void;
|
|
12
15
|
//# sourceMappingURL=wire.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wire.d.ts","sourceRoot":"","sources":["../../src/generate/wire.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGrC
|
|
1
|
+
{"version":3,"file":"wire.d.ts","sourceRoot":"","sources":["../../src/generate/wire.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGrC;;;;;;;;;GASG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,GAAG,YAAY,EAAE,OAAO,EAAE,aAAa,GAAG,IAAI,CAMpG"}
|
package/dist/generate/wire.js
CHANGED
|
@@ -6,10 +6,13 @@ import { wirings } from './wirings.js';
|
|
|
6
6
|
* `<kind>/<variant>.<target>.<family>.tpl`. Targets: `wiring` is the module file of the context
|
|
7
7
|
* (explicit and manual families), `routes` the list of its routes (both styles on tsyringe),
|
|
8
8
|
* `platform` and `platform-test` the two modules of the platform that bind what a declaration
|
|
9
|
-
* cannot say.
|
|
9
|
+
* cannot say. The module file is the one of the context, or, given `--module`, the
|
|
10
|
+
* `<module>/<module>.module.ts` of that module of its model when it exists, or the one that holds
|
|
11
|
+
* the line the registration needs (`Registration`, `wirings`).
|
|
10
12
|
*/
|
|
11
|
-
export function wire(scope,
|
|
12
|
-
|
|
13
|
+
export function wire(scope, registration, context) {
|
|
14
|
+
const registered = typeof registration === 'string' ? { kind: registration } : registration;
|
|
15
|
+
for (const { file, wiring } of wirings(scope, registered, context)) {
|
|
13
16
|
applyWiring(scope.ws, file, wiring);
|
|
14
17
|
}
|
|
15
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wire.js","sourceRoot":"","sources":["../../src/generate/wire.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"wire.js","sourceRoot":"","sources":["../../src/generate/wire.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;;;;;;;GASG;AACH,MAAM,UAAU,IAAI,CAAC,KAAY,EAAE,YAAmC,EAAE,OAAsB;IAC5F,MAAM,UAAU,GAAG,OAAO,YAAY,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC;IAE5F,KAAK,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,OAAO,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,CAAC;QACnE,WAAW,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IACtC,CAAC;AACH,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { RenderContext } from '../templating/index.js';
|
|
2
|
+
import type { Registration } from './registration.js';
|
|
2
3
|
import type { Scope } from './scope.js';
|
|
3
4
|
/** What `wire` adds, file by file, without adding it. */
|
|
4
|
-
export declare function wirings(scope: Scope, kind:
|
|
5
|
+
export declare function wirings(scope: Scope, { kind, holding }: Registration, context: RenderContext): {
|
|
5
6
|
file: string;
|
|
6
7
|
wiring: string;
|
|
7
8
|
}[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wirings.d.ts","sourceRoot":"","sources":["../../src/generate/wirings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wirings.d.ts","sourceRoot":"","sources":["../../src/generate/wirings.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAIrC,yDAAyD;AACzD,wBAAgB,OAAO,CACrB,KAAK,EAAE,KAAK,EACZ,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,YAAY,EAC/B,OAAO,EAAE,aAAa,GACrB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAAE,CAWpC"}
|
package/dist/generate/wirings.js
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import { routesFile } from '../declared/index.js';
|
|
2
|
+
import { declaredModule, moduleFileOf, treeOf, wiringFilesOf } from '../model-modules/index.js';
|
|
2
3
|
import { renderTemplate, templateExists } from '../templating/index.js';
|
|
3
4
|
import { wiringFamily } from './wiring-family.js';
|
|
4
5
|
import { platformPath } from './platform-path.js';
|
|
5
6
|
/** What `wire` adds, file by file, without adding it. */
|
|
6
|
-
export function wirings(scope, kind, context) {
|
|
7
|
+
export function wirings(scope, { kind, holding }, context) {
|
|
7
8
|
const base = kind.includes('/') ? `${kind}.` : `${kind}/`;
|
|
8
9
|
const family = wiringFamily(scope.config);
|
|
9
|
-
return Object.entries(targetsOf(scope, family)).flatMap(([target, file]) => {
|
|
10
|
+
return Object.entries(targetsOf(scope, family, holding)).flatMap(([target, file]) => {
|
|
10
11
|
const template = [family, ...(family === 'manual' ? [] : ['on-tsyringe'])]
|
|
11
12
|
.map((variant) => `${base}${target}.${variant}.tpl`)
|
|
12
13
|
.find(templateExists);
|
|
13
14
|
return template === undefined ? [] : [{ file, wiring: renderTemplate(template, context) }];
|
|
14
15
|
});
|
|
15
16
|
}
|
|
16
|
-
function targetsOf(scope, family) {
|
|
17
|
+
function targetsOf(scope, family, holding) {
|
|
17
18
|
const { context, dir } = scope;
|
|
18
|
-
const module =
|
|
19
|
+
const module = moduleFileFor(scope, holding);
|
|
19
20
|
if (family === 'manual') {
|
|
20
21
|
return { wiring: module };
|
|
21
22
|
}
|
|
@@ -26,4 +27,24 @@ function targetsOf(scope, family) {
|
|
|
26
27
|
'platform-test': platformPath(scope, 'composition/platform-test.module.ts'),
|
|
27
28
|
};
|
|
28
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* The module file a registration is written in: the one that holds the line it needs, else the
|
|
32
|
+
* module file of the module of the model `--module` names, when the context has one
|
|
33
|
+
* (`<module>/<module>.module.ts`, composed by the module file of the context), else the module
|
|
34
|
+
* file of the context.
|
|
35
|
+
*/
|
|
36
|
+
function moduleFileFor(scope, holding) {
|
|
37
|
+
const { config, context, dir, flags, ws } = scope;
|
|
38
|
+
const own = `${dir}/${context.kebab}.module.ts`;
|
|
39
|
+
const holder = holding === undefined
|
|
40
|
+
? undefined
|
|
41
|
+
: wiringFilesOf(treeOf(config, context.kebab), context.kebab).find((file) => ws.read(file)?.includes(holding));
|
|
42
|
+
if (holder !== undefined) {
|
|
43
|
+
return holder;
|
|
44
|
+
}
|
|
45
|
+
const asked = flags.module === undefined
|
|
46
|
+
? undefined
|
|
47
|
+
: `${dir}/${moduleFileOf(declaredModule(config, context.kebab, flags.module))}`;
|
|
48
|
+
return asked !== undefined && ws.exists(asked) ? asked : own;
|
|
49
|
+
}
|
|
29
50
|
//# sourceMappingURL=wirings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wirings.js","sourceRoot":"","sources":["../../src/generate/wirings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"wirings.js","sourceRoot":"","sources":["../../src/generate/wirings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEvF,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAG/D,OAAO,EAAE,YAAY,EAAqB,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,yDAAyD;AACzD,MAAM,UAAU,OAAO,CACrB,KAAY,EACZ,EAAE,IAAI,EAAE,OAAO,EAAgB,EAC/B,OAAsB;IAEtB,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC;IAC1D,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAE1C,OAAO,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE;QAClF,MAAM,QAAQ,GAAG,CA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K,CAAC;IAClD,MAAM,GAAG,GAAG,GAAG,GAAG,IAAI,OAAO,CAAC,KAAK,YAAY,CAAC;IAEhD,MAAM,MAAM,GACV,OAAO,KAAK,SAAS;QACnB,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;IAEnH,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,KAAK,GACT,KAAK,CAAC,MAAM,KAAK,SAAS;QACxB,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,GAAG,GAAG,IAAI,YAAY,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;IAEpF,OAAO,KAAK,KAAK,SAAS,IAAI,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC;AAC/D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persistence-files.d.ts","sourceRoot":"","sources":["../../../src/init/files/persistence-files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAmE5C,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"persistence-files.d.ts","sourceRoot":"","sources":["../../../src/init/files/persistence-files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAmE5C,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,EAAE,CAe3D"}
|
|
@@ -62,10 +62,13 @@ export function persistenceFiles(config) {
|
|
|
62
62
|
return [
|
|
63
63
|
...files.map(([file, variant]) => platformFile(config, `database/${file}`, variant)),
|
|
64
64
|
...(TOOLING[orm] ?? []),
|
|
65
|
-
// The global setup
|
|
66
|
-
...when(
|
|
65
|
+
// The global setup that saves the test database once per run, for each spec to open a copy of it; Jest names its teardown apart.
|
|
66
|
+
...when(WITH_DATABASE.includes(orm), [
|
|
67
67
|
['test/support/test-database-template.ts', 'init/platform/database/test-database-template.ts.tpl'],
|
|
68
68
|
]),
|
|
69
|
+
...when(tests === 'jest' && WITH_DATABASE.includes(orm), [
|
|
70
|
+
['test/support/test-database-teardown.ts', 'init/platform/database/test-database-teardown.ts.tpl'],
|
|
71
|
+
]),
|
|
69
72
|
];
|
|
70
73
|
}
|
|
71
74
|
/** The script that lists the routes and the hand-wired architecture test compose the application without a database to reach. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persistence-files.js","sourceRoot":"","sources":["../../../src/init/files/persistence-files.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAIzD,MAAM,KAAK,GAAG,sBAAsB,CAAC;AAErC,MAAM,SAAS,GAAa;IAC1B,CAAC,gBAAgB,EAAE,QAAQ,CAAC;IAC5B,CAAC,qBAAqB,EAAE,QAAQ,CAAC;IACjC,CAAC,KAAK,EAAE,QAAQ,CAAC;CAClB,CAAC;AAEF,2GAA2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SACnG,CAAC;KACH,CAAC;AACJ,CAAC;AAED,iIAAiI;AACjI,SAAS,yBAAyB,CAAC,MAAc;IAC/C,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,MAAM,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE,KAAK,UAAU,CAAC;AACxE,CAAC"}
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
/** Ranges written to the generated package.json; bumped together with the kit. */
|
|
2
2
|
export const VERSIONS = {
|
|
3
|
-
'@ddd-ts-kit/kernel': '^0.
|
|
4
|
-
'@ddd-ts-kit/validation': '^0.
|
|
5
|
-
'@ddd-ts-kit/http': '^0.
|
|
6
|
-
'@ddd-ts-kit/tracing': '^0.
|
|
7
|
-
'@ddd-ts-kit/di': '^0.
|
|
8
|
-
'@ddd-ts-kit/events': '^0.
|
|
9
|
-
'@ddd-ts-kit/testing': '^0.
|
|
10
|
-
'@ddd-ts-kit/drizzle': '^0.
|
|
11
|
-
'@ddd-ts-kit/knex': '^0.
|
|
12
|
-
'@ddd-ts-kit/prisma': '^0.
|
|
13
|
-
'@ddd-ts-kit/typeorm': '^0.
|
|
14
|
-
'@ddd-ts-kit/auth': '^0.
|
|
15
|
-
'@ddd-ts-kit/rabbitmq': '^0.
|
|
16
|
-
'@ddd-ts-kit/aspects': '^0.
|
|
17
|
-
'@ddd-ts-kit/audit': '^0.
|
|
18
|
-
'@ddd-ts-kit/redis': '^0.
|
|
19
|
-
'@ddd-ts-kit/kafka': '^0.
|
|
20
|
-
'@ddd-ts-kit/nats': '^0.
|
|
21
|
-
'@ddd-ts-kit/scheduling': '^0.
|
|
22
|
-
'@ddd-ts-kit/sentry': '^0.
|
|
23
|
-
'@ddd-ts-kit/s3': '^0.
|
|
3
|
+
'@ddd-ts-kit/kernel': '^0.98.0',
|
|
4
|
+
'@ddd-ts-kit/validation': '^0.98.0',
|
|
5
|
+
'@ddd-ts-kit/http': '^0.98.0',
|
|
6
|
+
'@ddd-ts-kit/tracing': '^0.98.0',
|
|
7
|
+
'@ddd-ts-kit/di': '^0.98.0',
|
|
8
|
+
'@ddd-ts-kit/events': '^0.98.0',
|
|
9
|
+
'@ddd-ts-kit/testing': '^0.98.0',
|
|
10
|
+
'@ddd-ts-kit/drizzle': '^0.98.0',
|
|
11
|
+
'@ddd-ts-kit/knex': '^0.98.0',
|
|
12
|
+
'@ddd-ts-kit/prisma': '^0.98.0',
|
|
13
|
+
'@ddd-ts-kit/typeorm': '^0.98.0',
|
|
14
|
+
'@ddd-ts-kit/auth': '^0.98.0',
|
|
15
|
+
'@ddd-ts-kit/rabbitmq': '^0.98.0',
|
|
16
|
+
'@ddd-ts-kit/aspects': '^0.98.0',
|
|
17
|
+
'@ddd-ts-kit/audit': '^0.98.0',
|
|
18
|
+
'@ddd-ts-kit/redis': '^0.98.0',
|
|
19
|
+
'@ddd-ts-kit/kafka': '^0.98.0',
|
|
20
|
+
'@ddd-ts-kit/nats': '^0.98.0',
|
|
21
|
+
'@ddd-ts-kit/scheduling': '^0.98.0',
|
|
22
|
+
'@ddd-ts-kit/sentry': '^0.98.0',
|
|
23
|
+
'@ddd-ts-kit/s3': '^0.98.0',
|
|
24
24
|
'@aws-sdk/client-s3': '^3.1150.0',
|
|
25
25
|
'@aws-sdk/lib-storage': '^3.1150.0',
|
|
26
26
|
'@aws-sdk/s3-request-presigner': '^3.1150.0',
|
|
27
27
|
busboy: '^1.6.0',
|
|
28
28
|
'@sentry/node': '^11.6.0',
|
|
29
|
-
'@ddd-ts-kit/pino': '^0.
|
|
29
|
+
'@ddd-ts-kit/pino': '^0.98.0',
|
|
30
30
|
pino: '^10.4.0',
|
|
31
31
|
'pino-pretty': '^13.2.0',
|
|
32
|
-
'@ddd-ts-kit/winston': '^0.
|
|
32
|
+
'@ddd-ts-kit/winston': '^0.98.0',
|
|
33
33
|
winston: '^3.19.0',
|
|
34
34
|
'@confluentinc/kafka-javascript': '^1.11.0',
|
|
35
35
|
'@nats-io/jetstream': '^3.4.0',
|
|
@@ -40,7 +40,7 @@ export const VERSIONS = {
|
|
|
40
40
|
'passport-jwt': '^4.0.1',
|
|
41
41
|
'@types/passport-jwt': '^4.0.1',
|
|
42
42
|
amqplib: '^2.2.0',
|
|
43
|
-
'ddd-ts-kit': '^0.
|
|
43
|
+
'ddd-ts-kit': '^0.98.0',
|
|
44
44
|
tsx: '^4.23.15',
|
|
45
45
|
vitest: '^5.0.3',
|
|
46
46
|
'fast-check': '^4.10.2',
|
|
@@ -16,4 +16,8 @@ export { moduleNameFlaw } from './module-name-flaw.js';
|
|
|
16
16
|
export { WITHOUT_MODULE } from './without-module.js';
|
|
17
17
|
export { modulesByContext, type ModulesByContext } from './modules-by-context.js';
|
|
18
18
|
export { treeOf, type ContextTree } from './context-tree.js';
|
|
19
|
+
export { moduleFileOf } from './module-file-of.js';
|
|
20
|
+
export { moduleOfModuleFile } from './module-of-module-file.js';
|
|
21
|
+
export { wiringFilesOf } from './wiring-files-of.js';
|
|
22
|
+
export { wiringTextOf } from './wiring-text-of.js';
|
|
19
23
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/model-modules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC5F,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,YAAY,EAAE,QAAQ,EAAE,M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AAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -15,4 +15,8 @@ export { moduleNameFlaw } from './module-name-flaw.js';
|
|
|
15
15
|
export { WITHOUT_MODULE } from './without-module.js';
|
|
16
16
|
export { modulesByContext } from './modules-by-context.js';
|
|
17
17
|
export { treeOf } from './context-tree.js';
|
|
18
|
+
export { moduleFileOf } from './module-file-of.js';
|
|
19
|
+
export { moduleOfModuleFile } from './module-of-module-file.js';
|
|
20
|
+
export { wiringFilesOf } from './wiring-files-of.js';
|
|
21
|
+
export { wiringTextOf } from './wiring-text-of.js';
|
|
18
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/model-modules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,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iB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAyB,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAoB,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The module file of a module of the model, relative to its context: `<module>/<module>.module.ts`,
|
|
3
|
+
* where the explicit style registers the handlers, consumers and reactions of that module, and
|
|
4
|
+
* that the module file of the context composes.
|
|
5
|
+
*/
|
|
6
|
+
export declare function moduleFileOf(module: string): string;
|
|
7
|
+
//# sourceMappingURL=module-file-of.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-file-of.d.ts","sourceRoot":"","sources":["../../src/model-modules/module-file-of.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEnD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The module file of a module of the model, relative to its context: `<module>/<module>.module.ts`,
|
|
3
|
+
* where the explicit style registers the handlers, consumers and reactions of that module, and
|
|
4
|
+
* that the module file of the context composes.
|
|
5
|
+
*/
|
|
6
|
+
export function moduleFileOf(module) {
|
|
7
|
+
return `${module}/${module}.module.ts`;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=module-file-of.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-file-of.js","sourceRoot":"","sources":["../../src/model-modules/module-file-of.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,MAAc;IACzC,OAAO,GAAG,MAAM,IAAI,MAAM,YAAY,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** The module whose module file a path relative to its context is, among the modules of the model the config declares. */
|
|
2
|
+
export declare function moduleOfModuleFile(file: string, modules: readonly string[]): string | undefined;
|
|
3
|
+
//# sourceMappingURL=module-of-module-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-of-module-file.d.ts","sourceRoot":"","sources":["../../src/model-modules/module-of-module-file.ts"],"names":[],"mappings":"AAEA,0HAA0H;AAC1H,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAE/F"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { moduleFileOf } from './module-file-of.js';
|
|
2
|
+
/** The module whose module file a path relative to its context is, among the modules of the model the config declares. */
|
|
3
|
+
export function moduleOfModuleFile(file, modules) {
|
|
4
|
+
return modules.find((module) => file === moduleFileOf(module));
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=module-of-module-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-of-module-file.js","sourceRoot":"","sources":["../../src/model-modules/module-of-module-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,0HAA0H;AAC1H,MAAM,UAAU,kBAAkB,CAAC,IAAY,EAAE,OAA0B;IACzE,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,KAAK,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;AACjE,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ContextTree } from './context-tree.js';
|
|
2
|
+
/** The module files of a context in the explicit style, from the project root: its own, then the one of each module of its model. */
|
|
3
|
+
export declare function wiringFilesOf({ directory, modules }: ContextTree, context: string): string[];
|
|
4
|
+
//# sourceMappingURL=wiring-files-of.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wiring-files-of.d.ts","sourceRoot":"","sources":["../../src/model-modules/wiring-files-of.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlD,qIAAqI;AACrI,wBAAgB,aAAa,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAE5F"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { moduleFileOf } from './module-file-of.js';
|
|
2
|
+
/** The module files of a context in the explicit style, from the project root: its own, then the one of each module of its model. */
|
|
3
|
+
export function wiringFilesOf({ directory, modules }, context) {
|
|
4
|
+
return [`${directory}/${context}.module.ts`, ...modules.map((module) => `${directory}/${moduleFileOf(module)}`)];
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=wiring-files-of.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wiring-files-of.js","sourceRoot":"","sources":["../../src/model-modules/wiring-files-of.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,qIAAqI;AACrI,MAAM,UAAU,aAAa,CAAC,EAAE,SAAS,EAAE,OAAO,EAAe,EAAE,OAAe;IAChF,OAAO,CAAC,GAAG,SAAS,IAAI,OAAO,YAAY,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,SAAS,IAAI,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;AACnH,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Workspace } from '../workspace/index.js';
|
|
2
|
+
import type { ContextTree } from './context-tree.js';
|
|
3
|
+
/** What the module files of a context register, read as one text: the ones that do not exist read as nothing. */
|
|
4
|
+
export declare function wiringTextOf(ws: Workspace, tree: ContextTree, context: string): string;
|
|
5
|
+
//# sourceMappingURL=wiring-text-of.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wiring-text-of.d.ts","sourceRoot":"","sources":["../../src/model-modules/wiring-text-of.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlD,iHAAiH;AACjH,wBAAgB,YAAY,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAItF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { wiringFilesOf } from './wiring-files-of.js';
|
|
2
|
+
/** What the module files of a context register, read as one text: the ones that do not exist read as nothing. */
|
|
3
|
+
export function wiringTextOf(ws, tree, context) {
|
|
4
|
+
return wiringFilesOf(tree, context)
|
|
5
|
+
.map((file) => ws.read(file) ?? '')
|
|
6
|
+
.join('\n');
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=wiring-text-of.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wiring-text-of.js","sourceRoot":"","sources":["../../src/model-modules/wiring-text-of.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,iHAAiH;AACjH,MAAM,UAAU,YAAY,CAAC,EAAa,EAAE,IAAiB,EAAE,OAAe;IAC5E,OAAO,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC;SAChC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;SAClC,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply-preset.d.ts","sourceRoot":"","sources":["../../src/presets/apply-preset.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,MAAM,EAAE,MAAM,WAAW,CAAC;AASlE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAS9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"apply-preset.d.ts","sourceRoot":"","sources":["../../src/presets/apply-preset.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,MAAM,EAAE,MAAM,WAAW,CAAC;AASlE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAS9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAOvC,qGAAqG;AACrG,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,MAAM,CAkCzF"}
|
|
@@ -13,6 +13,8 @@ import { organisationsAsTenantDirectory } from './organisations-as-tenant-direct
|
|
|
13
13
|
import { organisationsAsTenants } from './organisations-as-tenants.js';
|
|
14
14
|
import { outsideTheTenancy } from './outside-the-tenancy.js';
|
|
15
15
|
import { presetDecision } from './preset-decision.js';
|
|
16
|
+
/** The shared support of the end-to-end specs that `init` writes, where the fakes of outside systems are bound. */
|
|
17
|
+
const E2E_SUPPORT = 'test/e2e/support/start-application.ts';
|
|
16
18
|
/**
|
|
17
19
|
* Writes a preset into its context: its glossary, its files, then the generators that wire them
|
|
18
20
|
* (the storage of the platform, the published language, the registries), then the files those
|
|
@@ -47,6 +49,9 @@ function layOutAfterSteps(scope, preset, rendering) {
|
|
|
47
49
|
if (preset.explicitPolicies !== undefined && style === 'explicit') {
|
|
48
50
|
applyWiring(scope.ws, platformPath(scope, 'auth/authorization/access-policies.ts'), render(preset.explicitPolicies));
|
|
49
51
|
}
|
|
52
|
+
if (preset.e2eFakes !== undefined && scope.ws.read(E2E_SUPPORT) !== undefined) {
|
|
53
|
+
applyWiring(scope.ws, E2E_SUPPORT, render(preset.e2eFakes));
|
|
54
|
+
}
|
|
50
55
|
if (preset.prismaModels !== undefined && orm === 'prisma') {
|
|
51
56
|
layOutPrismaModels(scope.ws, render(preset.prismaModels), scope.context.kebab);
|
|
52
57
|
}
|