@slowcook-ai/cli 0.19.0-alpha.16 → 0.19.0-alpha.17
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/dist/commands/extract/index.d.ts.map +1 -1
- package/dist/commands/extract/index.js +23 -1
- package/dist/commands/extract/index.js.map +1 -1
- package/dist/commands/init/templates.d.ts.map +1 -1
- package/dist/commands/init/templates.js +12 -4
- package/dist/commands/init/templates.js.map +1 -1
- package/dist/commands/map/emit-typeorm.d.ts +117 -0
- package/dist/commands/map/emit-typeorm.d.ts.map +1 -0
- package/dist/commands/map/emit-typeorm.js +341 -0
- package/dist/commands/map/emit-typeorm.js.map +1 -0
- package/dist/commands/map/index.d.ts +18 -0
- package/dist/commands/map/index.d.ts.map +1 -1
- package/dist/commands/map/index.js +28 -0
- package/dist/commands/map/index.js.map +1 -1
- package/package.json +10 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/extract/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/extract/index.ts"],"names":[],"mappings":"AA4GA,wBAAsB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAmChF"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { emitSchemaDiagram, emitTokensCatalog } from "../map/index.js";
|
|
1
|
+
import { emitSchemaDiagram, emitTokensCatalog, emitEntitiesDiagram, } from "../map/index.js";
|
|
2
2
|
function parseArgs(argv) {
|
|
3
3
|
const args = {
|
|
4
4
|
repoRoot: process.cwd(),
|
|
5
5
|
schema: false,
|
|
6
6
|
tokens: false,
|
|
7
|
+
entities: false,
|
|
7
8
|
};
|
|
8
9
|
let any = false;
|
|
9
10
|
for (let i = 0; i < argv.length; i++) {
|
|
@@ -21,6 +22,10 @@ function parseArgs(argv) {
|
|
|
21
22
|
args.tokens = true;
|
|
22
23
|
any = true;
|
|
23
24
|
}
|
|
25
|
+
else if (a === "--entities") {
|
|
26
|
+
args.entities = true;
|
|
27
|
+
any = true;
|
|
28
|
+
}
|
|
24
29
|
else if (a === "--help" || a === "-h") {
|
|
25
30
|
printHelp();
|
|
26
31
|
process.exit(0);
|
|
@@ -35,6 +40,7 @@ function parseArgs(argv) {
|
|
|
35
40
|
if (!any) {
|
|
36
41
|
args.schema = true;
|
|
37
42
|
args.tokens = true;
|
|
43
|
+
args.entities = true;
|
|
38
44
|
}
|
|
39
45
|
return args;
|
|
40
46
|
}
|
|
@@ -61,6 +67,13 @@ Targets:
|
|
|
61
67
|
Design-token catalog from :root + @theme blocks in
|
|
62
68
|
**/*.css (skipping node_modules / .next / build dirs).
|
|
63
69
|
Skipped silently when no .css files / no tokens are found.
|
|
70
|
+
--entities .brewing/diagrams/entities.md (0.19.0+ / slowcook#36)
|
|
71
|
+
Mermaid ERD + per-entity table from TypeORM
|
|
72
|
+
**/*.entity.ts files containing @Entity decorators.
|
|
73
|
+
Skipped silently when no entity files are found (e.g.
|
|
74
|
+
Prisma / Drizzle / Supabase consumers). Tracked in git
|
|
75
|
+
by default; the init gitignore template carves out an
|
|
76
|
+
exception for this file.
|
|
64
77
|
|
|
65
78
|
This command does NOT run the ts-morph code-map scan; for that,
|
|
66
79
|
use \`slowcook map generate\`.
|
|
@@ -86,5 +99,14 @@ export async function extract(argv, _cliVersion) {
|
|
|
86
99
|
console.log(`Skipped tokens extract: ${r.skippedReason}`);
|
|
87
100
|
}
|
|
88
101
|
}
|
|
102
|
+
if (args.entities) {
|
|
103
|
+
const r = emitEntitiesDiagram(args.repoRoot);
|
|
104
|
+
if (r.written) {
|
|
105
|
+
console.log(`Wrote .brewing/diagrams/entities.md (${r.entityCount} entities, ${r.relationCount} relations, ${r.fileCount} *.entity.ts file(s) scanned).`);
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
console.log(`Skipped entities extract: ${r.skippedReason}`);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
89
111
|
}
|
|
90
112
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/extract/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/extract/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,iBAAiB,CAAC;AA2BzB,SAAS,SAAS,CAAC,IAAc;IAC/B,MAAM,IAAI,GAAgB;QACxB,QAAQ,EAAE,OAAO,CAAC,GAAG,EAAE;QACvB,MAAM,EAAE,KAAK;QACb,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE,KAAK;KAChB,CAAC;IACF,IAAI,GAAG,GAAG,KAAK,CAAC;IAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACzB,IAAI,CAAC,KAAK,OAAO,IAAI,IAAI,EAAE,CAAC;YAC1B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;YACrB,CAAC,EAAE,CAAC;QACN,CAAC;aAAM,IAAI,CAAC,KAAK,UAAU,EAAE,CAAC;YAC5B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;YACnB,GAAG,GAAG,IAAI,CAAC;QACb,CAAC;aAAM,IAAI,CAAC,KAAK,UAAU,EAAE,CAAC;YAC5B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;YACnB,GAAG,GAAG,IAAI,CAAC;QACb,CAAC;aAAM,IAAI,CAAC,KAAK,YA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iB,IAAI,MAAM,CAmD1C;AAED,wBAAgB,aAAa,IAAI,MAAM,CA0CtC;AAGD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAehE;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAQjE;AAED,wBAAgB,OAAO,IAAI,MAAM,CAEhC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,IAAI,MAAM,CA2CtC;AAED;;;;;;GAMG;AACH;;;;;;GAMG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAsDvC;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAwBzC"}
|
|
@@ -320,10 +320,18 @@ export function gitignoreSection() {
|
|
|
320
320
|
.brewing/code-map.json
|
|
321
321
|
.brewing/code-map.md
|
|
322
322
|
.brewing/code-map.target.md
|
|
323
|
-
# 0.13.5+ — brownfield extracts
|
|
324
|
-
#
|
|
325
|
-
# \`slowcook extract
|
|
326
|
-
.
|
|
323
|
+
# 0.13.5+ — brownfield extracts under .brewing/diagrams/. Ephemeral
|
|
324
|
+
# files (schema.mmd, tokens.md) are regenerated each refine/investigate
|
|
325
|
+
# workflow run via \`slowcook extract\` and SHOULD NOT be committed.
|
|
326
|
+
# Hand-curated artifacts (entities.md, architecture.md, etc.) are
|
|
327
|
+
# source-of-truth and SHOULD be tracked — \`!\` exceptions below
|
|
328
|
+
# whitelist them. The \`/*\` form (vs trailing slash) is required for
|
|
329
|
+
# the !-overrides to take effect.
|
|
330
|
+
.brewing/diagrams/*
|
|
331
|
+
!.brewing/diagrams/entities.md
|
|
332
|
+
!.brewing/diagrams/architecture.md
|
|
333
|
+
!.brewing/diagrams/sequence-*.md
|
|
334
|
+
!.brewing/diagrams/.gitkeep
|
|
327
335
|
${SLOWCOOK_GITIGNORE_MARKER_END}
|
|
328
336
|
`;
|
|
329
337
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.js","sourceRoot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AAO,GAAG,gCAAgC;;;;kCAIV,MAAM,CAAC,KAAK;kCACZ,MAAM,CAAC,KAAK;kCACZ,MAAM,CAAC,KAAK;kCACZ,MAAM,CAAC,KAAK;8CACA,MAAM,CAAC,KAAK;8CACZ,MAAM,CAAC,KAAK;8CACZ,MAAM,CAAC,KAAK;8CACZ,MAAM,CAAC,KAAK;EACxD,8BAA8B;CAC/B,CAAC;AACF,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,MAAsB;IACvD,qEAAqE;IACrE,OAAO;;;;;EAKP,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,OAAO;IACrB,OAAO,EAAE,CAAC;AACZ,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyCR,CAAC;AACF,CAAC;AAED;;;;;;GAMG;AACH;;;;;;GAMG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoDR,CAAC;AACF,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC9B,OAAO,GAAG,+BAA+B;;;;;;;;;;;;;;;;;;;;;EAqBzC,6BAA6B;CAC9B,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 0.19.0+ (slowcook#36) — TypeORM entity-graph extractor. Walks all
|
|
3
|
+
* `**\/*.entity.ts` files containing `@Entity(...)` decorators and emits
|
|
4
|
+
* a Mermaid ERD + per-entity summary table to
|
|
5
|
+
* `.brewing/diagrams/entities.md`.
|
|
6
|
+
*
|
|
7
|
+
* Why: slowcook's existing `emitSchemaDiagram` only knows about
|
|
8
|
+
* `supabase/migrations/*.sql`. Consumers on TypeORM (delgoosh, plus
|
|
9
|
+
* any NestJS monorepo) get nothing from the brownfield-extract step,
|
|
10
|
+
* leaving their slowcook agents (vibe / recipe / brew / chef /
|
|
11
|
+
* investigate) without entity grounding. Hand-curated entities.md
|
|
12
|
+
* is the workaround — this module replaces it with auto-extraction.
|
|
13
|
+
*
|
|
14
|
+
* Detection signal: any `*.entity.ts` file with `@Entity(` decorator.
|
|
15
|
+
* (Skips `node_modules`, `dist`, `.next`, `coverage`.)
|
|
16
|
+
*
|
|
17
|
+
* Parser is regex-based — TypeORM decorators have a strict shape
|
|
18
|
+
* across the ecosystem. Same approach as `ddlToMermaidErd` in
|
|
19
|
+
* refine/mermaid.ts; no AST tooling needed.
|
|
20
|
+
*/
|
|
21
|
+
export interface TypeOrmColumn {
|
|
22
|
+
/** TS property name (camelCase). */
|
|
23
|
+
property: string;
|
|
24
|
+
/** SQL column name (snake_case, from `@Column({ name: 'snake_case' })`). */
|
|
25
|
+
columnName?: string;
|
|
26
|
+
/** TypeORM column type ('uuid', 'text', 'enum', 'jsonb', etc.). */
|
|
27
|
+
columnType?: string;
|
|
28
|
+
/** Whether the column is nullable. */
|
|
29
|
+
nullable?: boolean;
|
|
30
|
+
/** TS type from the property declaration (for context). */
|
|
31
|
+
tsType?: string;
|
|
32
|
+
/** JSDoc COLUMN-DESCRIPTION text, if present. */
|
|
33
|
+
description?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface TypeOrmRelation {
|
|
36
|
+
/** TS property name on the entity. */
|
|
37
|
+
property: string;
|
|
38
|
+
/** Relation kind. */
|
|
39
|
+
kind: "ManyToOne" | "OneToOne" | "OneToMany" | "ManyToMany";
|
|
40
|
+
/** Target entity class name (the `() => User` part). */
|
|
41
|
+
target: string;
|
|
42
|
+
/** Optional foreign-key column name from @JoinColumn. */
|
|
43
|
+
joinColumn?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface TypeOrmEntity {
|
|
46
|
+
/** Class name (PascalCase). */
|
|
47
|
+
className: string;
|
|
48
|
+
/** SQL table name from `@Entity('table_name')`. Falls back to class name in snake_case if missing. */
|
|
49
|
+
tableName: string;
|
|
50
|
+
/** Whether the class `extends BaseEntity`. */
|
|
51
|
+
extendsBaseEntity: boolean;
|
|
52
|
+
/** Repo-relative path to the source file. */
|
|
53
|
+
sourcePath: string;
|
|
54
|
+
/** JSDoc TABLE-DESCRIPTION text, if present. */
|
|
55
|
+
description?: string;
|
|
56
|
+
columns: TypeOrmColumn[];
|
|
57
|
+
relations: TypeOrmRelation[];
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Recursive walk under `root` collecting absolute file paths matching
|
|
61
|
+
* the predicate. Skips EXCLUDED_DIRS at any depth.
|
|
62
|
+
*/
|
|
63
|
+
declare function walk(root: string, predicate: (path: string) => boolean): string[];
|
|
64
|
+
/**
|
|
65
|
+
* Find all `*.entity.ts` files under `repoRoot` whose content contains
|
|
66
|
+
* an `@Entity(` decorator. Returns paths sorted alphabetically for
|
|
67
|
+
* deterministic output.
|
|
68
|
+
*/
|
|
69
|
+
export declare function findEntityFiles(repoRoot: string): string[];
|
|
70
|
+
/**
|
|
71
|
+
* Parse one TypeORM entity source file. Returns null if no `@Entity`
|
|
72
|
+
* decorator is found (defense-in-depth — findEntityFiles already
|
|
73
|
+
* filtered).
|
|
74
|
+
*/
|
|
75
|
+
export declare function parseEntityFile(source: string, sourcePath: string): TypeOrmEntity | null;
|
|
76
|
+
/**
|
|
77
|
+
* Render one Mermaid `erDiagram` covering all entities + their
|
|
78
|
+
* relations. For very large graphs (>40 entities) the diagram is hard
|
|
79
|
+
* to read — but splitting by domain requires semantic knowledge we
|
|
80
|
+
* don't have. We render one big ERD; consumers can grep for entities
|
|
81
|
+
* they care about + use the per-entity table below for details.
|
|
82
|
+
*/
|
|
83
|
+
export declare function entitiesToMermaidErd(entities: TypeOrmEntity[]): string;
|
|
84
|
+
/**
|
|
85
|
+
* Render the per-entity summary table for the entities.md artifact.
|
|
86
|
+
* Pairs with the Mermaid ERD above to give agents structured access
|
|
87
|
+
* to the entity vocabulary.
|
|
88
|
+
*/
|
|
89
|
+
export declare function entitiesToSummaryTable(entities: TypeOrmEntity[]): string;
|
|
90
|
+
/**
|
|
91
|
+
* Full entities.md document body. Static header + conventions section
|
|
92
|
+
* (drawn from delgoosh dogfood — these are the same conventions every
|
|
93
|
+
* NestJS+TypeORM consumer follows) + the ERD + summary table.
|
|
94
|
+
*/
|
|
95
|
+
export declare function renderEntitiesMarkdown(entities: TypeOrmEntity[]): string;
|
|
96
|
+
/**
|
|
97
|
+
* Public entry — walks the repo, parses entities, returns the rendered
|
|
98
|
+
* markdown body PLUS counts for the caller (which writes the file).
|
|
99
|
+
* Skipped silently if no .entity.ts files with @Entity are found —
|
|
100
|
+
* consumer probably uses Prisma / Drizzle / Supabase / raw SQL.
|
|
101
|
+
*/
|
|
102
|
+
export declare function buildEntitiesArtifact(repoRoot: string): {
|
|
103
|
+
written: boolean;
|
|
104
|
+
body?: string;
|
|
105
|
+
entityCount?: number;
|
|
106
|
+
relationCount?: number;
|
|
107
|
+
fileCount?: number;
|
|
108
|
+
skippedReason?: string;
|
|
109
|
+
};
|
|
110
|
+
export declare const __testOnly__: {
|
|
111
|
+
parseEntityFile: typeof parseEntityFile;
|
|
112
|
+
walk: typeof walk;
|
|
113
|
+
entitiesToMermaidErd: typeof entitiesToMermaidErd;
|
|
114
|
+
entitiesToSummaryTable: typeof entitiesToSummaryTable;
|
|
115
|
+
};
|
|
116
|
+
export {};
|
|
117
|
+
//# sourceMappingURL=emit-typeorm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emit-typeorm.d.ts","sourceRoot":"","sources":["../../../src/commands/map/emit-typeorm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAgBH,MAAM,WAAW,aAAa;IAC5B,oCAAoC;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,4EAA4E;IAC5E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mEAAmE;IACnE,UAAU,CAAC,EAAE,MA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AQ,EAAE,aAAa,EAAE,GAAG,MAAM,CAwBxE;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,aAAa,EAAE,GAAG,MAAM,CAwCxE;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG;IACvD,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAmCA;AAGD,eAAO,MAAM,YAAY;;;;;CAKxB,CAAC"}
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 0.19.0+ (slowcook#36) — TypeORM entity-graph extractor. Walks all
|
|
3
|
+
* `**\/*.entity.ts` files containing `@Entity(...)` decorators and emits
|
|
4
|
+
* a Mermaid ERD + per-entity summary table to
|
|
5
|
+
* `.brewing/diagrams/entities.md`.
|
|
6
|
+
*
|
|
7
|
+
* Why: slowcook's existing `emitSchemaDiagram` only knows about
|
|
8
|
+
* `supabase/migrations/*.sql`. Consumers on TypeORM (delgoosh, plus
|
|
9
|
+
* any NestJS monorepo) get nothing from the brownfield-extract step,
|
|
10
|
+
* leaving their slowcook agents (vibe / recipe / brew / chef /
|
|
11
|
+
* investigate) without entity grounding. Hand-curated entities.md
|
|
12
|
+
* is the workaround — this module replaces it with auto-extraction.
|
|
13
|
+
*
|
|
14
|
+
* Detection signal: any `*.entity.ts` file with `@Entity(` decorator.
|
|
15
|
+
* (Skips `node_modules`, `dist`, `.next`, `coverage`.)
|
|
16
|
+
*
|
|
17
|
+
* Parser is regex-based — TypeORM decorators have a strict shape
|
|
18
|
+
* across the ecosystem. Same approach as `ddlToMermaidErd` in
|
|
19
|
+
* refine/mermaid.ts; no AST tooling needed.
|
|
20
|
+
*/
|
|
21
|
+
import { readdirSync, readFileSync, statSync } from "node:fs";
|
|
22
|
+
import { join, basename } from "node:path";
|
|
23
|
+
/** Skip these directories on the recursive walk. */
|
|
24
|
+
const EXCLUDED_DIRS = new Set([
|
|
25
|
+
"node_modules",
|
|
26
|
+
"dist",
|
|
27
|
+
".next",
|
|
28
|
+
".turbo",
|
|
29
|
+
"coverage",
|
|
30
|
+
".git",
|
|
31
|
+
"build",
|
|
32
|
+
]);
|
|
33
|
+
/**
|
|
34
|
+
* Recursive walk under `root` collecting absolute file paths matching
|
|
35
|
+
* the predicate. Skips EXCLUDED_DIRS at any depth.
|
|
36
|
+
*/
|
|
37
|
+
function walk(root, predicate) {
|
|
38
|
+
const out = [];
|
|
39
|
+
const stack = [root];
|
|
40
|
+
while (stack.length > 0) {
|
|
41
|
+
const dir = stack.pop();
|
|
42
|
+
let entries;
|
|
43
|
+
try {
|
|
44
|
+
entries = readdirSync(dir);
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
for (const entry of entries) {
|
|
50
|
+
if (EXCLUDED_DIRS.has(entry))
|
|
51
|
+
continue;
|
|
52
|
+
const path = join(dir, entry);
|
|
53
|
+
let st;
|
|
54
|
+
try {
|
|
55
|
+
st = statSync(path);
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
if (st.isDirectory()) {
|
|
61
|
+
stack.push(path);
|
|
62
|
+
}
|
|
63
|
+
else if (st.isFile() && predicate(path)) {
|
|
64
|
+
out.push(path);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return out;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Find all `*.entity.ts` files under `repoRoot` whose content contains
|
|
72
|
+
* an `@Entity(` decorator. Returns paths sorted alphabetically for
|
|
73
|
+
* deterministic output.
|
|
74
|
+
*/
|
|
75
|
+
export function findEntityFiles(repoRoot) {
|
|
76
|
+
const candidates = walk(repoRoot, (p) => p.endsWith(".entity.ts"));
|
|
77
|
+
const real = candidates.filter((p) => {
|
|
78
|
+
try {
|
|
79
|
+
const src = readFileSync(p, "utf8");
|
|
80
|
+
return /@Entity\s*\(/.test(src);
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
real.sort();
|
|
87
|
+
return real;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Parse one TypeORM entity source file. Returns null if no `@Entity`
|
|
91
|
+
* decorator is found (defense-in-depth — findEntityFiles already
|
|
92
|
+
* filtered).
|
|
93
|
+
*/
|
|
94
|
+
export function parseEntityFile(source, sourcePath) {
|
|
95
|
+
// Class name + extends BaseEntity check.
|
|
96
|
+
const classMatch = source.match(/export\s+class\s+(\w+)(?:\s+extends\s+(\w+))?/);
|
|
97
|
+
if (!classMatch)
|
|
98
|
+
return null;
|
|
99
|
+
const className = classMatch[1];
|
|
100
|
+
const extendsBaseEntity = classMatch[2] === "BaseEntity";
|
|
101
|
+
// Table name from @Entity('snake_case_plural'). Fallback to className.
|
|
102
|
+
const entityMatch = source.match(/@Entity\s*\(\s*['"]([^'"]+)['"]\s*\)/);
|
|
103
|
+
const tableName = entityMatch?.[1] ??
|
|
104
|
+
className
|
|
105
|
+
.replace(/([a-z0-9])([A-Z])/g, "$1_$2")
|
|
106
|
+
.toLowerCase();
|
|
107
|
+
// JSDoc above the class (TABLE-DESCRIPTION: ...).
|
|
108
|
+
const tableDescMatch = source.match(/TABLE-DESCRIPTION:\s*([^\n*]+?)(?:\s*\*\/|\s*\n\s*\*\s*TABLE-)/);
|
|
109
|
+
const description = tableDescMatch?.[1]?.trim();
|
|
110
|
+
// Columns: @Column(...) followed by `[public ]<property>: <type>`.
|
|
111
|
+
// The decorator may span multiple lines; we capture the args block in
|
|
112
|
+
// a balanced way using a permissive `[^@]*?` lookahead — fine because
|
|
113
|
+
// the next `@` always opens the next decorator or the property.
|
|
114
|
+
const columns = [];
|
|
115
|
+
const columnRe = /@Column\s*\(\s*(\{[\s\S]*?\})\s*\)\s*(?:public\s+|readonly\s+)?(\w+)\s*[?!]?\s*:\s*([^;]+);/g;
|
|
116
|
+
let cm;
|
|
117
|
+
while ((cm = columnRe.exec(source)) !== null) {
|
|
118
|
+
const [, args, property, tsType] = cm;
|
|
119
|
+
columns.push({
|
|
120
|
+
property: property,
|
|
121
|
+
columnName: args.match(/name:\s*['"]([^'"]+)['"]/)?.[1],
|
|
122
|
+
columnType: args.match(/type:\s*['"]([^'"]+)['"]/)?.[1],
|
|
123
|
+
nullable: /nullable:\s*true/.test(args),
|
|
124
|
+
tsType: tsType.trim(),
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
// Also catch bare `@Column()` (no args) — TypeORM allows this.
|
|
128
|
+
const bareColumnRe = /@Column\s*\(\s*\)\s*(?:public\s+|readonly\s+)?(\w+)\s*[?!]?\s*:\s*([^;]+);/g;
|
|
129
|
+
while ((cm = bareColumnRe.exec(source)) !== null) {
|
|
130
|
+
const [, property, tsType] = cm;
|
|
131
|
+
columns.push({
|
|
132
|
+
property: property,
|
|
133
|
+
tsType: tsType.trim(),
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
// Relations: @ManyToOne / @OneToOne / @OneToMany / @ManyToMany.
|
|
137
|
+
const relations = [];
|
|
138
|
+
const relRe = /@(ManyToOne|OneToOne|OneToMany|ManyToMany)\s*\(\s*\(\)\s*=>\s*(\w+)[\s\S]*?\)\s*(?:@JoinColumn\s*\(\s*\{?\s*(?:name:\s*['"]([^'"]+)['"])?[^}]*\}?\s*\)\s*)?(?:public\s+|readonly\s+)?(\w+)/g;
|
|
139
|
+
let rm;
|
|
140
|
+
while ((rm = relRe.exec(source)) !== null) {
|
|
141
|
+
const [, kind, target, joinColumn, property] = rm;
|
|
142
|
+
relations.push({
|
|
143
|
+
property: property,
|
|
144
|
+
kind: kind,
|
|
145
|
+
target: target,
|
|
146
|
+
joinColumn,
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
return {
|
|
150
|
+
className,
|
|
151
|
+
tableName,
|
|
152
|
+
extendsBaseEntity,
|
|
153
|
+
sourcePath,
|
|
154
|
+
description,
|
|
155
|
+
columns,
|
|
156
|
+
relations,
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Mermaid relation shape per TypeORM kind.
|
|
161
|
+
* ManyToOne N owners → 1 target → `}o--||`
|
|
162
|
+
* OneToOne 1 owner → 1 target → `||--o|`
|
|
163
|
+
* OneToMany 1 owner → 0..N targets → `||--o{`
|
|
164
|
+
* ManyToMany N owners → N targets → `}o--o{`
|
|
165
|
+
*/
|
|
166
|
+
const RELATION_SHAPES = {
|
|
167
|
+
ManyToOne: "}o--||",
|
|
168
|
+
OneToOne: "||--o|",
|
|
169
|
+
OneToMany: "||--o{",
|
|
170
|
+
ManyToMany: "}o--o{",
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* Render one Mermaid `erDiagram` covering all entities + their
|
|
174
|
+
* relations. For very large graphs (>40 entities) the diagram is hard
|
|
175
|
+
* to read — but splitting by domain requires semantic knowledge we
|
|
176
|
+
* don't have. We render one big ERD; consumers can grep for entities
|
|
177
|
+
* they care about + use the per-entity table below for details.
|
|
178
|
+
*/
|
|
179
|
+
export function entitiesToMermaidErd(entities) {
|
|
180
|
+
if (entities.length === 0) {
|
|
181
|
+
return "```mermaid\nerDiagram\n %% No @Entity decorators found.\n```";
|
|
182
|
+
}
|
|
183
|
+
const lines = ["```mermaid", "erDiagram"];
|
|
184
|
+
const known = new Set(entities.map((e) => e.className));
|
|
185
|
+
for (const e of entities) {
|
|
186
|
+
for (const r of e.relations) {
|
|
187
|
+
// Skip relations whose target isn't a known entity (e.g. enum types).
|
|
188
|
+
if (!known.has(r.target))
|
|
189
|
+
continue;
|
|
190
|
+
const label = r.property.replace(/"/g, "");
|
|
191
|
+
lines.push(` ${e.className} ${RELATION_SHAPES[r.kind]} ${r.target} : "${label}"`);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
// Always render entity boxes even with no columns (helps when a
|
|
195
|
+
// class only has relations, e.g. junction tables).
|
|
196
|
+
for (const e of entities) {
|
|
197
|
+
lines.push(` ${e.className} {`);
|
|
198
|
+
// Show only NOTABLE columns: anything that looks like an FK or
|
|
199
|
+
// status enum or has a tableName (the rest belong in the per-
|
|
200
|
+
// entity table below). Cap at 6 to keep diagram readable.
|
|
201
|
+
const notable = e.columns
|
|
202
|
+
.filter((c) => c.columnName?.endsWith("_id") || c.columnType === "enum")
|
|
203
|
+
.slice(0, 6);
|
|
204
|
+
if (notable.length === 0) {
|
|
205
|
+
// Show the first ~3 columns so the box isn't empty.
|
|
206
|
+
for (const c of e.columns.slice(0, 3)) {
|
|
207
|
+
lines.push(` ${c.columnType ?? "any"} ${c.columnName ?? c.property}`);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
for (const c of notable) {
|
|
212
|
+
const t = c.columnType ?? "any";
|
|
213
|
+
lines.push(` ${t} ${c.columnName ?? c.property}`);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
lines.push(` }`);
|
|
217
|
+
}
|
|
218
|
+
lines.push("```");
|
|
219
|
+
return lines.join("\n");
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Render the per-entity summary table for the entities.md artifact.
|
|
223
|
+
* Pairs with the Mermaid ERD above to give agents structured access
|
|
224
|
+
* to the entity vocabulary.
|
|
225
|
+
*/
|
|
226
|
+
export function entitiesToSummaryTable(entities) {
|
|
227
|
+
const lines = [];
|
|
228
|
+
lines.push("| Entity | Table | Purpose | Key relations | Notable columns |");
|
|
229
|
+
lines.push("|---|---|---|---|---|");
|
|
230
|
+
for (const e of entities) {
|
|
231
|
+
const purpose = (e.description ?? "—").replace(/\|/g, "\\|");
|
|
232
|
+
const relations = e.relations
|
|
233
|
+
.slice(0, 4)
|
|
234
|
+
.map((r) => `${r.kind} ${r.target}`)
|
|
235
|
+
.join("; ") || "—";
|
|
236
|
+
const notableCols = e.columns
|
|
237
|
+
.filter((c) => c.columnName?.endsWith("_id") || c.columnType === "enum")
|
|
238
|
+
.slice(0, 5)
|
|
239
|
+
.map((c) => c.columnName ?? c.property)
|
|
240
|
+
.join(", ") || "—";
|
|
241
|
+
lines.push(`| ${e.className} | \`${e.tableName}\` | ${purpose} | ${relations} | ${notableCols} |`);
|
|
242
|
+
}
|
|
243
|
+
return lines.join("\n");
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Full entities.md document body. Static header + conventions section
|
|
247
|
+
* (drawn from delgoosh dogfood — these are the same conventions every
|
|
248
|
+
* NestJS+TypeORM consumer follows) + the ERD + summary table.
|
|
249
|
+
*/
|
|
250
|
+
export function renderEntitiesMarkdown(entities) {
|
|
251
|
+
const baseEntityHits = entities.filter((e) => e.extendsBaseEntity).length;
|
|
252
|
+
const baseEntityHint = baseEntityHits > 0
|
|
253
|
+
? `${baseEntityHits} of ${entities.length} entities \`extend BaseEntity\` — assume the same UUID-id + soft-delete pattern when adding new entities.`
|
|
254
|
+
: "No `BaseEntity` parent class detected — entities define their own primary keys.";
|
|
255
|
+
return `# Entity graph (auto-generated by \`slowcook extract --entities\`)
|
|
256
|
+
|
|
257
|
+
> **Auto-generated; do not hand-edit.** Regenerate by running \`slowcook extract --entities\`.
|
|
258
|
+
> Source: \`*.entity.ts\` files containing an \`@Entity(\` decorator.
|
|
259
|
+
|
|
260
|
+
This artifact is consumed by slowcook agents (vibe / recipe / brew / chef / investigate) to ground their work in the existing entity vocabulary. Without it agents hallucinate table shapes and column names.
|
|
261
|
+
|
|
262
|
+
## Quick stats
|
|
263
|
+
|
|
264
|
+
- **${entities.length} entities** discovered
|
|
265
|
+
- **${entities.reduce((n, e) => n + e.relations.length, 0)} relations** declared
|
|
266
|
+
- ${baseEntityHint}
|
|
267
|
+
|
|
268
|
+
## Conventions (inferred from the codebase)
|
|
269
|
+
|
|
270
|
+
- Tables follow snake_case_plural (e.g. \`@Entity('patients')\`).
|
|
271
|
+
- TS properties are camelCase; SQL columns are snake_case via \`@Column({ name: 'snake_case' })\`.
|
|
272
|
+
- Foreign keys follow the \`<foreign_table_singular>_id\` pattern.
|
|
273
|
+
- Enum columns reference \`@Column({ type: 'enum', enum: <EnumFromRepoEnums> })\`.
|
|
274
|
+
- Relations are declared via \`@ManyToOne\` / \`@OneToOne\` / \`@OneToMany\` / \`@ManyToMany\` + \`@JoinColumn\`.
|
|
275
|
+
|
|
276
|
+
## Entity-relationship diagram
|
|
277
|
+
|
|
278
|
+
${entitiesToMermaidErd(entities)}
|
|
279
|
+
|
|
280
|
+
## Per-entity summary
|
|
281
|
+
|
|
282
|
+
${entitiesToSummaryTable(entities)}
|
|
283
|
+
|
|
284
|
+
## Source paths
|
|
285
|
+
|
|
286
|
+
${entities.map((e) => `- \`${e.sourcePath}\` — \`${e.className}\``).join("\n")}
|
|
287
|
+
`;
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Public entry — walks the repo, parses entities, returns the rendered
|
|
291
|
+
* markdown body PLUS counts for the caller (which writes the file).
|
|
292
|
+
* Skipped silently if no .entity.ts files with @Entity are found —
|
|
293
|
+
* consumer probably uses Prisma / Drizzle / Supabase / raw SQL.
|
|
294
|
+
*/
|
|
295
|
+
export function buildEntitiesArtifact(repoRoot) {
|
|
296
|
+
const files = findEntityFiles(repoRoot);
|
|
297
|
+
if (files.length === 0) {
|
|
298
|
+
return {
|
|
299
|
+
written: false,
|
|
300
|
+
skippedReason: "no `*.entity.ts` files with `@Entity(...)` decorator found (TypeORM signal absent)",
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
const entities = [];
|
|
304
|
+
for (const f of files) {
|
|
305
|
+
try {
|
|
306
|
+
const src = readFileSync(f, "utf8");
|
|
307
|
+
const repoRelative = f.startsWith(repoRoot)
|
|
308
|
+
? f.slice(repoRoot.length + 1)
|
|
309
|
+
: f;
|
|
310
|
+
const e = parseEntityFile(src, repoRelative);
|
|
311
|
+
if (e)
|
|
312
|
+
entities.push(e);
|
|
313
|
+
}
|
|
314
|
+
catch {
|
|
315
|
+
// Skip unreadable files silently.
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
if (entities.length === 0) {
|
|
319
|
+
return {
|
|
320
|
+
written: false,
|
|
321
|
+
skippedReason: `${files.length} candidate file(s) found but none parsed cleanly`,
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
return {
|
|
325
|
+
written: true,
|
|
326
|
+
body: renderEntitiesMarkdown(entities),
|
|
327
|
+
entityCount: entities.length,
|
|
328
|
+
relationCount: entities.reduce((n, e) => n + e.relations.length, 0),
|
|
329
|
+
fileCount: files.length,
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
// Test-only helper. Avoids exporting internals to the public surface.
|
|
333
|
+
export const __testOnly__ = {
|
|
334
|
+
parseEntityFile,
|
|
335
|
+
walk,
|
|
336
|
+
entitiesToMermaidErd,
|
|
337
|
+
entitiesToSummaryTable,
|
|
338
|
+
};
|
|
339
|
+
// Avoid unused-import warning on `basename` if not used above.
|
|
340
|
+
void basename;
|
|
341
|
+
//# sourceMappingURL=emit-typeorm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emit-typeorm.js","sourceRoot":"","sources":["../../../src/commands/map/emit-typeorm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE3C,oDAAoD;AACpD,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC;IAC5B,cAAc;IACd,MAAM;IACN,OAAO;IACP,QAAQ;IACR,UAAU;IACV,MAAM;IACN,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;YAC7C,IAAI,CAAC;gBAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC1B,CAAC;QAAC,MAAM,CAAC;YACP,kCAAkC;QACpC,CAAC;IACH,CAAC;IACD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO;YACL,OAAO,EAAE,KAAK;YACd,aAAa,EAAE,GAAG,KAAK,CAAC,MAAM,kDAAkD;SACjF,CAAC;IACJ,CAAC;IACD,OAAO;QACL,OAAO,EAAE,IAAI;QACb,IAAI,EAAE,sBAAsB,CAAC,QAAQ,CAAC;QACtC,WAAW,EAAE,QAAQ,CAAC,MAAM;QAC5B,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC;QACnE,SAAS,EAAE,KAAK,CAAC,MAAM;KACxB,CAAC;AACJ,CAAC;AAED,sEAAsE;AACtE,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,eAAe;IACf,IAAI;IACJ,oBAAoB;IACpB,sBAAsB;CACvB,CAAC;AAEF,+DAA+D;AAC/D,KAAK,QAAQ,CAAC"}
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
import type { CodeMap } from "./scan.js";
|
|
2
2
|
export { emitTokensCatalog } from "./emit-tokens.js";
|
|
3
|
+
export { buildEntitiesArtifact } from "./emit-typeorm.js";
|
|
4
|
+
/**
|
|
5
|
+
* 0.19.0+ (slowcook#36) — TypeORM entity-graph emitter. Mirrors
|
|
6
|
+
* `emitSchemaDiagram`'s shape for the (different) Supabase-migration
|
|
7
|
+
* source. Skipped silently when no `*.entity.ts` files with `@Entity(`
|
|
8
|
+
* decorators are found — not every consumer uses TypeORM.
|
|
9
|
+
*
|
|
10
|
+
* Output: `.brewing/diagrams/entities.md` (Mermaid ERD + per-entity
|
|
11
|
+
* summary + agent-facing conventions header). Tracked in git by
|
|
12
|
+
* default per the updated init gitignore template (slowcook#38).
|
|
13
|
+
*/
|
|
14
|
+
export declare function emitEntitiesDiagram(repoRoot: string): {
|
|
15
|
+
written: boolean;
|
|
16
|
+
entityCount?: number;
|
|
17
|
+
relationCount?: number;
|
|
18
|
+
fileCount?: number;
|
|
19
|
+
skippedReason?: string;
|
|
20
|
+
};
|
|
3
21
|
export declare function map(argv: string[], cliVersion: string): Promise<void>;
|
|
4
22
|
export declare function writeFreshMap(repoRoot: string, outJson: string, outMd: string, fresh: CodeMap): void;
|
|
5
23
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/map/index.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/map/index.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG;IACrD,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAeA;AAuFD,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA6E3E;AAED,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,OAAO,GACb,IAAI,CAMN;AAWD;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG;IACnD,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAuBA"}
|
|
@@ -4,7 +4,35 @@ import { generateMap } from "./scan.js";
|
|
|
4
4
|
import { renderJson, renderMarkdown, mapsEqual, CODE_MAP_JSON_PATH, CODE_MAP_MD_PATH, } from "./render.js";
|
|
5
5
|
import { ddlToMermaidErd } from "../refine/mermaid.js";
|
|
6
6
|
import { emitTokensCatalog } from "./emit-tokens.js";
|
|
7
|
+
import { buildEntitiesArtifact } from "./emit-typeorm.js";
|
|
7
8
|
export { emitTokensCatalog } from "./emit-tokens.js";
|
|
9
|
+
export { buildEntitiesArtifact } from "./emit-typeorm.js";
|
|
10
|
+
/**
|
|
11
|
+
* 0.19.0+ (slowcook#36) — TypeORM entity-graph emitter. Mirrors
|
|
12
|
+
* `emitSchemaDiagram`'s shape for the (different) Supabase-migration
|
|
13
|
+
* source. Skipped silently when no `*.entity.ts` files with `@Entity(`
|
|
14
|
+
* decorators are found — not every consumer uses TypeORM.
|
|
15
|
+
*
|
|
16
|
+
* Output: `.brewing/diagrams/entities.md` (Mermaid ERD + per-entity
|
|
17
|
+
* summary + agent-facing conventions header). Tracked in git by
|
|
18
|
+
* default per the updated init gitignore template (slowcook#38).
|
|
19
|
+
*/
|
|
20
|
+
export function emitEntitiesDiagram(repoRoot) {
|
|
21
|
+
const r = buildEntitiesArtifact(repoRoot);
|
|
22
|
+
if (!r.written || !r.body) {
|
|
23
|
+
return { written: false, skippedReason: r.skippedReason };
|
|
24
|
+
}
|
|
25
|
+
const outDir = join(repoRoot, ".brewing/diagrams");
|
|
26
|
+
mkdirSync(outDir, { recursive: true });
|
|
27
|
+
const outPath = join(outDir, "entities.md");
|
|
28
|
+
writeFileSync(outPath, r.body, "utf8");
|
|
29
|
+
return {
|
|
30
|
+
written: true,
|
|
31
|
+
entityCount: r.entityCount,
|
|
32
|
+
relationCount: r.relationCount,
|
|
33
|
+
fileCount: r.fileCount,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
8
36
|
function parseArgs(argv) {
|
|
9
37
|
const args = {
|
|
10
38
|
subcommand: "generate",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/map/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC1F,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EACL,UAAU,EACV,cAAc,EACd,SAAS,EACT,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/map/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC1F,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EACL,UAAU,EACV,cAAc,EACd,SAAS,EACT,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,iBA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AC3C,MAAM,MAAM,GACV,0FAA0F;QAC1F,gBAAgB,KAAK,CAAC,MAAM,wDAAwD,CAAC;IACvF,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,EAAE,MAAM,CAAC,CAAC;IACxD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,eAAe,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;AACvE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slowcook-ai/cli",
|
|
3
|
-
"version": "0.19.0-alpha.
|
|
3
|
+
"version": "0.19.0-alpha.17",
|
|
4
4
|
"description": "CLI for the slowcook brewing harness",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "aminazar",
|
|
@@ -35,17 +35,17 @@
|
|
|
35
35
|
"AGENTS.md"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@anthropic-ai/sdk": "^0.
|
|
39
|
-
"@octokit/rest": "^
|
|
40
|
-
"ts-morph": "^
|
|
41
|
-
"yaml": "^2.
|
|
42
|
-
"zod": "^
|
|
38
|
+
"@anthropic-ai/sdk": "^0.95.2",
|
|
39
|
+
"@octokit/rest": "^22.0.1",
|
|
40
|
+
"ts-morph": "^28.0.0",
|
|
41
|
+
"yaml": "^2.9.0",
|
|
42
|
+
"zod": "^4.4.3",
|
|
43
43
|
"@slowcook-ai/core": "^0.13.0",
|
|
44
44
|
"@slowcook-ai/stack-ts": "^0.9.9-alpha.0",
|
|
45
|
-
"@slowcook-ai/
|
|
46
|
-
"@slowcook-ai/
|
|
47
|
-
"@slowcook-ai/
|
|
48
|
-
"@slowcook-ai/
|
|
45
|
+
"@slowcook-ai/llm-anthropic": "^0.16.0-alpha.2",
|
|
46
|
+
"@slowcook-ai/recorder": "^0.9.1",
|
|
47
|
+
"@slowcook-ai/forge-github": "^0.12.1",
|
|
48
|
+
"@slowcook-ai/review-overlay": "^0.5.5"
|
|
49
49
|
},
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public"
|