feat: port all template categories to JSON format
- Ported Minimalist templates to JSON (Swiss Grid, Brutalist, etc.) - Ported Tech templates to JSON (SaaS, Terminal, Cyberpunk, etc.) - Ported Creative templates to JSON (Art Gallery, Zine, Pop Art, etc.) - Ported Industrial templates to JSON (Blueprint, Factory, Schematic, etc.) - Ported Nature templates to JSON (Botanical, Ocean, Mountain, etc.) - Ported Lifestyle templates to JSON (Cookbook, Travel, Coffee House, etc.) - Ported Vintage templates to JSON (Art Deco, Medieval, Retro 80s, etc.) - Updated README.md to reflect the new JSON-based style system (example configuration and contribution workflow) - Completed migration of over 150 styles to the new architecture
This commit is contained in:
31
validate_templates.cjs
Normal file
31
validate_templates.cjs
Normal file
@@ -0,0 +1,31 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const rootDir = 'd:\\gdfhbfgdbnbdfbdf\\typogenie\\src-tauri\\templates';
|
||||
let errorCount = 0;
|
||||
let totalCount = 0;
|
||||
|
||||
function walk(dir) {
|
||||
const files = fs.readdirSync(dir, { withFileTypes: true });
|
||||
files.forEach(dirent => {
|
||||
const fullPath = path.join(dir, dirent.name);
|
||||
if (dirent.isDirectory()) {
|
||||
walk(fullPath);
|
||||
} else if (dirent.name.endsWith('.json')) {
|
||||
totalCount++;
|
||||
const content = fs.readFileSync(fullPath, 'utf8');
|
||||
try {
|
||||
JSON.parse(content);
|
||||
} catch (e) {
|
||||
console.error(`Invalid JSON in: ${fullPath}\nError: ${e.message}`);
|
||||
errorCount++;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
walk(rootDir);
|
||||
console.log(`\nValidation complete.`);
|
||||
console.log(`Total Templates: ${totalCount}`);
|
||||
console.log(`Errors Found: ${errorCount}`);
|
||||
if (errorCount > 0) process.exit(1);
|
||||
Reference in New Issue
Block a user