From 9e30289fbfa3645feba735df9cec7da73d374e74 Mon Sep 17 00:00:00 2001 From: Ben Allfree Date: Sat, 22 Nov 2025 16:46:52 -0800 Subject: [PATCH] source targets from web project --- src/constants/targets.ts | 22 ++++++++++++++++++++++ tsconfig.json | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 src/constants/targets.ts diff --git a/src/constants/targets.ts b/src/constants/targets.ts new file mode 100644 index 0000000..1628c3f --- /dev/null +++ b/src/constants/targets.ts @@ -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 = {}; + +// 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", + }; + } +}); diff --git a/tsconfig.json b/tsconfig.json index d57034a..a531fb3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -24,6 +24,6 @@ "@/*": ["./src/*"] } }, - "include": ["src"], + "include": ["src", "vendor/web-flasher/public/data"], "references": [{ "path": "./tsconfig.node.json" }] }