feat: introduce vendors.json for mapping vendors to models and refactor targets.ts to utilize new data structure

This commit is contained in:
Ben Allfree
2025-12-10 17:39:10 -08:00
parent c38e6b735c
commit cdc4959dca
6 changed files with 498 additions and 263 deletions

View File

@@ -9,14 +9,6 @@ const FIRMWARE_DIR = path.resolve(__dirname, "../vendor/firmware")
const VARIANTS_DIR = path.join(FIRMWARE_DIR, "variants")
const OUTPUT_FILE = path.resolve(__dirname, "../constants/architecture-hierarchy.json")
/**
* Normalize architecture/target name (remove hyphens and underscores)
* This ensures consistent format matching PlatformIO architecture names
*/
function normalizeName(name) {
return name.replace(/[-_]/g, "")
}
/**
* Parse PlatformIO ini file to extract sections and their properties
*/
@@ -342,15 +334,8 @@ function buildParentMapping() {
delete resolvedParentMap[key]
}
// Normalize all keys and values (strip hyphens and underscores)
const normalizedMap = {}
for (const [key, value] of Object.entries(resolvedParentMap)) {
const normalizedKey = normalizeName(key)
const normalizedValue = value !== null ? normalizeName(value) : null
normalizedMap[normalizedKey] = normalizedValue
}
return normalizedMap
// Return map with actual PlatformIO environment names (no normalization)
return resolvedParentMap
}
/**