ddd-ts-kit 0.27.0 → 0.82.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.
Files changed (165) hide show
  1. package/CHANGELOG.md +129 -0
  2. package/README.fr.md +59 -13
  3. package/README.md +53 -12
  4. package/dist/check/catalogue/architecture-rules.d.ts.map +1 -1
  5. package/dist/check/catalogue/architecture-rules.js +4 -0
  6. package/dist/check/catalogue/architecture-rules.js.map +1 -1
  7. package/dist/check/catalogue/default-severities.d.ts.map +1 -1
  8. package/dist/check/catalogue/default-severities.js +2 -0
  9. package/dist/check/catalogue/default-severities.js.map +1 -1
  10. package/dist/check/commands/check-command.d.ts.map +1 -1
  11. package/dist/check/commands/check-command.js +4 -1
  12. package/dist/check/commands/check-command.js.map +1 -1
  13. package/dist/check/commands/explain-command.d.ts.map +1 -1
  14. package/dist/check/commands/explain-command.js +2 -9
  15. package/dist/check/commands/explain-command.js.map +1 -1
  16. package/dist/check/engine/format-check.d.ts +6 -1
  17. package/dist/check/engine/format-check.d.ts.map +1 -1
  18. package/dist/check/engine/format-check.js +33 -11
  19. package/dist/check/engine/format-check.js.map +1 -1
  20. package/dist/check/explain/documented-rule.d.ts +8 -0
  21. package/dist/check/explain/documented-rule.d.ts.map +1 -0
  22. package/dist/check/explain/documented-rule.js +14 -0
  23. package/dist/check/explain/documented-rule.js.map +1 -0
  24. package/dist/check/explain/explanations-of.d.ts +5 -0
  25. package/dist/check/explain/explanations-of.d.ts.map +1 -0
  26. package/dist/check/explain/explanations-of.js +16 -0
  27. package/dist/check/explain/explanations-of.js.map +1 -0
  28. package/dist/check/explain/persistence-docs.d.ts.map +1 -1
  29. package/dist/check/explain/persistence-docs.js +7 -0
  30. package/dist/check/explain/persistence-docs.js.map +1 -1
  31. package/dist/check/explain/wiring-docs.d.ts.map +1 -1
  32. package/dist/check/explain/wiring-docs.js +13 -0
  33. package/dist/check/explain/wiring-docs.js.map +1 -1
  34. package/dist/check/fixtures/declarations-fixtures.d.ts.map +1 -1
  35. package/dist/check/fixtures/declarations-fixtures.js +78 -1
  36. package/dist/check/fixtures/declarations-fixtures.js.map +1 -1
  37. package/dist/check/fixtures/persistence-fixtures.d.ts.map +1 -1
  38. package/dist/check/fixtures/persistence-fixtures.js +25 -0
  39. package/dist/check/fixtures/persistence-fixtures.js.map +1 -1
  40. package/dist/check/model/rule-explanation.d.ts +10 -0
  41. package/dist/check/model/rule-explanation.d.ts.map +1 -0
  42. package/dist/check/model/rule-explanation.js +2 -0
  43. package/dist/check/model/rule-explanation.js.map +1 -0
  44. package/dist/check/rules/declarations-port-adapter-wired.d.ts +3 -0
  45. package/dist/check/rules/declarations-port-adapter-wired.d.ts.map +1 -0
  46. package/dist/check/rules/declarations-port-adapter-wired.js +104 -0
  47. package/dist/check/rules/declarations-port-adapter-wired.js.map +1 -0
  48. package/dist/check/rules/persistence-primary-key-order.d.ts +3 -0
  49. package/dist/check/rules/persistence-primary-key-order.d.ts.map +1 -0
  50. package/dist/check/rules/persistence-primary-key-order.js +31 -0
  51. package/dist/check/rules/persistence-primary-key-order.js.map +1 -0
  52. package/dist/commands/doctor.d.ts +4 -1
  53. package/dist/commands/doctor.d.ts.map +1 -1
  54. package/dist/commands/doctor.js +20 -4
  55. package/dist/commands/doctor.js.map +1 -1
  56. package/dist/commands/lint.d.ts +7 -0
  57. package/dist/commands/lint.d.ts.map +1 -0
  58. package/dist/commands/lint.js +55 -0
  59. package/dist/commands/lint.js.map +1 -0
  60. package/dist/config/config.d.ts +2 -0
  61. package/dist/config/config.d.ts.map +1 -1
  62. package/dist/config/parse-config.d.ts.map +1 -1
  63. package/dist/config/parse-config.js +2 -0
  64. package/dist/config/parse-config.js.map +1 -1
  65. package/dist/config/restack-config-text.d.ts +3 -2
  66. package/dist/config/restack-config-text.d.ts.map +1 -1
  67. package/dist/config/restack-config-text.js +5 -3
  68. package/dist/config/restack-config-text.js.map +1 -1
  69. package/dist/config/serialize-config.d.ts.map +1 -1
  70. package/dist/config/serialize-config.js +2 -1
  71. package/dist/config/serialize-config.js.map +1 -1
  72. package/dist/doctor/diagnose.d.ts +2 -0
  73. package/dist/doctor/diagnose.d.ts.map +1 -1
  74. package/dist/doctor/diagnose.js +22 -3
  75. package/dist/doctor/diagnose.js.map +1 -1
  76. package/dist/doctor/doctor-finding.d.ts +13 -5
  77. package/dist/doctor/doctor-finding.d.ts.map +1 -1
  78. package/dist/doctor/format-diagnosis.d.ts +4 -1
  79. package/dist/doctor/format-diagnosis.d.ts.map +1 -1
  80. package/dist/doctor/format-diagnosis.js +49 -3
  81. package/dist/doctor/format-diagnosis.js.map +1 -1
  82. package/dist/doctor/in-range.d.ts +7 -0
  83. package/dist/doctor/in-range.d.ts.map +1 -0
  84. package/dist/doctor/in-range.js +90 -0
  85. package/dist/doctor/in-range.js.map +1 -0
  86. package/dist/doctor/install-findings.d.ts +11 -0
  87. package/dist/doctor/install-findings.d.ts.map +1 -0
  88. package/dist/doctor/install-findings.js +119 -0
  89. package/dist/doctor/install-findings.js.map +1 -0
  90. package/dist/doctor/node-findings.d.ts +7 -0
  91. package/dist/doctor/node-findings.d.ts.map +1 -0
  92. package/dist/doctor/node-findings.js +19 -0
  93. package/dist/doctor/node-findings.js.map +1 -0
  94. package/dist/doctor/package-findings.d.ts +2 -0
  95. package/dist/doctor/package-findings.d.ts.map +1 -1
  96. package/dist/doctor/package-findings.js +1 -1
  97. package/dist/doctor/package-findings.js.map +1 -1
  98. package/dist/doctor/submodule-findings.d.ts +7 -0
  99. package/dist/doctor/submodule-findings.d.ts.map +1 -0
  100. package/dist/doctor/submodule-findings.js +22 -0
  101. package/dist/doctor/submodule-findings.js.map +1 -0
  102. package/dist/generate/schedule/cron-problem.d.ts.map +1 -1
  103. package/dist/generate/schedule/cron-problem.js +16 -1
  104. package/dist/generate/schedule/cron-problem.js.map +1 -1
  105. package/dist/help/notes.d.ts +1 -1
  106. package/dist/help/notes.d.ts.map +1 -1
  107. package/dist/help/notes.js +21 -8
  108. package/dist/help/notes.js.map +1 -1
  109. package/dist/help/usage.d.ts +1 -1
  110. package/dist/help/usage.d.ts.map +1 -1
  111. package/dist/help/usage.js +2 -1
  112. package/dist/help/usage.js.map +1 -1
  113. package/dist/init/manifest/versions.js +24 -24
  114. package/dist/init/run-init.d.ts.map +1 -1
  115. package/dist/init/run-init.js +4 -2
  116. package/dist/init/run-init.js.map +1 -1
  117. package/dist/lint/eslint-in-project.d.ts +8 -0
  118. package/dist/lint/eslint-in-project.d.ts.map +1 -0
  119. package/dist/lint/eslint-in-project.js +33 -0
  120. package/dist/lint/eslint-in-project.js.map +1 -0
  121. package/dist/lint/format-verdict.d.ts +4 -0
  122. package/dist/lint/format-verdict.d.ts.map +1 -0
  123. package/dist/lint/format-verdict.js +11 -0
  124. package/dist/lint/format-verdict.js.map +1 -0
  125. package/dist/lint/lint-run.d.ts +8 -0
  126. package/dist/lint/lint-run.d.ts.map +1 -0
  127. package/dist/lint/lint-run.js +2 -0
  128. package/dist/lint/lint-run.js.map +1 -0
  129. package/dist/lint/lint-verdict.d.ts +19 -0
  130. package/dist/lint/lint-verdict.d.ts.map +1 -0
  131. package/dist/lint/lint-verdict.js +25 -0
  132. package/dist/lint/lint-verdict.js.map +1 -0
  133. package/dist/lint/parse-lint-answer.d.ts +13 -0
  134. package/dist/lint/parse-lint-answer.d.ts.map +1 -0
  135. package/dist/lint/parse-lint-answer.js +18 -0
  136. package/dist/lint/parse-lint-answer.js.map +1 -0
  137. package/dist/migration/plan-replay.d.ts +4 -3
  138. package/dist/migration/plan-replay.d.ts.map +1 -1
  139. package/dist/migration/plan-replay.js +21 -6
  140. package/dist/migration/plan-replay.js.map +1 -1
  141. package/dist/migration/rename-branch-migrations.d.ts +13 -0
  142. package/dist/migration/rename-branch-migrations.d.ts.map +1 -0
  143. package/dist/migration/rename-branch-migrations.js +25 -0
  144. package/dist/migration/rename-branch-migrations.js.map +1 -0
  145. package/dist/migration/replay-drizzle-migrations.d.ts +6 -3
  146. package/dist/migration/replay-drizzle-migrations.d.ts.map +1 -1
  147. package/dist/migration/replay-drizzle-migrations.js +48 -4
  148. package/dist/migration/replay-drizzle-migrations.js.map +1 -1
  149. package/dist/migration/replay-plan.d.ts +8 -0
  150. package/dist/migration/replay-plan.d.ts.map +1 -1
  151. package/dist/migration/restore-migration-folder.d.ts +4 -0
  152. package/dist/migration/restore-migration-folder.d.ts.map +1 -0
  153. package/dist/migration/restore-migration-folder.js +15 -0
  154. package/dist/migration/restore-migration-folder.js.map +1 -0
  155. package/dist/package-manager/lockfiles.d.ts +2 -0
  156. package/dist/package-manager/lockfiles.d.ts.map +1 -1
  157. package/dist/package-manager/lockfiles.js +5 -0
  158. package/dist/package-manager/lockfiles.js.map +1 -1
  159. package/dist/run.d.ts.map +1 -1
  160. package/dist/run.js +2 -0
  161. package/dist/run.js.map +1 -1
  162. package/dist/version.d.ts +1 -1
  163. package/dist/version.js +1 -1
  164. package/package.json +2 -2
  165. package/templates/pipeline/package-scripts.json +3 -3
