ddd-ts-kit 0.95.0 → 0.96.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/README.fr.md +60 -9
- package/README.md +54 -8
- package/dist/cli-error.d.ts +3 -3
- package/dist/cli-error.d.ts.map +1 -1
- package/dist/cli-error.js +4 -3
- package/dist/cli-error.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +2 -0
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/generate.d.ts +4 -0
- package/dist/commands/generate.d.ts.map +1 -1
- package/dist/commands/generate.js +5 -3
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/plan-waves.d.ts +2 -1
- package/dist/commands/plan-waves.d.ts.map +1 -1
- package/dist/commands/plan-waves.js +28 -2
- package/dist/commands/plan-waves.js.map +1 -1
- package/dist/doctor/diagnose.d.ts +2 -1
- package/dist/doctor/diagnose.d.ts.map +1 -1
- package/dist/doctor/diagnose.js +4 -1
- package/dist/doctor/diagnose.js.map +1 -1
- package/dist/doctor/doctor-finding.d.ts +1 -1
- package/dist/doctor/doctor-finding.d.ts.map +1 -1
- package/dist/doctor/format-diagnosis.js +25 -2
- package/dist/doctor/format-diagnosis.js.map +1 -1
- package/dist/doctor/install-script-findings.d.ts +11 -0
- package/dist/doctor/install-script-findings.d.ts.map +1 -0
- package/dist/doctor/install-script-findings.js +86 -0
- package/dist/doctor/install-script-findings.js.map +1 -0
- package/dist/doctor/installed-from.d.ts +3 -0
- package/dist/doctor/installed-from.d.ts.map +1 -0
- package/dist/doctor/installed-from.js +15 -0
- package/dist/doctor/installed-from.js.map +1 -0
- package/dist/doctor/override-findings.d.ts.map +1 -1
- package/dist/doctor/override-findings.js +1 -11
- package/dist/doctor/override-findings.js.map +1 -1
- package/dist/generate/kind.d.ts +3 -0
- package/dist/generate/kind.d.ts.map +1 -1
- package/dist/generate/kinds/declare-storage.d.ts.map +1 -1
- package/dist/generate/kinds/declare-storage.js +5 -1
- package/dist/generate/kinds/declare-storage.js.map +1 -1
- package/dist/generate/kinds/generate-context.d.ts.map +1 -1
- package/dist/generate/kinds/generate-context.js +14 -0
- package/dist/generate/kinds/generate-context.js.map +1 -1
- package/dist/generate/language-probe.d.ts +16 -0
- package/dist/generate/language-probe.d.ts.map +1 -0
- package/dist/generate/language-probe.js +2 -0
- package/dist/generate/language-probe.js.map +1 -0
- package/dist/generate/spoken-in-language.d.ts +2 -1
- package/dist/generate/spoken-in-language.d.ts.map +1 -1
- package/dist/generate/spoken-in-language.js +6 -1
- package/dist/generate/spoken-in-language.js.map +1 -1
- package/dist/help/notes.d.ts +1 -1
- package/dist/help/notes.d.ts.map +1 -1
- package/dist/help/notes.js +11 -3
- package/dist/help/notes.js.map +1 -1
- package/dist/init/first-install-note.d.ts.map +1 -1
- package/dist/init/first-install-note.js +21 -0
- package/dist/init/first-install-note.js.map +1 -1
- package/dist/init/managed-settings-note.d.ts.map +1 -1
- package/dist/init/managed-settings-note.js +1 -0
- package/dist/init/managed-settings-note.js.map +1 -1
- package/dist/init/manifest/allow-builds-block.d.ts +3 -0
- package/dist/init/manifest/allow-builds-block.d.ts.map +1 -0
- package/dist/init/manifest/allow-builds-block.js +5 -0
- package/dist/init/manifest/allow-builds-block.js.map +1 -0
- package/dist/init/manifest/allow-builds-entries.d.ts +8 -0
- package/dist/init/manifest/allow-builds-entries.d.ts.map +1 -0
- package/dist/init/manifest/allow-builds-entries.js +8 -0
- package/dist/init/manifest/allow-builds-entries.js.map +1 -0
- package/dist/init/manifest/database-scripts.d.ts.map +1 -1
- package/dist/init/manifest/database-scripts.js +3 -1
- package/dist/init/manifest/database-scripts.js.map +1 -1
- package/dist/init/manifest/install-scripts-of.d.ts +18 -0
- package/dist/init/manifest/install-scripts-of.d.ts.map +1 -0
- package/dist/init/manifest/install-scripts-of.js +25 -0
- package/dist/init/manifest/install-scripts-of.js.map +1 -0
- package/dist/init/manifest/names-package.d.ts +3 -0
- package/dist/init/manifest/names-package.d.ts.map +1 -0
- package/dist/init/manifest/names-package.js +5 -0
- package/dist/init/manifest/names-package.js.map +1 -0
- package/dist/init/manifest/prisma-client-script.d.ts +3 -0
- package/dist/init/manifest/prisma-client-script.d.ts.map +1 -0
- package/dist/init/manifest/prisma-client-script.js +5 -0
- package/dist/init/manifest/prisma-client-script.js.map +1 -0
- package/dist/init/manifest/versions.js +24 -24
- package/dist/init/manifest/write-install-scripts.d.ts +10 -0
- package/dist/init/manifest/write-install-scripts.d.ts.map +1 -0
- package/dist/init/manifest/write-install-scripts.js +78 -0
- package/dist/init/manifest/write-install-scripts.js.map +1 -0
- package/dist/init/manifest/write-manifest.d.ts.map +1 -1
- package/dist/init/manifest/write-manifest.js +9 -1
- package/dist/init/manifest/write-manifest.js.map +1 -1
- package/dist/init/run-init.d.ts.map +1 -1
- package/dist/init/run-init.js +20 -3
- package/dist/init/run-init.js.map +1 -1
- package/dist/merge/ensure-mergeable.d.ts.map +1 -1
- package/dist/merge/ensure-mergeable.js +15 -0
- package/dist/merge/ensure-mergeable.js.map +1 -1
- package/dist/merge/ensure-writable.d.ts +9 -0
- package/dist/merge/ensure-writable.d.ts.map +1 -0
- package/dist/merge/ensure-writable.js +51 -0
- package/dist/merge/ensure-writable.js.map +1 -0
- package/dist/merge/is-sandbox-mask.d.ts +4 -0
- package/dist/merge/is-sandbox-mask.d.ts.map +1 -0
- package/dist/merge/is-sandbox-mask.js +5 -0
- package/dist/merge/is-sandbox-mask.js.map +1 -0
- package/dist/merge/merge-trunk.d.ts.map +1 -1
- package/dist/merge/merge-trunk.js +4 -0
- package/dist/merge/merge-trunk.js.map +1 -1
- package/dist/plan/format-plan.d.ts +2 -1
- package/dist/plan/format-plan.d.ts.map +1 -1
- package/dist/plan/format-plan.js +20 -2
- package/dist/plan/format-plan.js.map +1 -1
- package/dist/plan/plan-waves.d.ts.map +1 -1
- package/dist/plan/plan-waves.js +2 -1
- package/dist/plan/plan-waves.js.map +1 -1
- package/dist/plan/planned-commands.d.ts +10 -0
- package/dist/plan/planned-commands.d.ts.map +1 -0
- package/dist/plan/planned-commands.js +13 -0
- package/dist/plan/planned-commands.js.map +1 -0
- package/dist/plan/planned-words.d.ts +27 -0
- package/dist/plan/planned-words.d.ts.map +1 -0
- package/dist/plan/planned-words.js +170 -0
- package/dist/plan/planned-words.js.map +1 -0
- package/dist/plan/wave-plan.d.ts +11 -1
- package/dist/plan/wave-plan.d.ts.map +1 -1
- package/dist/prisma-schema/index.d.ts +4 -0
- package/dist/prisma-schema/index.d.ts.map +1 -1
- package/dist/prisma-schema/index.js +4 -0
- package/dist/prisma-schema/index.js.map +1 -1
- package/dist/prisma-schema/keeps-single-prisma-schema.d.ts +7 -0
- package/dist/prisma-schema/keeps-single-prisma-schema.d.ts.map +1 -0
- package/dist/prisma-schema/keeps-single-prisma-schema.js +11 -0
- package/dist/prisma-schema/keeps-single-prisma-schema.js.map +1 -0
- package/dist/prisma-schema/single-prisma-schema-found.d.ts +3 -0
- package/dist/prisma-schema/single-prisma-schema-found.d.ts.map +1 -0
- package/dist/prisma-schema/single-prisma-schema-found.js +7 -0
- package/dist/prisma-schema/single-prisma-schema-found.js.map +1 -0
- package/dist/prisma-schema/single-prisma-schema-steps.d.ts +6 -0
- package/dist/prisma-schema/single-prisma-schema-steps.d.ts.map +1 -0
- package/dist/prisma-schema/single-prisma-schema-steps.js +25 -0
- package/dist/prisma-schema/single-prisma-schema-steps.js.map +1 -0
- package/dist/prisma-schema/single-prisma-schema.d.ts +3 -0
- package/dist/prisma-schema/single-prisma-schema.d.ts.map +1 -0
- package/dist/prisma-schema/single-prisma-schema.js +3 -0
- package/dist/prisma-schema/single-prisma-schema.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -4
- package/templates/aggregate/event-sourced.aggregate.spec.ts.tpl +8 -0
- package/templates/init/pnpm-workspace.yaml +2 -5
- package/templates/pipeline/package-scripts.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** A generator command of a row: as the row writes it, and as the arguments that follow `generate`. */
|
|
2
|
+
export interface PlannedCommand {
|
|
3
|
+
/** `generate aggregate billing Invoice`, as the row writes it, without `npx ddd-ts-kit` and with `g` written `generate`. */
|
|
4
|
+
readonly text: string;
|
|
5
|
+
/** `['aggregate', 'billing', 'Invoice']`, the quotes removed as a shell removes them. */
|
|
6
|
+
readonly argv: readonly string[];
|
|
7
|
+
}
|
|
8
|
+
/** The generator commands a `Start with` cell holds, in its order; none for a cell that runs no generator (`none: ...`). */
|
|
9
|
+
export declare function plannedCommands(startWith: string): PlannedCommand[];
|
|
10
|
+
//# sourceMappingURL=planned-commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planned-commands.d.ts","sourceRoot":"","sources":["../../src/plan/planned-commands.ts"],"names":[],"mappings":"AAQA,uGAAuG;AACvG,MAAM,WAAW,cAAc;IAC7B,4HAA4H;IAC5H,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,yFAAyF;IACzF,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC;AAED,4HAA4H;AAC5H,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc,EAAE,CAKnE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** A generator command of a `Start with` cell, between backquotes, with or without `npx ddd-ts-kit` before it. */
|
|
2
|
+
const COMMAND = /`(?:npx ddd-ts-kit )?(?:generate|g) ([^`]+)`/g;
|
|
3
|
+
/** A word of a command line, as a shell reads it: characters without a space, quoted texts included. */
|
|
4
|
+
const WORD = /(?:[^\s"']+|"[^"]*"|'[^']*')+/g;
|
|
5
|
+
const QUOTED = /"([^"]*)"|'([^']*)'/g;
|
|
6
|
+
/** The generator commands a `Start with` cell holds, in its order; none for a cell that runs no generator (`none: ...`). */
|
|
7
|
+
export function plannedCommands(startWith) {
|
|
8
|
+
return [...startWith.matchAll(COMMAND)].map(([, line = '']) => ({
|
|
9
|
+
text: `generate ${line}`,
|
|
10
|
+
argv: [...line.matchAll(WORD)].map(([word]) => word.replace(QUOTED, '$1$2')),
|
|
11
|
+
}));
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=planned-commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planned-commands.js","sourceRoot":"","sources":["../../src/plan/planned-commands.ts"],"names":[],"mappings":"AAAA,kHAAkH;AAClH,MAAM,OAAO,GAAG,+CAA+C,CAAC;AAEhE,wGAAwG;AACxG,MAAM,IAAI,GAAG,gCAAgC,CAAC;AAE9C,MAAM,MAAM,GAAG,sBAAsB,CAAC;AAUtC,4HAA4H;AAC5H,MAAM,UAAU,eAAe,CAAC,SAAiB;IAC/C,OAAO,CAAC,GAAG,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAC9D,IAAI,EAAE,YAAY,IAAI,EAAE;QACxB,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC7E,CAAC,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { LanguageProbe } from '../generate/language-probe.js';
|
|
2
|
+
import type { Slice } from '../progress/slice.js';
|
|
3
|
+
import type { NotReplayed, PlanProblem } from './wave-plan.js';
|
|
4
|
+
/** Runs `generate` with the arguments that follow it, hearing its names with the probe; throws what the generator refuses. */
|
|
5
|
+
type Generate = (argv: readonly string[], language: LanguageProbe) => void;
|
|
6
|
+
export interface WordsRequest {
|
|
7
|
+
/** The context whose rows to judge; null for every row. */
|
|
8
|
+
readonly context: string | null;
|
|
9
|
+
readonly generate: Generate;
|
|
10
|
+
}
|
|
11
|
+
/** What the replay of the planned commands found. */
|
|
12
|
+
export interface PlannedWords {
|
|
13
|
+
/** The names a worker following the rows would have refused, for a word: one per name and row. */
|
|
14
|
+
readonly problems: readonly PlanProblem[];
|
|
15
|
+
/** The commands the generator refused for another reason: the names they would have introduced after it are not judged. */
|
|
16
|
+
readonly notReplayed: readonly NotReplayed[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Replays the generator commands of the rows not done, in a copy of the project, in the order of
|
|
20
|
+
* their waves, so that each command finds what the rows before it generate. The generator itself
|
|
21
|
+
* says which names each command introduces; each is judged against the glossary of its context as
|
|
22
|
+
* it stands, with the `--term` of its row and of the rows it waits for, transitively: what a worker
|
|
23
|
+
* following that row would have when they run it.
|
|
24
|
+
*/
|
|
25
|
+
export declare function plannedWords(root: string, rows: readonly Slice[], request: WordsRequest): PlannedWords;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=planned-words.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planned-words.d.ts","sourceRoot":"","sources":["../../src/plan/planned-words.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAa,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAG/C,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG5D,8HAA8H;AAC9H,KAAK,QAAQ,GAAG,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAC;AAE3E,MAAM,WAAW,YAAY;IAC3B,2DAA2D;IAC3D,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;CAC7B;AAED,qDAAqD;AACrD,MAAM,WAAW,YAAY;IAC3B,kGAAkG;IAClG,QAAQ,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE,CAAC;IAC1C,2HAA2H;IAC3H,QAAQ,CAAC,WAAW,EAAE,SAAS,WAAW,EAAE,CAAC;CAC9C;AAKD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,KAAK,EAAE,EAAE,OAAO,EAAE,YAAY,GAAG,YAAY,CA6BtG"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { spawnSync } from 'node:child_process';
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import os from 'node:os';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import { parseGlossary } from '../check/language/parse-glossary.js';
|
|
6
|
+
import { technicalWordsOf } from '../check/language/technical-words-of.js';
|
|
7
|
+
import { unknownWords } from '../check/language/unknown-words.js';
|
|
8
|
+
import { findKind } from '../generate/find-kind.js';
|
|
9
|
+
import { toName } from '../naming/index.js';
|
|
10
|
+
import { plannedCommands } from './planned-commands.js';
|
|
11
|
+
import { rowsToPlan } from './rows-to-plan.js';
|
|
12
|
+
import { waveNumbers } from './wave-numbers.js';
|
|
13
|
+
/** Directories never copied when the project is not a git repository. */
|
|
14
|
+
const NOT_COPIED = new Set(['node_modules', '.git', 'dist', 'coverage', '.worktrees']);
|
|
15
|
+
/**
|
|
16
|
+
* Replays the generator commands of the rows not done, in a copy of the project, in the order of
|
|
17
|
+
* their waves, so that each command finds what the rows before it generate. The generator itself
|
|
18
|
+
* says which names each command introduces; each is judged against the glossary of its context as
|
|
19
|
+
* it stands, with the `--term` of its row and of the rows it waits for, transitively: what a worker
|
|
20
|
+
* following that row would have when they run it.
|
|
21
|
+
*/
|
|
22
|
+
export function plannedWords(root, rows, request) {
|
|
23
|
+
const planned = rowsToPlan(rows, request.context);
|
|
24
|
+
const waves = waveNumbers(planned);
|
|
25
|
+
const ordered = [...planned].sort((left, right) => (waves.get(left.id) ?? 0) - (waves.get(right.id) ?? 0));
|
|
26
|
+
const termsOf = rowTerms(rows);
|
|
27
|
+
const copy = copyOfProject(root);
|
|
28
|
+
try {
|
|
29
|
+
const inCopy = (argv, language) => request.generate([...argv, '--cwd', copy], language);
|
|
30
|
+
const replays = ordered.flatMap((row) => plannedCommands(row.startWith).map((command) => replayed(row, command, inCopy)));
|
|
31
|
+
return {
|
|
32
|
+
problems: firstOfEachWord(replays.flatMap((replay) => {
|
|
33
|
+
const terms = termsOf(replay.row);
|
|
34
|
+
return replay.heard.flatMap((heard) => judged({ ...replay, heard }, glossaryFor(root, heard, terms)));
|
|
35
|
+
})),
|
|
36
|
+
notReplayed: replays.flatMap(({ row, command, refusal }) => refusal === undefined ? [] : [{ row: row.id, command, refusal }]),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
finally {
|
|
40
|
+
fs.rmSync(copy, { recursive: true, force: true });
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function replayed(row, { text, argv }, generate) {
|
|
44
|
+
const heard = [];
|
|
45
|
+
try {
|
|
46
|
+
generate(argv, (name) => heard.push(name));
|
|
47
|
+
return { row, command: text, heard, refusal: undefined };
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
return { row, command: text, heard, refusal: error instanceof Error ? error.message : String(error) };
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/** The glossary a name is judged against: its context's as it stands, and the terms the rows add to that context. */
|
|
54
|
+
function glossaryFor(root, heard, added) {
|
|
55
|
+
const doc = path.join(root, heard.dir, 'CONTEXT.md');
|
|
56
|
+
const standing = fs.existsSync(doc) ? parseGlossary(fs.readFileSync(doc, 'utf8')).terms : [];
|
|
57
|
+
return { terms: [...standing, ...(added.get(heard.context) ?? [])], line: undefined, lastRowLine: undefined };
|
|
58
|
+
}
|
|
59
|
+
function judged({ row, command, heard }, glossary) {
|
|
60
|
+
const technical = technicalWordsOf(heard.name, glossary);
|
|
61
|
+
const unknown = unknownWords(heard.name, glossary, heard.qualifiers);
|
|
62
|
+
const at = `#${row.id} \`${command}\`: "${heard.name}"`;
|
|
63
|
+
return [
|
|
64
|
+
...(technical.length === 0
|
|
65
|
+
? []
|
|
66
|
+
: [
|
|
67
|
+
{
|
|
68
|
+
kind: 'technical-word',
|
|
69
|
+
rows: [row.id],
|
|
70
|
+
words: technical,
|
|
71
|
+
message: `${at} carries the technical word ${quoted(technical)}: use the word of the business, or define the term that holds it with --term in this row or a row it depends on`,
|
|
72
|
+
},
|
|
73
|
+
]),
|
|
74
|
+
...(unknown.length === 0
|
|
75
|
+
? []
|
|
76
|
+
: [
|
|
77
|
+
{
|
|
78
|
+
kind: 'undefined-word',
|
|
79
|
+
rows: [row.id],
|
|
80
|
+
words: unknown,
|
|
81
|
+
message: `${at} uses ${quoted(unknown)}, which the glossary of ${heard.context} does not define: add ${unknown.map((word) => `--term "${toName(word).pascal}=<what it means for the business>"`).join(' ')} to this row or to a row it depends on`,
|
|
82
|
+
},
|
|
83
|
+
]),
|
|
84
|
+
];
|
|
85
|
+
}
|
|
86
|
+
function quoted(words) {
|
|
87
|
+
return words.map((word) => `"${word}"`).join(', ');
|
|
88
|
+
}
|
|
89
|
+
/** Each word once per row, at the first name that carries it: a name whose words were all said already is left out. */
|
|
90
|
+
function firstOfEachWord(problems) {
|
|
91
|
+
const said = new Set();
|
|
92
|
+
return problems.flatMap(({ words, ...problem }) => {
|
|
93
|
+
const fresh = words.filter((word) => !said.has(`${problem.kind} ${problem.rows.join()} ${word}`));
|
|
94
|
+
for (const word of fresh) {
|
|
95
|
+
said.add(`${problem.kind} ${problem.rows.join()} ${word}`);
|
|
96
|
+
}
|
|
97
|
+
return fresh.length === 0 ? [] : [problem];
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The terms a row can count on, by context: the `--term` of its own commands and of the rows it
|
|
102
|
+
* waits for, transitively, each given to the context its command writes in.
|
|
103
|
+
*/
|
|
104
|
+
function rowTerms(rows) {
|
|
105
|
+
const byId = new Map(rows.map((row) => [row.id, row]));
|
|
106
|
+
return (row) => {
|
|
107
|
+
const terms = new Map();
|
|
108
|
+
const seen = new Set();
|
|
109
|
+
const queue = [row];
|
|
110
|
+
for (let next = queue.shift(); next !== undefined; next = queue.shift()) {
|
|
111
|
+
if (seen.has(next.id)) {
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
seen.add(next.id);
|
|
115
|
+
queue.push(...next.dependsOn.flatMap((id) => byId.get(id) ?? []));
|
|
116
|
+
for (const { argv } of plannedCommands(next.startWith)) {
|
|
117
|
+
const context = contextOf(argv);
|
|
118
|
+
if (context !== undefined) {
|
|
119
|
+
terms.set(context, [...(terms.get(context) ?? []), ...termFlags(argv)]);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return terms;
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
/** The context a generator command writes in: its first argument after the kind, for a kind that takes one. */
|
|
127
|
+
function contextOf([kindName = '', context]) {
|
|
128
|
+
return findKind(kindName)?.positionals[0] === 'context' && context !== undefined ? toName(context).kebab : undefined;
|
|
129
|
+
}
|
|
130
|
+
/** The terms of `--term "<Term>=<meaning>"` and `--term=<Term>=<meaning>`. */
|
|
131
|
+
function termFlags(argv) {
|
|
132
|
+
return argv.flatMap((word, index) => {
|
|
133
|
+
const value = word === '--term' ? argv[index + 1] : word.startsWith('--term=') ? word.slice(7) : undefined;
|
|
134
|
+
const term = value?.split('=')[0]?.trim() ?? '';
|
|
135
|
+
return term === '' ? [] : [term];
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
/** A copy of the project, its sources only, in a directory of its own that the caller removes. */
|
|
139
|
+
function copyOfProject(root) {
|
|
140
|
+
const copy = fs.mkdtempSync(path.join(os.tmpdir(), 'ddd-ts-kit-plan-'));
|
|
141
|
+
for (const file of sourceFiles(root)) {
|
|
142
|
+
fs.mkdirSync(path.dirname(path.join(copy, file)), { recursive: true });
|
|
143
|
+
fs.copyFileSync(path.join(root, file), path.join(copy, file));
|
|
144
|
+
}
|
|
145
|
+
return copy;
|
|
146
|
+
}
|
|
147
|
+
/** The files git sees, tracked or not, the ignored ones left out; every file outside the build folders when git does not answer. */
|
|
148
|
+
function sourceFiles(root) {
|
|
149
|
+
const listed = spawnSync('git', ['ls-files', '--cached', '--others', '--exclude-standard', '-z'], {
|
|
150
|
+
cwd: root,
|
|
151
|
+
encoding: 'utf8',
|
|
152
|
+
maxBuffer: 1 << 28,
|
|
153
|
+
});
|
|
154
|
+
if (listed.status === 0) {
|
|
155
|
+
return listed.stdout
|
|
156
|
+
.split('\0')
|
|
157
|
+
.filter((file) => file !== '' && fs.statSync(path.join(root, file), { throwIfNoEntry: false })?.isFile());
|
|
158
|
+
}
|
|
159
|
+
return walk(root, '');
|
|
160
|
+
}
|
|
161
|
+
function walk(root, directory) {
|
|
162
|
+
return fs.readdirSync(path.join(root, directory), { withFileTypes: true }).flatMap((entry) => {
|
|
163
|
+
const relative = path.join(directory, entry.name);
|
|
164
|
+
if (entry.isDirectory()) {
|
|
165
|
+
return NOT_COPIED.has(entry.name) ? [] : walk(root, relative);
|
|
166
|
+
}
|
|
167
|
+
return entry.isFile() ? [relative] : [];
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=planned-words.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planned-words.js","sourceRoot":"","sources":["../../src/plan/planned-words.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,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AC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,EAAE,IAAI,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IAC9G,CAAC;IAED,OAAO,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AACxB,CAAC;AAED,SAAS,IAAI,CAAC,IAAY,EAAE,SAAiB;IAC3C,OAAO,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QAC3F,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QAElD,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,OAAO,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAChE,CAAC;QAED,OAAO,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/plan/wave-plan.d.ts
CHANGED
|
@@ -10,13 +10,23 @@ export interface WavePlan {
|
|
|
10
10
|
readonly mergeOrder: readonly string[];
|
|
11
11
|
/** The rows not done that a planned row of another story depends on, in the order of the file. */
|
|
12
12
|
readonly otherStories: readonly OtherStoryRow[];
|
|
13
|
+
/** The planned commands the generator refused, replayed, for another reason than a word; empty when they were not replayed. */
|
|
14
|
+
readonly notReplayed: readonly NotReplayed[];
|
|
13
15
|
}
|
|
14
16
|
export interface PlanProblem {
|
|
15
|
-
|
|
17
|
+
/** The first four keep the rows from being ordered; a word keeps a row from being run as written. */
|
|
18
|
+
readonly kind: 'cycle' | 'unknown-dependency' | 'no-owner' | 'duplicate-id' | 'undefined-word' | 'technical-word';
|
|
16
19
|
/** The ids involved, in order: the rows of a cycle, a row then the id it names. */
|
|
17
20
|
readonly rows: readonly string[];
|
|
18
21
|
readonly message: string;
|
|
19
22
|
}
|
|
23
|
+
/** A planned command the generator refused when the plan was replayed: the names it would introduce after the refusal are not judged. */
|
|
24
|
+
export interface NotReplayed {
|
|
25
|
+
readonly row: string;
|
|
26
|
+
/** `generate <kind> ...`, as the row writes it. */
|
|
27
|
+
readonly command: string;
|
|
28
|
+
readonly refusal: string;
|
|
29
|
+
}
|
|
20
30
|
/** Wave 1 holds the rows whose dependencies are all done; wave n the rows whose dependencies are done or in earlier waves. */
|
|
21
31
|
export interface Wave {
|
|
22
32
|
readonly wave: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wave-plan.d.ts","sourceRoot":"","sources":["../../src/plan/wave-plan.ts"],"names":[],"mappings":"AAAA,6GAA6G;AAC7G,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,sDAAsD;IACtD,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,sGAAsG;IACtG,QAAQ,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE,CAAC;IAC1C,QAAQ,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,CAAC;IAChC,gFAAgF;IAChF,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,kGAAkG;IAClG,QAAQ,CAAC,YAAY,EAAE,SAAS,aAAa,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"wave-plan.d.ts","sourceRoot":"","sources":["../../src/plan/wave-plan.ts"],"names":[],"mappings":"AAAA,6GAA6G;AAC7G,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IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,+FAA+F;IAC/F,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,qFAAqF;IACrF,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;CACzC"}
|
|
@@ -4,4 +4,8 @@ export { PRISMA_SCHEMA_FOLDER } from './prisma-schema-folder.js';
|
|
|
4
4
|
export { prismaSchemaOf } from './prisma-schema-of.js';
|
|
5
5
|
export { schemaAt } from './schema-at.js';
|
|
6
6
|
export { schemaOfContext } from './schema-of-context.js';
|
|
7
|
+
export { keepsSinglePrismaSchema } from './keeps-single-prisma-schema.js';
|
|
8
|
+
export { SINGLE_PRISMA_SCHEMA } from './single-prisma-schema.js';
|
|
9
|
+
export { singlePrismaSchemaFound } from './single-prisma-schema-found.js';
|
|
10
|
+
export { singlePrismaSchemaSteps } from './single-prisma-schema-steps.js';
|
|
7
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prisma-schema/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prisma-schema/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -4,4 +4,8 @@ export { PRISMA_SCHEMA_FOLDER } from './prisma-schema-folder.js';
|
|
|
4
4
|
export { prismaSchemaOf } from './prisma-schema-of.js';
|
|
5
5
|
export { schemaAt } from './schema-at.js';
|
|
6
6
|
export { schemaOfContext } from './schema-of-context.js';
|
|
7
|
+
export { keepsSinglePrismaSchema } from './keeps-single-prisma-schema.js';
|
|
8
|
+
export { SINGLE_PRISMA_SCHEMA } from './single-prisma-schema.js';
|
|
9
|
+
export { singlePrismaSchemaFound } from './single-prisma-schema-found.js';
|
|
10
|
+
export { singlePrismaSchemaSteps } from './single-prisma-schema-steps.js';
|
|
7
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prisma-schema/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prisma-schema/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether the project keeps its Prisma schema in one file, as versions before 0.95 laid it out:
|
|
3
|
+
* the file is there and the main file of the folder is not. A folder written beside that file
|
|
4
|
+
* would hold a second generator and datasource, and the move into it would find its target taken.
|
|
5
|
+
*/
|
|
6
|
+
export declare function keepsSinglePrismaSchema(exists: (file: string) => boolean): boolean;
|
|
7
|
+
//# sourceMappingURL=keeps-single-prisma-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keeps-single-prisma-schema.d.ts","sourceRoot":"","sources":["../../src/prisma-schema/keeps-single-prisma-schema.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GAAG,OAAO,CAElF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PRISMA_MAIN_SCHEMA } from './prisma-main-schema.js';
|
|
2
|
+
import { SINGLE_PRISMA_SCHEMA } from './single-prisma-schema.js';
|
|
3
|
+
/**
|
|
4
|
+
* Whether the project keeps its Prisma schema in one file, as versions before 0.95 laid it out:
|
|
5
|
+
* the file is there and the main file of the folder is not. A folder written beside that file
|
|
6
|
+
* would hold a second generator and datasource, and the move into it would find its target taken.
|
|
7
|
+
*/
|
|
8
|
+
export function keepsSinglePrismaSchema(exists) {
|
|
9
|
+
return exists(SINGLE_PRISMA_SCHEMA) && !exists(PRISMA_MAIN_SCHEMA);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=keeps-single-prisma-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keeps-single-prisma-schema.js","sourceRoot":"","sources":["../../src/prisma-schema/keeps-single-prisma-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,MAAiC;IACvE,OAAO,MAAM,CAAC,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;AACrE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"single-prisma-schema-found.d.ts","sourceRoot":"","sources":["../../src/prisma-schema/single-prisma-schema-found.ts"],"names":[],"mappings":"AAGA,2GAA2G;AAC3G,wBAAgB,uBAAuB,IAAI,MAAM,CAEhD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PRISMA_SCHEMA_FOLDER } from './prisma-schema-folder.js';
|
|
2
|
+
import { SINGLE_PRISMA_SCHEMA } from './single-prisma-schema.js';
|
|
3
|
+
/** That one file, and what to do with it: what `init` says and what `generate repository` refuses with. */
|
|
4
|
+
export function singlePrismaSchemaFound() {
|
|
5
|
+
return `${SINGLE_PRISMA_SCHEMA} holds the whole Prisma schema, as versions before 0.95 laid it out, where the models of each context now live in a file of their own under ${PRISMA_SCHEMA_FOLDER}/.`;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=single-prisma-schema-found.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"single-prisma-schema-found.js","sourceRoot":"","sources":["../../src/prisma-schema/single-prisma-schema-found.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,2GAA2G;AAC3G,MAAM,UAAU,uBAAuB;IACrC,OAAO,GAAG,oBAAoB,+IAA+I,oBAAoB,IAAI,CAAC;AACxM,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The steps that lay the schema out as 0.95 does, the contexts of the project named: the tables
|
|
3
|
+
* stay the same, so no migration follows.
|
|
4
|
+
*/
|
|
5
|
+
export declare function singlePrismaSchemaSteps(contexts: readonly string[]): string;
|
|
6
|
+
//# sourceMappingURL=single-prisma-schema-steps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"single-prisma-schema-steps.d.ts","sourceRoot":"","sources":["../../src/prisma-schema/single-prisma-schema-steps.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAmB3E"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { PRISMA_MAIN_SCHEMA } from './prisma-main-schema.js';
|
|
2
|
+
import { PRISMA_SCHEMA_FOLDER } from './prisma-schema-folder.js';
|
|
3
|
+
import { prismaSchemaOf } from './prisma-schema-of.js';
|
|
4
|
+
import { schemaOfContext } from './schema-of-context.js';
|
|
5
|
+
import { SINGLE_PRISMA_SCHEMA } from './single-prisma-schema.js';
|
|
6
|
+
/**
|
|
7
|
+
* The steps that lay the schema out as 0.95 does, the contexts of the project named: the tables
|
|
8
|
+
* stay the same, so no migration follows.
|
|
9
|
+
*/
|
|
10
|
+
export function singlePrismaSchemaSteps(contexts) {
|
|
11
|
+
const each = contexts.length === 0
|
|
12
|
+
? `the models and enums of each context (those whose \`@@schema\` is the schema of the context) into ${prismaSchemaOf('<context>')}`
|
|
13
|
+
: contexts
|
|
14
|
+
.map((context) => `the models and enums whose \`@@schema\` is "${schemaOfContext(context)}" into ${prismaSchemaOf(context)}`)
|
|
15
|
+
.join(', ');
|
|
16
|
+
return [
|
|
17
|
+
`To move: \`mkdir ${PRISMA_SCHEMA_FOLDER} && git mv ${SINGLE_PRISMA_SCHEMA} ${PRISMA_MAIN_SCHEMA}\`;`,
|
|
18
|
+
'in that file write the `output` of the generator one level up (`"../../generated/prisma"`);',
|
|
19
|
+
`move out of its \`// ddd-ts-kit:models\` region ${each}, each file holding them between a \`// ddd-ts-kit:models\` and a \`// /ddd-ts-kit:models\` line of its own, then remove the emptied region;`,
|
|
20
|
+
`in prisma.config.ts set \`schema: './${PRISMA_SCHEMA_FOLDER}'\`;`,
|
|
21
|
+
`in the \`db:client\` script of package.json replace \`--to-schema ${SINGLE_PRISMA_SCHEMA}\` by \`--to-schema ${PRISMA_SCHEMA_FOLDER}\`;`,
|
|
22
|
+
'then run `npm run db:client`: the tables are the same, so `npm run db:generate` finds no change and no migration is needed.',
|
|
23
|
+
].join(' ');
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=single-prisma-schema-steps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"single-prisma-schema-steps.js","sourceRoot":"","sources":["../../src/prisma-schema/single-prisma-schema-steps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,QAA2B;IACjE,MAAM,IAAI,GACR,QAAQ,CAAC,MAAM,KAAK,CAAC;QACnB,CAAC,CAAC,qGAAqG,cAAc,CAAC,WAAW,CAAC,EAAE;QACpI,CAAC,CAAC,QAAQ;aACL,GAAG,CACF,CAAC,OAAO,EAAE,EAAE,CACV,+CAA+C,eAAe,CAAC,OAAO,CAAC,UAAU,cAAc,CAAC,OAAO,CAAC,EAAE,CAC7G;aACA,IAAI,CAAC,IAAI,CAAC,CAAC;IAEpB,OAAO;QACL,oBAAoB,oBAAoB,cAAc,oBAAoB,IAAI,kBAAkB,KAAK;QACrG,6FAA6F;QAC7F,mDAAmD,IAAI,8IAA8I;QACrM,wCAAwC,oBAAoB,MAAM;QAClE,qEAAqE,oBAAoB,uBAAuB,oBAAoB,KAAK;QACzI,6HAA6H;KAC9H,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"single-prisma-schema.d.ts","sourceRoot":"","sources":["../../src/prisma-schema/single-prisma-schema.ts"],"names":[],"mappings":"AAAA,6GAA6G;AAC7G,eAAO,MAAM,oBAAoB,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"single-prisma-schema.js","sourceRoot":"","sources":["../../src/prisma-schema/single-prisma-schema.ts"],"names":[],"mappings":"AAAA,6GAA6G;AAC7G,MAAM,CAAC,MAAM,oBAAoB,GAAG,sBAAsB,CAAC"}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.96.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.96.0';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ddd-ts-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.96.0",
|
|
4
4
|
"description": "Bootstrap, scaffold and verify Domain-Driven Design (DDD), Clean Architecture and hexagonal TypeScript backends on Node.js: project and code generators, architecture checks, OpenAPI and AsyncAPI documents, for developers and AI coding agents (Claude Code, Codex, GitHub Copilot).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ddd",
|
|
@@ -52,9 +52,9 @@
|
|
|
52
52
|
"clean:packages": "node dist/bin.js check --clean-only ../kernel/src ../validation/src ../http/src ../tracing/src ../di/src ../events/src ../testing/src ../s3/src ../drizzle/src ../knex/src ../prisma/src ../typeorm/src ../aspects/src ../rabbitmq/src ../auth/src ../audit/src ../redis/src ../scheduling/src ../pino/src ../winston/src ../sentry/src ../kafka/src ../nats/src ../eslint-plugin/src"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@ddd-ts-kit/audit": "^0.
|
|
56
|
-
"@ddd-ts-kit/events": "^0.
|
|
57
|
-
"@ddd-ts-kit/kernel": "^0.
|
|
55
|
+
"@ddd-ts-kit/audit": "^0.96.0",
|
|
56
|
+
"@ddd-ts-kit/events": "^0.96.0",
|
|
57
|
+
"@ddd-ts-kit/kernel": "^0.96.0",
|
|
58
58
|
"@types/pg": "^8.23.1",
|
|
59
59
|
"pg": "^8.23.1"
|
|
60
60
|
}
|
|
@@ -2,6 +2,7 @@ import { describe, expect, it } from '{{tests.module}}';
|
|
|
2
2
|
import { givenEvents } from '@ddd-ts-kit/testing';
|
|
3
3
|
import { {{name.pascal}} } from '{{alias.context}}/domain/aggregates/{{name.kebab}}.aggregate{{alias.ext}}';
|
|
4
4
|
import { {{event.pascal}} } from '{{alias.context}}/domain/events/{{event.kebab}}.event{{alias.ext}}';
|
|
5
|
+
import { {{name.article}}{{name.pascal}} } from '{{alias.context}}/test/builders/{{name.kebab}}.builder{{alias.ext}}';
|
|
5
6
|
|
|
6
7
|
const bornAt = new Date('2026-03-01T00:00:00.000Z');
|
|
7
8
|
|
|
@@ -20,6 +21,13 @@ describe('{{name.pascal}}', () => {
|
|
|
20
21
|
.thenState((loaded) => expect(loaded.version).toBe(1));
|
|
21
22
|
});
|
|
22
23
|
|
|
24
|
+
it('is loaded by its builder in the state its birth gives, recording nothing', () => {
|
|
25
|
+
const loaded = {{name.article}}{{name.pascal}}().identifiedBy('{{name.kebab}}-7').bornAt(bornAt).build();
|
|
26
|
+
|
|
27
|
+
expect(loaded.registeredAt).toEqual(bornAt);
|
|
28
|
+
expect(loaded.pullEvents()).toEqual([]);
|
|
29
|
+
});
|
|
30
|
+
|
|
23
31
|
// TODO(domain): replace each entry below by a test named after the business rule it proves: given the events of a history, when one command, then the events it records (`thenEvents`) or the refusal (`thenError`).
|
|
24
32
|
it.todo('refuses to be born when a birth invariant is violated');
|
|
25
33
|
it.todo('records a fact for each business intention, and changes state only through it');
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
#
|
|
4
|
-
# allowBuilds:
|
|
5
|
-
# '<package>': true
|
|
1
|
+
# pnpm runs the build script of a dependency only when `allowBuilds` names it (`'<package>': true`):
|
|
2
|
+
# init allows those the stack needs, and another one is added the same way, once its script was read.
|
|
6
3
|
#
|
|
7
4
|
# Without this line pnpm refuses to install as long as one script is neither allowed nor refused.
|
|
8
5
|
strictDepBuilds: false
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@biomejs/biome": "2.6.2",
|
|
24
24
|
"@commitlint/cli": "^21.2.3",
|
|
25
25
|
"@commitlint/config-conventional": "^21.2.3",
|
|
26
|
-
"@ddd-ts-kit/eslint-plugin": "^0.
|
|
26
|
+
"@ddd-ts-kit/eslint-plugin": "^0.96.0",
|
|
27
27
|
"@eslint/js": "^10.0.1",
|
|
28
28
|
"@typescript/native": "npm:typescript@~7.0.2",
|
|
29
29
|
"@vitest/coverage-v8": "5.0.3",
|