ddd-ts-kit 0.84.0 → 0.85.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 +50 -0
- package/README.fr.md +60 -27
- package/README.md +57 -28
- package/dist/check/canonical/stray-entry.js +3 -2
- package/dist/check/canonical/stray-entry.js.map +1 -1
- package/dist/check/explain/layout-docs.js +1 -1
- package/dist/check/explain/layout-docs.js.map +1 -1
- package/dist/check/explain/tree-docs.d.ts.map +1 -1
- package/dist/check/explain/tree-docs.js +3 -2
- package/dist/check/explain/tree-docs.js.map +1 -1
- package/dist/check/explain/wiring-docs.d.ts.map +1 -1
- package/dist/check/explain/wiring-docs.js +17 -6
- package/dist/check/explain/wiring-docs.js.map +1 -1
- package/dist/check/fixtures/authz-policy-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/authz-policy-fixtures.js +4 -4
- package/dist/check/fixtures/authz-policy-fixtures.js.map +1 -1
- package/dist/check/fixtures/constructor-injection-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/constructor-injection-fixtures.js +10 -8
- package/dist/check/fixtures/constructor-injection-fixtures.js.map +1 -1
- package/dist/check/fixtures/declarations-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/declarations-fixtures.js +54 -9
- package/dist/check/fixtures/declarations-fixtures.js.map +1 -1
- package/dist/check/fixtures/declared-declarations.d.ts +7 -0
- package/dist/check/fixtures/declared-declarations.d.ts.map +1 -0
- package/dist/check/fixtures/declared-declarations.js +21 -0
- package/dist/check/fixtures/declared-declarations.js.map +1 -0
- package/dist/check/fixtures/declared-project.d.ts +4 -1
- package/dist/check/fixtures/declared-project.d.ts.map +1 -1
- package/dist/check/fixtures/declared-project.js +17 -9
- package/dist/check/fixtures/declared-project.js.map +1 -1
- package/dist/check/fixtures/paths.d.ts +1 -0
- package/dist/check/fixtures/paths.d.ts.map +1 -1
- package/dist/check/fixtures/paths.js +1 -0
- package/dist/check/fixtures/paths.js.map +1 -1
- package/dist/check/fixtures/signature-project.d.ts +3 -3
- package/dist/check/fixtures/signature-project.js +3 -3
- package/dist/check/fixtures/signature.d.ts +2 -1
- package/dist/check/fixtures/signature.d.ts.map +1 -1
- package/dist/check/fixtures/signature.js +2 -1
- package/dist/check/fixtures/signature.js.map +1 -1
- package/dist/check/fixtures/single-file-declarations.d.ts +7 -0
- package/dist/check/fixtures/single-file-declarations.d.ts.map +1 -0
- package/dist/check/fixtures/single-file-declarations.js +21 -0
- package/dist/check/fixtures/single-file-declarations.js.map +1 -0
- package/dist/check/rules/clean-file-size.d.ts.map +1 -1
- package/dist/check/rules/clean-file-size.js +9 -1
- package/dist/check/rules/clean-file-size.js.map +1 -1
- package/dist/check/rules/declarations-barrel-current.d.ts.map +1 -1
- package/dist/check/rules/declarations-barrel-current.js +56 -23
- package/dist/check/rules/declarations-barrel-current.js.map +1 -1
- package/dist/check/rules/naming-suffix.d.ts.map +1 -1
- package/dist/check/rules/naming-suffix.js +7 -3
- package/dist/check/rules/naming-suffix.js.map +1 -1
- package/dist/check/support/is-generated-context-file.d.ts +5 -1
- package/dist/check/support/is-generated-context-file.d.ts.map +1 -1
- package/dist/check/support/is-generated-context-file.js +11 -5
- package/dist/check/support/is-generated-context-file.js.map +1 -1
- package/dist/commands/docs.d.ts.map +1 -1
- package/dist/commands/docs.js +23 -11
- package/dist/commands/docs.js.map +1 -1
- package/dist/commands/generate.d.ts.map +1 -1
- package/dist/commands/generate.js +7 -4
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/print-report.js +1 -0
- package/dist/commands/print-report.js.map +1 -1
- package/dist/commit/is-derived.js +4 -4
- package/dist/commit/is-derived.js.map +1 -1
- package/dist/declared/barrel-file.d.ts +4 -1
- package/dist/declared/barrel-file.d.ts.map +1 -1
- package/dist/declared/barrel-file.js +4 -1
- package/dist/declared/barrel-file.js.map +1 -1
- package/dist/declared/context-declarations.d.ts +24 -0
- package/dist/declared/context-declarations.d.ts.map +1 -0
- package/dist/declared/context-declarations.js +22 -0
- package/dist/declared/context-declarations.js.map +1 -0
- package/dist/declared/declarations-folder-of.d.ts +10 -0
- package/dist/declared/declarations-folder-of.d.ts.map +1 -0
- package/dist/declared/declarations-folder-of.js +13 -0
- package/dist/declared/declarations-folder-of.js.map +1 -0
- package/dist/declared/folder-declarations-file.d.ts +7 -0
- package/dist/declared/folder-declarations-file.d.ts.map +1 -0
- package/dist/declared/folder-declarations-file.js +10 -0
- package/dist/declared/folder-declarations-file.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 +8 -1
- package/dist/declared/index.js.map +1 -1
- package/dist/declared/is-declarations-file.d.ts +7 -0
- package/dist/declared/is-declarations-file.d.ts.map +1 -0
- package/dist/declared/is-declarations-file.js +20 -0
- package/dist/declared/is-declarations-file.js.map +1 -0
- package/dist/declared/keeps-single-file.d.ts +11 -0
- package/dist/declared/keeps-single-file.d.ts.map +1 -0
- package/dist/declared/keeps-single-file.js +23 -0
- package/dist/declared/keeps-single-file.js.map +1 -0
- package/dist/declared/render-declarations.d.ts +18 -0
- package/dist/declared/render-declarations.d.ts.map +1 -0
- package/dist/declared/render-declarations.js +37 -0
- package/dist/declared/render-declarations.js.map +1 -0
- package/dist/declared/render-folder-declarations.d.ts +11 -0
- package/dist/declared/render-folder-declarations.d.ts.map +1 -0
- package/dist/declared/render-folder-declarations.js +23 -0
- package/dist/declared/render-folder-declarations.js.map +1 -0
- package/dist/declared/single-file-declarations.d.ts +9 -0
- package/dist/declared/single-file-declarations.d.ts.map +1 -0
- package/dist/declared/single-file-declarations.js +14 -0
- package/dist/declared/single-file-declarations.js.map +1 -0
- package/dist/declared/single-file-notice.d.ts +8 -0
- package/dist/declared/single-file-notice.d.ts.map +1 -0
- package/dist/declared/single-file-notice.js +9 -0
- package/dist/declared/single-file-notice.js.map +1 -0
- package/dist/derived/is-derived.d.ts +4 -3
- package/dist/derived/is-derived.d.ts.map +1 -1
- package/dist/derived/is-derived.js +8 -8
- package/dist/derived/is-derived.js.map +1 -1
- package/dist/describe/read-consumed-events.js +7 -2
- package/dist/describe/read-consumed-events.js.map +1 -1
- package/dist/dev/refresh-declarations.d.ts.map +1 -1
- package/dist/dev/refresh-declarations.js +3 -2
- package/dist/dev/refresh-declarations.js.map +1 -1
- package/dist/docs/write-docs.d.ts +3 -1
- package/dist/docs/write-docs.d.ts.map +1 -1
- package/dist/docs/write-docs.js +4 -2
- package/dist/docs/write-docs.js.map +1 -1
- package/dist/generate/context-imports.d.ts.map +1 -1
- package/dist/generate/context-imports.js +2 -1
- package/dist/generate/context-imports.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/e2e/reaction-of.d.ts +14 -0
- package/dist/generate/kinds/e2e/reaction-of.d.ts.map +1 -0
- package/dist/generate/kinds/e2e/reaction-of.js +93 -0
- package/dist/generate/kinds/e2e/reaction-of.js.map +1 -0
- package/dist/generate/kinds/e2e-kind.d.ts.map +1 -1
- package/dist/generate/kinds/e2e-kind.js +30 -18
- package/dist/generate/kinds/e2e-kind.js.map +1 -1
- package/dist/generate/refresh-barrels.d.ts +11 -4
- package/dist/generate/refresh-barrels.d.ts.map +1 -1
- package/dist/generate/refresh-barrels.js +41 -15
- package/dist/generate/refresh-barrels.js.map +1 -1
- package/dist/generate/refuse-shared-writes.js +1 -1
- package/dist/generate/refuse-shared-writes.js.map +1 -1
- package/dist/help/notes.d.ts +1 -1
- package/dist/help/notes.d.ts.map +1 -1
- package/dist/help/notes.js +19 -16
- package/dist/help/notes.js.map +1 -1
- package/dist/init/manifest/versions.js +24 -24
- package/dist/merge/classify-conflict.d.ts +2 -1
- package/dist/merge/classify-conflict.d.ts.map +1 -1
- package/dist/merge/classify-conflict.js +9 -0
- package/dist/merge/classify-conflict.js.map +1 -1
- package/dist/merge/higher-version.d.ts +7 -0
- package/dist/merge/higher-version.d.ts.map +1 -0
- package/dist/merge/higher-version.js +59 -0
- package/dist/merge/higher-version.js.map +1 -0
- package/dist/merge/merge-client-manifest.d.ts +16 -0
- package/dist/merge/merge-client-manifest.d.ts.map +1 -0
- package/dist/merge/merge-client-manifest.js +39 -0
- package/dist/merge/merge-client-manifest.js.map +1 -0
- package/dist/merge/merge-exclusions.d.ts +4 -3
- package/dist/merge/merge-exclusions.d.ts.map +1 -1
- package/dist/merge/merge-exclusions.js +6 -3
- package/dist/merge/merge-exclusions.js.map +1 -1
- package/dist/merge/resolve-conflict.d.ts +3 -2
- package/dist/merge/resolve-conflict.d.ts.map +1 -1
- package/dist/merge/resolve-conflict.js +29 -7
- package/dist/merge/resolve-conflict.js.map +1 -1
- package/dist/plan/batched-waves.d.ts +2 -0
- package/dist/plan/batched-waves.d.ts.map +1 -1
- package/dist/plan/batched-waves.js +20 -7
- package/dist/plan/batched-waves.js.map +1 -1
- package/dist/plan/format-plan.d.ts +1 -1
- package/dist/plan/format-plan.d.ts.map +1 -1
- package/dist/plan/format-plan.js +33 -8
- package/dist/plan/format-plan.js.map +1 -1
- package/dist/plan/other-stories.d.ts +9 -0
- package/dist/plan/other-stories.d.ts.map +1 -0
- package/dist/plan/other-stories.js +31 -0
- package/dist/plan/other-stories.js.map +1 -0
- package/dist/plan/plan-waves.d.ts +2 -1
- package/dist/plan/plan-waves.d.ts.map +1 -1
- package/dist/plan/plan-waves.js +13 -4
- package/dist/plan/plan-waves.js.map +1 -1
- package/dist/plan/wave-plan.d.ts +28 -0
- package/dist/plan/wave-plan.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/worker/briefing-of.js +4 -2
- package/dist/worker/briefing-of.js.map +1 -1
- package/dist/workspace/workspace-report.d.ts +2 -0
- package/dist/workspace/workspace-report.d.ts.map +1 -1
- package/dist/workspace/workspace.d.ts +8 -0
- package/dist/workspace/workspace.d.ts.map +1 -1
- package/dist/workspace/workspace.js +24 -3
- package/dist/workspace/workspace.js.map +1 -1
- package/package.json +2 -2
- package/templates/e2e/e2e-reaction.spec.ts.tpl +68 -0
- package/templates/init/AGENTS.md.tpl +1 -1
- package/templates/init/README.md.tpl +2 -1
- package/templates/init/e2e/start-application.database.ts.tpl +22 -2
- package/templates/init/e2e/start-application.memory.ts.tpl +22 -2
- package/templates/init/platform/events/custom-event-bus.ts.tpl +1 -1
- package/templates/init/platform/events/in-process-events.ts.tpl +1 -1
- package/templates/init/rules/tests.md.tpl +1 -1
- package/templates/pipeline/biome.json.tpl +1 -0
- package/templates/pipeline/github/actions/setup/action.yml.tpl +3 -0
- package/templates/pipeline/github/workflows/ci.yml.tpl +12 -12
- package/templates/pipeline/github/workflows/codeql.yml +1 -1
- package/templates/pipeline/github/workflows/copilot-setup-steps.yml +1 -1
- package/templates/pipeline/github/workflows/pr-title.yml +1 -1
- package/templates/pipeline/package-scripts.json +1 -1
- package/templates/presets/identity/context/test/worlds/__context__.world.ts.tpl +1 -0
- package/templates/test-world/world.buses.ts.tpl +1 -1
- package/templates/test-world/world.tsyringe.ts.tpl +1 -0
- package/dist/check/fixtures/declared-barrel.d.ts +0 -3
- package/dist/check/fixtures/declared-barrel.d.ts.map +0 -1
- package/dist/check/fixtures/declared-barrel.js +0 -4
- package/dist/check/fixtures/declared-barrel.js.map +0 -1
- package/dist/declared/render-barrel.d.ts +0 -11
- package/dist/declared/render-barrel.d.ts.map +0 -1
- package/dist/declared/render-barrel.js +0 -29
- package/dist/declared/render-barrel.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wiring-docs.d.ts","sourceRoot":"","sources":["../../../src/check/explain/wiring-docs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"wiring-docs.d.ts","sourceRoot":"","sources":["../../../src/check/explain/wiring-docs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA+GzD,CAAC"}
|
|
@@ -30,18 +30,29 @@ export class IssueInvoiceHandler {}
|
|
|
30
30
|
export class InvoiceIssuedEventHandler {}`,
|
|
31
31
|
},
|
|
32
32
|
'declarations/barrel-current': {
|
|
33
|
-
why: 'With stack.assembly set to barrel, the composition root assembles a context from <context>.declarations.ts and from nothing else. A role file added by hand and missing from the
|
|
34
|
-
bad: `//
|
|
33
|
+
why: 'With stack.assembly set to barrel, the composition root assembles a context from <context>.declarations.ts and from nothing else. That file only re-exports the generated <folder>.declarations.ts of each role folder of the context (application/commands/commands.declarations.ts, infrastructure/persistence/persistence.declarations.ts, presentation/http/http.declarations.ts; the files of a use case or of a route roll up to the folder at <layer>/<folder>/, and a role file sitting directly in a layer to <layer>/<layer>.declarations.ts). A role file added by hand and missing from the declarations of its folder compiles, passes its unit tests and is never registered. The same file registers what each constructor of its folder is injected, read from its signature: a constructor changed without regenerating would be given the dependencies of the old one. Each file is derived from the tree, one export per role file sorted by path then one injected(Class, [Tokens]) per class that takes something, so it is compared with what the tree says, and the message names the class whose list is stale; the declarations of a folder that holds no role file any more are reported until they are deleted. A context still declared in the single <context>.declarations.ts of 0.84, exactly as that version would write it for the current tree and with no declarations file in a role folder yet, is a warning in this version, not an error: ddd-ts-kit docs moves it to the files of its role folders, and a later minor version reports it as an error. With stack.assembly set to discovery the role files are found at startup, <context>.dependencies.ts holds the lists alone and is compared the same way, and generated declarations left behind are reported.',
|
|
34
|
+
bad: `// application/commands/commands.declarations.ts, while IssueInvoiceHandler now also takes a Clock
|
|
35
35
|
export * from '@/contexts/billing/application/commands/issue-invoice/issue-invoice.command';
|
|
36
36
|
export * from '@/contexts/billing/application/commands/issue-invoice/issue-invoice.handler';
|
|
37
37
|
|
|
38
|
-
injected(IssueInvoiceHandler, [InvoiceRepository])
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
injected(IssueInvoiceHandler, [InvoiceRepository]);
|
|
39
|
+
|
|
40
|
+
// billing.declarations.ts, while application/authorization/only-issuer-voids.policy.ts exists
|
|
41
|
+
export * from '@/contexts/billing/application/commands/commands.declarations';`,
|
|
42
|
+
good: `// application/commands/commands.declarations.ts, rewritten by \`ddd-ts-kit generate\`, \`ddd-ts-kit docs\` and \`npm run dev\`
|
|
43
|
+
import { injected } from '@ddd-ts-kit/kernel/declarations';
|
|
44
|
+
import { Clock } from '@ddd-ts-kit/kernel';
|
|
45
|
+
import { IssueInvoiceHandler } from '@/contexts/billing/application/commands/issue-invoice/issue-invoice.handler';
|
|
46
|
+
import { InvoiceRepository } from '@/contexts/billing/domain/repositories/invoice.repository';
|
|
47
|
+
|
|
41
48
|
export * from '@/contexts/billing/application/commands/issue-invoice/issue-invoice.command';
|
|
42
49
|
export * from '@/contexts/billing/application/commands/issue-invoice/issue-invoice.handler';
|
|
43
50
|
|
|
44
|
-
injected(IssueInvoiceHandler, [InvoiceRepository, Clock])
|
|
51
|
+
injected(IssueInvoiceHandler, [InvoiceRepository, Clock]);
|
|
52
|
+
|
|
53
|
+
// billing.declarations.ts, the summary the composition root imports
|
|
54
|
+
export * from '@/contexts/billing/application/authorization/authorization.declarations';
|
|
55
|
+
export * from '@/contexts/billing/application/commands/commands.declarations';`,
|
|
45
56
|
},
|
|
46
57
|
'declarations/constructor-injection': {
|
|
47
58
|
why: 'The constructor signature is the one statement of what a declared class depends on: `ddd-ts-kit docs` reads it and writes the list the composition root injects, so nothing is repeated in the decorator and nothing can disagree with the constructor. That only works when each parameter names exactly one injection token, and a token is a class: an interface, a type alias or a primitive is erased by the compiler, a union names two things, an optional or defaulted parameter says the container might not give a value, which it always does. A constructor inherited from a class of a package cannot be read at all. The compiler is not asked for the types at run time: `emitDecoratorMetadata` exists only with legacy decorators compiled by tsc or swc, not with standard decorators nor under tsx or esbuild. Under "stack.dependencies": "signature" a list left in a decorator is a second statement: it wins at run time, so it is removed when it repeats the constructor (ESLint fixes it) and reported when it differs. A project whose config does not say lists its dependencies in its decorators, as 0.1 did, and may keep doing so.',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wiring-docs.js","sourceRoot":"","sources":["../../../src/check/explain/wiring-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAsC;IAC5D,4BAA4B,EAAE;QAC5B,GAAG,EAAE,qnBAAqnB;QAC1nB,GAAG,EAAE;;;sCAG6B;QAClC,IAAI,EAAE;;;;;;+CAMqC;KAC5C;IACD,4BAA4B,EAAE;QAC5B,GAAG,EAAE,irBAAirB;QACtrB,GAAG,EAAE;;;;;;wBAMe;QACpB,IAAI,EAAE;;;;;0CAKgC;KACvC;IACD,6BAA6B,EAAE;QAC7B,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"wiring-docs.js","sourceRoot":"","sources":["../../../src/check/explain/wiring-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAsC;IAC5D,4BAA4B,EAAE;QAC5B,GAAG,EAAE,qnBAAqnB;QAC1nB,GAAG,EAAE;;;sCAG6B;QAClC,IAAI,EAAE;;;;;;+CAMqC;KAC5C;IACD,4BAA4B,EAAE;QAC5B,GAAG,EAAE,irBAAirB;QACtrB,GAAG,EAAE;;;;;;wBAMe;QACpB,IAAI,EAAE;;;;;0CAKgC;KACvC;IACD,6BAA6B,EAAE;QAC7B,GAAG,EAAE,4sDAA4sD;QACjtD,GAAG,EAAE;;;;;;;+EAOsE;QAC3E,IAAI,EAAE;;;;;;;;;;;;;+EAaqE;KAC5E;IACD,oCAAoC,EAAE;QACpC,GAAG,EAAE,omCAAomC;QACzmC,GAAG,EAAE;;;;;;;;;iEASwD;QAC7D,IAAI,EAAE;;;;;;;EAOR;KACC;IACD,iCAAiC,EAAE;QACjC,GAAG,EAAE,4nBAA4nB;QACjoB,GAAG,EAAE;+DACsD;QAC3D,IAAI,EAAE;;;;;;;+DAOqD;KAC5D;IACD,4BAA4B,EAAE;QAC5B,GAAG,EAAE,+bAA+b;QACpc,GAAG,EAAE;yIACgI;QACrI,IAAI,EAAE;yIAC+H;KACtI;IACD,cAAc,EAAE;QACd,GAAG,EAAE,kXAAkX;QACvX,GAAG,EAAE;;uEAE8D;QACnE,IAAI,EAAE;;2IAEiI;KACxI;IACD,iCAAiC,EAAE;QACjC,GAAG,EAAE,qMAAqM;QAC1M,GAAG,EAAE,qDAAqD;QAC1D,IAAI,EAAE,qGAAqG;KAC5G;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authz-policy-fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/authz-policy-fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"authz-policy-fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/authz-policy-fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAyC5C,eAAO,MAAM,qBAAqB,EAAE,SAAS,OAAO,EA+FnD,CAAC"}
|
|
@@ -3,9 +3,9 @@ import { PATHS } from './paths.js';
|
|
|
3
3
|
import { project } from './project.js';
|
|
4
4
|
import { signatureProject } from './signature-project.js';
|
|
5
5
|
import { source } from './source.js';
|
|
6
|
-
const {
|
|
7
|
-
/** The
|
|
8
|
-
const
|
|
6
|
+
const { COMMAND, COMMANDS_DECLARATIONS, HANDLER, MODULE, POLICY } = PATHS;
|
|
7
|
+
/** The declarations of application/commands/ the generator derives once the handler takes `Access` and the repository in its constructor. */
|
|
8
|
+
const COMMANDS_OF_THE_POLICY = source("import { injected } from '@ddd-ts-kit/kernel/declarations';", "import { IssueInvoiceHandler } from '@/contexts/billing/application/commands/issue-invoice/issue-invoice.handler.js';", "import { InvoiceRepository } from '@/contexts/billing/domain/repositories/invoice.repository.js';", "import { Access } from '@ddd-ts-kit/auth';", '', "export * from '@/contexts/billing/application/commands/issue-invoice/issue-invoice.command.js';", "export * from '@/contexts/billing/application/commands/issue-invoice/issue-invoice.handler.js';", '', 'injected(IssueInvoiceHandler, [Access, InvoiceRepository]);');
|
|
9
9
|
const ISSUE_POLICY = [
|
|
10
10
|
"import { Policy } from '@ddd-ts-kit/kernel/declarations';",
|
|
11
11
|
'',
|
|
@@ -115,6 +115,6 @@ function declaredHandler(body) {
|
|
|
115
115
|
}
|
|
116
116
|
/** The declared issue-invoice use case whose permission a policy refines, its handler written with `body`. */
|
|
117
117
|
function withPolicy(body) {
|
|
118
|
-
return signatureProject(body, { [POLICY]: ISSUE_POLICY, [
|
|
118
|
+
return signatureProject(body, { [POLICY]: ISSUE_POLICY, [COMMANDS_DECLARATIONS]: COMMANDS_OF_THE_POLICY });
|
|
119
119
|
}
|
|
120
120
|
//# sourceMappingURL=authz-policy-fixtures.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authz-policy-fixtures.js","sourceRoot":"","sources":["../../../src/check/fixtures/authz-policy-fixtures.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"authz-policy-fixtures.js","sourceRoot":"","sources":["../../../src/check/fixtures/authz-policy-fixtures.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OA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CAAuC;YAClD,CAAC,MAAM,CAAC,EACN,8HAA8H;YAChI,GAAG,OAAO,CACR,sJAAsJ,CACvJ;SACF,CAAC;KACH;CACF,CAAC;AAEF,uEAAuE;AACvE,SAAS,eAAe,CAAC,IAAY;IACnC,OAAO;QACL,iDAAiD;QACjD,mEAAmE;QACnE,wGAAwG;QACxG,uHAAuH;QACvH,EAAE;QACF,sCAAsC;QACtC,oCAAoC;QACpC,gBAAgB;QAChB,sCAAsC;QACtC,mDAAmD;QACnD,QAAQ;QACR,EAAE;QACF,gEAAgE;QAChE,IAAI;QACJ,KAAK;QACL,GAAG;QACH,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,8GAA8G;AAC9G,SAAS,UAAU,CAAC,IAAY;IAC9B,OAAO,gBAAgB,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC,qBAAqB,CAAC,EAAE,sBAAsB,EAAE,CAAC,CAAC;AAC7G,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constructor-injection-fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/constructor-injection-fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAwB5C,eAAO,MAAM,8BAA8B,EAAE,SAAS,OAAO,
|
|
1
|
+
{"version":3,"file":"constructor-injection-fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/constructor-injection-fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAwB5C,eAAO,MAAM,8BAA8B,EAAE,SAAS,OAAO,EA+H5D,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { PATHS } from './paths.js';
|
|
|
2
2
|
import { SIGNATURE } from './signature.js';
|
|
3
3
|
import { signatureProject } from './signature-project.js';
|
|
4
4
|
import { source } from './source.js';
|
|
5
|
-
const {
|
|
5
|
+
const { BILLING, COMMANDS_DECLARATIONS, HANDLER } = PATHS;
|
|
6
6
|
const RULE = 'declarations/constructor-injection';
|
|
7
7
|
const BARE = '@CommandHandler(IssueInvoiceCommand)';
|
|
8
8
|
const SETTINGS = `${BILLING}/application/ports/invoice-settings.port.ts`;
|
|
@@ -21,13 +21,15 @@ export const CONSTRUCTOR_INJECTION_FIXTURES = [
|
|
|
21
21
|
ruleId: RULE,
|
|
22
22
|
name: 'a handler that lists nothing and types each constructor parameter by a port, its barrel registering what was read',
|
|
23
23
|
expect: 'pass',
|
|
24
|
-
files: signatureProject(SIGNATURE.handler, { [
|
|
24
|
+
files: signatureProject(SIGNATURE.handler, { [COMMANDS_DECLARATIONS]: SIGNATURE.declarations }),
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
ruleId: RULE,
|
|
28
28
|
name: 'a parameter typed by a generic class, whose raw class is the token',
|
|
29
29
|
expect: 'pass',
|
|
30
|
-
files: signatureProject(takingInstead('private readonly clock: Clock<Date>'), {
|
|
30
|
+
files: signatureProject(takingInstead('private readonly clock: Clock<Date>'), {
|
|
31
|
+
[COMMANDS_DECLARATIONS]: SIGNATURE.declarations,
|
|
32
|
+
}),
|
|
31
33
|
},
|
|
32
34
|
...REFUSED_PARAMETERS.map(([name, parameter]) => ({
|
|
33
35
|
ruleId: RULE,
|
|
@@ -83,16 +85,16 @@ export const CONSTRUCTOR_INJECTION_FIXTURES = [
|
|
|
83
85
|
},
|
|
84
86
|
{
|
|
85
87
|
ruleId: 'declarations/barrel-current',
|
|
86
|
-
name: '
|
|
87
|
-
expect: { file:
|
|
88
|
+
name: 'declarations whose dependency list was read from a constructor that has changed since',
|
|
89
|
+
expect: { file: COMMANDS_DECLARATIONS },
|
|
88
90
|
files: signatureProject(SIGNATURE.handler, {
|
|
89
|
-
[
|
|
91
|
+
[COMMANDS_DECLARATIONS]: SIGNATURE.declarations.replace('[InvoiceRepository, Clock]', '[InvoiceRepository]'),
|
|
90
92
|
}),
|
|
91
93
|
},
|
|
92
94
|
{
|
|
93
95
|
ruleId: 'declarations/barrel-current',
|
|
94
|
-
name: '
|
|
95
|
-
expect: { file:
|
|
96
|
+
name: 'declarations that register no dependency list for a constructor that takes something',
|
|
97
|
+
expect: { file: COMMANDS_DECLARATIONS },
|
|
96
98
|
files: signatureProject(SIGNATURE.handler),
|
|
97
99
|
},
|
|
98
100
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constructor-injection-fixtures.js","sourceRoot":"","sources":["../../../src/check/fixtures/constructor-injection-fixtures.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"constructor-injection-fixtures.js","sourceRoot":"","sources":["../../../src/check/fixtures/constructor-injection-fixtures.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,EAAE,OAAO,EAAE,qBAAqB,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;AAC1D,MAAM,IAAI,GAAG,oCAAoC,CAAC;AAClD,MAAM,IAAI,GAAG,sCAAsC,CAAC;AACpD,MAAM,QAAQ,GAAG,GAAG,OAAO,6CAA6C,CAAC;AACzE,MAAM,YAAY,GAAG,GAAG,OAAO,0BAA0B,CAAC;AAE1D,MAAM,aAAa,GAAG,CAAC,SAAiB,EAAE,OAAO,GAAsB,SAAS,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EAAE,IAAI,EAAE,YAAY,EAAE;QAC9B,KAAK,EAAE,gBAAgB,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,EAAE,WAAW,CAAC;KAC5D;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declarations-fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/declarations-fixtures.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"declarations-fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/declarations-fixtures.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAuD5C,eAAO,MAAM,qBAAqB,EAAE,SAAS,OAAO,EAyRnD,CAAC"}
|
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
import { aggregate } from './aggregate.js';
|
|
2
2
|
import { DECLARED } from './declared.js';
|
|
3
|
-
import { DECLARED_BARREL } from './declared-barrel.js';
|
|
4
3
|
import { DECLARED_CONTEXT } from './declared-context.js';
|
|
4
|
+
import { DECLARED_DECLARATIONS } from './declared-declarations.js';
|
|
5
5
|
import { declaredProject } from './declared-project.js';
|
|
6
6
|
import { discoveredProject } from './discovered-project.js';
|
|
7
7
|
import { handler } from './handler.js';
|
|
8
8
|
import { PATHS } from './paths.js';
|
|
9
9
|
import { project } from './project.js';
|
|
10
10
|
import { SAMPLES } from './samples.js';
|
|
11
|
+
import { SINGLE_FILE_DECLARATIONS } from './single-file-declarations.js';
|
|
11
12
|
import { source } from './source.js';
|
|
12
13
|
import { withoutFile } from './without-file.js';
|
|
13
|
-
const { ADAPTER, AGGREGATE, BARREL, BILLING, COMMAND, EVENT, EVENT_HANDLER, EVENT_HANDLER_SPEC, HANDLER, INTEGRATION_HANDLER, INTEGRATION_HANDLER_SPEC, JOB, JOB_SPEC, MODULE, PLATFORM_MODULE, POLICY, PORT, } = PATHS;
|
|
14
|
+
const { ADAPTER, AGGREGATE, BARREL, BILLING, COMMAND, COMMANDS_DECLARATIONS, EVENT, EVENT_HANDLER, EVENT_HANDLER_SPEC, HANDLER, INTEGRATION_HANDLER, INTEGRATION_HANDLER_SPEC, JOB, JOB_SPEC, MODULE, PLATFORM_MODULE, POLICY, PORT, } = PATHS;
|
|
14
15
|
const { SPEC } = SAMPLES;
|
|
15
16
|
/** A class of infrastructure/ that implements a port, in a file without a role suffix, declared by nothing. */
|
|
16
17
|
const STRIPE = `${BILLING}/infrastructure/external/stripe-payment-gateway.ts`;
|
|
17
18
|
const STRIPE_IMPORT = "import { StripePaymentGateway } from '@/contexts/billing/infrastructure/external/stripe-payment-gateway.js';";
|
|
18
19
|
const PORT_IMPORT = "import { PaymentGateway } from '@/contexts/billing/application/ports/payment-gateway.port.js';";
|
|
19
20
|
const stripeGateway = (...before) => source(PORT_IMPORT, '', ...before, 'export class StripePaymentGateway implements PaymentGateway {}');
|
|
21
|
+
/** The billing context declared in the single file of 0.84: no declarations file in a role folder. */
|
|
22
|
+
const singleFile = (declarations) => Object.fromEntries(Object.entries(declaredProject(DECLARED_CONTEXT, { [BARREL]: declarations })).filter(([file]) => file === BARREL || !file.startsWith(`${BILLING}/`) || !file.endsWith('.declarations.ts')));
|
|
20
23
|
const explicitModule = (...statements) => source("import type { ModuleBuilder } from '@ddd-ts-kit/di';", PORT_IMPORT, ...statements);
|
|
21
24
|
export const DECLARATIONS_FIXTURES = [
|
|
22
25
|
{
|
|
@@ -95,9 +98,9 @@ export const DECLARATIONS_FIXTURES = [
|
|
|
95
98
|
},
|
|
96
99
|
{
|
|
97
100
|
ruleId: 'declarations/barrel-current',
|
|
98
|
-
name: '
|
|
101
|
+
name: 'the declarations of each role folder list its role files, sorted by path, and the summary at the root re-exports them',
|
|
99
102
|
expect: 'pass',
|
|
100
|
-
files: declaredProject(DECLARED_CONTEXT,
|
|
103
|
+
files: declaredProject(DECLARED_CONTEXT, DECLARED_DECLARATIONS),
|
|
101
104
|
},
|
|
102
105
|
{
|
|
103
106
|
ruleId: 'declarations/barrel-current',
|
|
@@ -116,23 +119,65 @@ export const DECLARATIONS_FIXTURES = [
|
|
|
116
119
|
},
|
|
117
120
|
{
|
|
118
121
|
ruleId: 'declarations/barrel-current',
|
|
119
|
-
name: 'a declared context without its
|
|
122
|
+
name: 'a declared context without the summary of its declarations',
|
|
120
123
|
expect: { file: BARREL },
|
|
121
124
|
files: withoutFile(declaredProject(DECLARED_CONTEXT), BARREL),
|
|
122
125
|
},
|
|
123
126
|
{
|
|
124
127
|
ruleId: 'declarations/barrel-current',
|
|
125
|
-
name: 'a role
|
|
126
|
-
expect: { file:
|
|
128
|
+
name: 'a role folder without its declarations',
|
|
129
|
+
expect: { file: COMMANDS_DECLARATIONS },
|
|
130
|
+
files: withoutFile(declaredProject(DECLARED_CONTEXT), COMMANDS_DECLARATIONS),
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
ruleId: 'declarations/barrel-current',
|
|
134
|
+
name: 'a role file added by hand that the declarations of its folder do not list',
|
|
135
|
+
expect: { file: COMMANDS_DECLARATIONS },
|
|
127
136
|
files: declaredProject(DECLARED_CONTEXT, {
|
|
128
|
-
|
|
137
|
+
...DECLARED_DECLARATIONS,
|
|
138
|
+
[COMMANDS_DECLARATIONS]: source("export * from '@/contexts/billing/application/commands/issue-invoice/issue-invoice.handler.js';"),
|
|
129
139
|
}),
|
|
130
140
|
},
|
|
141
|
+
{
|
|
142
|
+
ruleId: 'declarations/barrel-current',
|
|
143
|
+
name: 'the declarations of a folder that holds no role file any more, left behind',
|
|
144
|
+
expect: { file: `${BILLING}/application/background/background.declarations.ts` },
|
|
145
|
+
files: declaredProject(DECLARED_CONTEXT, {
|
|
146
|
+
[`${BILLING}/application/background/background.declarations.ts`]: 'export {};\n',
|
|
147
|
+
}),
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
ruleId: 'declarations/barrel-current',
|
|
151
|
+
name: 'the single declarations file of 0.84, current and not moved yet: a warning, until a later minor version',
|
|
152
|
+
expect: { file: BARREL },
|
|
153
|
+
severity: 'warn',
|
|
154
|
+
files: singleFile(SINGLE_FILE_DECLARATIONS),
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
ruleId: 'declarations/barrel-current',
|
|
158
|
+
name: 'the single declarations file of 0.84 that misses a role file: stale, an error',
|
|
159
|
+
expect: { file: BARREL },
|
|
160
|
+
files: singleFile(SINGLE_FILE_DECLARATIONS.replace("export * from '@/contexts/billing/application/scheduling/send-reminders.job.js';\n", '')),
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
ruleId: 'declarations/barrel-current',
|
|
164
|
+
name: 'a context half moved, the single declarations file of 0.84 next to the declarations of its role folders: an error',
|
|
165
|
+
expect: { file: BARREL },
|
|
166
|
+
files: declaredProject(DECLARED_CONTEXT, { [BARREL]: SINGLE_FILE_DECLARATIONS }),
|
|
167
|
+
},
|
|
131
168
|
{
|
|
132
169
|
ruleId: 'declarations/barrel-current',
|
|
133
170
|
name: 'assembly by discovery: a barrel left behind',
|
|
134
171
|
expect: { file: BARREL },
|
|
135
|
-
files: discoveredProject(DECLARED_CONTEXT, { [BARREL]:
|
|
172
|
+
files: discoveredProject(DECLARED_CONTEXT, { [BARREL]: DECLARED_DECLARATIONS[BARREL] ?? '' }),
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
ruleId: 'declarations/barrel-current',
|
|
176
|
+
name: 'assembly by discovery: the declarations of a role folder left behind',
|
|
177
|
+
expect: { file: COMMANDS_DECLARATIONS },
|
|
178
|
+
files: discoveredProject(DECLARED_CONTEXT, {
|
|
179
|
+
[COMMANDS_DECLARATIONS]: DECLARED_DECLARATIONS[COMMANDS_DECLARATIONS] ?? '',
|
|
180
|
+
}),
|
|
136
181
|
},
|
|
137
182
|
{
|
|
138
183
|
ruleId: 'declarations/role-declared',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declarations-fixtures.js","sourceRoot":"","sources":["../../../src/check/fixtures/declarations-fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"declarations-fixtures.js","sourceRoot":"","sources":["../../../src/check/fixtures/declarations-fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAG5D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,EACJ,OAAO,EACP,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,qBAAqB,EACrB,KAAK,EACL,aAAa,EACb,kBAAkB,EAClB,OAAO,EACP,mBAAmB,EACnB,wBAAwB,EACxB,GAAG,EACH,QAAQ,EACR,MAAM,EACN,eAAe,EACf,MAAM,EACN,IAAI,GACL,GAAG,KAAK,CAAC;AAEV,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;AAEz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;SACF,CAAC;KACH;IACD;QACE,MAAM,EAAE,iCAAiC;QACzC,IAAI,EAAE,8CAA8C;QACpD,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;QACxB,KAAK,EAAE,OAAO,CAAC;YACb,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,IAAI;YACrB,CAAC,MAAM,CAAC,EAAE,aAAa,EAAE;YACzB,CAAC,GAAG,OAAO,kDAAkD,CAAC,EAAE,MAAM,CACpE,8BAA8B,EAC9B,aAAa,EACb,EAAE,EACF,sEAAsE,CACvE;SACF,CAAC;KACH;CACF,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FixtureFiles } from './fixture-files.js';
|
|
2
|
+
/**
|
|
3
|
+
* The declarations of `DECLARED_CONTEXT`, one file per role folder and the summary at the root of
|
|
4
|
+
* the context, written out so that the fixtures do not prove the rule with its own code.
|
|
5
|
+
*/
|
|
6
|
+
export declare const DECLARED_DECLARATIONS: FixtureFiles;
|
|
7
|
+
//# sourceMappingURL=declared-declarations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declared-declarations.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/declared-declarations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAUvD;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,YAuCnC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PATHS } from './paths.js';
|
|
2
|
+
import { source } from './source.js';
|
|
3
|
+
const IN_BILLING = '@/contexts/billing';
|
|
4
|
+
/** `export * from` each file, given relative to the billing context. */
|
|
5
|
+
const exporting = (...files) => source(...files.map((file) => `export * from '${IN_BILLING}/${file}.js';`));
|
|
6
|
+
/**
|
|
7
|
+
* The declarations of `DECLARED_CONTEXT`, one file per role folder and the summary at the root of
|
|
8
|
+
* the context, written out so that the fixtures do not prove the rule with its own code.
|
|
9
|
+
*/
|
|
10
|
+
export const DECLARED_DECLARATIONS = {
|
|
11
|
+
[PATHS.BARREL]: exporting('application/authorization/authorization.declarations', 'application/commands/commands.declarations', 'application/event-handlers/event-handlers.declarations', 'application/integration/integration.declarations', 'application/queries/queries.declarations', 'application/scheduling/scheduling.declarations', 'infrastructure/external/external.declarations', 'infrastructure/persistence/persistence.declarations'),
|
|
12
|
+
[`${PATHS.BILLING}/application/authorization/authorization.declarations.ts`]: exporting('application/authorization/only-issuer-voids.policy'),
|
|
13
|
+
[PATHS.COMMANDS_DECLARATIONS]: exporting('application/commands/issue-invoice/issue-invoice.command', 'application/commands/issue-invoice/issue-invoice.handler'),
|
|
14
|
+
[`${PATHS.BILLING}/application/event-handlers/event-handlers.declarations.ts`]: exporting('application/event-handlers/invoice-issued.event-handler'),
|
|
15
|
+
[`${PATHS.BILLING}/application/integration/integration.declarations.ts`]: exporting('application/integration/handlers/product-listed.integration-handler', 'application/integration/publishers/invoice-issued.publisher'),
|
|
16
|
+
[`${PATHS.BILLING}/application/queries/queries.declarations.ts`]: exporting('application/queries/invoices-issued/invoices-issued.handler', 'application/queries/invoices-issued/invoices-issued.query'),
|
|
17
|
+
[`${PATHS.BILLING}/application/scheduling/scheduling.declarations.ts`]: exporting('application/scheduling/send-reminders.job'),
|
|
18
|
+
[`${PATHS.BILLING}/infrastructure/external/external.declarations.ts`]: exporting('infrastructure/external/in-process-price-catalog.gateway', 'infrastructure/external/remote-payment-gateway.adapter'),
|
|
19
|
+
[`${PATHS.BILLING}/infrastructure/persistence/persistence.declarations.ts`]: exporting('infrastructure/persistence/in-memory-invoice.repository'),
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=declared-declarations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declared-declarations.js","sourceRoot":"","sources":["../../../src/check/fixtures/declared-declarations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;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AAC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { FixtureFiles } from './fixture-files.js';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* The same two contexts in the declared style, each with the declarations of the role files it
|
|
4
|
+
* is given, `overrides` included: a fixture that writes a declarations file out wins over them.
|
|
5
|
+
*/
|
|
3
6
|
export declare function declaredProject(files: FixtureFiles, overrides?: FixtureFiles): FixtureFiles;
|
|
4
7
|
//# sourceMappingURL=declared-project.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declared-project.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/declared-project.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"declared-project.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/declared-project.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAKvD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,YAAY,EAAE,SAAS,GAAE,YAAiB,GAAG,YAAY,CAmB/F"}
|
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
import { CONFIG_FILE } from '../../config/index.js';
|
|
2
|
-
import {
|
|
2
|
+
import { renderDeclarations } from '../../declared/index.js';
|
|
3
3
|
import { config } from './config.js';
|
|
4
4
|
import { project } from './project.js';
|
|
5
|
-
|
|
5
|
+
const NOTHING_INJECTED = { imports: [], calls: [] };
|
|
6
|
+
/**
|
|
7
|
+
* The same two contexts in the declared style, each with the declarations of the role files it
|
|
8
|
+
* is given, `overrides` included: a fixture that writes a declarations file out wins over them.
|
|
9
|
+
*/
|
|
6
10
|
export function declaredProject(files, overrides = {}) {
|
|
7
11
|
const written = project(files, { [CONFIG_FILE]: config({ stack: { style: 'declared' } }) });
|
|
8
|
-
const
|
|
12
|
+
const tree = Object.keys({ ...written, ...overrides });
|
|
13
|
+
const declarations = ['billing', 'catalog'].flatMap((context) => {
|
|
9
14
|
const directory = `src/contexts/${context}/`;
|
|
10
|
-
const inside =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
const inside = tree.flatMap((file) => (file.startsWith(directory) ? [file.slice(directory.length)] : []));
|
|
16
|
+
const rendered = renderDeclarations({
|
|
17
|
+
context,
|
|
18
|
+
files: inside,
|
|
19
|
+
specifierOf: (entry) => `@/contexts/${context}/${entry.replace(/\.ts$/, '.js')}`,
|
|
20
|
+
injectedIn: () => NOTHING_INJECTED,
|
|
21
|
+
});
|
|
22
|
+
return [...rendered].map(([file, content]) => [`${directory}${file}`, content]);
|
|
15
23
|
});
|
|
16
|
-
return { ...written, ...Object.fromEntries(
|
|
24
|
+
return { ...written, ...Object.fromEntries(declarations), ...overrides };
|
|
17
25
|
}
|
|
18
26
|
//# sourceMappingURL=declared-project.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declared-project.js","sourceRoot":"","sources":["../../../src/check/fixtures/declared-project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"declared-project.js","sourceRoot":"","sources":["../../../src/check/fixtures/declared-project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,gBAAgB,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;AAEpD;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,KAAmB,EAAE,SAAS,GAAiB,EAAE;IAC/E,MAAM,OAAO,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@ -31,6 +31,7 @@ export declare const PATHS: {
|
|
|
31
31
|
readonly PUBLISHED: "src/contexts/billing/published-language/invoice-issued.v1.integration-event.ts";
|
|
32
32
|
readonly MODULE: "src/contexts/billing/billing.module.ts";
|
|
33
33
|
readonly BARREL: "src/contexts/billing/billing.declarations.ts";
|
|
34
|
+
readonly COMMANDS_DECLARATIONS: "src/contexts/billing/application/commands/commands.declarations.ts";
|
|
34
35
|
readonly PLATFORM_MODULE: 'src/platform/composition/platform.module.ts';
|
|
35
36
|
/** The decision record behind what the fixtures relax on purpose, so that only the rule under test speaks. */
|
|
36
37
|
readonly FIXTURE_ADR: 'docs/adr/0001-fixture-decisions.md';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/paths.ts"],"names":[],"mappings":"AAGA,mHAAmH;AACnH,eAAO,MAAM,KAAK
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/paths.ts"],"names":[],"mappings":"AAGA,mHAAmH;AACnH,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAiCC,6CAA6C;IAC9D,8GAA8G;0BACjG,oCAAoC;0BACpC,qCAAqC;CAC1C,CAAC"}
|
|
@@ -33,6 +33,7 @@ export const PATHS = {
|
|
|
33
33
|
PUBLISHED: `${BILLING}/published-language/invoice-issued.v1.integration-event.ts`,
|
|
34
34
|
MODULE: `${BILLING}/billing.module.ts`,
|
|
35
35
|
BARREL: `${BILLING}/billing.declarations.ts`,
|
|
36
|
+
COMMANDS_DECLARATIONS: `${BILLING}/application/commands/commands.declarations.ts`,
|
|
36
37
|
PLATFORM_MODULE: 'src/platform/composition/platform.module.ts',
|
|
37
38
|
/** The decision record behind what the fixtures relax on purpose, so that only the rule under test speaks. */
|
|
38
39
|
FIXTURE_ADR: 'docs/adr/0001-fixture-decisions.md',
|
|
@@ -1 +1 @@
|
|
|
1
|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G,wBAAwB,EAAE,GAAG,OAAO,uDAAuD;IAC3F,2BAA2B,EAAE,GAAG,OAAO,yEAAyE;IAChH,OAAO,EAAE,GAAG,OAAO,6DAA6D;IAChF,OAAO,EAAE,GAAG,OAAO,8DAA8D;IACjF,eAAe,EAAE,GAAG,OAAO,4DAA4D;IACvF,KAAK,EAAE,GAAG,OAAO,2CAA2C;IAC5D,MAAM,EAAE,GAAG,OAAO,sCAAsC;IACxD,SAAS,EAAE,GAAG,OAAO,4DAA4D;IACjF,MAAM,EAAE,GAAG,OAAO,oBAAoB;IACtC,MAAM,EAAE,GAAG,OAAO,0BAA0B;IAC5C,qBAAqB,EAAE,GAAG,OAAO,gDAAgD;IACjF,eAAe,EAAE,6CAA6C;IAC9D,8GAA8G;IAC9G,WAAW,EAAE,oCAAoC;IACjD,WAAW,EAAE,qCAAqC;CAC1C,CAAC"}
|
|
@@ -2,9 +2,9 @@ import type { FixtureFiles } from './fixture-files.js';
|
|
|
2
2
|
type Assembly = 'barrel' | 'discovery';
|
|
3
3
|
/**
|
|
4
4
|
* A declared project that states dependencies in constructor signatures, holding the
|
|
5
|
-
* issue-invoice use case with the handler it is given. Its
|
|
6
|
-
* derives from the role files alone: a fixture whose handler is injected something
|
|
7
|
-
* generated file out, so that it does not prove the rule with its own code.
|
|
5
|
+
* issue-invoice use case with the handler it is given. Its declarations are the ones the
|
|
6
|
+
* generator derives from the role files alone: a fixture whose handler is injected something
|
|
7
|
+
* writes the generated file of its folder out, so that it does not prove the rule with its own code.
|
|
8
8
|
*/
|
|
9
9
|
export declare function signatureProject(body: string, overrides?: FixtureFiles, assembly?: Assembly): FixtureFiles;
|
|
10
10
|
export {};
|
|
@@ -6,9 +6,9 @@ import { handler } from './handler.js';
|
|
|
6
6
|
import { PATHS } from './paths.js';
|
|
7
7
|
/**
|
|
8
8
|
* A declared project that states dependencies in constructor signatures, holding the
|
|
9
|
-
* issue-invoice use case with the handler it is given. Its
|
|
10
|
-
* derives from the role files alone: a fixture whose handler is injected something
|
|
11
|
-
* generated file out, so that it does not prove the rule with its own code.
|
|
9
|
+
* issue-invoice use case with the handler it is given. Its declarations are the ones the
|
|
10
|
+
* generator derives from the role files alone: a fixture whose handler is injected something
|
|
11
|
+
* writes the generated file of its folder out, so that it does not prove the rule with its own code.
|
|
12
12
|
*/
|
|
13
13
|
export function signatureProject(body, overrides = {}, assembly = 'barrel') {
|
|
14
14
|
const stack = { style: 'declared', dependencies: 'signature', assembly };
|
|
@@ -4,7 +4,8 @@ export declare const SIGNATURE: {
|
|
|
4
4
|
readonly handlerOf: typeof handler;
|
|
5
5
|
readonly ports: string[];
|
|
6
6
|
readonly taken: string[];
|
|
7
|
-
|
|
7
|
+
/** The declarations of application/commands/, which the handler and its command sit in. */
|
|
8
|
+
readonly declarations: string;
|
|
8
9
|
readonly dependencies: string;
|
|
9
10
|
};
|
|
10
11
|
/** The issue-invoice handler, declared with `decorator`, importing `imports` and taking `parameters`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/signature.ts"],"names":[],"mappings":"AAcA,kHAAkH;AAClH,eAAO,MAAM,SAAS;aACpB,OAAO;aACP,SAAS;aACT,KAAK;aACL,KAAK;
|
|
1
|
+
{"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/signature.ts"],"names":[],"mappings":"AAcA,kHAAkH;AAClH,eAAO,MAAM,SAAS;aACpB,OAAO;aACP,SAAS;aACT,KAAK;aACL,KAAK;IACL,2FAA2F;aAC3F,YAAY;aAWZ,YAAY;CAQJ,CAAC;AAEX,yGAAyG;AACzG,iBAAS,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,UAAU,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAarG"}
|
|
@@ -14,7 +14,8 @@ export const SIGNATURE = {
|
|
|
14
14
|
handlerOf: handler,
|
|
15
15
|
ports: PORTS,
|
|
16
16
|
taken: TAKEN,
|
|
17
|
-
|
|
17
|
+
/** The declarations of application/commands/, which the handler and its command sit in. */
|
|
18
|
+
declarations: source(`import { injected } from ${DECLARATIONS};`, `import { IssueInvoiceHandler } from ${HANDLER};`, `import { InvoiceRepository } from ${REPOSITORY};`, "import { Clock } from '@ddd-ts-kit/kernel';", '', `export * from ${COMMAND};`, `export * from ${HANDLER};`, '', 'injected(IssueInvoiceHandler, [InvoiceRepository, Clock]);'),
|
|
18
19
|
dependencies: source(`import { injected } from ${DECLARATIONS};`, `import { IssueInvoiceHandler } from ${HANDLER};`, `import { InvoiceRepository } from ${REPOSITORY};`, "import { Clock } from '@ddd-ts-kit/kernel';", '', 'injected(IssueInvoiceHandler, [InvoiceRepository, Clock]);'),
|
|
19
20
|
};
|
|
20
21
|
/** The issue-invoice handler, declared with `decorator`, importing `imports` and taking `parameters`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signature.js","sourceRoot":"","sources":["../../../src/check/fixtures/signature.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,YAAY,GAAG,mCAAmC,CAAC;AACzD,MAAM,OAAO,GAAG,kFAAkF,CAAC;AACnG,MAAM,OAAO,GAAG,kFAAkF,CAAC;AACnG,MAAM,UAAU,GAAG,gEAAgE,CAAC;AAEpF,MAAM,KAAK,GAAG;IACZ,kDAAkD;IAClD,0CAA0C,UAAU,GAAG;CACxD,CAAC;AAEF,MAAM,KAAK,GAAG,CAAC,uDAAuD,EAAE,+BAA+B,CAAC,CAAC;AAEzG,kHAAkH;AAClH,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,OAAO,EAAE,OAAO,CAAC,sCAAsC,EAAE,KAAK,EAAE,KAAK,CAAC;IACtE,SAAS,EAAE,OAAO;IAClB,KAAK,EAAE,KAAK;IACZ,KAAK,EAAE,KAAK;IACZ,
|
|
1
|
+
{"version":3,"file":"signature.js","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,CAAC,SAAS,EAAE,EAAE,CAAC,OAAO,SAAS,GAAG,CAAC,EACrD,QAAQ,EACR,GAAG,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The declarations of `DECLARED_CONTEXT` as the generator wrote them up to 0.84, all in
|
|
3
|
+
* `billing.declarations.ts`: one `export *` per role file, sorted by path, and no registration,
|
|
4
|
+
* since no constructor of the context takes anything. Written out, not rendered by the kit.
|
|
5
|
+
*/
|
|
6
|
+
export declare const SINGLE_FILE_DECLARATIONS: string;
|
|
7
|
+
//# sourceMappingURL=single-file-declarations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"single-file-declarations.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/single-file-declarations.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,QAepC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { source } from './source.js';
|
|
2
|
+
/**
|
|
3
|
+
* The declarations of `DECLARED_CONTEXT` as the generator wrote them up to 0.84, all in
|
|
4
|
+
* `billing.declarations.ts`: one `export *` per role file, sorted by path, and no registration,
|
|
5
|
+
* since no constructor of the context takes anything. Written out, not rendered by the kit.
|
|
6
|
+
*/
|
|
7
|
+
export const SINGLE_FILE_DECLARATIONS = source(...[
|
|
8
|
+
'application/authorization/only-issuer-voids.policy',
|
|
9
|
+
'application/commands/issue-invoice/issue-invoice.command',
|
|
10
|
+
'application/commands/issue-invoice/issue-invoice.handler',
|
|
11
|
+
'application/event-handlers/invoice-issued.event-handler',
|
|
12
|
+
'application/integration/handlers/product-listed.integration-handler',
|
|
13
|
+
'application/integration/publishers/invoice-issued.publisher',
|
|
14
|
+
'application/queries/invoices-issued/invoices-issued.handler',
|
|
15
|
+
'application/queries/invoices-issued/invoices-issued.query',
|
|
16
|
+
'application/scheduling/send-reminders.job',
|
|
17
|
+
'infrastructure/external/in-process-price-catalog.gateway',
|
|
18
|
+
'infrastructure/external/remote-payment-gateway.adapter',
|
|
19
|
+
'infrastructure/persistence/in-memory-invoice.repository',
|
|
20
|
+
].map((file) => `export * from '@/contexts/billing/${file}.js';`));
|
|
21
|
+
//# sourceMappingURL=single-file-declarations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"single-file-declarations.js","sourceRoot":"","sources":["../../../src/check/fixtures/single-file-declarations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAC5C,GAAG;IACD,oDAAoD;IACpD,0DAA0D;IAC1D,0DAA0D;IAC1D,yDAAyD;IACzD,qEAAqE;IACrE,6DAA6D;IAC7D,6DAA6D;IAC7D,2DAA2D;IAC3D,2CAA2C;IAC3C,0DAA0D;IAC1D,wDAAwD;IACxD,yDAAyD;CAC1D,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,qCAAqC,IAAI,OAAO,CAAC,CAClE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clean-file-size.d.ts","sourceRoot":"","sources":["../../../src/check/rules/clean-file-size.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"clean-file-size.d.ts","sourceRoot":"","sources":["../../../src/check/rules/clean-file-size.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAwB7C,eAAO,MAAM,aAAa,EAAE,IAY3B,CAAC"}
|