Darstellung: Inline-Code-Chips fuer Dark Mode, 58 Seiten auf .mdx (Komponenten rendern jetzt)
Befund 1 (Nutzer): Inline-Code war im Dark Mode kaum lesbar.
- src/styles/custom.css: eigene Chip-Farben (--tibi-inline-*), Rahmen, nowrap in der ersten Tabellenspalte
- gemessen: Text/Chip 10,2:1 dunkel, 12,4:1 hell
Befund 2 (beim Nachmessen gefunden): 58 Seiten waren .md - Starlight-Komponenten wurden NICHT gerendert
(rohe <Aside>/<Steps>-Tags, import-Zeile als sichtbarer Text auf 57 Seiten).
- alle 58 Seiten auf .mdx umgestellt und MDX-konform gemacht (Imports, Block-Tags in eigenen Zeilen,
HTML-Kommentare -> {/* */}, geschweifte Klammern escaped)
- nachher: 428 Asides, 87 Steps, 158 Tab-Gruppen gerendert, 0 geleakte Imports
- fehlender Import in reference/hooks-daten ergaenzt
Regressionsschutz: audit-docs.mjs prueft jetzt Komponente-ohne-Import, .md-mit-Komponente,
geleakte Imports und rohe Tags im gebauten dist/. AGENTS.md 3 dokumentiert die .mdx-Regel.
Nebenfund: de.json mit ASCII-Umschreibungen -> Issue tibi-admin-nova #6
Build: 71 Seiten gruen, Audit 7 legitime Platzhalter-Marker
This commit is contained in:
1 parent
06c5f0d8ea
commit
dcdb6ee637
64 files changed
+246
-104
No files matched your search
+35
-3
@@ -179,6 +179,18 @@ for (const f of files) {
|
||||
if (!im[1].trim()) add(f, 'image', 'Bild ohne Alt-Text', line);
|
||||
}
|
||||
|
||||
// Komponente genutzt, aber nicht importiert (rendert dann als rohes HTML)
|
||||
const usedComponents = new Set(
|
||||
[...text.matchAll(/<(Aside|Steps|Tabs|TabItem|Card|CardGrid|LinkCard|Badge|FileTree)\b/g)].map((m) => m[1]),
|
||||
);
|
||||
const imported = new Set(
|
||||
([...text.matchAll(/^import\s*\{([^}]*)\}/gm)].flatMap((m) => m[1].split(',').map((s) => s.trim()))),
|
||||
);
|
||||
for (const c of usedComponents) {
|
||||
if (!imported.has(c) && f.endsWith('.mdx')) add(f, 'import', `Komponente <${c}> genutzt, aber nicht importiert`);
|
||||
if (!f.endsWith('.mdx')) add(f, 'import', `Komponente <${c}> in einer .md-Datei — Datei muss .mdx sein`);
|
||||
}
|
||||
|
||||
// Starlight-Komponenten
|
||||
for (const c of new Set(STARLIGHT_COMPONENTS)) {
|
||||
const n = (text.match(new RegExp(`<${c}[\\s/>]`, 'g')) ?? []).length;
|
||||
@@ -248,6 +260,26 @@ for (const f of files) {
|
||||
if (badAdmin) stats.tibiAdminRefs.push(`${rel(f)} (${badAdmin.length}×)`);
|
||||
}
|
||||
|
||||
// --- Render-Prüfung gegen dist/ (Komponenten müssen echt gerendert sein) ----
|
||||
const DIST = path.join(ROOT, 'dist');
|
||||
const renderFindings = [];
|
||||
if (fs.existsSync(DIST)) {
|
||||
const htmlFiles = walk(DIST).filter((f) => f.endsWith('.html'));
|
||||
const RAW_TAG = /<(Aside|Steps|Tabs|TabItem|Card|CardGrid|LinkCard|Badge|FileTree)[\s/>]/;
|
||||
for (const f of htmlFiles) {
|
||||
const html = fs.readFileSync(f, 'utf8');
|
||||
if (html.includes('astrojs/starlight/components')) {
|
||||
renderFindings.push({ file: rel(f), kind: 'render', msg: 'import-Zeile steht sichtbar im HTML (Seite ist .md statt .mdx)', line: null });
|
||||
}
|
||||
const m = RAW_TAG.exec(html);
|
||||
if (m) {
|
||||
renderFindings.push({ file: rel(f), kind: 'render', msg: `Komponenten-Tag <${m[1]}> ungerendert im HTML (Seite ist .md statt .mdx)`, line: null });
|
||||
}
|
||||
}
|
||||
} else {
|
||||
renderFindings.push({ file: 'dist/', kind: 'render', msg: 'dist/ fehlt — zuerst `npm run build` laufen lassen', line: null });
|
||||
}
|
||||
|
||||
// --- Sidebar-Abgleich -----------------------------------------------------
|
||||
const cfg = fs.readFileSync(path.join(ROOT, 'astro.config.mjs'), 'utf8');
|
||||
const sidebarSlugs = [...cfg.matchAll(/slug:\s*'([^']+)'/g)].map((m) => m[1]);
|
||||
@@ -259,10 +291,10 @@ const report = {
|
||||
generatedAt: new Date().toISOString(),
|
||||
stats,
|
||||
sidebar: { count: sidebarSlugs.length, notInSidebar, sidebarMissing },
|
||||
findings,
|
||||
findings: [...findings, ...renderFindings],
|
||||
summary: {
|
||||
total: findings.length,
|
||||
byKind: findings.reduce((a, f) => ({ ...a, [f.kind]: (a[f.kind] ?? 0) + 1 }), {}),
|
||||
total: findings.length + renderFindings.length,
|
||||
byKind: [...findings, ...renderFindings].reduce((a, f) => ({ ...a, [f.kind]: (a[f.kind] ?? 0) + 1 }), {}),
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user