-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate-elements.js
More file actions
45 lines (38 loc) · 1.69 KB
/
generate-elements.js
File metadata and controls
45 lines (38 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Script to generate the comprehensive elements.ts file
const fs = require('fs')
const content = `/**
* Enhanced Element Library with Icons and Better Data
* Comprehensive Brazilian permaculture and agriculture database
*/
import type { Plant, Terrain, Structure } from '@/types/canvas'
// Helper function to get icon for an element
export function getElementIcon(name: string, type: 'plant' | 'terrain' | 'structure'): string {
const icons = {
plant: {
'Eucalipto': '🌳', 'Ipê Amarelo': '🌳', 'Pau-Brasil': '🌳', 'Jatobá': '🌳',
'Tomate': '🍅', 'Alface': '🥬', 'Cenoura': '🥕', 'Milho': '🌽',
'Laranjeira': '🍊', 'Limoeiro': '🍋', 'Bananeira': '🍌', 'Abacateiro': '🥑',
'Hortelã': '🌿', 'Alecrim': '🌿', 'Manjericão': '🌿',
},
terrain: {
'Campo de cultivo': '🌾', 'Lago': '🌊', 'Mata nativa': '🌳',
'Trilha': '🥾', 'Zona 1 - Intensiva': '🏠',
},
structure: {
'Cisterna': '💧', 'Casa principal': '🏠', 'Galpão': '🏚️',
'Estufa': '🏭', 'Composteira': '🌱',
}
};
return icons[type]?.[name] || (type === 'plant' ? '🌱' : type === 'terrain' ? '🟫' : '🏗️');
}
// Legacy exports for backward compatibility
export const ENHANCED_PLANTS: Plant[] = []
export const ENHANCED_TERRAINS: Terrain[] = []
export const ENHANCED_STRUCTURES: Structure[] = []
// Icon mappings (kept for reference)
export const PLANT_ICONS: Record<string, string> = {}
export const TERRAIN_ICONS: Record<string, string> = {}
export const STRUCTURE_ICONS: Record<string, string> = {}
`
fs.writeFileSync('client/src/data/elements.ts', content, 'utf8')
console.log('✅ Generated client/src/data/elements.ts')