fix(plugins): preserve settings for compatibility IDs (#114521)

Honor canonical plugin identity across allowlists, denylists, and plugin mutations. Preserve and deterministically deep-merge alias configuration, and explicitly persist canonical entries in CLI enable and disable commands.

Closes #114320

Co-authored-by: kevin2966n <147227108+kevin2966n@users.noreply.github.com>
This commit is contained in:
Peter Steinberger
2026-07-27 06:54:14 -04:00
committed by GitHub
parent 521f45592e
commit dd472deab4
6 changed files with 213 additions and 17 deletions

View File

@@ -232,6 +232,11 @@ async function runPluginsEnableCommandUnlocked(idInput: string): Promise<void> {
await replaceConfigFile({
nextConfig: next,
...(snapshot.hash !== undefined ? { baseHash: snapshot.hash } : {}),
// Source/runtime projection must retain the explicitly merged canonical
// entry; otherwise compatibility-only nested settings are silently lost.
writeOptions: {
explicitSetPaths: [["plugins", "entries", enableResult.pluginId]],
},
});
await refreshPluginRegistryAfterConfigMutation({
config: next,
@@ -276,6 +281,11 @@ async function runPluginsDisableCommandUnlocked(idInput: string): Promise<void>
await replaceConfigFile({
nextConfig: next,
...(snapshot.hash !== undefined ? { baseHash: snapshot.hash } : {}),
// `id` was normalized before discovery; persist that same canonical entry
// so alias invocations cannot lose settings during source projection.
writeOptions: {
explicitSetPaths: [["plugins", "entries", id]],
},
});
await refreshPluginRegistryAfterConfigMutation({
config: next,