ddd-ts-kit 0.23.1 → 0.24.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 (239) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.fr.md +42 -7
  3. package/README.md +38 -6
  4. package/dist/check/canonical/stray-entry.d.ts +8 -0
  5. package/dist/check/canonical/stray-entry.d.ts.map +1 -0
  6. package/dist/check/canonical/stray-entry.js +75 -0
  7. package/dist/check/canonical/stray-entry.js.map +1 -0
  8. package/dist/check/catalogue/architecture-rules.d.ts.map +1 -1
  9. package/dist/check/catalogue/architecture-rules.js +2 -0
  10. package/dist/check/catalogue/architecture-rules.js.map +1 -1
  11. package/dist/check/catalogue/default-severities.d.ts.map +1 -1
  12. package/dist/check/catalogue/default-severities.js +1 -0
  13. package/dist/check/catalogue/default-severities.js.map +1 -1
  14. package/dist/check/explain/persistence-docs.js +1 -1
  15. package/dist/check/explain/persistence-docs.js.map +1 -1
  16. package/dist/check/explain/tree-docs.d.ts.map +1 -1
  17. package/dist/check/explain/tree-docs.js +5 -0
  18. package/dist/check/explain/tree-docs.js.map +1 -1
  19. package/dist/check/fixtures/tree-fixtures.d.ts.map +1 -1
  20. package/dist/check/fixtures/tree-fixtures.js +17 -0
  21. package/dist/check/fixtures/tree-fixtures.js.map +1 -1
  22. package/dist/check/migrations/drizzle-history-findings.js +1 -1
  23. package/dist/check/migrations/drizzle-history-findings.js.map +1 -1
  24. package/dist/check/rules/tree-closed.d.ts.map +1 -1
  25. package/dist/check/rules/tree-closed.js +4 -68
  26. package/dist/check/rules/tree-closed.js.map +1 -1
  27. package/dist/check/rules/tree-documented-paths.d.ts +3 -0
  28. package/dist/check/rules/tree-documented-paths.d.ts.map +1 -0
  29. package/dist/check/rules/tree-documented-paths.js +54 -0
  30. package/dist/check/rules/tree-documented-paths.js.map +1 -0
  31. package/dist/commands/drizzle-generate.d.ts +6 -1
  32. package/dist/commands/drizzle-generate.d.ts.map +1 -1
  33. package/dist/commands/drizzle-generate.js +39 -6
  34. package/dist/commands/drizzle-generate.js.map +1 -1
  35. package/dist/commands/plan-waves.d.ts +9 -0
  36. package/dist/commands/plan-waves.d.ts.map +1 -0
  37. package/dist/commands/plan-waves.js +36 -0
  38. package/dist/commands/plan-waves.js.map +1 -0
  39. package/dist/commands/status.d.ts +1 -0
  40. package/dist/commands/status.d.ts.map +1 -1
  41. package/dist/commands/status.js +4 -2
  42. package/dist/commands/status.js.map +1 -1
  43. package/dist/help/notes.d.ts +1 -1
  44. package/dist/help/notes.d.ts.map +1 -1
  45. package/dist/help/notes.js +19 -3
  46. package/dist/help/notes.js.map +1 -1
  47. package/dist/help/usage.d.ts +1 -1
  48. package/dist/help/usage.d.ts.map +1 -1
  49. package/dist/help/usage.js +2 -0
  50. package/dist/help/usage.js.map +1 -1
  51. package/dist/init/files/persistence-files.d.ts.map +1 -1
  52. package/dist/init/files/persistence-files.js +7 -1
  53. package/dist/init/files/persistence-files.js.map +1 -1
  54. package/dist/init/manifest/versions.js +24 -24
  55. package/dist/migration/branch-migration.d.ts +9 -0
  56. package/dist/migration/branch-migration.d.ts.map +1 -0
  57. package/dist/migration/branch-migration.js +2 -0
  58. package/dist/migration/branch-migration.js.map +1 -0
  59. package/dist/migration/branch-migrations.d.ts +16 -0
  60. package/dist/migration/branch-migrations.d.ts.map +1 -0
  61. package/dist/migration/branch-migrations.js +48 -0
  62. package/dist/migration/branch-migrations.js.map +1 -0
  63. package/dist/migration/delete-branch-migrations.d.ts +9 -0
  64. package/dist/migration/delete-branch-migrations.d.ts.map +1 -0
  65. package/dist/migration/delete-branch-migrations.js +23 -0
  66. package/dist/migration/delete-branch-migrations.js.map +1 -0
  67. package/dist/migration/drizzle-run.d.ts +7 -0
  68. package/dist/migration/drizzle-run.d.ts.map +1 -0
  69. package/dist/migration/drizzle-run.js +2 -0
  70. package/dist/migration/drizzle-run.js.map +1 -0
  71. package/dist/migration/drizzle-silent-failures.js +1 -1
  72. package/dist/migration/drizzle-silent-failures.js.map +1 -1
  73. package/dist/migration/find-project-formatter.d.ts +8 -0
  74. package/dist/migration/find-project-formatter.d.ts.map +1 -0
  75. package/dist/migration/find-project-formatter.js +52 -0
  76. package/dist/migration/find-project-formatter.js.map +1 -0
  77. package/dist/migration/format-written-files.d.ts +9 -0
  78. package/dist/migration/format-written-files.d.ts.map +1 -0
  79. package/dist/migration/format-written-files.js +32 -0
  80. package/dist/migration/format-written-files.js.map +1 -0
  81. package/dist/migration/generate-and-read.d.ts +6 -0
  82. package/dist/migration/generate-and-read.d.ts.map +1 -0
  83. package/dist/migration/generate-and-read.js +14 -0
  84. package/dist/migration/generate-and-read.js.map +1 -0
  85. package/dist/migration/index.d.ts +4 -0
  86. package/dist/migration/index.d.ts.map +1 -1
  87. package/dist/migration/index.js +4 -0
  88. package/dist/migration/index.js.map +1 -1
  89. package/dist/migration/known-primary-keys.d.ts +3 -0
  90. package/dist/migration/known-primary-keys.d.ts.map +1 -0
  91. package/dist/migration/known-primary-keys.js +2 -0
  92. package/dist/migration/known-primary-keys.js.map +1 -0
  93. package/dist/migration/migration-files.d.ts +7 -0
  94. package/dist/migration/migration-files.d.ts.map +1 -0
  95. package/dist/migration/migration-files.js +29 -0
  96. package/dist/migration/migration-files.js.map +1 -0
  97. package/dist/migration/plan-replay.d.ts +9 -0
  98. package/dist/migration/plan-replay.d.ts.map +1 -0
  99. package/dist/migration/plan-replay.js +68 -0
  100. package/dist/migration/plan-replay.js.map +1 -0
  101. package/dist/migration/previous-primary-keys.d.ts +9 -0
  102. package/dist/migration/previous-primary-keys.d.ts.map +1 -0
  103. package/dist/migration/previous-primary-keys.js +55 -0
  104. package/dist/migration/previous-primary-keys.js.map +1 -0
  105. package/dist/migration/primary-key-order-finding.d.ts +12 -0
  106. package/dist/migration/primary-key-order-finding.d.ts.map +1 -0
  107. package/dist/migration/primary-key-order-finding.js +2 -0
  108. package/dist/migration/primary-key-order-finding.js.map +1 -0
  109. package/dist/migration/primary-key-order-findings.d.ts +12 -0
  110. package/dist/migration/primary-key-order-findings.d.ts.map +1 -0
  111. package/dist/migration/primary-key-order-findings.js +55 -0
  112. package/dist/migration/primary-key-order-findings.js.map +1 -0
  113. package/dist/migration/project-formatter.d.ts +9 -0
  114. package/dist/migration/project-formatter.d.ts.map +1 -0
  115. package/dist/migration/project-formatter.js +2 -0
  116. package/dist/migration/project-formatter.js.map +1 -0
  117. package/dist/migration/replay-drizzle-migrations.d.ts +15 -0
  118. package/dist/migration/replay-drizzle-migrations.d.ts.map +1 -0
  119. package/dist/migration/replay-drizzle-migrations.js +63 -0
  120. package/dist/migration/replay-drizzle-migrations.js.map +1 -0
  121. package/dist/migration/replay-plan.d.ts +11 -0
  122. package/dist/migration/replay-plan.d.ts.map +1 -0
  123. package/dist/migration/replay-plan.js +2 -0
  124. package/dist/migration/replay-plan.js.map +1 -0
  125. package/dist/migration/replayed-name.d.ts +7 -0
  126. package/dist/migration/replayed-name.d.ts.map +1 -0
  127. package/dist/migration/replayed-name.js +12 -0
  128. package/dist/migration/replayed-name.js.map +1 -0
  129. package/dist/migration/sql-statement.d.ts +6 -0
  130. package/dist/migration/sql-statement.d.ts.map +1 -0
  131. package/dist/migration/sql-statement.js +2 -0
  132. package/dist/migration/sql-statement.js.map +1 -0
  133. package/dist/migration/sql-statements.d.ts +4 -0
  134. package/dist/migration/sql-statements.d.ts.map +1 -0
  135. package/dist/migration/sql-statements.js +36 -0
  136. package/dist/migration/sql-statements.js.map +1 -0
  137. package/dist/migration/table-change.d.ts +12 -0
  138. package/dist/migration/table-change.d.ts.map +1 -0
  139. package/dist/migration/table-change.js +2 -0
  140. package/dist/migration/table-change.js.map +1 -0
  141. package/dist/migration/table-changes.d.ts +9 -0
  142. package/dist/migration/table-changes.d.ts.map +1 -0
  143. package/dist/migration/table-changes.js +55 -0
  144. package/dist/migration/table-changes.js.map +1 -0
  145. package/dist/migration/tidy-written-migration.d.ts +5 -0
  146. package/dist/migration/tidy-written-migration.d.ts.map +1 -0
  147. package/dist/migration/tidy-written-migration.js +8 -0
  148. package/dist/migration/tidy-written-migration.js.map +1 -0
  149. package/dist/migration/wait-for-next-second.d.ts +6 -0
  150. package/dist/migration/wait-for-next-second.d.ts.map +1 -0
  151. package/dist/migration/wait-for-next-second.js +11 -0
  152. package/dist/migration/wait-for-next-second.js.map +1 -0
  153. package/dist/migration/warn-primary-key-order.d.ts +5 -0
  154. package/dist/migration/warn-primary-key-order.d.ts.map +1 -0
  155. package/dist/migration/warn-primary-key-order.js +16 -0
  156. package/dist/migration/warn-primary-key-order.js.map +1 -0
  157. package/dist/migration/written-migration.d.ts +9 -0
  158. package/dist/migration/written-migration.d.ts.map +1 -0
  159. package/dist/migration/written-migration.js +2 -0
  160. package/dist/migration/written-migration.js.map +1 -0
  161. package/dist/migration/written-paths.d.ts +3 -0
  162. package/dist/migration/written-paths.d.ts.map +1 -0
  163. package/dist/migration/written-paths.js +5 -0
  164. package/dist/migration/written-paths.js.map +1 -0
  165. package/dist/plan/aggregates-of.d.ts +6 -0
  166. package/dist/plan/aggregates-of.d.ts.map +1 -0
  167. package/dist/plan/aggregates-of.js +13 -0
  168. package/dist/plan/aggregates-of.js.map +1 -0
  169. package/dist/plan/batched-waves.d.ts +18 -0
  170. package/dist/plan/batched-waves.d.ts.map +1 -0
  171. package/dist/plan/batched-waves.js +73 -0
  172. package/dist/plan/batched-waves.js.map +1 -0
  173. package/dist/plan/cycles-of.d.ts +8 -0
  174. package/dist/plan/cycles-of.d.ts.map +1 -0
  175. package/dist/plan/cycles-of.js +30 -0
  176. package/dist/plan/cycles-of.js.map +1 -0
  177. package/dist/plan/format-plan.d.ts +4 -0
  178. package/dist/plan/format-plan.d.ts.map +1 -0
  179. package/dist/plan/format-plan.js +53 -0
  180. package/dist/plan/format-plan.js.map +1 -0
  181. package/dist/plan/merge-order.d.ts +8 -0
  182. package/dist/plan/merge-order.d.ts.map +1 -0
  183. package/dist/plan/merge-order.js +32 -0
  184. package/dist/plan/merge-order.js.map +1 -0
  185. package/dist/plan/plan-problems.d.ts +8 -0
  186. package/dist/plan/plan-problems.d.ts.map +1 -0
  187. package/dist/plan/plan-problems.js +57 -0
  188. package/dist/plan/plan-problems.js.map +1 -0
  189. package/dist/plan/plan-waves.d.ts +16 -0
  190. package/dist/plan/plan-waves.d.ts.map +1 -0
  191. package/dist/plan/plan-waves.js +23 -0
  192. package/dist/plan/plan-waves.js.map +1 -0
  193. package/dist/plan/rows-to-plan.d.ts +7 -0
  194. package/dist/plan/rows-to-plan.d.ts.map +1 -0
  195. package/dist/plan/rows-to-plan.js +19 -0
  196. package/dist/plan/rows-to-plan.js.map +1 -0
  197. package/dist/plan/wave-numbers.d.ts +8 -0
  198. package/dist/plan/wave-numbers.d.ts.map +1 -0
  199. package/dist/plan/wave-numbers.js +27 -0
  200. package/dist/plan/wave-numbers.js.map +1 -0
  201. package/dist/plan/wave-plan.d.ts +48 -0
  202. package/dist/plan/wave-plan.d.ts.map +1 -0
  203. package/dist/plan/wave-plan.js +2 -0
  204. package/dist/plan/wave-plan.js.map +1 -0
  205. package/dist/progress/format-progress.d.ts.map +1 -1
  206. package/dist/progress/format-progress.js +16 -1
  207. package/dist/progress/format-progress.js.map +1 -1
  208. package/dist/progress/progress.d.ts +11 -1
  209. package/dist/progress/progress.d.ts.map +1 -1
  210. package/dist/progress/read-progress.d.ts +6 -2
  211. package/dist/progress/read-progress.d.ts.map +1 -1
  212. package/dist/progress/read-progress.js +10 -5
  213. package/dist/progress/read-progress.js.map +1 -1
  214. package/dist/progress/status-row-of.d.ts +16 -0
  215. package/dist/progress/status-row-of.d.ts.map +1 -0
  216. package/dist/progress/status-row-of.js +23 -0
  217. package/dist/progress/status-row-of.js.map +1 -0
  218. package/dist/run.d.ts.map +1 -1
  219. package/dist/run.js +2 -0
  220. package/dist/run.js.map +1 -1
  221. package/dist/version.d.ts +1 -1
  222. package/dist/version.js +1 -1
  223. package/dist/worker/rows-on-branches.d.ts +8 -0
  224. package/dist/worker/rows-on-branches.d.ts.map +1 -0
  225. package/dist/worker/rows-on-branches.js +9 -0
  226. package/dist/worker/rows-on-branches.js.map +1 -0
  227. package/package.json +2 -2
  228. package/templates/e2e/e2e.spec.ts.tpl +2 -2
  229. package/templates/init/e2e/start-application.database.ts.tpl +30 -1
  230. package/templates/init/e2e/start-application.memory.ts.tpl +30 -1
  231. package/templates/init/e2e/vitest.e2e.config.ts.tpl +4 -0
  232. package/templates/init/platform/database/open-test-database.drizzle.ts.tpl +18 -1
  233. package/templates/init/platform/database/open-test-database.knex.ts.tpl +18 -1
  234. package/templates/init/platform/database/open-test-database.prisma.ts.tpl +18 -1
  235. package/templates/init/platform/database/open-test-database.typeorm.ts.tpl +18 -1
  236. package/templates/init/platform/database/test-database-template.ts.tpl +23 -0
  237. package/templates/init/rules/tests.md.tpl +1 -1
  238. package/templates/pipeline/package-scripts.json +1 -1
  239. package/templates/pipeline/vitest.config.ts.tpl +6 -0
