/
githubmirror
/
tabby
Обзор
Документация
Войти
/
githubmirror
/
tabby
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
app/lib/pluginManager.ts
17 строк
730 B
Eugene
clean up the plugin manager
13 июл 2026, 11:41
Не верифицирован
13 июл 2026, 11:41
d33ba48
Код
Авторство
О чём код?
import Arborist from '@npmcli/arborist' // Arborist is npm's own install engine, used in-process so we don't have to bundle the 18 MB npm CLI // and run it via ELECTRON_RUN_AS_NODE. reify() resolves and installs the full dependency tree. export class PluginManager { async install (targetPath: string, name: string, version: string): Promise<void> { await new Arborist({ path: targetPath, save: false, audit: false, fund: false }) .reify({ add: [`${name}@${version}`] }) } async uninstall (targetPath: string, name: string): Promise<void> { await new Arborist({ path: targetPath, save: false }) .reify({ rm: [name] }) } } export const pluginManager = new PluginManager()