mirror of
https://github.com/MeshEnvy/mesh-forge.git
synced 2026-05-02 19:42:45 +02:00
source targets from web project
This commit is contained in:
22
src/constants/targets.ts
Normal file
22
src/constants/targets.ts
Normal 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",
|
||||
};
|
||||
}
|
||||
});
|
||||
@@ -24,6 +24,6 @@
|
||||
"@/*": ["./src/*"]
|
||||
}
|
||||
},
|
||||
"include": ["src"],
|
||||
"include": ["src", "vendor/web-flasher/public/data"],
|
||||
"references": [{ "path": "./tsconfig.node.json" }]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user