feat: Add documentation scripts for diagram exports and refresh process

This commit is contained in:
defiQUG
2025-11-11 09:13:22 -08:00
parent 76aa2c72c5
commit b421d2964c
2 changed files with 16 additions and 2 deletions

View File

@@ -9,7 +9,11 @@
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"deploy": "npm run build && gh-pages -d dist"
"deploy": "npm run build && gh-pages -d dist",
"diagram:png": "node scripts/export-architecture.mjs --format=png",
"diagram:svg": "node scripts/export-architecture.mjs --format=svg",
"docs:index": "node scripts/generate-doc-index.mjs",
"docs:refresh": "npm run docs:index && npm run diagram:png"
},
"keywords": [
"non-profit",

View File

@@ -46,7 +46,17 @@ function build() {
for (const cat of Object.keys(byCategory).sort()) {
body += `### ${cat}\n` + byCategory[cat].map(f => `- ${f}`).join('\n') + '\n\n'
}
// Append diagram export instructions (persistent section)
body += '## Diagram Export\n'
body += 'The architecture diagram source is `ArchitectureDiagram.mmd`. Export updated images using:\n\n'
body += '```bash\n'
body += 'npm run diagram:png\n'
body += 'npm run diagram:svg\n'
body += '```\n\n'
body += 'Refresh docs index and PNG in one step:\n\n'
body += '```bash\n'
body += 'npm run docs:refresh\n'
body += '```\n\n'
body += '---\nLast regenerated: ' + new Date().toISOString() + '\n'
writeFileSync(OUTPUT, body)
console.log('docs/README.md regenerated.')