@@ -1,8 +1,4 @@
1
- import path from 'node:path';
2
- import { barrelFile, dependenciesFile } from '../../declared/index.js';
3
- import { isCanonicalDirectory } from '../canonical/is-canonical-directory.js';
4
- import { OPEN_DIRECTORIES } from '../canonical/open-directories.js';
5
- import { roleOf } from '../canonical/role-of.js';
1
+ import { strayEntry } from '../canonical/stray-entry.js';
6
2
  import { reporter } from '../support/reporter.js';
7
3
  export const treeClosed = {
8
4
  id: 'tree/closed',
@@ -13,78 +9,18 @@ export const treeClosed = {
13
9
  // A rejected directory is reported once: what it holds is not reported again.
14
10
  const rejected = [];
15
11
  return project.contextEntries.flatMap((entry) => {
16
- const placed = place(entry, project.config);
17
- if (placed === undefined || rejected.some((parent) => entry.startsWith(parent))) {
12
+ if (rejected.some((parent) => entry.startsWith(parent))) {
18
13
  return [];
19
14
  }
20
- const isDirectory = entry.endsWith('/');
21
- const flaw = isDirectory ? strayDirectory(placed) : straySource(placed);
15
+ const flaw = strayEntry(entry, project.config);
22
16
  if (flaw === undefined) {
23
17
  return [];
24
18
  }
25
- if (isDirectory) {
19
+ if (entry.endsWith('/')) {
26
20
  rejected.push(entry);
27
21
  }
28
22
  return [report({ file: entry.replace(/\/$/, ''), line: 1 }, flaw.message, flaw.fix)];
29
23
  });
30
24
  },
31
25
  };
32
- function place(entry, { contextsDir, contexts, stack }) {
33
- const [context = '', ...rest] = entry
34
- .slice(contextsDir.length + 1)
35
- .replace(/\/$/, '')
36
- .split('/');
37
- if (rest.length === 0) {
38
- return undefined;
39
- }
40
- return {
41
- context,
42
- declared: stack.style === 'declared',
43
- inside: rest.join('/'),
44
- extras: contexts[context]?.extraDirectories ?? [],
45
- };
46
- }
47
- function strayDirectory({ context, inside, extras }) {
48
- if (isCanonicalDirectory(inside) || coveredByExtra(extras, inside)) {
49
- return undefined;
50
- }
51
- return {
52
- message: `"${inside}" is not a directory of the canonical tree.`,
53
- fix: `Move its files to the canonical directory of their role (see \`ddd-ts-kit explain tree/closed\`), or, if this is a design decision, add "${inside}" to contexts.${context}.extraDirectories in ddd-ts-kit.config.json.`,
54
- };
55
- }
56
- function straySource(placed) {
57
- const { inside, extras } = placed;
58
- if (!inside.endsWith('.ts')) {
59
- return undefined;
60
- }
61
- const directory = path.posix.dirname(inside);
62
- if (directory === '.') {
63
- return atContextRoot(placed);
64
- }
65
- const open = OPEN_DIRECTORIES.some((root) => directory === root || directory.startsWith(`${root}/`));
66
- if (open || roleOf(directory) !== undefined || coveredByExtra(extras, directory)) {
67
- return undefined;
68
- }
69
- return {
70
- message: `"${inside}" is not in a role directory.`,
71
- fix: `Move it one level down into the directory of its role (for example ${directory.split('/')[0] ?? directory}/<role>/), so that its suffix and its tests can be checked.`,
72
- };
73
- }
74
- function atContextRoot({ context, declared, inside: file }) {
75
- const generated = [barrelFile(context), dependenciesFile(context)];
76
- if (file === `${context}.module.ts` || (declared && generated.includes(file))) {
77
- return undefined;
78
- }
79
- const allowed = declared
80
- ? `CONTEXT.md, the generated ${generated.join(' or ')} and ${context}.module.ts`
81
- : `CONTEXT.md and ${context}.module.ts`;
82
- return {
83
- message: `"${file}" sits at the root of the context.`,
84
- fix: `Move it into the directory of its role; only ${allowed} live at the root of a context.`,
85
- };
86
- }
87
- function coveredByExtra(extras, directory) {
88
- return extras.some((extra) => directory === extra || directory.startsWith(`${extra}/`) || extra.startsWith(`${directory}/`));
89
- }
90
26
  //# sourceMappingURL=tree-closed.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tree-closed.js","sourceRoot":"","sources":["../../../src/check/rules/tree-closed.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAGjD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAWlD,MAAM,CAAC,MAAM,UAAU,GAAS;IAC9B,EAAE,EAAE,aAAa;IACjB,WAAW,EACT,mIAAmI;IACrI,KAAK,EAAE,SAAS;IAChB,GAAG,CAAC,OAAO;QACT,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;QAC1C,8EAA8E;QAC9E,MAAM,QAAQ,GAAa,EAAE,CAAC;QAE9B,OAAO,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YAC9C,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;YAE5C,IAAI,MAAM,KAAK,SAAS,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;gBAChF,OAAO,EAAE,CAAC;YACZ,CAAC;YAED,MAAM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O,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YAC9C,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;gBACxD,OAAO,EAAE,CAAC;YACZ,CAAC;YAED,MAAM,IAAI,GAAG,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;YAE/C,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;gBACvB,OAAO,EAAE,CAAC;YACZ,CAAC;YAED,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;gBACxB,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACvB,CAAC;YAED,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QACvF,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Rule } from '../model/rule.js';
2
+ export declare const treeDocumentedPaths: Rule;
3
+ //# sourceMappingURL=tree-documented-paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tree-documented-paths.d.ts","sourceRoot":"","sources":["../../../src/check/rules/tree-documented-paths.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAS7C,eAAO,MAAM,mBAAmB,EAAE,IAmBjC,CAAC"}
@@ -0,0 +1,54 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ import { strayEntry } from '../canonical/stray-entry.js';
4
+ import { reporter } from '../support/reporter.js';
5
+ /** Where the plan, the design notes and the reviews of a project live. */
6
+ const ARCHITECTURE_DOCS = 'docs/architecture';
7
+ /** A path written as code in Markdown, a `:line` after it left out. */
8
+ const CITED = /`([^`\s]+?)(?::\d+)?`/g;
9
+ export const treeDocumentedPaths = {
10
+ id: 'tree/documented-paths',
11
+ description: 'A path of a bounded context cited as code in docs/architecture (a plan, a design note, a review) is a place the canonical tree allows: a document that names a directory the tree refuses describes a design the code no longer has.',
12
+ scope: 'project',
13
+ run(project) {
14
+ const report = reporter(project, this.id);
15
+ return markdownUnder(project.root, ARCHITECTURE_DOCS).flatMap((document) => citedFlaws(fs.readFileSync(path.join(project.root, document), 'utf8'), project.config).map(({ line, cited, flaw }) => report({ file: document, line }, `"${cited}" names a place the canonical tree refuses: ${flaw.message}`, `Write the place the code has now (\`npx ddd-ts-kit describe <context>\` lists it), or remove the path; ${flaw.fix}`)));
16
+ },
17
+ };
18
+ /** Each path of a context cited in a document, with the first flaw of its directories or of itself. */
19
+ function citedFlaws(text, config) {
20
+ return text.split('\n').flatMap((content, index) => [...content.matchAll(CITED)].flatMap(([, cited = '']) => {
21
+ const flaw = cited.startsWith(`${config.contextsDir}/`) ? firstFlaw(cited, config) : undefined;
22
+ return flaw === undefined ? [] : [{ line: index + 1, cited, flaw }];
23
+ }));
24
+ }
25
+ /** The directories of a path from the outermost, then the path itself: the first one the tree refuses. */
26
+ function firstFlaw(cited, config) {
27
+ const segments = cited.replace(/\/$/, '').split('/');
28
+ const directories = segments.slice(0, -1).map((_, index) => `${segments.slice(0, index + 1).join('/')}/`);
29
+ const entries = [...directories, cited];
30
+ for (const entry of entries) {
31
+ const flaw = strayEntry(entry, config);
32
+ if (flaw !== undefined) {
33
+ return flaw;
34
+ }
35
+ }
36
+ return undefined;
37
+ }
38
+ function markdownUnder(root, directory) {
39
+ const absolute = path.join(root, directory);
40
+ if (!fs.existsSync(absolute)) {
41
+ return [];
42
+ }
43
+ return fs
44
+ .readdirSync(absolute, { withFileTypes: true })
45
+ .flatMap((entry) => {
46
+ const relative = `${directory}/${entry.name}`;
47
+ if (entry.isDirectory()) {
48
+ return markdownUnder(root, relative);
49
+ }
50
+ return entry.isFile() && entry.name.endsWith('.md') ? [relative] : [];
51
+ })
52
+ .sort();
53
+ }
54
+ //# sourceMappingURL=tree-documented-paths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tree-documented-paths.js","sourceRoot":"","sources":["../../../src/check/rules/tree-documented-paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAIzD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,0EAA0E;AAC1E,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;AAC9C,uEAAuE;AACvE,MAAM,KAAK,GAAG,wBAAwB,CAAC;AAEvC,MAAM,CAAC,MAAM,mBAAmB,GAAS;IACvC,EAAE,EAAE,uBAAuB;IAC3B,WAAW,EACT,sOAAsO;IACxO,KAAK,EAAE,SAAS;IAChB,GAAG,CAAC,OAAO;QACT,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;QAE1C,OAAO,aAAa,CAAC,OAAO,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE,CACzE,UAAU,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CACxF,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,EAAa,EAAE,CACnC,MAAM,CACJ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EACxB,IAAI,KAAK,+CAA+C,IAAI,CAAC,OAAO,EAAE,EACtE,0GAA0G,IAAI,CAAC,GAA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I,OAAO,EAAE,CAAC;QAC5B,MAAM,IAAI,GAAG,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QAEvC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,aAAa,CAAC,IAAY,EAAE,SAAiB;IACpD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAE5C,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC7B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,EAAE;SACN,WAAW,CAAC,QAAQ,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;SAC9C,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QACjB,MAAM,QAAQ,GAAG,GAAG,SAAS,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;QAE9C,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,OAAO,aAAa,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QACvC,CAAC;QAED,OAAO,KAAK,CAAC,MAAM,EAAE,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACxE,CAAC,CAAC;SACD,IAAI,EAAE,CAAC;AACZ,CAAC"}
@@ -1,4 +1,9 @@
1
1
  import type { Command } from './command.js';
