@aprimediet/codewalker 1.2.0 → 1.4.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.
@@ -0,0 +1,99 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import { renderNoteCard, parseNoteCard } from './notes-cards.ts';
3
+ import type { Note } from './types.ts';
4
+
5
+ function makeNote(overrides: Partial<Note> = {}): Note {
6
+ return {
7
+ note_kind: 'glossary',
8
+ title: 'Idempotency Key',
9
+ body: 'A client-supplied key that makes a retried POST safe to replay.',
10
+ tags: 'api, payments',
11
+ related: 'createCharge, charge.ts:88-140',
12
+ card_path: '',
13
+ ...overrides,
14
+ };
15
+ }
16
+
17
+ describe('renderNoteCard', () => {
18
+ it('renders a glossary note with frontmatter head', () => {
19
+ const note = makeNote();
20
+ const md = renderNoteCard(note);
21
+
22
+ expect(md).toContain('---');
23
+ expect(md).toContain('note_kind: glossary');
24
+ expect(md).toContain('title: Idempotency Key');
25
+ expect(md).toContain('tags: api, payments');
26
+ expect(md).toContain('related: createCharge, charge.ts:88-140');
27
+ expect(md).toContain('summary: A client-supplied key that makes a retried POST safe to replay.');
28
+
29
+ // Body
30
+ expect(md).toContain('# Idempotency Key');
31
+ expect(md).toContain(note.body);
32
+ });
33
+
34
+ it('renders a decision note', () => {
35
+ const note = makeNote({
36
+ note_kind: 'decision',
37
+ title: 'Use SQLite over ChromaDB',
38
+ body: 'We chose SQLite+FTS5 because the agent can expand queries itself.',
39
+ tags: 'tech-decision, database',
40
+ related: 'docs/tech-decision.md',
41
+ });
42
+ const md = renderNoteCard(note);
43
+ expect(md).toContain('note_kind: decision');
44
+ expect(md).toContain('title: Use SQLite over ChromaDB');
45
+ expect(md).toContain('tags: tech-decision, database');
46
+ expect(md).toContain('related: docs/tech-decision.md');
47
+ expect(md).toContain('# Use SQLite over ChromaDB');
48
+ expect(md).toContain(note.body);
49
+ });
50
+
51
+ it('sanitizes newlines in head fields', () => {
52
+ const note = makeNote({
53
+ title: 'Multi\nline',
54
+ });
55
+
56
+ const md = renderNoteCard(note);
57
+ // title should not have raw newlines in frontmatter
58
+ const fmMatch = md.match(/^title: (.+)$/m);
59
+ expect(fmMatch).not.toBeNull();
60
+ expect(fmMatch![1]!).not.toContain('\n');
61
+ });
62
+
63
+ it('uses body first line as summary', () => {
64
+ const note = makeNote();
65
+ const md = renderNoteCard(note);
66
+ // The first line of body should appear as summary
67
+ expect(md).toContain('summary: A client-supplied key that makes a retried POST safe to replay.');
68
+ });
69
+ });
70
+
71
+ describe('parseNoteCard', () => {
72
+ it('round-trips renderNoteCard -> parseNoteCard preserving head fields', () => {
73
+ const note = makeNote();
74
+ const md = renderNoteCard(note);
75
+ const parsed = parseNoteCard(md);
76
+ expect(parsed).not.toBeNull();
77
+ expect(parsed!.note_kind).toBe('glossary');
78
+ expect(parsed!.title).toBe('Idempotency Key');
79
+ expect(parsed!.tags).toBe('api, payments');
80
+ expect(parsed!.related).toBe('createCharge, charge.ts:88-140');
81
+ // summary from body first line
82
+ expect(parsed!.summary).toBeTruthy();
83
+ });
84
+
85
+ it('returns null for invalid markdown', () => {
86
+ expect(parseNoteCard('no frontmatter')).toBeNull();
87
+ expect(parseNoteCard('')).toBeNull();
88
+ });
89
+
90
+ it('returns null for card without note_kind in frontmatter', () => {
91
+ const md = `---
92
+ name: foo
93
+ kind: function
94
+ ---
95
+ # foo
96
+ `;
97
+ expect(parseNoteCard(md)).toBeNull();
98
+ });
99
+ });
@@ -0,0 +1,92 @@
1
+ /**
2
+ * Note (glossary/decision) card rendering and parsing for codewalker v1.3.
3
+ *
4
+ * PURE module — no I/O. Renders a Note into a markdown card
5
+ * with frontmatter head (note_kind, title, tags, related, summary) and body.
6
+ *
7
+ * Cards live at entries/glossary/<slug>.md and entries/decisions/<slug>.md.
8
+ */
9
+
10
+ import type { Note, NoteKind } from "./types.ts";
11
+
12
+ /**
13
+ * Render a Note (glossary term or decision) into a markdown card string.
14
+ *
15
+ * Frontmatter head includes note_kind, title, tags, related, summary.
16
+ * Body starts with `# <title>` and contains the full body text.
17
+ * Summary is the first line of the body.
18
+ */
19
+ export function renderNoteCard(note: Note): string {
20
+ const lines: string[] = ["---"];
21
+
22
+ addNoteHeadField(lines, "note_kind", note.note_kind);
23
+ addNoteHeadField(lines, "title", note.title);
24
+ if (note.tags) addNoteHeadField(lines, "tags", note.tags);
25
+ if (note.related) addNoteHeadField(lines, "related", note.related);
26
+
27
+ // Summary = first line of body
28
+ const summary = note.body.split("\n")[0]?.trim() || note.title;
29
+ addNoteHeadField(lines, "summary", summary);
30
+
31
+ lines.push("---");
32
+ lines.push("");
33
+
34
+ // Body
35
+ lines.push(`# ${note.title}`);
36
+ lines.push("");
37
+
38
+ if (note.body) {
39
+ lines.push(note.body);
40
+ }
41
+
42
+ return lines.join("\n") + "\n";
43
+ }
44
+
45
+ /**
46
+ * Parse a note card from a markdown string.
47
+ * Returns null if the card is invalid or not a note card.
48
+ */
49
+ export function parseNoteCard(text: string): {
50
+ note_kind: NoteKind;
51
+ title: string;
52
+ tags: string;
53
+ related: string;
54
+ summary: string;
55
+ } | null {
56
+ const trimmed = text.trim();
57
+ if (!trimmed.startsWith("---")) return null;
58
+
59
+ const endOfFm = trimmed.indexOf("\n---", 3);
60
+ if (endOfFm === -1) return null;
61
+
62
+ const fmRaw = trimmed.slice(3, endOfFm).trim();
63
+
64
+ // Parse frontmatter lines into a record
65
+ const fm: Record<string, string> = {};
66
+ for (const line of fmRaw.split("\n")) {
67
+ const sep = line.indexOf(":");
68
+ if (sep > 0) {
69
+ const key = line.slice(0, sep).trim();
70
+ const value = line.slice(sep + 1).trim();
71
+ fm[key] = value;
72
+ }
73
+ }
74
+
75
+ const noteKind = fm["note_kind"];
76
+ if (noteKind !== "glossary" && noteKind !== "decision" && noteKind !== "convention") return null;
77
+ if (!fm["title"]) return null;
78
+
79
+ return {
80
+ note_kind: noteKind as NoteKind,
81
+ title: fm["title"] ?? "",
82
+ tags: fm["tags"] ?? "",
83
+ related: fm["related"] ?? "",
84
+ summary: fm["summary"] ?? "",
85
+ };
86
+ }
87
+
88
+ /** Add a key:value line to the frontmatter, sanitizing newlines. */
89
+ function addNoteHeadField(lines: string[], key: string, value: string): void {
90
+ const safe = value.replace(/\n/g, " ").trim();
91
+ lines.push(`${key}: ${safe}`);
92
+ }
@@ -0,0 +1,172 @@
1
+ import { describe, it, expect, beforeEach, afterEach } from 'vitest';
2
+ import * as fs from 'node:fs';
3
+ import * as path from 'node:path';
4
+ import * as os from 'node:os';
5
+ import { openDb, searchNotes } from './db.ts';
6
+ import { addNote, rebuildNotesDbFromCards } from './notes.ts';
7
+
8
+ describe('notes.ts', () => {
9
+ let tmpDir: string;
10
+ let glossaryDir: string;
11
+ let decisionsDir: string;
12
+ let dbPath: string;
13
+
14
+ beforeEach(() => {
15
+ tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'cw-notes-'));
16
+ glossaryDir = path.join(tmpDir, 'glossary');
17
+ decisionsDir = path.join(tmpDir, 'decisions');
18
+ dbPath = path.join(tmpDir, 'test.db');
19
+ fs.mkdirSync(glossaryDir, { recursive: true });
20
+ fs.mkdirSync(decisionsDir, { recursive: true });
21
+ });
22
+
23
+ afterEach(() => {
24
+ fs.rmSync(tmpDir, { recursive: true, force: true });
25
+ });
26
+
27
+ describe('addNote', () => {
28
+ it('writes a glossary card and inserts a DB row', () => {
29
+ addNote(dbPath, {
30
+ note_kind: 'glossary',
31
+ title: 'Idempotency Key',
32
+ body: 'A client-supplied key that makes retries safe.',
33
+ tags: 'api,payments',
34
+ related: 'createCharge',
35
+ card_path: '',
36
+ }, glossaryDir);
37
+
38
+ // Card file exists under glossary dir
39
+ const files = fs.readdirSync(glossaryDir);
40
+ expect(files.length).toBeGreaterThan(0);
41
+ const cardFile = files.find((f) => f.endsWith('.md'));
42
+ expect(cardFile).toBeDefined();
43
+
44
+ // Card content has frontmatter
45
+ const cardContent = fs.readFileSync(path.join(glossaryDir, cardFile!), 'utf-8');
46
+ expect(cardContent).toContain('note_kind: glossary');
47
+ expect(cardContent).toContain('title: Idempotency Key');
48
+
49
+ // DB row exists
50
+ const db = openDb(dbPath);
51
+ const results = searchNotes(db, 'Idempotency');
52
+ expect(results).toHaveLength(1);
53
+ expect(results[0]!.name).toBe('Idempotency Key');
54
+ expect(results[0]!.note_kind).toBe('glossary');
55
+ db.close();
56
+ });
57
+
58
+ it('writes a decision card under decisions dir', () => {
59
+ addNote(dbPath, {
60
+ note_kind: 'decision',
61
+ title: 'Use SQLite over ChromaDB',
62
+ body: 'Chosen for zero-infra approach.',
63
+ tags: 'tech-decision',
64
+ related: '',
65
+ card_path: '',
66
+ }, decisionsDir);
67
+
68
+ const files = fs.readdirSync(decisionsDir);
69
+ const cardFile = files.find((f) => f.endsWith('.md'));
70
+ expect(cardFile).toBeDefined();
71
+
72
+ const cardContent = fs.readFileSync(path.join(decisionsDir, cardFile!), 'utf-8');
73
+ expect(cardContent).toContain('note_kind: decision');
74
+ expect(cardContent).toContain('title: Use SQLite over ChromaDB');
75
+ });
76
+
77
+ it('is idempotent — re-adding same note updates in place', () => {
78
+ addNote(dbPath, {
79
+ note_kind: 'glossary', title: 'Term',
80
+ body: 'Version 1', tags: '', related: '',
81
+ card_path: '',
82
+ }, glossaryDir);
83
+
84
+ addNote(dbPath, {
85
+ note_kind: 'glossary', title: 'Term',
86
+ body: 'Version 2 updated', tags: 'v2', related: '',
87
+ card_path: '',
88
+ }, glossaryDir);
89
+
90
+ // Single card file
91
+ const files = fs.readdirSync(glossaryDir).filter((f) => f.endsWith('.md'));
92
+ expect(files).toHaveLength(1);
93
+
94
+ // DB has single row with updated body
95
+ const db = openDb(dbPath);
96
+ const results = searchNotes(db, '');
97
+ expect(results).toHaveLength(1);
98
+ expect(results[0]!.summary).toContain('updated');
99
+ db.close();
100
+ });
101
+ });
102
+
103
+ describe('rebuildNotesDbFromCards', () => {
104
+ it('reconstructs DB rows from glossary + decisions cards alone', () => {
105
+ // Add two notes
106
+ addNote(dbPath, {
107
+ note_kind: 'glossary', title: 'Cache Stampede',
108
+ body: 'When many requests miss cache simultaneously.', tags: 'cache',
109
+ related: 'getOrCreate',
110
+ card_path: '',
111
+ }, glossaryDir);
112
+ addNote(dbPath, {
113
+ note_kind: 'decision', title: 'Use triggers for FTS',
114
+ body: 'FTS triggers prevent index corruption.', tags: 'sqlite',
115
+ related: 'db.ts',
116
+ card_path: '',
117
+ }, decisionsDir);
118
+
119
+ // Delete the DB to simulate disposable-index property
120
+ fs.rmSync(dbPath, { force: true });
121
+
122
+ // Rebuild from cards
123
+ rebuildNotesDbFromCards(dbPath, glossaryDir, decisionsDir);
124
+
125
+ // Query should find both
126
+ const db = openDb(dbPath);
127
+ const results = searchNotes(db, '');
128
+ expect(results).toHaveLength(2);
129
+
130
+ const glossaryHits = results.filter((r) => r.note_kind === 'glossary');
131
+ const decisionHits = results.filter((r) => r.note_kind === 'decision');
132
+ expect(glossaryHits).toHaveLength(1);
133
+ expect(decisionHits).toHaveLength(1);
134
+ expect(glossaryHits[0]!.name).toBe('Cache Stampede');
135
+ expect(decisionHits[0]!.name).toBe('Use triggers for FTS');
136
+
137
+ db.close();
138
+ });
139
+
140
+ it('handles empty directories gracefully', () => {
141
+ // No cards added — should not throw
142
+ fs.rmSync(dbPath, { force: true });
143
+ rebuildNotesDbFromCards(dbPath, glossaryDir, decisionsDir);
144
+ const db = openDb(dbPath);
145
+ const results = searchNotes(db, '');
146
+ expect(results).toHaveLength(0);
147
+ db.close();
148
+ });
149
+
150
+ it('preserves card_path in rebuilt rows', () => {
151
+ addNote(dbPath, {
152
+ note_kind: 'glossary', title: 'Idempotency Key',
153
+ body: 'Retry-safe POST key.', tags: '', related: '',
154
+ card_path: '',
155
+ }, glossaryDir);
156
+
157
+ // Get the card path
158
+ const files = fs.readdirSync(glossaryDir).filter((f) => f.endsWith('.md'));
159
+ const cardPath = path.join(glossaryDir, files[0]!);
160
+
161
+ fs.rmSync(dbPath, { force: true });
162
+ rebuildNotesDbFromCards(dbPath, glossaryDir, decisionsDir);
163
+
164
+ const db = openDb(dbPath);
165
+ const row = db.prepare("SELECT card_path FROM notes WHERE title = ?").get('Idempotency Key') as any;
166
+ expect(row).not.toBeUndefined();
167
+ // card_path might be absolute or relative depending on how we stored it
168
+ expect(row.card_path).toBeTruthy();
169
+ db.close();
170
+ });
171
+ });
172
+ });
package/src/notes.ts ADDED
@@ -0,0 +1,151 @@
1
+ /**
2
+ * Note orchestration for codewalker v1.3.
3
+ *
4
+ * Provides:
5
+ * - `addNote()`: render card → atomic write → upsertNote
6
+ * - `rebuildNotesDbFromCards()`: disposable-index rebuild from card files
7
+ *
8
+ * Mirrors the style of src/libs/indexer.ts (atomic write, tmp + rename, mode 0o600).
9
+ */
10
+
11
+ import * as fs from "node:fs";
12
+ import * as path from "node:path";
13
+ import { openDb, upsertNote } from "./db.ts";
14
+ import { renderNoteCard, parseNoteCard } from "./notes-cards.ts";
15
+ import type { Note, NoteKind } from "./types.ts";
16
+
17
+ /**
18
+ * Write a note: render card → atomic write → upsert DB row.
19
+ *
20
+ * The note's note_kind determines which directory to use.
21
+ * When `notesDir` is provided, it is used directly (backward compat).
22
+ * When both `glossaryDir` and `decisionsDir` are available, pass them via an options bag.
23
+ */
24
+ export function addNote(
25
+ dbPath: string,
26
+ note: Note,
27
+ notesDir?: string,
28
+ ): void {
29
+ const dir = notesDir;
30
+ if (!dir) throw new Error("notesDir is required");
31
+
32
+ // Ensure directory exists
33
+ fs.mkdirSync(dir, { recursive: true });
34
+
35
+ // Generate slug from title
36
+ const slug = slugifyNoteTitle(note.title);
37
+ const cardPath = path.join(dir, `${slug}.md`);
38
+
39
+ // Render card
40
+ const card = renderNoteCard(note);
41
+
42
+ // Atomic write
43
+ const tmpPath = cardPath + ".tmp";
44
+ fs.writeFileSync(tmpPath, card, { encoding: "utf-8", mode: 0o600 });
45
+ fs.renameSync(tmpPath, cardPath);
46
+
47
+ // Upsert DB row with the actual card_path
48
+ const db = openDb(dbPath);
49
+ try {
50
+ upsertNote(db, {
51
+ ...note,
52
+ card_path: cardPath,
53
+ });
54
+ } finally {
55
+ db.close();
56
+ }
57
+ }
58
+
59
+ /**
60
+ * Rebuild the notes DB tables from glossary + decisions cards alone.
61
+ * Demonstrates the disposable-index property: cards are the source of truth.
62
+ */
63
+ export function rebuildNotesDbFromCards(
64
+ dbPath: string,
65
+ glossaryDir: string,
66
+ decisionsDir: string,
67
+ conventionsDir?: string,
68
+ ): void {
69
+ const db = openDb(dbPath);
70
+
71
+ try {
72
+ db.exec("BEGIN TRANSACTION");
73
+
74
+ // Clear existing notes
75
+ db.prepare("DELETE FROM notes").run();
76
+
77
+ // Process glossary cards
78
+ if (fs.existsSync(glossaryDir)) {
79
+ processCardsInDir(db, glossaryDir, "glossary");
80
+ }
81
+
82
+ // Process decisions cards
83
+ if (fs.existsSync(decisionsDir)) {
84
+ processCardsInDir(db, decisionsDir, "decision");
85
+ }
86
+
87
+ // Process conventions cards (v1.4)
88
+ if (conventionsDir && fs.existsSync(conventionsDir)) {
89
+ processCardsInDir(db, conventionsDir, "convention");
90
+ }
91
+
92
+ db.exec("COMMIT");
93
+ } catch (e) {
94
+ db.exec("ROLLBACK");
95
+ throw e;
96
+ } finally {
97
+ db.close();
98
+ }
99
+ }
100
+
101
+ // ── Internal helpers ───────────────────────────────────────────
102
+
103
+ function processCardsInDir(
104
+ db: ReturnType<typeof openDb>,
105
+ dir: string,
106
+ expectedKind: NoteKind,
107
+ ): void {
108
+ for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
109
+ if (!entry.isFile() || !entry.name.endsWith(".md")) continue;
110
+
111
+ const cardPath = path.join(dir, entry.name);
112
+ const cardText = fs.readFileSync(cardPath, "utf-8");
113
+ const parsed = parseNoteCard(cardText);
114
+ if (!parsed) continue;
115
+ if (parsed.note_kind !== expectedKind) continue;
116
+
117
+ // Extract body from card
118
+ const body = extractNoteBody(cardText);
119
+
120
+ upsertNote(db, {
121
+ note_kind: parsed.note_kind,
122
+ title: parsed.title,
123
+ body,
124
+ tags: parsed.tags,
125
+ related: parsed.related,
126
+ card_path: cardPath,
127
+ });
128
+ }
129
+ }
130
+
131
+ /** Extract the body (after frontmatter) from a note card, stripping the # title header. */
132
+ function extractNoteBody(cardText: string): string {
133
+ const trimmed = cardText.trim();
134
+ if (!trimmed.startsWith("---")) return "";
135
+
136
+ const endOfFm = trimmed.indexOf("\n---", 3);
137
+ if (endOfFm === -1) return "";
138
+
139
+ return trimmed.slice(endOfFm + 4).trim();
140
+ }
141
+
142
+ function slugifyNoteTitle(title: string): string {
143
+ return title
144
+ .toLowerCase()
145
+ .replace(/[^a-z0-9]+/g, "-")
146
+ .replace(/^-+|-+$/g, "")
147
+ .slice(0, 60) || "untitled";
148
+ }
149
+
150
+ // Re-export for convenience
151
+ export { slugifyNoteTitle };
@@ -80,6 +80,21 @@ describe('project.ts', () => {
80
80
  expect(p.metaFile).toBe(path.join(p.codewalkerDir, 'meta.json'));
81
81
  expect(p.entriesDir).toBe(path.join(p.codewalkerDir, 'entries'));
82
82
  expect(p.symbolsDir).toBe(path.join(p.codewalkerDir, 'entries', 'symbols'));
83
+ expect(p.libsDir).toBe(path.join(p.codewalkerDir, 'entries', 'libs'));
84
+ });
85
+
86
+ it('exposes glossaryDir and decisionsDir paths', async () => {
87
+ const mod = await import('./project.ts');
88
+ const p = mod.resolveProject(tmpDir);
89
+ expect(p.glossaryDir).toBe(path.join(p.codewalkerDir, 'entries', 'glossary'));
90
+ expect(p.decisionsDir).toBe(path.join(p.codewalkerDir, 'entries', 'decisions'));
91
+ });
92
+
93
+ it('exposes analysisDir and conventionsDir paths', async () => {
94
+ const mod = await import('./project.ts');
95
+ const p = mod.resolveProject(tmpDir);
96
+ expect(p.analysisDir).toBe(path.join(p.codewalkerDir, 'entries', 'analysis'));
97
+ expect(p.conventionsDir).toBe(path.join(p.codewalkerDir, 'entries', 'conventions'));
83
98
  });