@@ -1,16 +1,24 @@
1
1
  import { createHash } from 'node:crypto';
2
2
  const CODE_QUALITY_SEVERITIES = { error: 'major', warn: 'minor' };
3
- export function formatCheck(result, format) {
3
+ /**
4
+ * With explanations, text and json add them once per rule after the violations; an annotation of
5
+ * github or gitlab is read alone, on its line of the diff, so it carries the reason of its rule.
6
+ */
7
+ export function formatCheck(result, format, explanations) {
8
+ const reasons = new Map(explanations?.map((explanation) => [explanation.id, explanation.why]));
4
9
  if (format === 'gitlab') {
5
- return JSON.stringify(result.violations.map(toCodeQualityIssue), null, 2);
10
+ return JSON.stringify(codeQualityReport(result.violations, reasons), null, 2);
6
11
  }
7
12
  if (format === 'json') {
8
- return JSON.stringify(jsonOf(result), null, 2);
13
+ return JSON.stringify(jsonOf(result, explanations), null, 2);
14
+ }
15
+ if (format === 'github') {
16
+ return [...result.violations.map((violation) => githubLine(violation, reasons)), summaryLine(result)].join('\n');
9
17
  }
10
- const lines = result.violations.map(format === 'github' ? githubLine : textLine);
11
- return [...lines, summaryLine(result)].join(format === 'github' ? '\n' : '\n\n');
18
+ const blocks = [...result.violations.map(textLine), ...(explanations ?? []).map(explanationBlock)];
19
+ return [...blocks, summaryLine(result)].join('\n\n');
12
20
  }
13
- function jsonOf(result) {
21
+ function jsonOf(result, explanations) {
14
22
  return {
15
23
  ok: result.errorCount === 0,
16
24
  errors: result.errorCount,
@@ -19,6 +27,7 @@ function jsonOf(result) {
19
27
  suppressed: result.suppressedCount,
20
28
  files: result.fileCount,
21
29
  violations: result.violations,
30
+ ...(explanations === undefined ? {} : { explanations }),
22
31
  };
23
32
  }
24
33
  function summaryLine(result) {
@@ -31,11 +40,18 @@ function textLine(violation) {
31
40
  const label = violation.severity === 'error' ? 'error' : 'warn ';
32
41
  return `${violation.file}:${violation.line} ${label} ${violation.ruleId}\n ${violation.message}\n fix: ${violation.fix}`;
33
42
  }
34
- function githubLine(violation) {
43
+ function explanationBlock({ id, description, why }) {
44
+ return `${id}\n ${description}\n why: ${why}`;
45
+ }
46
+ function githubLine(violation, reasons) {
35
47
  const level = violation.severity === 'error' ? 'error' : 'warning';
36
- const message = `${violation.message} Fix: ${violation.fix}`;
48
+ const message = annotationOf(violation, reasons);
37
49
  return `::${level} file=${escapeProperty(violation.file)},line=${violation.line},title=${escapeProperty(violation.ruleId)}::${escapeData(message)}`;
38
50
  }
51
+ function annotationOf(violation, reasons) {
52
+ const reason = reasons.get(violation.ruleId);
53
+ return `${violation.message} Fix: ${violation.fix}${reason === undefined ? '' : ` Why: ${reason}`}`;
54
+ }
39
55
  /** GitHub cuts an annotation at the first raw newline or unescaped separator. */
40
56
  function escapeData(value) {
41
57
  return value.replaceAll('%', '%25').replaceAll('\r', '%0D').replaceAll('\n', '%0A');
@@ -43,14 +59,20 @@ function escapeData(value) {
43
59
  function escapeProperty(value) {
44
60
  return escapeData(value).replaceAll(':', '%3A').replaceAll(',', '%2C');
45
61
  }
62
+ /** The rank of a violation tells apart the identical ones of a file, whose fingerprints would otherwise collide. */
63
+ function codeQualityReport(violations, reasons) {
64
+ return violations.map((violation, index) => {
65
+ const rank = violations.slice(0, index).filter((earlier) => identity(earlier) === identity(violation)).length;
66
+ return toCodeQualityIssue(violation, rank, reasons);
67
+ });
68
+ }
46
69
  /**
47
70
  * One issue of a GitLab Code Quality report. The fingerprint is stable across runs and does not
48
71
  * depend on the line, so a violation that merely moves is not reported as fixed and new.
49
72
  */
50
- function toCodeQualityIssue(violation, index, all) {
51
- const rank = all.slice(0, index).filter((earlier) => identity(earlier) === identity(violation)).length;
73
+ function toCodeQualityIssue(violation, rank, reasons) {
52
74
  return {
53
- description: `${violation.message} Fix: ${violation.fix}`,
75
+ description: annotationOf(violation, reasons),
54
76
  check_name: violation.ruleId,
55
77
  fingerprint: createHash('sha256')
56
78
  .update(`${identity(violation)}\n${rank}`)
@@ -1 +1 @@
1
- {"version":3,"file":"format-check.js","sourceRoot":"","sources":["../../../src/check/engine/format-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAMzC,MAAM,uBAAuB,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAW,CAAC;AAE3E,MAAM,UAAU,WAAW,CAAC,MAAmB,EAAE,MAAmB;IAClE,IAAI,MAAM,KAAK,QAAQ,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,kBAAkB,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC5E,CAAC;IAED,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QACtB,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACjD,CAAC;IAED,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ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,MAAM;QAC5B,WAAW,EAAE,UAAU,CAAC,QAAQ,CAAC;aAC9B,MAAM,CAAC,GAAG,QAAQ,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE,CAAC;aACzC,MAAM,CAAC,KAAK,CAAC;QAChB,QAAQ,EAAE,uBAAuB,CAAC,SAAS,CAAC,QAAQ,CAAC;QACrD,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,CAAC,IAAI,EAAE,EAAE;KACrE,CAAC;AACJ,CAAC;AAED,SAAS,QAAQ,CAAC,SAAoB;IACpC,OAAO,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1E,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { RuleDoc } from '../model/rule-doc.js';
2
+ export interface DocumentedRule extends RuleDoc {
3
+ readonly id: string;
4
+ readonly description: string;
5
+ }
6
+ /** The description and the documentation of a rule this checker judges; a rule without both is a bug of the kit. */
7
+ export declare function documentedRule(id: string): DocumentedRule;
8
+ //# sourceMappingURL=documented-rule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"documented-rule.d.ts","sourceRoot":"","sources":["../../../src/check/explain/documented-rule.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAGpD,MAAM,WAAW,cAAe,SAAQ,OAAO;IAC7C,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,oHAAoH;AACpH,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc,CASzD"}
@@ -0,0 +1,14 @@
1
+ import { CliError } from '../../cli-error.js';
2
+ import { RULES } from '../catalogue/rules.js';
3
+ import { SUPPRESSION_RULE } from '../catalogue/suppression-rule.js';
4
+ import { RULE_DOCS } from './rule-docs.js';
5
+ /** The description and the documentation of a rule this checker judges; a rule without both is a bug of the kit. */
6
+ export function documentedRule(id) {
7
+ const rule = [...RULES, SUPPRESSION_RULE].find((candidate) => candidate.id === id);
8
+ const doc = RULE_DOCS[id];
9
+ if (rule === undefined || doc === undefined) {
10
+ throw new CliError(`The rule "${id}" has no explanation.`, 'Report this as a bug of ddd-ts-kit.');
11
+ }
12
+ return { id, description: rule.description, ...doc };
13
+ }
14
+ //# sourceMappingURL=documented-rule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"documented-rule.js","sourceRoot":"","sources":["../../../src/check/explain/documented-rule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAO3C,oHAAoH;AACpH,MAAM,UAAU,cAAc,CAAC,EAAU;IACvC,MAAM,IAAI,GAAG,CAAC,GAAG,KAAK,EAAE,gBAAgB,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IACnF,MAAM,GAAG,GAAG,SAAS,CAAC,EAAE,CAAC,CAAC;IAE1B,IAAI,IAAI,KAAK,SAAS,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;QAC5C,MAAM,IAAI,QAAQ,CAAC,aAAa,EAAE,uBAAuB,EAAE,qCAAqC,CAAC,CAAC;IACpG,CAAC;IAED,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,GAAG,GAAG,EAAE,CAAC;AACvD,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { RuleExplanation } from '../model/rule-explanation.js';
2
+ import type { Violation } from '../model/violation.js';
3
+ /** One explanation per rule the violations report, however many times, in the order of its first violation. */
4
+ export declare function explanationsOf(violations: readonly Violation[]): RuleExplanation[];
5
+ //# sourceMappingURL=explanations-of.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"explanations-of.d.ts","sourceRoot":"","sources":["../../../src/check/explain/explanations-of.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGvD,+GAA+G;AAC/G,wBAAgB,cAAc,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,GAAG,eAAe,EAAE,CAIlF"}
@@ -0,0 +1,16 @@
1
+ import { DELEGATED_RULES } from '../catalogue/delegated-rules.js';
2
+ import { documentedRule } from './documented-rule.js';
3
+ /** One explanation per rule the violations report, however many times, in the order of its first violation. */
4
+ export function explanationsOf(violations) {
5
+ const ids = new Set(violations.map((violation) => violation.ruleId));
6
+ return [...ids].map(explanationOf);
7
+ }
8
+ function explanationOf(id) {
9
+ const delegated = DELEGATED_RULES.find((rule) => rule.id === id);
10
+ if (delegated !== undefined) {
11
+ return { id, description: delegated.description, why: delegated.where, checkedBy: delegated.checkedBy };
12
+ }
13
+ const { description, why } = documentedRule(id);
14
+ return { id, description, why };
15
+ }
16
+ //# sourceMappingURL=explanations-of.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"explanations-of.js","sourceRoot":"","sources":["../../../src/check/explain/explanations-of.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAGlE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,+GAA+G;AAC/G,MAAM,UAAU,cAAc,CAAC,UAAgC;IAC7D,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;IAErE,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AACrC,CAAC;AAED,SAAS,aAAa,CAAC,EAAU;IAC/B,MAAM,SAAS,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IAEjE,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,SAAS,CAAC,WAAW,EAAE,GAAG,EAAE,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,SAAS,CAAC,SAAS,EAAE,CAAC;IAC1G,CAAC;IAED,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,GAAG,cAAc,CAAC,EAAE,CAAC,CAAC;IAEhD,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC;AAClC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"persistence-docs.d.ts","sourceRoot":"","sources":["../../../src/check/explain/persistence-docs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAsC9D,CAAC"}
1
+ {"version":3,"file":"persistence-docs.d.ts","sourceRoot":"","sources":["../../../src/check/explain/persistence-docs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA6C9D,CAAC"}
@@ -9,6 +9,13 @@ export const PERSISTENCE_DOCS = {
9
9
  20261010120000_add-invoices.sql
10
10
  20261012093000_add-payments.sql # generated again after main took add-invoices
11
11
  meta/_journal.json # one entry each, in order, each snapshot from the one before`,
12
+ },
13
+ 'persistence/primary-key-order': {
14
+ why: 'A table has one primary key. When a migration changes it, drizzle-kit may write the statement that adds the new key before the one that drops the old key, or drop a column before the key that holds it; PostgreSQL refuses either, and the migration fails only when it runs, on the database of a colleague or of a deployment. `drizzle-generate` warns when it writes such a migration; this rule keeps reporting it until the migration is fixed, so that a warning that scrolled away is not merged. A dropped constraint is a primary key when the snapshot before the migration records it or its name ends in `_pkey` or `_pk`. Fix the migration while no database has applied it: move the `DROP CONSTRAINT` above, or write the change yourself with `npm run db:generate -- <name> --custom`.',
15
+ bad: `ALTER TABLE "invoices" ADD CONSTRAINT "invoices_id_issuer_pk" PRIMARY KEY("id","issuer");--> statement-breakpoint
16
+ ALTER TABLE "invoices" DROP CONSTRAINT "invoices_pkey"; -- too late: the ADD above already failed`,
17
+ good: `ALTER TABLE "invoices" DROP CONSTRAINT "invoices_pkey";--> statement-breakpoint
18
+ ALTER TABLE "invoices" ADD CONSTRAINT "invoices_id_issuer_pk" PRIMARY KEY("id","issuer");`,
12
19
  },
13
20
  'persistence/no-file-content': {
14
21
  why: 'A file in a column is read whole into the memory of the application and of the database, travels in every backup, every replica and every dump, swells the table its rows share pages with, and cannot be handed out by a short signed link: an upload of a few megabytes becomes a transaction, a replication lag and a backup to restore. An object store is made for it: it streams, it is cheap per gigabyte, it has lifecycle rules and signed links. The row keeps what the domain needs to know about the file, its reference.',
@@ -1 +1 @@
1
- {"version":3,"file":"persistence-docs.js","sourceRoot":"","sources":["../../../src/check/explain/persistence-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gBAAgB,GAAsC;IACjE,+BAA+B,EAAE;QAC/B,GAAG,EAAE,0jCAA0jC;QAC/jC,GAAG,EAAE;;;wFAG+E;QACpF,IAAI,EAAE;;;kGAGwF;KAC/F;IACD,6BAA6B,EAAE;QAC7B,GAAG,EAAE,ugBAAugB;QAC5gB,GAAG,EAAE;;;IAGL;QACA,IAAI,EAAE;;;;;IAKN;KACD;IACD,0BAA0B,EAAE;QAC1B,GAAG,EAAE,0YAA0Y;QAC/Y,GAAG,EAAE;;;;EAIP;QACE,IAAI,EAAE;;;;EAIR;KACC;CACF,CAAC"}
1
+ {"version":3,"file":"persistence-docs.js","sourceRoot":"","sources":["../../../src/check/explain/persistence-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gBAAgB,GAAsC;IACjE,+BAA+B,EAAE;QAC/B,GAAG,EAAE,0jCAA0jC;QAC/jC,GAAG,EAAE;;;wFAG+E;QACpF,IAAI,EAAE;;;kGAGwF;KAC/F;IACD,+BAA+B,EAAE;QAC/B,GAAG,EAAE,6wBAA6wB;QAClxB,GAAG,EAAE;oGAC2F;QAChG,IAAI,EAAE;0FACgF;KACvF;IACD,6BAA6B,EAAE;QAC7B,GAAG,EAAE,ugBAAugB;QAC5gB,GAAG,EAAE;;;IAGL;QACA,IAAI,EAAE;;;;;IAKN;KACD;IACD,0BAA0B,EAAE;QAC1B,GAAG,EAAE,0YAA0Y;QAC/Y,GAAG,EAAE;;;;EAIP;QACE,IAAI,EAAE;;;;EAIR;KACC;CACF,CAAC"}
@@ -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,CAuFzD,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,CAoGzD,CAAC"}
@@ -63,6 +63,19 @@ export class IssueInvoiceHandler {
63
63
  private readonly clock: Clock,
64
64
  ) {}
65
65
  }`,
66
+ },
67
+ 'declarations/port-adapter-wired': {
68
+ why: 'A port is resolved by its class at start-up, so an adapter that nothing binds compiles, passes the contract suite its spec runs, and is only missed when the application starts without it, or keeps an older adapter bound. declarations/role-declared reads a role file by its suffix; a class of infrastructure/ that implements a port in a file without one, with no declaration and no binding in the composition root, is reported by no other rule. An adapter can be kept unwired on purpose (a provider being replaced, one kept for a fallback): a suppression that names a decision record says so, and tells it from a forgotten declaration.',
69
+ bad: `// infrastructure/external/stripe-payment-gateway.ts, imported by no module file and by no file of the platform
70
+ export class StripePaymentGateway implements PaymentGateway {}`,
71
+ good: `// declared style: infrastructure/external/stripe-payment.gateway.ts
72
+ @Gateway(PaymentGateway)
73
+ export class StripePaymentGateway implements PaymentGateway {}
74
+ // explicit style: billing.module.ts
75
+ builder.bind(PaymentGateway).toClass(StripePaymentGateway, [PaymentsSettings]);
76
+ // kept on purpose
77
+ // ddd-ts-kit-disable-next-line declarations/port-adapter-wired -- ADR-0007: kept until the switch back is decided
78
+ export class StripePaymentGateway implements PaymentGateway {}`,
66
79
  },
67
80
  'config/rule-off-everywhere': {
68
81
  why: 'An exception is decided for some files: generated mappers, a legacy module, a migration script. Written as "off" alone, it silences the rule in every file of the project, and the real findings in the others go unseen; the decision record says why the rule is off, not that the exception grew to the whole project. A rule set for some files keeps judging the rest. When the whole project is really meant, "files": ["**"] says it in so many words.',
@@ -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,60BAA60B;QACl1B,GAAG,EAAE;;;;oDAI2C;QAChD,IAAI,EAAE;;;;;2DAKiD;KACxD;IACD,oCAAoC,EAAE;QACpC,GAAG,EAAE,omCAAomC;QACzmC,GAAG,EAAE;;;;;;;;;iEASwD;QAC7D,IAAI,EAAE;;;;;;;EAOR;KACC;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
+ {"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,60BAA60B;QACl1B,GAAG,EAAE;;;;oDAI2C;QAChD,IAAI,EAAE;;;;;2DAKiD;KACxD;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":"declarations-fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/declarations-fixtures.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AA2B5C,eAAO,MAAM,qBAAqB,EAAE,SAAS,OAAO,EAyInD,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;AA4C5C,eAAO,MAAM,qBAAqB,EAAE,SAAS,OAAO,EA2OnD,CAAC"}
@@ -8,9 +8,16 @@ 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 { source } from './source.js';
11
12
  import { withoutFile } from './without-file.js';
12
- const { ADAPTER, AGGREGATE, BARREL, BILLING, COMMAND, EVENT, EVENT_HANDLER, EVENT_HANDLER_SPEC, HANDLER, INTEGRATION_HANDLER, INTEGRATION_HANDLER_SPEC, JOB, JOB_SPEC, MODULE, POLICY, } = PATHS;
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;
13
14
  const { SPEC } = SAMPLES;
15
+ /** A class of infrastructure/ that implements a port, in a file without a role suffix, declared by nothing. */
16
+ const STRIPE = `${BILLING}/infrastructure/external/stripe-payment-gateway.ts`;
17
+ const STRIPE_IMPORT = "import { StripePaymentGateway } from '@/contexts/billing/infrastructure/external/stripe-payment-gateway.js';";
18
+ const PORT_IMPORT = "import { PaymentGateway } from '@/contexts/billing/application/ports/payment-gateway.port.js';";
19
+ const stripeGateway = (...before) => source(PORT_IMPORT, '', ...before, 'export class StripePaymentGateway implements PaymentGateway {}');
20
+ const explicitModule = (...statements) => source("import type { ModuleBuilder } from '@ddd-ts-kit/di';", PORT_IMPORT, ...statements);
14
21
  export const DECLARATIONS_FIXTURES = [
15
22
  {
16
23
  ruleId: 'declarations/role-declared',
@@ -136,5 +143,75 @@ export const DECLARATIONS_FIXTURES = [
136
143
  [JOB_SPEC]: SPEC,
137
144
  }),
138
145
  },
146
+ {
147
+ ruleId: 'declarations/port-adapter-wired',
148
+ name: 'declared style: every adapter carries its declaration in its role file',
149
+ expect: 'pass',
150
+ files: declaredProject(DECLARED_CONTEXT),
151
+ },
152
+ {
153
+ ruleId: 'declarations/port-adapter-wired',
154
+ name: 'explicit style: an adapter bound to its port in the module file',
155
+ expect: 'pass',
156
+ files: project({
157
+ [PORT]: DECLARED.port,
158
+ [STRIPE]: stripeGateway(),
159
+ [MODULE]: explicitModule(STRIPE_IMPORT, '', 'export function billingModule(builder: ModuleBuilder): void {', ' builder.bind(PaymentGateway).toClass(StripePaymentGateway, []);', '}'),
160
+ }),
161
+ },
162
+ {
163
+ ruleId: 'declarations/port-adapter-wired',
164
+ name: 'declared style: an adapter without a declaration, bound by the platform',
165
+ expect: 'pass',
166
+ files: declaredProject({
167
+ [PORT]: DECLARED.port,
168
+ [STRIPE]: stripeGateway(),
169
+ [PLATFORM_MODULE]: source("import { defineModule } from '@ddd-ts-kit/di';", PORT_IMPORT, STRIPE_IMPORT, '', "export const platformModule = defineModule('platform', (builder) => {", ' builder.bind(PaymentGateway).toFactory(() => new StripePaymentGateway());', '});'),
170
+ }),
171
+ },
172
+ {
173
+ ruleId: 'declarations/port-adapter-wired',
174
+ name: 'an adapter kept unwired on purpose, with a suppression that points to a decision record',
175
+ expect: 'pass',
176
+ files: declaredProject({
177
+ [PORT]: DECLARED.port,
178
+ [STRIPE]: stripeGateway('// ddd-ts-kit-disable-next-line declarations/port-adapter-wired -- ADR-0001: kept for the switch back to Stripe'),
179
+ }),
180
+ },
181
+ {
182
+ ruleId: 'declarations/port-adapter-wired',
183
+ name: 'explicit style: an adapter the generator wrote, its outside system not ready, left to do',
184
+ expect: 'pass',
185
+ files: project({
186
+ [PORT]: DECLARED.port,
187
+ [STRIPE]: stripeGateway('// TODO(platform): replace the body by the real client of the outside system, built in billing.module.ts.'),
188
+ }),
189
+ },
190
+ {
191
+ ruleId: 'declarations/port-adapter-wired',
192
+ name: 'declared style: an adapter that carries no declaration and that nothing binds',
193
+ expect: { file: STRIPE },
194
+ files: declaredProject({ [PORT]: DECLARED.port, [STRIPE]: stripeGateway() }),
195
+ },
196
+ {
197
+ ruleId: 'declarations/port-adapter-wired',
198
+ name: 'explicit style: an adapter the module file does not bind',
199
+ expect: { file: STRIPE },
200
+ files: project({
201
+ [PORT]: DECLARED.port,
202
+ [STRIPE]: stripeGateway(),
203
+ [MODULE]: explicitModule('', 'export function billingModule(builder: ModuleBuilder): void {', ' builder.bind(PaymentGateway).toValue(null);', '}'),
204
+ }),
205
+ },
206
+ {
207
+ ruleId: 'declarations/port-adapter-wired',
208
+ name: 'explicit style: an adapter only a test binds',
209
+ expect: { file: STRIPE },
210
+ files: project({
211
+ [PORT]: DECLARED.port,
212
+ [STRIPE]: stripeGateway(),
213
+ [`${BILLING}/test/integration/stripe-payment-gateway.spec.ts`]: source("import { it } from 'vitest';", STRIPE_IMPORT, '', "it.todo('charges through Stripe', () => new StripePaymentGateway());"),
214
+ }),
215
+ },
139
216
  ];
140
217
  //# sourceMappingURL=declarations-fixtures.js.map
@@ -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,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,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,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,EACJ,OAAO,EACP,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,KAAK,EACL,aAAa,EACb,kBAAkB,EAClB,OAAO,EACP,mBAAmB,EACnB,wBAAwB,EACxB,GAAG,EACH,QAAQ,EACR,MAAM,EACN,MAAM,GACP,GAAG,KAAK,CAAC;AAEV,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;AAEzB,MAAM,CAAC,MAAM,qBAAqB,GAAuB;IACvD;QACE,MAAM,EAAE,4BAA4B;QACpC,IAAI,EAAE,wFAAwF;QAC9F,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,eAAe,CAAC,gBAAgB,CAAC;KACzC;IACD;Q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M,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;QACxB,KAAK,EAAE,WAAW,CAAC,eAAe,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;KAC9D;IACD;QACE,MAAM,EAAE,6BAA6B;QACrC,IAAI,EAAE,yDAAyD;QAC/D,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;QACxB,KAAK,EAAE,eAAe,CAAC,gBAAgB,EAAE;YACvC,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC,OAAO,CAC/B,6FAA6F,EAC7F,EAAE,CACH;SACF,CAAC;KACH;IACD;QACE,MAAM,EAAE,6BAA6B;QACrC,IAAI,EAAE,6CAA6C;QACnD,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;QACxB,KAAK,EAAE,iBAAiB,CAAC,gBAAgB,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,eAAe,EAAE,CAAC;KAC1E;IACD;QACE,MAAM,EAAE,4BAA4B;QACpC,IAAI,EAAE,8CAA8C;QACpD,MAAM,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE;QACrB,KAAK,EAAE,eAAe,CAAC;YACrB,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,wEAAwE,EAAE,EAAE,CAAC;YACzG,CAAC,QAAQ,CAAC,EAAE,IAAI;SACjB,CAAC;KACH;CACF,CAAC"}
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,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE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C;YACb,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,IAAI;YACrB,CAAC,MAAM,CAAC,EAAE,aAAa,EAAE;YACzB,CAAC,MAAM,CAAC,EAAE,cAAc,CACtB,EAAE,EACF,+DAA+D,EAC/D,+CAA+C,EAC/C,GAAG,CACJ;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"}
@@ -1 +1 @@
1
- {"version":3,"file":"persistence-fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/persistence-fixtures.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAS5C,eAAO,MAAM,oBAAoB,EAAE,SAAS,OAAO,EAoDlD,CAAC"}
1
+ {"version":3,"file":"persistence-fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/persistence-fixtures.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAY5C,eAAO,MAAM,oBAAoB,EAAE,SAAS,OAAO,EAgElD,CAAC"}
@@ -7,6 +7,9 @@ const INITIAL = '20261010120000_initial';
7
7
  const INVOICES = '20261011120000_add-invoices';
8
8
  const PAYMENTS = '20261012120000_add-payments';
9
9
  const ORIGIN = '00000000-0000-0000-0000-000000000000';
10
+ const KEY_CHANGE = '20261013120000_change-invoice-key';
11
+ const ADD_KEY = 'ALTER TABLE "invoices" ADD CONSTRAINT "invoices_id_issuer_pk" PRIMARY KEY("id","issuer");';
12
+ const DROP_KEY = 'ALTER TABLE "invoices" DROP CONSTRAINT "invoices_pkey";';
10
13
  export const PERSISTENCE_FIXTURES = [
11
14
  {
12
15
  ruleId: 'persistence/migration-history',
@@ -59,7 +62,29 @@ export const PERSISTENCE_FIXTURES = [
59
62
  expect: { file: 'migrations/20261015101500_working-add-claims.js' },
60
63
  files: knex(['20261012093000_initial', '20261015101500_working-add-claims']),
61
64
  },
65
+ {
66
+ ruleId: 'persistence/primary-key-order',
67
+ name: 'a drizzle migration that drops the old primary key of a table before adding the new one',
68
+ expect: 'pass',
69
+ files: drizzleKeyChange([DROP_KEY, ADD_KEY]),
70
+ },
71
+ {
72
+ ruleId: 'persistence/primary-key-order',
73
+ name: 'a drizzle migration that adds the new primary key of a table before dropping the old one',
74
+ expect: { file: `migrations/${KEY_CHANGE}.sql` },
75
+ files: drizzleKeyChange([ADD_KEY, DROP_KEY]),
76
+ },
62
77
  ];
78
+ /** The drizzle-kit project of three migrations, then a fourth one that changes the primary key of the invoices with `statements`. */
79
+ function drizzleKeyChange(statements) {
80
+ const tags = [INITIAL, INVOICES, PAYMENTS, KEY_CHANGE];
81
+ return {
82
+ ...drizzle('b'),
83
+ [`migrations/${KEY_CHANGE}.sql`]: `${statements.join('--> statement-breakpoint\n')}\n`,
84
+ 'migrations/meta/20261013120000_snapshot.json': snapshot('d', 'c'),
85
+ [JOURNAL]: journal(tags.map((tag) => [tag, Number(tag.slice(0, 14))])),
86
+ };
87
+ }
63
88
  /** A drizzle-kit project with three migrations; `payments` names the snapshot the third one was generated from. */
64
89
  function drizzle(payments, order = [INITIAL, INVOICES, PAYMENTS]) {
65
90
  return project({
@@ -1 +1 @@
1
- {"version":3,"file":"persistence-fixtures.js","sourceRoot":"","sources":["../../../src/check/fixtures/persistence-fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,WAAW,E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ED,SAAS,QAAQ,CAAC,EAAU,EAAE,MAAc;IAC1C,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAClG,CAAC;AAED,SAAS,OAAO,CAAC,IAAuD;IACtE,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAEtG,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACnF,CAAC;AAED,SAAS,IAAI,CAAC,KAAwB;IACpC,MAAM,SAAS,GAAG,4EAA4E,CAAC;IAE/F,OAAO,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,cAAc,IAAI,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE;QAC5F,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC;KAClD,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,10 @@
1
+ /** What `check --explain` prints once for each rule it reports. */
2
+ export interface RuleExplanation {
3
+ readonly id: string;
4
+ readonly description: string;
5
+ /** The reason behind the rule; for a rule another tool decides, where it is checked and how it is settled. */
6
+ readonly why: string;
7
+ /** The tool that decides a delegated rule, as `ddd-ts-kit rules --json` names it. */
8
+ readonly checkedBy?: string;
9
+ }
10
+ //# sourceMappingURL=rule-explanation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rule-explanation.d.ts","sourceRoot":"","sources":["../../../src/check/model/rule-explanation.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,8GAA8G;IAC9G,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,qFAAqF;IACrF,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=rule-explanation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rule-explanation.js","sourceRoot":"","sources":["../../../src/check/model/rule-explanation.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import type { Rule } from '../model/rule.js';
2
+ export declare const declarationsPortAdapterWired: Rule;
3
+ //# sourceMappingURL=declarations-port-adapter-wired.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"declarations-port-adapter-wired.d.ts","sourceRoot":"","sources":["../../../src/check/rules/declarations-port-adapter-wired.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AA8B7C,eAAO,MAAM,4BAA4B,EAAE,IAoB1C,CAAC"}
@@ -0,0 +1,104 @@
1
+ import { DECLARED_ROLES, declaredRoleOf } from '../../declared/index.js';
2
+ import { classesOf } from '../declarations/classes-of.js';
3
+ import { DECLARATIONS_ENTRY } from '../declarations/declarations-entry.js';
4
+ import { importedFrom } from '../support/imported-from.js';
5
+ import { inLayer } from '../support/in-layer.js';
6
+ import { isDeclaredStyle } from '../support/is-declared-style.js';
7
+ import { isPortFile } from '../support/is-port-file.js';
8
+ import { pathInContext } from '../support/path-in-context.js';
9
+ import { perFile } from '../support/per-file.js';
10
+ /** The decorators that declare a class of infrastructure/: `@Repository`, `@Gateway`, `@Adapter`. */
11
+ const ADAPTER_DECORATORS = [
12
+ ...new Set(DECLARED_ROLES.filter((role) => role.folders.some((folder) => folder.startsWith('infrastructure'))).flatMap((role) => role.decorators)),
13
+ ];
14
+ const RULE_ID = 'declarations/port-adapter-wired';
15
+ /** A marker the generator leaves in an adapter it writes before the outside system is ready, which `ddd-ts-kit todo` lists. */
16
+ const LEFT_TO_DO = /\bTODO\((?:domain|platform)\)/;
17
+ export const declarationsPortAdapterWired = {
18
+ id: RULE_ID,
19
+ description: 'A class of infrastructure/ that implements a port is wired: declared with @Repository, @Gateway or @Adapter in the declared style, or imported by the composition root (<context>.module.ts, main.ts, apps/, the platform directory). One kept unwired on purpose says so with a suppression that points to a decision record. A file that still carries a TODO(domain) or TODO(platform) of the generator is not judged yet.',
20
+ scope: 'project',
21
+ run(project) {
22
+ const composed = composedClasses(project);
23
+ return perFile(project, this.id, (file) => {
24
+ const place = inLayer(file, 'infrastructure');
25
+ if (place === undefined || isLeftToDo(file)) {
26
+ return [];
27
+ }
28
+ return implementations(file)
29
+ .filter(({ shape }) => !composed.has(`${file.path}#${shape.name}`) && !isDeclared(file, project, shape))
30
+ .map((implementation) => unwired(implementation, project, place.context));
31
+ });
32
+ },
33
+ };
34
+ /**
35
+ * An adapter the generator wrote is wired once the outside system is ready, a step its markers
36
+ * name: until they are done, the file is listed by `ddd-ts-kit todo`, not reported here.
37
+ */
38
+ function isLeftToDo({ scan }) {
39
+ return scan.comments.some(({ text }) => LEFT_TO_DO.test(text));
40
+ }
41
+ /** `<file>#<class>` for each class a file of the composition root imports as a value. */
42
+ function composedClasses(project) {
43
+ const composing = project.files.filter((file) => isCompositionRoot(file, project));
44
+ return new Set(composing.flatMap(({ imports }) => imports.flatMap(({ target, names, typeNames }) => target.kind === 'file'
45
+ ? names.filter((name) => !typeNames.includes(name)).map((name) => `${target.path}#${name}`)
46
+ : [])));
47
+ }
48
+ function isCompositionRoot({ isTest, location, path }, project) {
49
+ if (isTest) {
50
+ return false;
51
+ }
52
+ if (location.area === 'main' || location.area === 'platform') {
53
+ return true;
54
+ }
55
+ return ((location.area === 'context' && location.layer === 'module') ||
56
+ new RegExp(`^${project.config.sourceRoot}/apps/[^/]+/main\\.ts$`).test(path));
57
+ }
58
+ /** The concrete classes of the module that implement a class imported from a port file, each with its first port. */
59
+ function implementations(file) {
60
+ return file.structure.classes.flatMap((shape) => {
61
+ const ports = shape.depth === 0 && !shape.isAbstract ? shape.implemented.flatMap((name) => portOf(file, name)) : [];
62
+ const [port] = ports;
63
+ return port === undefined ? [] : [{ shape, ...port }];
64
+ });
65
+ }
66
+ function portOf(file, name) {
67
+ const target = importedFrom(file, name)?.target;
68
+ if (target?.kind !== 'file' || !isPortFile(target.path, target.location)) {
69
+ return [];
70
+ }
71
+ return [{ port: name, repository: target.location.area === 'context' && target.location.layer === 'domain' }];
72
+ }
73
+ /**
74
+ * In the declared style a class is wired by its decorator. The exported class of a role file is
75
+ * judged by `declarations/role-declared`, which already reports it when it declares nothing.
76
+ */
77
+ function isDeclared(file, project, shape) {
78
+ if (!isDeclaredStyle(project)) {
79
+ return false;
80
+ }
81
+ const declared = classesOf(file.scan).find((candidate) => candidate.name === shape.name);
82
+ if (declared?.decorations.some(({ name }) => ADAPTER_DECORATORS.includes(name)) === true) {
83
+ return true;
84
+ }
85
+ return shape.isExported && declaredRoleOf(pathInContext(project, file) ?? '') !== undefined;
86
+ }
87
+ function unwired({ shape, port, repository }, project, context) {
88
+ const marker = `if it is kept unwired on purpose, write docs/adr/NNNN-<slug>.md and put \`// ddd-ts-kit-disable-next-line ${RULE_ID} -- ADR-NNNN: <why>\` above the class`;
89
+ if (isDeclaredStyle(project)) {
90
+ const decorator = repository ? `@Repository(${port})` : `@Gateway(${port}) or @Adapter(${port}, { kind })`;
91
+ const files = repository ? 'infrastructure/persistence/*.repository.ts' : '*.gateway.ts or *.adapter.ts';
92
+ return {
93
+ line: shape.line,
94
+ message: `${shape.name} implements the port ${port}, but carries no declaration and no file of the composition root imports it: nothing binds it, and the port is missing at run time.`,
95
+ fix: `Put ${decorator} from ${DECLARATIONS_ENTRY} above the class, in a role file (${files}), or bind it in the platform; ${marker}.`,
96
+ };
97
+ }
98
+ return {
99
+ line: shape.line,
100
+ message: `${shape.name} implements the port ${port}, but no file of the composition root imports it: nothing binds it, and the port is missing at run time.`,
101
+ fix: `Bind it in ${context}.module.ts, \`builder.bind(${port}).toClass(${shape.name}, [..])\`, or in src/main.ts; ${marker}.`,
102
+ };
103
+ }
104
+ //# sourceMappingURL=declarations-port-adapter-wired.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"declarations-port-adapter-wired.js","sourceRoot":"","sources":["../../../src/check/rules/declarations-port-adapter-wired.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAM3E,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,qGAAqG;AACrG,MAAM,kBAAkB,GAAG;IACzB,GAAG,IAAI,GAAG,CACR,cAAc,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,OAAO,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AAK,CAAC,IAAI,iCAAiC,MAAM,GAAG;KAC9H,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Rule } from '../model/rule.js';
2
+ export declare const persistencePrimaryKeyOrder: Rule;
3
+ //# sourceMappingURL=persistence-primary-key-order.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"persistence-primary-key-order.d.ts","sourceRoot":"","sources":["../../../src/check/rules/persistence-primary-key-order.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAI7C,eAAO,MAAM,0BAA0B,EAAE,IAkBxC,CAAC"}