2
- /** `db:generate` of a Drizzle project: drizzle-kit generate, which fails instead of succeeding silently when it cannot ask its question. */
2
+ /**
3
+ * `db:generate` of a Drizzle project: drizzle-kit generate, which fails instead of succeeding
4
+ * silently when it cannot ask its question, then formats what it wrote and warns about a primary
5
+ * key changed in an order that fails. `--replay` generates again the migrations of a branch on top
6
+ * of the trunk it merged.
7
+ */
3
8
  export declare const drizzleGenerateCommand: Command;
4
9
  //# sourceMappingURL=drizzle-generate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"drizzle-generate.d.ts","sourceRoot":"","sources":["../../src/commands/drizzle-generate.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,4IAA4I;AAC5I,eAAO,MAAM,sBAAsB,EAAE,OAcpC,CAAC"}
1
+ {"version":3,"file":"drizzle-generate.d.ts","sourceRoot":"","sources":["../../src/commands/drizzle-generate.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAK5C;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,EAAE,OAyBpC,CAAC"}
@@ -1,14 +1,47 @@
1
1
  import { CliError } from '../cli-error.js';
2
- import { generateDrizzleMigration } from '../migration/index.js';
2
+ import { generateAndRead, replayDrizzleMigrations, tidyWrittenMigration } from '../migration/index.js';
3
3
  import { Arguments } from './arguments.js';
4
- /** `db:generate` of a Drizzle project: drizzle-kit generate, which fails instead of succeeding silently when it cannot ask its question. */
4
+ /** The trunk a branch merged, when `--replay` is not given another. */
5
+ const DEFAULT_BASE = 'origin/main';
6
+ /**
7
+ * `db:generate` of a Drizzle project: drizzle-kit generate, which fails instead of succeeding
8
+ * silently when it cannot ask its question, then formats what it wrote and warns about a primary
9
+ * key changed in an order that fails. `--replay` generates again the migrations of a branch on top
10
+ * of the trunk it merged.
11
+ */
5
12
  export const drizzleGenerateCommand = (argv, io) => {
6
- const args = Arguments.parse(argv, { name: { type: 'string' }, custom: { type: 'boolean', default: false } });
13
+ const args = Arguments.parse(argv, {
14
+ name: { type: 'string' },
15
+ custom: { type: 'boolean', default: false },
16
+ replay: { type: 'boolean', default: false },
17
+ base: { type: 'string' },
18
+ });
19
+ const root = args.projectRoot;
20
+ const interactive = process.stdin.isTTY && process.stdout.isTTY;
21
+ if (args.flag('replay')) {
22
+ refuseNamedReplay(args);
23
+ return replayDrizzleMigrations({ root, base: args.text('base') ?? DEFAULT_BASE, interactive }, io);
24
+ }
25
+ const name = namedMigration(args);
26
+ const { code, written } = generateAndRead({ root, name, custom: args.flag('custom'), interactive }, io);
27
+ if (code === 0) {
28
+ tidyWrittenMigration(written, io);
29
+ }
30
+ return code;
31
+ };
32
+ function refuseNamedReplay(args) {
33
+ if (args.text('name') !== undefined || args.flag('custom')) {
34
+ throw new CliError('A replay generates the migrations of the branch again under their own names, custom ones included.', 'Run `npx ddd-ts-kit drizzle-generate --replay [--base <ref>]`, without --name or --custom.');
35
+ }
36
+ }
37
+ function namedMigration(args) {
7
38
  const name = args.text('name')?.trim() ?? '';
39
+ if (args.text('base') !== undefined) {
40
+ throw new CliError('--base names the trunk of a replay.', 'Run `npx ddd-ts-kit drizzle-generate --replay --base <ref>` after merging the trunk into the branch.');
41
+ }
8
42
  if (name === '') {
9
43
  throw new CliError('A migration is named by what it does.', 'Run `npm run db:generate <what-it-does>`, for example `npm run db:generate add-invoices`.');
10
44
  }
11
- const interactive = process.stdin.isTTY && process.stdout.isTTY;
12
- return generateDrizzleMigration({ root: args.projectRoot, name, custom: args.flag('custom'), interactive }, io);
13
- };
45
+ return name;
46
+ }
14
47
  //# sourceMappingURL=drizzle-generate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"drizzle-generate.js","sourceRoot":"","sources":["../../src/commands/drizzle-generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG3C,4IAA4I;AAC5I,MAAM,CAAC,MAAM,sBAAsB,GAAY,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE;IAC1D,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE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AAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAE7C,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,SAAS,EAAE,CAAC;QACpC,MAAM,IAAI,QAAQ,CAChB,qCAAqC,EACrC,sGAAsG,CACvG,CAAC;IACJ,CAAC;IAED,IAAI,IAAI,KAAK,EAAE,EAAE,CAAC;QAChB,MAAM,IAAI,QAAQ,CAChB,uCAAuC,EACvC,2FAA2F,CAC5F,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { Command } from './command.js';
