fix(plugins): preserve empty provider scopes

This commit is contained in:
Vincent Koc
2026-04-12 11:04:28 +01:00
parent 269a5b0cfc
commit a5689accc4
4 changed files with 60 additions and 6 deletions

View File

@@ -358,7 +358,8 @@ function buildCacheKey(params: {
},
]),
);
const scopeKey = JSON.stringify(params.onlyPluginIds ?? []);
const scopeKey =
params.onlyPluginIds === undefined ? "__unscoped__" : JSON.stringify(params.onlyPluginIds);
const setupOnlyKey = params.includeSetupOnlyChannelPlugins === true ? "setup-only" : "runtime";
const startupChannelMode =
params.preferSetupRuntimeForChannelPlugins === true ? "prefer-setup" : "full";
@@ -378,7 +379,7 @@ function normalizeScopedPluginIds(ids?: string[]): string[] | undefined {
return undefined;
}
const normalized = Array.from(new Set(ids.map((id) => id.trim()).filter(Boolean))).toSorted();
return normalized.length > 0 ? normalized : undefined;
return normalized;
}
function matchesScopedPluginRequest(params: {
@@ -442,19 +443,19 @@ function buildActivationMetadataHash(params: {
}
function hasExplicitCompatibilityInputs(options: PluginLoadOptions): boolean {
return Boolean(
return (
options.config !== undefined ||
options.activationSourceConfig !== undefined ||
options.autoEnabledReasons !== undefined ||
options.workspaceDir !== undefined ||
options.env !== undefined ||
options.onlyPluginIds?.length ||
options.onlyPluginIds !== undefined ||
options.runtimeOptions !== undefined ||
options.pluginSdkResolution !== undefined ||
options.coreGatewayHandlers !== undefined ||
options.includeSetupOnlyChannelPlugins === true ||
options.preferSetupRuntimeForChannelPlugins === true ||
options.loadModules === false,
options.loadModules === false
);
}