Only report a missing plugin web build when one is expected (#1013)

Plugins with only host, instance or ctl code have no reason to ship a
webpack build, yet the plugin list showed "Missing dist/web/manifest.json"
as an error for them and the controller logged a warning on every start.

Decide whether a build is expected from the plugin declaration, using the
same rule the create tool uses to decide when to generate one: a web or
controller entrypoint, or any config fields. Plugins outside that rule get
no bundle path and no error, the web UI skips loading them, and the plugin
pages show them as having no web module instead of an error or a prompt to
reload.

Fixes #1004

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
BastiaanandClaude Fable 5.1 authored and GitHub committed 2026-09-12 01:59:16 +01:00
1 parent 9c97eeb597
commit 1a10b38743
9 files changed
+76 -6

No files matched your search

+2 -1
View File
@@ -4,7 +4,8 @@ export type PluginWebApi = {
enabled: boolean;
loaded: boolean;
web: {
main: string;
/** Path to the web bundle, not present if the plugin has no web build. */
main?: string;
error?: string;
};
/**
+17
View File
@@ -41,6 +41,23 @@ export type PluginDeclaration = {
routes?: string[];
}
/**
* Check if a plugin is expected to ship a web build.
*
* Mirrors the rule used by the create tool: a web build is generated when the
* plugin has a web or controller entrypoint or defines config fields.
*/
export function pluginNeedsWebBuild(info: PluginDeclaration) {
return Boolean(
info.webEntrypoint
|| info.controllerEntrypoint
|| info.controllerConfigFields
|| info.hostConfigFields
|| info.instanceConfigFields
|| info.controlConfigFields
);
}
export type PluginNodeEnvInfo = PluginDeclaration & {
/**
* Path to the folder with the static files that should be hosted on the web