fix: unraid-connect plugin not loaded when connect is installed (#1856)

Previously, api plugins could only be installed as `peerDependencies` in
the api. This change allows them to be listed as `dependencies` as well.
This makes plugin loading (eg loading Connect) more robust.

Tests:

- [x] Re-logging on 7.3.0-beta.0.5
This commit is contained in:
Pujit Mehrotra
2025-12-19 15:06:52 -05:00
committed by GitHub
parent e42d619b6d
commit 73135b8328

View File

@@ -91,13 +91,9 @@ export class PluginService {
return name;
})
);
const { peerDependencies } = getPackageJson();
// All api plugins must be installed as peer dependencies of the unraid-api package
if (!peerDependencies) {
PluginService.logger.warn('Unraid-API peer dependencies not found; skipping plugins.');
return [];
}
const pluginTuples = Object.entries(peerDependencies).filter(
const { peerDependencies = {}, dependencies = {} } = getPackageJson();
const allDependencies = { ...peerDependencies, ...dependencies };
const pluginTuples = Object.entries(allDependencies).filter(
(entry): entry is [string, string] => {
const [pkgName, version] = entry;
return pluginNames.has(pkgName) && typeof version === 'string';