fix: respect plugin allowlist for bundled deps

This commit is contained in:
Peter Steinberger
2026-04-26 11:00:59 +01:00
parent 93f2d42259
commit d22d6aed16
3 changed files with 88 additions and 5 deletions

View File

@@ -907,10 +907,8 @@ function isBundledPluginConfiguredForRuntimeDeps(params: {
if (entry?.enabled === false) {
return false;
}
if (entry?.enabled === true) {
return true;
}
let hasExplicitChannelDisable = false;
let hasConfiguredChannel = false;
for (const channelId of readBundledPluginChannels(params.pluginDir)) {
const normalizedChannelId = normalizeOptionalLowercaseString(channelId);
if (!normalizedChannelId) {
@@ -932,15 +930,31 @@ function isBundledPluginConfiguredForRuntimeDeps(params: {
channelConfig &&
typeof channelConfig === "object" &&
!Array.isArray(channelConfig) &&
(params.includeConfiguredChannels ||
(channelConfig as { enabled?: unknown }).enabled === true)
(channelConfig as { enabled?: unknown }).enabled === true
) {
return true;
}
if (
channelConfig &&
typeof channelConfig === "object" &&
!Array.isArray(channelConfig) &&
params.includeConfiguredChannels
) {
hasConfiguredChannel = true;
}
}
if (hasExplicitChannelDisable) {
return false;
}
if (plugins.allow.length > 0 && !plugins.allow.includes(params.pluginId)) {
return false;
}
if (entry?.enabled === true) {
return true;
}
if (hasConfiguredChannel) {
return true;
}
return readBundledPluginEnabledByDefault(params.pluginDir);
}