84
99
  });
85
100
 
@@ -89,10 +104,15 @@ describe('project.ts', () => {
89
104
  const p = await mod.ensureProject(tmpDir);
90
105
  // marker file exists
91
106
  expect(fs.existsSync(p.markerPath)).toBe(true);
92
- // codewalker dir is created
107
+ // codewalker dir + subdirs are created
93
108
  expect(fs.existsSync(p.codewalkerDir)).toBe(true);
94
109
  expect(fs.existsSync(p.entriesDir)).toBe(true);
95
110
  expect(fs.existsSync(p.symbolsDir)).toBe(true);
111
+ expect(fs.existsSync(p.libsDir)).toBe(true);
112
+ expect(fs.existsSync(p.glossaryDir)).toBe(true);
113
+ expect(fs.existsSync(p.decisionsDir)).toBe(true);
114
+ expect(fs.existsSync(p.analysisDir)).toBe(true);
115
+ expect(fs.existsSync(p.conventionsDir)).toBe(true);
96
116
  // meta.json written
97
117
  expect(fs.existsSync(p.metaFile)).toBe(true);
98
118
  // meta.json has correct shape
package/src/project.ts CHANGED
@@ -31,6 +31,10 @@ export interface ProjectPaths {
31
31
  entriesDir: string;
32
32
  symbolsDir: string;
33
33
  libsDir: string;
34
+ glossaryDir: string;
35
+ decisionsDir: string;
36
+ analysisDir: string;
37
+ conventionsDir: string;
34
38
  }
35
39
 
36
40
  function piHome(): string {
@@ -125,6 +129,10 @@ function pathsForId(id: string, root: string, configDir: string, markerPath: str
125
129
  entriesDir: path.join(globalDir, "codewalker", "entries"),
126
130
  symbolsDir: path.join(globalDir, "codewalker", "entries", "symbols"),
127
131
  libsDir: path.join(globalDir, "codewalker", "entries", "libs"),
132
+ glossaryDir: path.join(globalDir, "codewalker", "entries", "glossary"),
133
+ decisionsDir: path.join(globalDir, "codewalker", "entries", "decisions"),
134
+ analysisDir: path.join(globalDir, "codewalker", "entries", "analysis"),
135
+ conventionsDir: path.join(globalDir, "codewalker", "entries", "conventions"),
128
136
  };
129
137
  }
130
138
 
@@ -166,7 +174,7 @@ export async function ensureProject(cwd: string): Promise<ProjectPaths> {
166
174
  const p = resolveProject(cwd);
167
175
  const nowISO = new Date().toISOString();
168
176
 
169
- for (const dir of [p.codewalkerDir, p.entriesDir, p.symbolsDir, p.libsDir]) {
177
+ for (const dir of [p.codewalkerDir, p.entriesDir, p.symbolsDir, p.libsDir, p.glossaryDir, p.decisionsDir, p.analysisDir, p.conventionsDir]) {
170
178
  fs.mkdirSync(dir, { recursive: true });
171
179
  }
172
180