2
+ /**
3
+ * Orders the rows of the slices file not done, of the project or of one context, in waves cut
4
+ * into batches of one or two rows, with the command that briefs each batch and the order of the
5
+ * merges. Exits 1, without waves, while a cycle, an unknown dependency or a row without owner
6
+ * keeps the rows from being ordered.
7
+ */
8
+ export declare const planWavesCommand: Command;
9
+ //# sourceMappingURL=plan-waves.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan-waves.d.ts","sourceRoot":"","sources":["../../src/commands/plan-waves.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,OAiB9B,CAAC"}
@@ -0,0 +1,36 @@
1
+ import path from 'node:path';
2
+ import { CliError } from '../cli-error.js';
3
+ import { formatPlan } from '../plan/format-plan.js';
4
+ import { planWaves } from '../plan/plan-waves.js';
5
+ import { readSlices, SLICES_FILE } from '../progress/read-slices.js';
6
+ import { Workspace } from '../workspace/index.js';
7
+ import { Arguments } from './arguments.js';
8
+ /**
9
+ * Orders the rows of the slices file not done, of the project or of one context, in waves cut
10
+ * into batches of one or two rows, with the command that briefs each batch and the order of the
11
+ * merges. Exits 1, without waves, while a cycle, an unknown dependency or a row without owner
12
+ * keeps the rows from being ordered.
13
+ */
14
+ export const planWavesCommand = (argv, io) => {
15
+ const args = Arguments.parse(argv, {});
16
+ const root = args.projectRoot;
17
+ const rows = readSlices(new Workspace(root, false));
18
+ if (rows === undefined) {
19
+ throw new CliError(`${SLICES_FILE} has no slices table.`, 'Plan the slices first (the skill ddd-ts-kit:plan-slices writes the table), then run plan-waves again.');
20
+ }
21
+ const plan = planWaves(rows, { context: contextOf(rows, args.positionals[0]), project: path.basename(root) });
22
+ io.out(args.json ? JSON.stringify(plan, null, 2) : formatPlan(plan));
23
+ return plan.problems.length === 0 ? 0 : 1;
24
+ };
25
+ /** The context asked for, which a row of the file must name; null when none is. */
26
+ function contextOf(rows, asked) {
27
+ if (asked === undefined) {
28
+ return null;
29
+ }
30
+ const contexts = [...new Set(rows.map((row) => row.context))].sort();
31
+ if (!contexts.includes(asked)) {
32
+ throw new CliError(`No row of ${SLICES_FILE} is in the context "${asked}".`, `Use one of: ${contexts.join(', ')}.`);
33
+ }
34
+ return asked;
35
+ }
36
+ //# sourceMappingURL=plan-waves.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan-waves.js","sourceRoot":"","sources":["../../src/commands/plan-waves.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAErE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG3C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAY,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE;IACpD,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC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Ae,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACtH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import type { Command } from './command.js';
2
2
  /**
3
3
  * Prints where the work stands: the next step of the plan, the slices by status and by owner, the markers left in each context.
4
+ * Each slice not done says whether it is ready on the trunk, ready once a worker's branch merges, or waiting.
4
5
  * With `--workers`, the workers of a parallel build instead: who builds what in which worktree, and the files two of them change.
5
6
  */
