refactor(plugins): make manifests own config ui hints (#121329)

This commit is contained in:
Peter Steinberger
2026-08-09 18:48:49 -07:00
committed by GitHub
parent a6c410ef51
commit 620fcd0e27
16 changed files with 122 additions and 432 deletions
+3 -1
View File
@@ -28,7 +28,8 @@ describe("linux-node config", () => {
});
it("exports the same strict shape through the plugin schema", () => {
const safeParse = createLinuxNodePluginConfigSchema().safeParse;
const schema = createLinuxNodePluginConfigSchema();
const safeParse = schema.safeParse;
if (!safeParse) {
throw new Error("missing config schema validator");
}
@@ -37,5 +38,6 @@ describe("linux-node config", () => {
unexpected: true,
});
expect(result.success).toBe(false);
expect(schema).not.toHaveProperty("uiHints");
});
});
+1 -16
View File
@@ -19,22 +19,7 @@ export type ResolvedLinuxNodePluginConfig = {
};
export function createLinuxNodePluginConfigSchema() {
return buildPluginConfigSchema(LinuxNodePluginConfigSchema, {
uiHints: {
"notify.enabled": {
label: "Desktop Notifications",
help: "Expose system.notify when notify-send is installed. Enabled by default.",
},
"camera.enabled": {
label: "Camera",
help: "Expose camera commands when FFmpeg is installed. Requires a node service restart.",
},
"location.enabled": {
label: "Location",
help: "Expose location.get when the GeoClue where-am-i demo is installed. Requires a node service restart.",
},
},
});
return buildPluginConfigSchema(LinuxNodePluginConfigSchema);
}
export function resolveLinuxNodePluginConfig(value: unknown): ResolvedLinuxNodePluginConfig {