refactor: migrate from BunProc to Npm module

- Replace BunProc.install with Npm.add for plugin resolution

- Remove needsInstall check from installDependencies

- Update test files to use Npm module instead of BunProc

- Delete bun/index.ts and bun/registry.ts (no longer needed)
This commit is contained in:
Dax Raad
2026-03-27 11:19:38 -04:00
parent 4d079b34f4
commit ec9c9960a3
8 changed files with 38 additions and 314 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
import path from "path"
import { fileURLToPath, pathToFileURL } from "url"
import semver from "semver"
import { BunProc } from "@/bun"
import { Npm } from "@/npm"
import { Filesystem } from "@/util/filesystem"
import { isRecord } from "@/util/record"
@@ -103,7 +103,7 @@ export async function checkPluginCompatibility(target: string, opencodeVersion:
export async function resolvePluginTarget(spec: string, parsed = parsePluginSpecifier(spec)) {
if (isPathPluginSpec(spec)) return resolvePathPluginTarget(spec)
return BunProc.install(parsed.pkg, parsed.version)
return Npm.add(parsed.version === "latest" ? parsed.pkg : `${parsed.pkg}@${parsed.version}`)
}
export async function readPluginPackage(target: string) {