opencode-hub 1.0.11 → 1.0.13

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 +5 -2
  2. package/package.json +27 -27
package/oc-tui.js CHANGED
@@ -25,7 +25,7 @@ function loadNpmPlugins() {
25
25
  if (!existsSync(ocPath)) return [];
26
26
  try {
27
27
  var raw = readFileSync(ocPath, "utf-8");
28
- var stripped = raw.replace(/\/\/[^\n]*/g, "");
28
+ var stripped = raw.replace(/^\s*\/\/[^\n]*/gm, "");
29
29
  var oc = JSON.parse(stripped);
30
30
  var plugins = oc.plugin || [];
31
31
  return plugins
@@ -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 || "";
@@ -375,6 +377,7 @@ function showCur() { process.stderr.write(E + "?25h"); }
375
377
 
376
378
  var items = buildList();
377
379
  var pluginItems = buildPluginList();
380
+
378
381
  var npmPluginItems = loadNpmPlugins();
379
382
  var cursor = 0;
380
383
  var pcursor = 0; // plugin page cursor
package/package.json CHANGED
@@ -1,29 +1,29 @@
1
1
  {
2
- "name": "opencode-hub",
3
- "version": "1.0.11",
4
- "description": "TUI launcher for OpenCode - project switcher and plugin manager with oc command",
5
- "main": "plugin.js",
6
- "type": "module",
7
- "license": "MIT",
8
- "author": "intisy",
9
- "repository": {
10
- "type": "git",
11
- "url": "git+https://github.com/intisy/opencode-hub.git"
12
- },
13
- "homepage": "https://github.com/intisy/opencode-hub#readme",
14
- "keywords": [
15
- "opencode",
16
- "launcher",
17
- "tui",
18
- "project-switcher",
19
- "plugin"
20
- ],
21
- "engines": {
22
- "node": ">=20.0.0"
23
- },
24
- "files": [
25
- "plugin.js",
26
- "oc-tui.js",
27
- "README.md"
28
- ]
2
+ "name": "opencode-hub",
3
+ "version": "1.0.13",
4
+ "description": "TUI launcher for OpenCode - project switcher and plugin manager with oc command",
5
+ "main": "plugin.js",
6
+ "type": "module",
7
+ "license": "MIT",
8
+ "author": "intisy",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/intisy/opencode-hub.git"
12
+ },
13
+ "homepage": "https://github.com/intisy/opencode-hub#readme",
14
+ "keywords": [
15
+ "opencode",
16
+ "launcher",
17
+ "tui",
18
+ "project-switcher",
19
+ "plugin"
20
+ ],
21
+ "engines": {
22
+ "node": ">=20.0.0"
23
+ },
24
+ "files": [
25
+ "plugin.js",
26
+ "oc-tui.js",
27
+ "README.md"
28
+ ]
29
29
  }