6
7
  export declare const statusCommand: Command;
@@ -1 +1 @@
1
- {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,OAiB3B,CAAC"}
1
+ {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,OAiB3B,CAAC"}
@@ -3,21 +3,23 @@ import { formatProgress } from '../progress/format-progress.js';
3
3
  import { readProgress } from '../progress/read-progress.js';
4
4
  import { formatWorkers } from '../worker/format-workers.js';
5
5
  import { readWorkers } from '../worker/read-workers.js';
6
+ import { rowsOnBranches } from '../worker/rows-on-branches.js';
6
7
  import { Workspace } from '../workspace/index.js';
7
8
  import { Arguments } from './arguments.js';
8
9
  /**
9
10
  * Prints where the work stands: the next step of the plan, the slices by status and by owner, the markers left in each context.
11
+ * Each slice not done says whether it is ready on the trunk, ready once a worker's branch merges, or waiting.
10
12
  * With `--workers`, the workers of a parallel build instead: who builds what in which worktree, and the files two of them change.
11
13
  */
12
14
  export const statusCommand = (argv, io) => {
13
15
  const args = Arguments.parse(argv, { workers: { type: 'boolean', default: false } });
14
16
  const root = args.projectRoot;
17
+ const workers = readWorkers(root);
15
18
  if (args.flag('workers')) {
16
- const workers = readWorkers(root);
17
19
  io.out(args.json ? JSON.stringify(workers, null, 2) : formatWorkers(workers));
18
20
  return 0;
19
21
  }
20
- const progress = readProgress(new Workspace(root, false), readConfig(root).config);
22
+ const progress = readProgress(new Workspace(root, false), readConfig(root).config, rowsOnBranches(workers));
21
23
  io.out(args.json ? JSON.stringify(progress, null, 2) : formatProgress(progress));
22
24
  return 0;
23
25
  };
@@ -1 +1 @@
1
- {"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG3C;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAY,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE;IACjD,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;IACrF,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC;IAE9B,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;QACzB,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;QAElC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IA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;IAE9B,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IAElC,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;QACzB,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;QAE9E,OAAO,CAAC,CAAC;IACX,CAAC;IAED,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IAE5G,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEjF,OAAO,CAAC,CAAC;AACX,CAAC,CAAC"}
@@ -1,3 +1,3 @@
1
1
  /** What a line of the usage cannot say about a command or a flag. */
2
- export declare const NOTES = " affected what a pull request has to run: the contexts a change set reaches through the context\n map (a changed context and the contexts downstream of it), as filters for the test\n runner and the linter; everything when a shared path changed or without --base\n build-aliases after the compiler: rewrites the import aliases left in the emitted .js and .d.ts files\n into relative paths, so that plain node runs the output (tsconfig.build.json by default)\n drizzle-generate the db:generate of a Drizzle project: drizzle-kit generate --name, which without a terminal\n fails and names the fix when drizzle-kit would ask whether a column or table is renamed,\n where drizzle-kit alone writes nothing and exits 0\n error-factories moves a project from one class per error to static factories on one error class per\n concept: --plan writes error-factories.plan.json, where each class is given its concept;\n --apply follows it (classes, specs, every usage, \"stack.refusals\" in the config)\n value-objects moves the value objects of a project from a Result to factories that return the value or\n throw: every create returning Result<T, E> returns T, err(..) is thrown, unwrap(..) of\n them goes, specs assert expectRefusal(() => ..), \"stack.valueObjects\" becomes throwing\n controllers moves the function routes of a project, or of one context, to controller classes: each\n <name>.route.ts becomes <resource>/<name>/<name>.controller.ts behind the route group of\n its resource, its schema files and its spec follow; a context is turned whole or not at all\n doctor what an upgrade left to do: the scripts, the packages of the kit (at the ranges of this\n version) and the agent permissions this version writes that the project lacks or writes\n otherwise; init adds what is missing; --strict exits 1 while something is missing\n describe one context as facts: use cases, routes, events, ports, policies, gateways, dependencies\n status the next step of docs/architecture/plan.md, the slices of docs/architecture/slices.md by\n status and by owner, and the TODO(domain), TODO(platform), it.todo and TODO(review) left in\n each context; --workers shows instead each worktree holding .ddd-ts-kit/worker.json (branch,\n context, rows, base, commits ahead, files changed since the base, its report), then the\n contexts and the files more than one worker holds\n sdk the typed client of each document of the contract, a workspace package under\n clients/<document> without runtime dependency: typed errors keyed by the error codes,\n credentials per security scheme; records \"sdk\" in the config the first time, wires the\n scripts (docs:generate regenerates it, docs:check compares it, ci:build builds it);\n --check writes nothing and exits 1 while a client differs from its contract\n todo those markers as file:line, in the project or in one context\n worker-scope a git worktree on the branch build/<context> (by default ../<project>-<context>), cut from\n --base <ref> (by default the current branch, refused from a worker's worktree), its\n .ddd-ts-kit/worker.json, and the briefing of the worker of that context; --rows <id,...>\n briefs those rows of slices.md only, with their rules; an existing worktree or branch\n that does not contain the base is refused\n verify-slice closes a slice before its commit, in one run: the regenerate script, check on the files\n changed since --since (new ones included), the test script for the context; then the\n changed files past 300 of the 350 lines, the paths of the slice to stage (its context, an\n end-to-end spec, a working migration, the derived files git tracks) and every other\n changed path, left out and never to stage with it; exits 1 while a step fails\n --commit-size the files and lines about to be committed against \"commit\" in the config (20 files and\n 600 lines by default, generated files not counted); --staged reads the index only;\n advisory, --strict exits 1 when over\n --stored-events docs records the shape of each version of the stored events in stored-events.lock.json,\n never rewriting a recorded one: run it once the shape of a version is the one to store;\n docs --check fails while a declared version is not recorded\n --sdk init records \"sdk\" in the config and generates the clients with the project\n --local-only generate refuses, and writes nothing, when the kind would write outside its context;\n \"generate --help --json\" says which kinds do";
2
+ export declare const NOTES = " affected what a pull request has to run: the contexts a change set reaches through the context\n map (a changed context and the contexts downstream of it), as filters for the test\n runner and the linter; everything when a shared path changed or without --base\n build-aliases after the compiler: rewrites the import aliases left in the emitted .js and .d.ts files\n into relative paths, so that plain node runs the output (tsconfig.build.json by default)\n drizzle-generate the db:generate of a Drizzle project: drizzle-kit generate --name, which without a terminal\n fails and names the fix when drizzle-kit would ask whether a column or table is renamed,\n where drizzle-kit alone writes nothing and exits 0; then formats the snapshot and the\n journal it wrote with the Biome or Prettier of the format script, and warns when the\n SQL changes a primary key in an order that fails on PostgreSQL (exit code unchanged);\n --replay, after merging the trunk into a branch when both added migrations: deletes\n the migrations of the branch that --base <ref> (origin/main by default) does not have,\n with their snapshots and journal entries, then generates each again on top, in order,\n under its name (working- dropped outside a worker's worktree, a custom one keeping\n its SQL); refused while the journal holds conflict markers or when two of them change\n the schema\n error-factories moves a project from one class per error to static factories on one error class per\n concept: --plan writes error-factories.plan.json, where each class is given its concept;\n --apply follows it (classes, specs, every usage, \"stack.refusals\" in the config)\n value-objects moves the value objects of a project from a Result to factories that return the value or\n throw: every create returning Result<T, E> returns T, err(..) is thrown, unwrap(..) of\n them goes, specs assert expectRefusal(() => ..), \"stack.valueObjects\" becomes throwing\n controllers moves the function routes of a project, or of one context, to controller classes: each\n <name>.route.ts becomes <resource>/<name>/<name>.controller.ts behind the route group of\n its resource, its schema files and its spec follow; a context is turned whole or not at all\n doctor what an upgrade left to do: the scripts, the packages of the kit (at the ranges of this\n version) and the agent permissions this version writes that the project lacks or writes\n otherwise; init adds what is missing; --strict exits 1 while something is missing\n describe one context as facts: use cases, routes, events, ports, policies, gateways, dependencies\n status the next step of docs/architecture/plan.md, the slices of docs/architecture/slices.md by\n status and by owner, each row not done ready on the trunk (its dependencies done), ready\n on a branch (the others briefed to a worker with commits ahead of its base) or waiting\n (with the ids it waits for), and the TODO(domain), TODO(platform), it.todo and TODO(review)\n left in each context; --workers shows instead each worktree holding .ddd-ts-kit/worker.json (branch,\n context, rows, base, commits ahead, files changed since the base, its report), then the\n contexts and the files more than one worker holds\n sdk the typed client of each document of the contract, a workspace package under\n clients/<document> without runtime dependency: typed errors keyed by the error codes,\n credentials per security scheme; records \"sdk\" in the config the first time, wires the\n scripts (docs:generate regenerates it, docs:check compares it, ci:build builds it);\n --check writes nothing and exits 1 while a client differs from its contract\n todo those markers as file:line, in the project or in one context\n plan-waves the rows of slices.md not done, of the project or of one context, in waves (wave 1: every\n dependency done; wave n: the others in earlier waves), each wave cut into batches of one\n owner, one or two rows on one aggregate, with the worker-scope command that briefs each,\n the batches of a wave likely to touch the same files (same aggregate in Start with, or\n unknown when it names none), and the merge order; a cycle, a dependency on an unknown id\n or a row without owner is reported alone, and exits 1\n worker-scope a git worktree on the branch build/<context> (by default ../<project>-<context>), cut from\n --base <ref> (by default the current branch, refused from a worker's worktree), its\n .ddd-ts-kit/worker.json, and the briefing of the worker of that context; --rows <id,...>\n briefs those rows of slices.md only, with their rules; an existing worktree or branch\n that does not contain the base is refused\n verify-slice closes a slice before its commit, in one run: the regenerate script, check on the files\n changed since --since (new ones included), the test script for the context; then the\n changed files past 300 of the 350 lines, the paths of the slice to stage (its context, an\n end-to-end spec, a working migration, the derived files git tracks) and every other\n changed path, left out and never to stage with it; exits 1 while a step fails\n --commit-size the files and lines about to be committed against \"commit\" in the config (20 files and\n 600 lines by default, generated files not counted); --staged reads the index only;\n advisory, --strict exits 1 when over\n --stored-events docs records the shape of each version of the stored events in stored-events.lock.json,\n never rewriting a recorded one: run it once the shape of a version is the one to store;\n docs --check fails while a declared version is not recorded\n --sdk init records \"sdk\" in the config and generates the clients with the project\n --local-only generate refuses, and writes nothing, when the kind would write outside its context;\n \"generate --help --json\" says which kinds do";
3
3
  //# sourceMappingURL=notes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"notes.d.ts","sourceRoot":"","sources":["../../src/help/notes.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,eAAO,MAAM,KAAK,qjKAkD8C,CAAC"}
1
+ {"version":3,"file":"notes.d.ts","sourceRoot":"","sources":["../../src/help/notes.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,eAAO,MAAM,KAAK,kqNAkE8C,CAAC"}
@@ -6,7 +6,15 @@ export const NOTES = ` affected what a pull request has to run: the con
6
6
  into relative paths, so that plain node runs the output (tsconfig.build.json by default)
7
7
  drizzle-generate the db:generate of a Drizzle project: drizzle-kit generate --name, which without a terminal
8
8
  fails and names the fix when drizzle-kit would ask whether a column or table is renamed,
9
- where drizzle-kit alone writes nothing and exits 0
9
+ where drizzle-kit alone writes nothing and exits 0; then formats the snapshot and the
10
+ journal it wrote with the Biome or Prettier of the format script, and warns when the
11
+ SQL changes a primary key in an order that fails on PostgreSQL (exit code unchanged);
12
+ --replay, after merging the trunk into a branch when both added migrations: deletes
13
+ the migrations of the branch that --base <ref> (origin/main by default) does not have,
14
+ with their snapshots and journal entries, then generates each again on top, in order,
15
+ under its name (working- dropped outside a worker's worktree, a custom one keeping
16
+ its SQL); refused while the journal holds conflict markers or when two of them change
17
+ the schema
10
18
  error-factories moves a project from one class per error to static factories on one error class per
11
19
  concept: --plan writes error-factories.plan.json, where each class is given its concept;
12
20
  --apply follows it (classes, specs, every usage, "stack.refusals" in the config)
@@ -21,8 +29,10 @@ export const NOTES = ` affected what a pull request has to run: the con
21
29
  otherwise; init adds what is missing; --strict exits 1 while something is missing
22
30
  describe one context as facts: use cases, routes, events, ports, policies, gateways, dependencies
23
31
  status the next step of docs/architecture/plan.md, the slices of docs/architecture/slices.md by
24
- status and by owner, and the TODO(domain), TODO(platform), it.todo and TODO(review) left in
25
- each context; --workers shows instead each worktree holding .ddd-ts-kit/worker.json (branch,
32
+ status and by owner, each row not done ready on the trunk (its dependencies done), ready
33
+ on a branch (the others briefed to a worker with commits ahead of its base) or waiting
34
+ (with the ids it waits for), and the TODO(domain), TODO(platform), it.todo and TODO(review)
35
+ left in each context; --workers shows instead each worktree holding .ddd-ts-kit/worker.json (branch,
26
36
  context, rows, base, commits ahead, files changed since the base, its report), then the
27
37
  contexts and the files more than one worker holds
28
38
  sdk the typed client of each document of the contract, a workspace package under
@@ -31,6 +41,12 @@ export const NOTES = ` affected what a pull request has to run: the con
31
41
  scripts (docs:generate regenerates it, docs:check compares it, ci:build builds it);
32
42
  --check writes nothing and exits 1 while a client differs from its contract
33
43
  todo those markers as file:line, in the project or in one context
44
+ plan-waves the rows of slices.md not done, of the project or of one context, in waves (wave 1: every
45
+ dependency done; wave n: the others in earlier waves), each wave cut into batches of one
46
+ owner, one or two rows on one aggregate, with the worker-scope command that briefs each,
47
+ the batches of a wave likely to touch the same files (same aggregate in Start with, or
48
+ unknown when it names none), and the merge order; a cycle, a dependency on an unknown id
49
+ or a row without owner is reported alone, and exits 1
34
50
  worker-scope a git worktree on the branch build/<context> (by default ../<project>-<context>), cut from
35
51
  --base <ref> (by default the current branch, refused from a worker's worktree), its
36
52
  .ddd-ts-kit/worker.json, and the briefing of the worker of that context; --rows <id,...>
@@ -1 +1 @@
1
- {"version":3,"file":"notes.js","sourceRoot":"","sources":["../../src/help/notes.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,MAAM,CAAC,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gEAkD2C,CAAC"}
1
+ {"version":3,"file":"notes.js","sourceRoot":"","sources":["../../src/help/notes.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,MAAM,CAAC,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gEAkE2C,CAAC"}
@@ -1,3 +1,3 @@
1
1
  /** Every command of the CLI and its flags, as `--help` prints them and docs/guides/commands.md shows them. */
2
- export declare const USAGE = "Usage\n ddd-ts-kit init [--http express|fastify|hono|nest|none]\n [--validation zod|class-validator|typebox|standard-schema|none]\n [--di tsyringe|nest|manual] [--tests vitest|jest]\n [--orm drizzle|knex|prisma|typeorm|custom|none] [--database postgres|mysql|sqlite|none]\n [--events in-memory|outbox] [--docs-ui swagger|scalar|redoc|none]\n [--ci github|gitlab|both|none] [--ci-extras <extra>,...|none]\n [--authn jwt|keycloak|none] [--authz rbac|abac|rebac|custom]\n [--broker none|rabbitmq|kafka|nats|redis|custom] [--cache none|redis] [--http-cache none|varnish]\n [--storage local|s3|none]\n [--audit on|off]\n [--errors none|sentry] [--logger stdout|pino|winston] [--style declared|explicit] [--assembly barrel|discovery]\n [--dependencies signature|listed] [--refusals factories|classes]\n [--routes controllers|functions] [--representations negotiated|json] [--forms on|off]\n [--value-objects throwing|result] [--literals named|free] [--values classes|free] [--tenancy none|shared-table] [--queue database|redis|memory]\n [--schemas shared|per-route]\n [--package-manager npm|pnpm] [--allow-no-outbox \"<reason>\"] [--import-alias '$<name>/']\n [--import-extension none|js] [--sdk]\n [--context <name>:<core|supporting|generic>]... [--preset identity]... [--dry-run] [--force]\n ddd-ts-kit generate <kind> ... [--term \"<Term>=<meaning>\"]... [--allow-name] [--local-only] [--dry-run] [--force] (alias: g)\n ddd-ts-kit generate --help --json\n ddd-ts-kit list [--context <name>]\n ddd-ts-kit describe <context>\n ddd-ts-kit status [--workers]\n ddd-ts-kit doctor [--strict]\n ddd-ts-kit todo [<context>]\n ddd-ts-kit worker-scope <context> [--base <ref>] [--rows <id,...>] [--worktree <path>] [--branch <name>] [--dry-run]\n ddd-ts-kit verify-slice <context> --since <git-ref>\n ddd-ts-kit docs [--check] [--stored-events]\n ddd-ts-kit sdk [--check] [--dry-run]\n ddd-ts-kit depcruise-config [--check|--write]\n ddd-ts-kit build-aliases [--project <tsconfig>]\n ddd-ts-kit drizzle-generate --name <what-it-does> [--custom]\n ddd-ts-kit error-factories --plan | --apply [--dry-run]\n ddd-ts-kit controllers [<context>] [--dry-run]\n ddd-ts-kit value-objects [--dry-run]\n ddd-ts-kit affected [--base <git-ref>] [--head <git-ref>] [--format text|json|github|env]\n ddd-ts-kit check [paths...] [--rule <id>]... [--format text|json|github|gitlab] [--changed-since <git-ref>] [--self]\n ddd-ts-kit check --clean-only <dir>... [--rule <id>]... [--format text|json|github]\n ddd-ts-kit check --commit-size [--staged] [--strict]\n ddd-ts-kit check-file <path>\n ddd-ts-kit rules\n ddd-ts-kit explain <rule-id>\n\nEvery command accepts --json (machine-readable output) and --cwd <dir> (project root).";
2
+ export declare const USAGE = "Usage\n ddd-ts-kit init [--http express|fastify|hono|nest|none]\n [--validation zod|class-validator|typebox|standard-schema|none]\n [--di tsyringe|nest|manual] [--tests vitest|jest]\n [--orm drizzle|knex|prisma|typeorm|custom|none] [--database postgres|mysql|sqlite|none]\n [--events in-memory|outbox] [--docs-ui swagger|scalar|redoc|none]\n [--ci github|gitlab|both|none] [--ci-extras <extra>,...|none]\n [--authn jwt|keycloak|none] [--authz rbac|abac|rebac|custom]\n [--broker none|rabbitmq|kafka|nats|redis|custom] [--cache none|redis] [--http-cache none|varnish]\n [--storage local|s3|none]\n [--audit on|off]\n [--errors none|sentry] [--logger stdout|pino|winston] [--style declared|explicit] [--assembly barrel|discovery]\n [--dependencies signature|listed] [--refusals factories|classes]\n [--routes controllers|functions] [--representations negotiated|json] [--forms on|off]\n [--value-objects throwing|result] [--literals named|free] [--values classes|free] [--tenancy none|shared-table] [--queue database|redis|memory]\n [--schemas shared|per-route]\n [--package-manager npm|pnpm] [--allow-no-outbox \"<reason>\"] [--import-alias '$<name>/']\n [--import-extension none|js] [--sdk]\n [--context <name>:<core|supporting|generic>]... [--preset identity]... [--dry-run] [--force]\n ddd-ts-kit generate <kind> ... [--term \"<Term>=<meaning>\"]... [--allow-name] [--local-only] [--dry-run] [--force] (alias: g)\n ddd-ts-kit generate --help --json\n ddd-ts-kit list [--context <name>]\n ddd-ts-kit describe <context>\n ddd-ts-kit status [--workers]\n ddd-ts-kit doctor [--strict]\n ddd-ts-kit todo [<context>]\n ddd-ts-kit plan-waves [<context>]\n ddd-ts-kit worker-scope <context> [--base <ref>] [--rows <id,...>] [--worktree <path>] [--branch <name>] [--dry-run]\n ddd-ts-kit verify-slice <context> --since <git-ref>\n ddd-ts-kit docs [--check] [--stored-events]\n ddd-ts-kit sdk [--check] [--dry-run]\n ddd-ts-kit depcruise-config [--check|--write]\n ddd-ts-kit build-aliases [--project <tsconfig>]\n ddd-ts-kit drizzle-generate --name <what-it-does> [--custom]\n ddd-ts-kit drizzle-generate --replay [--base <git-ref>]\n ddd-ts-kit error-factories --plan | --apply [--dry-run]\n ddd-ts-kit controllers [<context>] [--dry-run]\n ddd-ts-kit value-objects [--dry-run]\n ddd-ts-kit affected [--base <git-ref>] [--head <git-ref>] [--format text|json|github|env]\n ddd-ts-kit check [paths...] [--rule <id>]... [--format text|json|github|gitlab] [--changed-since <git-ref>] [--self]\n ddd-ts-kit check --clean-only <dir>... [--rule <id>]... [--format text|json|github]\n ddd-ts-kit check --commit-size [--staged] [--strict]\n ddd-ts-kit check-file <path>\n ddd-ts-kit rules\n ddd-ts-kit explain <rule-id>\n\nEvery command accepts --json (machine-readable output) and --cwd <dir> (project root).";
3
3
  //# sourceMappingURL=usage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../src/help/usage.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAC9G,eAAO,MAAM,KAAK,+8FA4CqE,CAAC"}
1
+ {"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../src/help/usage.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAC9G,eAAO,MAAM,KAAK,+iGA8CqE,CAAC"}
@@ -25,6 +25,7 @@ export const USAGE = `Usage
25
25
  ddd-ts-kit status [--workers]
26
26
  ddd-ts-kit doctor [--strict]
27
27
  ddd-ts-kit todo [<context>]
28
+ ddd-ts-kit plan-waves [<context>]
28
29
  ddd-ts-kit worker-scope <context> [--base <ref>] [--rows <id,...>] [--worktree <path>] [--branch <name>] [--dry-run]
29
30
  ddd-ts-kit verify-slice <context> --since <git-ref>
30
31
  ddd-ts-kit docs [--check] [--stored-events]
@@ -32,6 +33,7 @@ export const USAGE = `Usage
32
33
  ddd-ts-kit depcruise-config [--check|--write]
33
34
  ddd-ts-kit build-aliases [--project <tsconfig>]
34
35
  ddd-ts-kit drizzle-generate --name <what-it-does> [--custom]
36
+ ddd-ts-kit drizzle-generate --replay [--base <git-ref>]
35
37
  ddd-ts-kit error-factories --plan | --apply [--dry-run]
36
38
  ddd-ts-kit controllers [<context>] [--dry-run]
37
39
  ddd-ts-kit value-objects [--dry-run]
@@ -1 +1 @@
1
- {"version":3,"file":"usage.js","sourceRoot":"","sources":["../../src/help/usage.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAC9G,MAAM,CAAC,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uFA4CkE,CAAC"}
1
+ {"version":3,"file":"usage.js","sourceRoot":"","sources":["../../src/help/usage.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAC9G,MAAM,CAAC,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uFA8CkE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"persistence-files.d.ts","sourceRoot":"","sources":["../../../src/init/files/persistence-files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AA4D/C,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,EAAE,CAQ3D"}
1
+ {"version":3,"file":"persistence-files.d.ts","sourceRoot":"","sources":["../../../src/init/files/persistence-files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AA8D/C,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,EAAE,CAY3D"}
@@ -1,4 +1,6 @@
1
+ import { WITH_DATABASE } from '../../stack/with-database.js';
1
2
  import { platformFile } from './platform-file.js';
3
+ import { when } from './when.js';
2
4
  const INERT = 'inert-persistence.ts';
3
5
  const IN_MEMORY = [
4
6
  ['persistence.ts', 'memory'],
@@ -50,11 +52,15 @@ const TOOLING = {
50
52
  ],
51
53
  };
52
54
  export function persistenceFiles(config) {
53
- const { orm } = config.stack;
55
+ const { orm, tests } = config.stack;
54
56
  const files = (PERSISTENCE[orm] ?? []).filter(([file]) => file !== INERT || composesWithoutConnecting(config));
55
57
  return [
56
58
  ...files.map(([file, variant]) => platformFile(config, `database/${file}`, variant)),
57
59
  ...(TOOLING[orm] ?? []),
60
+ // The global setup of Vitest that saves the test database once per run, for each spec to open a copy of it.
61
+ ...when(tests === 'vitest' && WITH_DATABASE.includes(orm), [
62
+ ['test/support/test-database-template.ts', 'init/platform/database/test-database-template.ts.tpl'],
63
+ ]),
58
64
  ];
59
65
  }
60
66
  /** The script that lists the routes and the hand-wired architecture test compose the application without a database to reach. */
@@ -1 +1 @@
1
- {"version":3,"file":"persistence-files.js","sourceRoot":"","sources":["../../../src/init/files/persistence-files.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAIlD,MAAM,KAAK,GAAG,sBAAsB,CAAC;AAErC,MAAM,SAAS,GAAa;IAC1B,CAAC,gBAAgB,EAAE,QAAQ,CAAC;IAC5B,CAAC,qBAAqB,EAAE,QAAQ,CAAC;IACjC,CAAC,KAAK,EAAE,QAAQ,CAAC;CAClB,CAAC;AAEF,2GAA2G;AAC3G,MAAM,WAAW,GAAuC;IACtD,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,CAAC,GAAG,SAAS,E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