opencode-hub 1.0.11 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/oc-tui.js +3 -1
  2. package/package.json +1 -1
package/oc-tui.js CHANGED
@@ -36,12 +36,14 @@ function loadNpmPlugins() {
36
36
  try {
37
37
  // OpenCode installs npm plugins into ~/.cache/opencode/node_modules
38
38
  var cachePkg = join(homedir(), ".cache", "opencode", "node_modules", name, "package.json");
39
- // Fallback: config-local node_modules, then global npm
39
+ // Fallback: config-local node_modules, then global npm, then local repos
40
40
  var globalNpm = process.platform === "win32"
41
41
  ? join(homedir(), "AppData", "Roaming", "npm", "node_modules")
42
42
  : join("/usr", "lib", "node_modules");
43
+ var repoPkg = join(CONFIG_DIR, "repos", "intisy", name, "package.json");
43
44
  var pkgPath = existsSync(cachePkg) ? cachePkg
44
45
  : existsSync(join(CONFIG_DIR, "node_modules", name, "package.json")) ? join(CONFIG_DIR, "node_modules", name, "package.json")
46
+ : existsSync(repoPkg) ? repoPkg
45
47
  : join(globalNpm, name, "package.json");
46
48
  if (existsSync(pkgPath)) {
47
49
  version = JSON.parse(readFileSync(pkgPath, "utf-8")).version || "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-hub",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "description": "TUI launcher for OpenCode - project switcher and plugin manager with oc command",
5
5
  "main": "plugin.js",
6
6
  "type": "module",