source targets from web project

This commit is contained in:
Ben Allfree
2025-11-22 16:46:52 -08:00
parent b8636aa06c
commit 9e30289fbf
2 changed files with 23 additions and 1 deletions

22
src/constants/targets.ts Normal file
View File

@@ -0,0 +1,22 @@
import hardwareList from "../../vendor/web-flasher/public/data/hardware-list.json";
export interface TargetMetadata {
name: string;
category: string;
}
export const TARGETS: Record<string, TargetMetadata> = {};
// Sort by display name
const sortedHardware = [...hardwareList].sort((a, b) =>
(a.displayName || "").localeCompare(b.displayName || "")
);
sortedHardware.forEach((hw) => {
if (hw.platformioTarget) {
TARGETS[hw.platformioTarget] = {
name: hw.displayName || hw.platformioTarget,
category: hw.tags?.[0] || "Other",
};
}
});

View File

@@ -24,6 +24,6 @@
"@/*": ["./src/*"]
}
},
"include": ["src"],
"include": ["src", "vendor/web-flasher/public/data"],
"references": [{ "path": "./tsconfig.node.json" }]
}