feat(plugins): refresh registry after plugin mutations

This commit is contained in:
Vincent Koc
2026-04-25 04:30:21 -07:00
parent 53c3c949d0
commit 0cc2b0e283
5 changed files with 72 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ import { updateNpmInstalledHookPacks } from "../hooks/update.js";
import { updateNpmInstalledPlugins } from "../plugins/update.js";
import { defaultRuntime } from "../runtime.js";
import { theme } from "../terminal/theme.js";
import { refreshPluginRegistryAfterConfigMutation } from "./plugins-registry-refresh.js";
import {
resolveHookPackUpdateSelection,
resolvePluginUpdateSelection,
@@ -112,6 +113,13 @@ export async function runPluginUpdateCommand(params: {
nextConfig: hookResult.config,
baseHash: (await sourceSnapshotPromise)?.hash,
});
if (pluginResult.changed) {
await refreshPluginRegistryAfterConfigMutation({
config: hookResult.config,
reason: "source-changed",
logger,
});
}
defaultRuntime.log("Restart the gateway to load plugins and hooks.");
}
}