mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 16:10:43 +00:00
refactor: simplify plugin dependency handling
Simplify plugin installation and runtime loading around package-manager-owned dependencies, with Jiti reserved for local/TS fallback paths. Also scans npm plugin install roots so hoisted transitive dependencies are covered by dependency denylist and node_modules symlink checks.
This commit is contained in:
committed by
GitHub
parent
2e8e9cd6ca
commit
ed8f50f240
@@ -39,13 +39,6 @@ export type PluginRegistryOptions = {
|
||||
refresh?: boolean;
|
||||
};
|
||||
|
||||
export type PluginsDepsCliOptions = {
|
||||
json?: boolean;
|
||||
packageRoot?: string;
|
||||
prune?: boolean;
|
||||
repair?: boolean;
|
||||
};
|
||||
|
||||
function countEnabledPlugins(plugins: readonly { enabled: boolean }[]): number {
|
||||
return plugins.filter((plugin) => plugin.enabled).length;
|
||||
}
|
||||
@@ -81,21 +74,6 @@ export function registerPluginsCli(program: Command) {
|
||||
await runPluginsListCommand(opts);
|
||||
});
|
||||
|
||||
plugins
|
||||
.command("deps")
|
||||
.description("Inspect or repair bundled plugin runtime dependencies")
|
||||
.option("--json", "Print JSON")
|
||||
.option("--package-root <path>", "OpenClaw package root to inspect")
|
||||
.option("--prune", "Prune stale unknown external runtime dependency roots", false)
|
||||
.option("--repair", "Install missing bundled runtime dependencies", false)
|
||||
.action(async (opts: PluginsDepsCliOptions) => {
|
||||
const { runPluginsDepsCommand } = await import("./plugins-deps-command.js");
|
||||
await runPluginsDepsCommand({
|
||||
config: getRuntimeConfig(),
|
||||
options: opts,
|
||||
});
|
||||
});
|
||||
|
||||
plugins
|
||||
.command("inspect")
|
||||
.alias("info")
|
||||
|
||||
Reference in New Issue
Block a user