feat: type the plugin host record, move plugin strings out of core and add lint checks

This commit is contained in:
LukeGus committed 2026-09-29 13:08:39 -05:00
1 parent bba06f7ff6
commit b8bbcd2196
626 files changed
+23884 -4590

No files matched your search

@@ -1,10 +1,14 @@
import { toast } from "sonner";
import type { PluginApiClient, TermixApp } from "@termix/plugin-sdk/frontend";
import type {
PluginApiClient,
PluginHostRecord,
TermixApp,
} from "@termix/plugin-sdk/frontend";
export function hasMacAddress(host: Record<string, unknown>): boolean {
const settings = host.pluginSettings as
Record<string, Record<string, unknown>> | undefined;
const macAddress = settings?.["wake-on-lan"]?.macAddress;
export function hasMacAddress(
host: Pick<PluginHostRecord, "pluginSettings">,
): boolean {
const macAddress = host.pluginSettings?.["wake-on-lan"]?.macAddress;
return typeof macAddress === "string" && macAddress.trim().length > 0;
}
+1 -1
View File
@@ -9,7 +9,7 @@ export function activate(app: TermixApp): void {
icon: Zap,
kind: "open",
order: 50,
when: (host) => hasMacAddress(host as Record<string, unknown>),
when: (host) => hasMacAddress(host),
run: (host) => wakeHost(app.api, app.t, String(host.id)),
});
}