fix(lib/plugins): don't add own IDs to dependency map of reserved dependencies

This commit is contained in:
PalmDevs 2026-08-13 01:42:43 +07:00
parent 34e8430257
commit 6f50a92c71
No known key found for this signature in database
GPG key ID: 6FAE8F8677ACA8BA

View file

@ -21,6 +21,7 @@ import {
ApiDependencyId,
computePendingNodes,
DiscordDependencyId,
isReservedDependency,
pLeafOrSingleNodes,
pListOrdered,
pPending,
@ -347,9 +348,12 @@ export function registerInternalPlugin<O extends PluginApiExtensionsOptions>(
manifest.version ??= InternalPluginVersion
// TODO: This has to be shared from native somehow.
manifest.format ??= 1
manifest.dependencies ??= {}
manifest.dependencies[ApiDependencyId] ??= { version: '*' }
manifest.dependencies[DiscordDependencyId] ??= { version: '*' }
if (!isReservedDependency(manifest.id)) {
manifest.dependencies ??= {}
manifest.dependencies[ApiDependencyId] ??= { version: '*' }
manifest.dependencies[DiscordDependencyId] ??= { version: '*' }
}
return register(manifest as PluginManifest, options, defflags, iflags)
}