create-nimbo 0.2.0 → 0.3.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 +17 -0
- package/README.md +16 -99
- package/package.json +1 -9
- package/tools/nimbo/install.js +160 -44
- package/tools/nimbo/template/.claude/skills/blueprint/SKILL.md +1 -1
- package/tools/nimbo/template/.claude/skills/intake/SKILL.md +5 -5
- package/tools/nimbo/template/.claude/skills/roadmap/SKILL.md +1 -1
- package/tools/nimbo/template/.claude/skills/stack/SKILL.md +1 -1
- package/tools/nimbo/template/.workflow/dashboard/build.mjs +124 -42
- package/tools/nimbo/template/.workflow/dashboard/template.html +123 -62
- package/tools/nimbo/template/.workflow/terms.md +148 -0
- package/tools/nimbo/template/AGENTS.md.template +1 -1
- package/tools/nimbo/template/CLAUDE.md.template +2 -2
|
@@ -10,20 +10,92 @@ import { fileURLToPath, pathToFileURL } from "node:url";
|
|
|
10
10
|
const HERE = path.dirname(fileURLToPath(import.meta.url));
|
|
11
11
|
const PHASES = ["intake", "discover", "blueprint", "stack", "roadmap"];
|
|
12
12
|
const PHASE = {
|
|
13
|
-
intake: { name: "Intake",
|
|
14
|
-
discover: { name: "Discover",
|
|
15
|
-
blueprint: { name: "Blueprint",
|
|
16
|
-
stack: { name: "Stack",
|
|
17
|
-
roadmap: { name: "Roadmap",
|
|
13
|
+
intake: { name: "Intake", doc: null },
|
|
14
|
+
discover: { name: "Discover", doc: "plan.md" },
|
|
15
|
+
blueprint: { name: "Blueprint", doc: "blueprint.md" },
|
|
16
|
+
stack: { name: "Stack", doc: "stack.md" },
|
|
17
|
+
roadmap: { name: "Roadmap", doc: "roadmap.md" },
|
|
18
18
|
};
|
|
19
|
+
|
|
20
|
+
/** Texts the script writes into the model, per language. The page has its own texts in template.html. */
|
|
21
|
+
export const TEXT = {
|
|
22
|
+
nl: {
|
|
23
|
+
months: ["jan", "feb", "mrt", "apr", "mei", "jun", "jul", "aug", "sep", "okt", "nov", "dec"],
|
|
24
|
+
phase: {
|
|
25
|
+
intake: { sub: "afspraken", title: "Werkafspraken", wat: "Hoe jullie werken: taal, Git en wat je wilt leren." },
|
|
26
|
+
discover: { sub: "plan", title: "Plan", wat: "Wat je wilt maken, voor wie en waarom." },
|
|
27
|
+
blueprint: { sub: "ontwerp", title: "Ontwerp", wat: "Hoe het werkt: gedrag, regels en onderdelen." },
|
|
28
|
+
stack: { sub: "techniek", title: "Stack", wat: "Waarmee je het bouwt." },
|
|
29
|
+
roadmap: { sub: "features", title: "Roadmap", wat: "Je plan in kleine features, op volgorde." },
|
|
30
|
+
},
|
|
31
|
+
level: { ervaren: "ervaren", "wat ervaring": "met wat ervaring", beginner: "als beginner" },
|
|
32
|
+
gitSupport: "Git zelf doen, met uitleg bij elke stap", gitSelf: "Git zelf doen",
|
|
33
|
+
goal: { blueprint: "Ontwerpen", stack: "Een stack kiezen", roadmap: "Plannen" },
|
|
34
|
+
learningGoal: "Leerdoel", step: "Trede", exercise: "Oefening", nowWorking: "hier werk je nu aan",
|
|
35
|
+
stepName: { voorspellen: "Voorspellen", invullen: "Invullen", schrijven: "Schrijven" },
|
|
36
|
+
features: { sub: "na de roadmap", title: "Je features", wat: "Na de roadmap verschijnt hier elke feature als eigen halte.",
|
|
37
|
+
lab: "Straks · oefening", tx: "Per feature zie je hier wat je zelf deed." },
|
|
38
|
+
release: "Opleveren: een versie, een korte uitleg en eventueel online zetten.",
|
|
39
|
+
later: "Straks", ideaLater: "Verandert je idee onderweg, dan komt hier een kaartje bij.",
|
|
40
|
+
updated: "Dashboard bijgewerkt", opened: "Geopend in de browser.", openFailed: "Openen lukte niet. Adres:",
|
|
41
|
+
},
|
|
42
|
+
en: {
|
|
43
|
+
months: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
|
|
44
|
+
phase: {
|
|
45
|
+
intake: { sub: "agreements", title: "Working agreements", wat: "How you work together: language, Git and what you want to learn." },
|
|
46
|
+
discover: { sub: "plan", title: "Plan", wat: "What you want to make, for whom and why." },
|
|
47
|
+
blueprint: { sub: "design", title: "Design", wat: "How it works: behaviour, rules and parts." },
|
|
48
|
+
stack: { sub: "technology", title: "Stack", wat: "What you build it with." },
|
|
49
|
+
roadmap: { sub: "features", title: "Roadmap", wat: "Your plan in small features, in order." },
|
|
50
|
+
},
|
|
51
|
+
level: { ervaren: "experienced", "wat ervaring": "with some experience", beginner: "as a beginner" },
|
|
52
|
+
gitSupport: "Doing Git yourself, with an explanation at every step", gitSelf: "Doing Git yourself",
|
|
53
|
+
goal: { blueprint: "Designing", stack: "Choosing a stack", roadmap: "Planning" },
|
|
54
|
+
learningGoal: "Learning goal", step: "Step", exercise: "Exercise", nowWorking: "you are working on this now",
|
|
55
|
+
stepName: { voorspellen: "Predict", invullen: "Fill in", schrijven: "Write" },
|
|
56
|
+
features: { sub: "after the roadmap", title: "Your features", wat: "After the roadmap, every feature appears here as its own stop.",
|
|
57
|
+
lab: "Later · exercise", tx: "For every feature you see here what you did yourself." },
|
|
58
|
+
release: "Delivering: a version, a short explanation and optionally putting it online.",
|
|
59
|
+
later: "Later", ideaLater: "If your idea changes along the way, a card appears here.",
|
|
60
|
+
updated: "Dashboard updated", opened: "Opened in the browser.", openFailed: "Could not open it. Address:",
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* English words from .workflow/terms.md, mapped to the Dutch word the script works with.
|
|
66
|
+
* Field names, statuses, log types and idea kinds; matching ignores case.
|
|
67
|
+
*/
|
|
68
|
+
const ALIAS = {
|
|
69
|
+
// fields in config, decisions, documents, roadmap and reflection
|
|
70
|
+
"language": "Voertaal", "learning goal design": "Leerdoel ontwerp", "learning goal stack": "Leerdoel stack",
|
|
71
|
+
"learning goal roadmap": "Leerdoel roadmap", "learning goal programming": "Leerdoel techniek",
|
|
72
|
+
"learning goal release": "Leerdoel release", "git actions": "Git-handelingen",
|
|
73
|
+
"phase": "Fase", "subject": "Onderwerp", "content and reason": "Inhoud en reden", "concerns": "Betreft",
|
|
74
|
+
"consequence": "Gevolg", "source": "Bron", "idea": "Idee", "name": "Naam", "result": "Resultaat",
|
|
75
|
+
"needs": "Nodig", "exercise": "Oefening", "date": "Datum", "basis": "Basis",
|
|
76
|
+
};
|
|
77
|
+
const STATUS = { planned: "gepland", "in progress": "bezig", accepted: "geaccepteerd", integrating: "integreren", blocked: "geblokkeerd", done: "afgerond" };
|
|
78
|
+
const LOGTYPE = { choice: "keuze", steering: "sturing", proposal: "voorstel", assessment: "beoordeling", acceptance: "acceptatie", rejection: "afwijzing" };
|
|
79
|
+
const IDEA = { "initial idea": "startidee", added: "toegevoegd", changed: "gewijzigd", adjusted: "bijgestuurd" };
|
|
80
|
+
const STEP = { predict: "voorspellen", "fill in": "invullen", write: "schrijven", core: "kern", "own build": "eigen bouw" };
|
|
81
|
+
const OPEN_SECTIONS = ["Nog onduidelijk", "Open punten", "Bewust open", "Still unclear", "Open points", "Deliberately open"];
|
|
82
|
+
|
|
19
83
|
const TREDE = { voorspellen: 1, invullen: 2, schrijven: 3 };
|
|
20
|
-
const MONTHS = ["jan", "feb", "mrt", "apr", "mei", "jun", "jul", "aug", "sep", "okt", "nov", "dec"];
|
|
21
84
|
const DONE = new Set(["afgerond"]);
|
|
22
85
|
const ACTIVE = new Set(["bezig", "geaccepteerd", "integreren", "geblokkeerd"]);
|
|
23
86
|
|
|
24
87
|
const read = (file) => { try { return fs.readFileSync(file, "utf8").replace(/\r\n/g, "\n"); } catch { return null; } };
|
|
25
88
|
const clean = (t) => (t || "").trim().replace(/\s+/g, " ");
|
|
26
|
-
const
|
|
89
|
+
const dateText = (iso, lang = "nl") => { const m = /^(\d{4})-(\d{2})-(\d{2})$/.exec(iso || ""); return m ? `${+m[3]} ${TEXT[lang].months[+m[2] - 1]} ${m[1]}` : ""; };
|
|
90
|
+
/** A status, log type or idea kind in English becomes its Dutch counterpart; Dutch stays as it is. */
|
|
91
|
+
const fromEnglish = (table, text) => {
|
|
92
|
+
const t = clean(text).toLowerCase();
|
|
93
|
+
const hit = Object.keys(table).sort((a, b) => b.length - a.length).find((k) => t === k || t.startsWith(k + " ") || t.startsWith(k + ".") || t.startsWith(k + ","));
|
|
94
|
+
return hit ? table[hit] + t.slice(hit.length) : t;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
/** The language of the project from the configuration: English or Dutch (the default). */
|
|
98
|
+
export const languageOf = (config) => (/^\s*(english|engels|en)\b/i.test(config?.Voertaal || "") ? "en" : "nl");
|
|
27
99
|
|
|
28
100
|
/** `- Key: value` lines, with indented continuation lines appended. */
|
|
29
101
|
export function fields(text) {
|
|
@@ -31,7 +103,7 @@ export function fields(text) {
|
|
|
31
103
|
let last = null;
|
|
32
104
|
for (const line of (text || "").split("\n")) {
|
|
33
105
|
const m = /^- ([^:\n]{1,40}): (.*)$/.exec(line);
|
|
34
|
-
if (m) { last = m[1].trim(); out[last] = m[2].trim(); }
|
|
106
|
+
if (m) { last = m[1].trim(); last = ALIAS[last.toLowerCase()] || last; out[last] = m[2].trim(); }
|
|
35
107
|
else if (last && /^\s{2,}\S/.test(line)) out[last] += " " + line.trim();
|
|
36
108
|
else if (!line.trim() || line.startsWith("#")) last = null;
|
|
37
109
|
}
|
|
@@ -53,11 +125,11 @@ export function parseDecisions(text) {
|
|
|
53
125
|
if (!m) continue;
|
|
54
126
|
const f = fields(rest.join("\n"));
|
|
55
127
|
out.push({
|
|
56
|
-
id: m[1], datum: m[2], herkomst: m[3], type: m[4],
|
|
128
|
+
id: m[1], datum: m[2], herkomst: m[3], type: fromEnglish(LOGTYPE, m[4]),
|
|
57
129
|
fase: clean(f["Fase"]).toLowerCase().split(/[\s,]/)[0] || "",
|
|
58
130
|
onderwerp: clean(f["Onderwerp"]), inhoud: clean(f["Inhoud en reden"]),
|
|
59
131
|
betreft: clean(f["Betreft"]), gevolg: clean(f["Gevolg"]),
|
|
60
|
-
idee:
|
|
132
|
+
idee: ideaLine(f["Idee"]),
|
|
61
133
|
});
|
|
62
134
|
}
|
|
63
135
|
return out;
|
|
@@ -85,13 +157,13 @@ export function parseRoadmap(text) {
|
|
|
85
157
|
for (const line of (text || "").split("\n")) {
|
|
86
158
|
if (!/^\s*\|/.test(line)) { cols = null; continue; }
|
|
87
159
|
const cells = line.trim().replace(/^\||\|$/g, "").split("|").map((c) => c.trim());
|
|
88
|
-
if (!cols) { cols = cells.map((c) => c.toLowerCase()); continue; }
|
|
160
|
+
if (!cols) { cols = cells.map((c) => { const k = c.toLowerCase(); return k === "result" ? "resultaat" : k; }); continue; }
|
|
89
161
|
if (cells.every((c) => /^:?-+:?$/.test(c))) continue;
|
|
90
162
|
const get = (k) => cells[cols.indexOf(k)] || "";
|
|
91
163
|
const id = get("id");
|
|
92
164
|
if (!/^F\d{2,}$/.test(id)) continue;
|
|
93
165
|
const f = add(id);
|
|
94
|
-
f.name = get("feature"); f.resultaat = get("resultaat"); f.status = get("status")
|
|
166
|
+
f.name = get("feature"); f.resultaat = get("resultaat"); f.status = fromEnglish(STATUS, get("status"));
|
|
95
167
|
}
|
|
96
168
|
// feature blocks
|
|
97
169
|
for (const block of (text || "").split(/^### /m).slice(1)) {
|
|
@@ -101,29 +173,29 @@ export function parseRoadmap(text) {
|
|
|
101
173
|
const f = add(m[1]), x = fields(rest.join("\n"));
|
|
102
174
|
if (!f.name) f.name = clean(m[2]);
|
|
103
175
|
if (x["Resultaat"]) f.resultaat = clean(x["Resultaat"]);
|
|
104
|
-
if (x["Status"] && !f.status) f.status =
|
|
176
|
+
if (x["Status"] && !f.status) f.status = fromEnglish(STATUS, x["Status"]).replace(/\.$/, "");
|
|
105
177
|
if (x["Nodig"]) f.nodig = x["Nodig"].match(/V\d{2,}/g) || [];
|
|
106
|
-
if (x["Oefening"]) f.oefening = clean(x["Oefening"]);
|
|
178
|
+
if (x["Oefening"]) f.oefening = clean(x["Oefening"]).replace(/^step\s+/i, "trede ").replace(/^(?:trede\s+)?(predict|fill in|write|core|own build)\b/i, (w, k) => (/^trede/i.test(w) ? "trede " : "") + STEP[k.toLowerCase()]).replace(/[,;] (on my own|with a head start)\.?$/i, (_, k) => `, ${/own/i.test(k) ? "zelfstandig" : "met een voorzet"}`);
|
|
107
179
|
}
|
|
108
180
|
for (const f of features.values()) f.status = (/^\w+/.exec(f.status) || [""])[0];
|
|
109
181
|
return [...features.values()];
|
|
110
182
|
}
|
|
111
183
|
|
|
112
|
-
/** Open points `- V01 — text` under "Nog onduidelijk" / "Open punten". */
|
|
184
|
+
/** Open points `- V01 — text` under "Nog onduidelijk" / "Open punten" (or their English names). */
|
|
113
185
|
export function parseOpenPoints(text) {
|
|
114
|
-
const body =
|
|
186
|
+
const body = OPEN_SECTIONS.map((h) => section(text, h)).join("");
|
|
115
187
|
const out = [];
|
|
116
188
|
for (const line of body.split("\n")) {
|
|
117
189
|
const m = /^- (V\d{2,})\s+—\s+(.+)$/.exec(line.trim());
|
|
118
|
-
if (m) out.push({ id: m[1], label: clean(m[2]).replace(/\s+(Vóór|Nog niet gepland)\b.*$/, "").replace(/\.$/, "") });
|
|
190
|
+
if (m) out.push({ id: m[1], label: clean(m[2]).replace(/\s+(Vóór|Nog niet gepland|Before|Not yet planned)\b.*$/, "").replace(/\.$/, "") });
|
|
119
191
|
}
|
|
120
192
|
return out;
|
|
121
193
|
}
|
|
122
194
|
|
|
123
|
-
export function parseDuiding(text) {
|
|
195
|
+
export function parseDuiding(text, lang = "nl") {
|
|
124
196
|
if (!text || !text.trim()) return null;
|
|
125
197
|
const head = fields(text.split(/^## /m)[0]);
|
|
126
|
-
const keyOf = (h) => { const t = h.toLowerCase(); return t.includes("route") ? "route" : t
|
|
198
|
+
const keyOf = (h) => { const t = h.toLowerCase(); return t.includes("route") ? "route" : /idee|idea/.test(t) ? "idee" : /samen|collab/.test(t) ? "samen" : /leren|learn/.test(t) ? "leren" : null; };
|
|
127
199
|
const cards = [];
|
|
128
200
|
for (const block of text.split(/^## /m).slice(1)) {
|
|
129
201
|
const [h, ...rest] = block.split("\n");
|
|
@@ -131,15 +203,15 @@ export function parseDuiding(text) {
|
|
|
131
203
|
if (!key) continue;
|
|
132
204
|
const c = { key, vraag: "", paras: [], mine: "", ask: "", basis: "" };
|
|
133
205
|
for (const para of rest.join("\n").split(/\n\s*\n/).map(clean).filter(Boolean)) {
|
|
134
|
-
if (/^Vraag:/i.test(para)) c.vraag = para.replace(/^Vraag:\s*/i, "");
|
|
135
|
-
else if (/^Jouw reflectie:/i.test(para)) c.mine = para.replace(/^Jouw reflectie:\s*/i, "");
|
|
206
|
+
if (/^(Vraag|Question):/i.test(para)) c.vraag = para.replace(/^(Vraag|Question):\s*/i, "");
|
|
207
|
+
else if (/^(Jouw reflectie|Your reflection):/i.test(para)) c.mine = para.replace(/^(Jouw reflectie|Your reflection):\s*/i, "");
|
|
136
208
|
else if (/^Denkvraag:/i.test(para)) c.ask = para.replace(/^Denkvraag:\s*/i, "");
|
|
137
209
|
else if (/^Gebaseerd op:/i.test(para)) c.basis = para.replace(/^Gebaseerd op:\s*/i, "");
|
|
138
210
|
else c.paras.push(para);
|
|
139
211
|
}
|
|
140
212
|
cards.push(c);
|
|
141
213
|
}
|
|
142
|
-
return cards.length ? { basis: clean(head["Basis"]), datum:
|
|
214
|
+
return cards.length ? { basis: clean(head["Basis"]), datum: dateText(clean(head["Datum"]), lang), cards } : null;
|
|
143
215
|
}
|
|
144
216
|
|
|
145
217
|
/** V-IDs named in a text, with ranges such as "V01–V03" expanded. */
|
|
@@ -154,13 +226,20 @@ export function vids(text) {
|
|
|
154
226
|
|
|
155
227
|
/** Idea text as a card line: capital first letter, no closing full stop. */
|
|
156
228
|
const ideaText = (t) => { const x = clean(t).replace(/\.$/, ""); return x && x[0].toUpperCase() + x.slice(1); };
|
|
229
|
+
/** `kind — text` with the kind in Dutch (startidee, toegevoegd, gewijzigd, bijgestuurd). */
|
|
230
|
+
const ideaLine = (value) => {
|
|
231
|
+
const m = /^(.+?)\s+—\s+(.*)$/.exec(clean(value));
|
|
232
|
+
return m ? `${fromEnglish(IDEA, m[1])} — ${ideaText(m[2])}` : clean(value);
|
|
233
|
+
};
|
|
157
234
|
|
|
158
|
-
const
|
|
235
|
+
const levelOf = (v) => { const t = (v || "").toLowerCase(); return /ervaren|experienced/.test(t) && !/wat ervaring|some experience/.test(t) ? "ervaren" : /wat ervaring|some experience/.test(t) ? "wat ervaring" : t.includes("beginner") ? "beginner" : ""; };
|
|
159
236
|
|
|
160
237
|
/** Everything the dashboard shows, derived from the project files. */
|
|
161
238
|
export function readProject(root) {
|
|
162
239
|
const docs = (f) => read(path.join(root, "docs", f));
|
|
163
240
|
const config = fields(read(path.join(root, ".workflow", "config.md")) || "");
|
|
241
|
+
const lang = languageOf(config), T = TEXT[lang];
|
|
242
|
+
const level = (v) => T.level[levelOf(v)] || "";
|
|
164
243
|
const log = parseDecisions(docs("decisions.md"));
|
|
165
244
|
const explained = parseExplained(docs("explained.md"));
|
|
166
245
|
const roadmapText = docs("roadmap.md");
|
|
@@ -170,23 +249,23 @@ export function readProject(root) {
|
|
|
170
249
|
|
|
171
250
|
// phase status
|
|
172
251
|
const done = {
|
|
173
|
-
intake: /voltooid/i.test(config["Intake"] || ""),
|
|
252
|
+
intake: /voltooid|completed/i.test(config["Intake"] || ""),
|
|
174
253
|
discover: docs("plan.md") !== null, blueprint: docs("blueprint.md") !== null,
|
|
175
254
|
stack: docs("stack.md") !== null, roadmap: roadmapText !== null,
|
|
176
255
|
};
|
|
177
256
|
const stops = [];
|
|
178
257
|
const uitlegFor = (key) => explained.filter((e) => (key.startsWith("F") ? e.feature === key : !e.feature && e.fase === key)).map((e) => e.onderwerp);
|
|
179
258
|
const goal = {
|
|
180
|
-
intake: config["Git-handelingen"] && !/^ai$/i.test(clean(config["Git-handelingen"])) ? (/ondersteuning/i.test(config["Git-handelingen"]) ?
|
|
181
|
-
blueprint: level(config["Leerdoel ontwerp"]) &&
|
|
182
|
-
stack: level(config["Leerdoel stack"]) &&
|
|
183
|
-
roadmap: level(config["Leerdoel roadmap"]) &&
|
|
259
|
+
intake: config["Git-handelingen"] && !/^ai$/i.test(clean(config["Git-handelingen"])) ? (/ondersteuning|support/i.test(config["Git-handelingen"]) ? T.gitSupport : T.gitSelf) : "",
|
|
260
|
+
blueprint: level(config["Leerdoel ontwerp"]) && `${T.goal.blueprint}, ${level(config["Leerdoel ontwerp"])}`,
|
|
261
|
+
stack: level(config["Leerdoel stack"]) && `${T.goal.stack}, ${level(config["Leerdoel stack"])}`,
|
|
262
|
+
roadmap: level(config["Leerdoel roadmap"]) && `${T.goal.roadmap}, ${level(config["Leerdoel roadmap"])}`,
|
|
184
263
|
};
|
|
185
264
|
let nowSet = false;
|
|
186
265
|
for (const key of PHASES) {
|
|
187
|
-
const p = PHASE[key], s = { key, name: p.name, sub: p.sub, title: p.title, wat: p.wat, dids: log.filter((d) => d.fase === key).map((d) => d.id) };
|
|
266
|
+
const p = { ...PHASE[key], ...T.phase[key] }, s = { key, name: p.name, sub: p.sub, title: p.title, wat: p.wat, dids: log.filter((d) => d.fase === key).map((d) => d.id) };
|
|
188
267
|
if (key === "roadmap" && features.length) s.sub = `${features.length} features`;
|
|
189
|
-
if (goal[key]) { s.lc = { lab:
|
|
268
|
+
if (goal[key]) { s.lc = { lab: T.learningGoal, tx: goal[key] }; s.leerdoel = goal[key]; }
|
|
190
269
|
const u = uitlegFor(key); if (u.length) s.uitleg = u;
|
|
191
270
|
if (!done[key]) { if (!nowSet) { s.now = true; nowSet = true; } else s.future = true; }
|
|
192
271
|
stops.push(s);
|
|
@@ -194,10 +273,11 @@ export function readProject(root) {
|
|
|
194
273
|
|
|
195
274
|
// features
|
|
196
275
|
const techniek = clean(config["Leerdoel techniek"]);
|
|
197
|
-
const
|
|
276
|
+
const tredeMatch = /(?:trede|step) (voorspellen|invullen|schrijven|predict|fill in|write)/i.exec(techniek);
|
|
277
|
+
const tredeNu = tredeMatch ? (STEP[tredeMatch[1].toLowerCase()] || tredeMatch[1].toLowerCase()) : undefined;
|
|
198
278
|
if (!features.length) {
|
|
199
|
-
stops.push({ key: "features", name: "Features", sub:
|
|
200
|
-
gLeren: { lab:
|
|
279
|
+
stops.push({ key: "features", name: "Features", sub: T.features.sub, ghost: true, future: true, title: T.features.title, wat: T.features.wat,
|
|
280
|
+
gLeren: { lab: T.features.lab, tx: T.features.tx } });
|
|
201
281
|
}
|
|
202
282
|
for (const f of features) {
|
|
203
283
|
const s = { key: f.id, name: f.id, sub: f.name.toLowerCase(), feature: true, title: f.name, wat: f.resultaat || f.name,
|
|
@@ -207,17 +287,17 @@ export function readProject(root) {
|
|
|
207
287
|
const t = TREDE[ex[1].toLowerCase()];
|
|
208
288
|
s.trede = t || null; s.geoefend = ex[2];
|
|
209
289
|
const tx = ex[2].replace(/[,;] (zelfstandig|met een voorzet)\.?$/i, "").replace(/\.$/, "");
|
|
210
|
-
s.lc = { lab: t ?
|
|
290
|
+
s.lc = { lab: t ? `${T.step} ${t}` : T.exercise, tx: tx[0].toUpperCase() + tx.slice(1) };
|
|
211
291
|
}
|
|
212
292
|
const u = uitlegFor(f.id); if (u.length) s.uitleg = u;
|
|
213
293
|
if (DONE.has(f.status)) { /* done */ }
|
|
214
294
|
else if (!nowSet && (ACTIVE.has(f.status) || !features.some((g) => ACTIVE.has(g.status)))) {
|
|
215
295
|
s.now = true; nowSet = true;
|
|
216
|
-
if (!s.lc && tredeNu && /beginner/i.test(techniek)) { s.trede = TREDE[tredeNu
|
|
296
|
+
if (!s.lc && tredeNu && /beginner/i.test(techniek)) { s.trede = TREDE[tredeNu]; s.lc = { lab: `${T.step} ${s.trede}`, tx: `${T.stepName[tredeNu]}: ${T.nowWorking}` }; }
|
|
217
297
|
} else s.future = true;
|
|
218
298
|
stops.push(s);
|
|
219
299
|
}
|
|
220
|
-
const release = { key: "release", name: "Release", sub: "", title: "Release", wat:
|
|
300
|
+
const release = { key: "release", name: "Release", sub: "", title: "Release", wat: T.release, dids: log.filter((d) => d.fase === "release").map((d) => d.id) };
|
|
221
301
|
if (!nowSet) { release.now = true; nowSet = true; } else release.future = true;
|
|
222
302
|
stops.push(release);
|
|
223
303
|
for (const s of stops) if (s.dids && !s.dids.length) delete s.dids;
|
|
@@ -225,7 +305,7 @@ export function readProject(root) {
|
|
|
225
305
|
// ghost: idea card at the current stop while the idea has not changed yet
|
|
226
306
|
const ideas = log.filter((d) => d.idee);
|
|
227
307
|
const nowStop = stops.find((s) => s.now);
|
|
228
|
-
if (!ideas.some((d) => !/^startidee/i.test(d.idee)) && nowStop && !nowStop.ghost) nowStop.gIdee = { lab:
|
|
308
|
+
if (!ideas.some((d) => !/^startidee/i.test(d.idee)) && nowStop && !nowStop.ghost) nowStop.gIdee = { lab: T.later, tx: T.ideaLater };
|
|
229
309
|
|
|
230
310
|
// open points as tracks
|
|
231
311
|
const firstSeen = new Map(), lastSeen = new Map();
|
|
@@ -245,11 +325,11 @@ export function readProject(root) {
|
|
|
245
325
|
}
|
|
246
326
|
|
|
247
327
|
// duiding
|
|
248
|
-
const duiding = parseDuiding(read(path.join(root, ".workflow", "out", "duiding.md")));
|
|
328
|
+
const duiding = parseDuiding(read(path.join(root, ".workflow", "out", "duiding.md")), lang);
|
|
249
329
|
const last = log.length ? log[log.length - 1] : null;
|
|
250
330
|
if (duiding && last) duiding.stale = !!duiding.basis && duiding.basis < last.id;
|
|
251
331
|
|
|
252
|
-
return { name, stand: last ?
|
|
332
|
+
return { lang, name, stand: last ? dateText(last.datum, lang) : "", early: !features.length, log, stops, tracks, duiding };
|
|
253
333
|
}
|
|
254
334
|
|
|
255
335
|
const ESC = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" };
|
|
@@ -291,11 +371,13 @@ export function openInBrowser(file) {
|
|
|
291
371
|
if (process.argv[1] && import.meta.url === pathToFileURL(fs.realpathSync(process.argv[1])).href) {
|
|
292
372
|
const args = process.argv.slice(2);
|
|
293
373
|
const root = args.find((a) => !a.startsWith("--"));
|
|
294
|
-
const
|
|
295
|
-
|
|
374
|
+
const projectRoot = root ? path.resolve(root) : process.cwd();
|
|
375
|
+
const out = build(projectRoot);
|
|
376
|
+
const T = TEXT[languageOf(fields(read(path.join(projectRoot, ".workflow", "config.md")) || ""))];
|
|
377
|
+
console.log(`${T.updated}: ${path.relative(process.cwd(), out) || out}`);
|
|
296
378
|
if (args.includes("--open")) {
|
|
297
379
|
const ok = await openInBrowser(out);
|
|
298
|
-
console.log(ok ?
|
|
380
|
+
console.log(ok ? T.opened : `${T.openFailed} ${pathToFileURL(out).href}`);
|
|
299
381
|
if (!ok) process.exitCode = 2;
|
|
300
382
|
}
|
|
301
383
|
}
|