plugin-updater 1.0.42 → 1.0.43

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/dist/git.js +21 -0
  2. package/package.json +1 -1
package/dist/git.js CHANGED
@@ -45,6 +45,27 @@ export function updatePlugin(pluginName, gitUrl, branch, commitHash, updateInter
45
45
  const elapsed = Date.now() - lastCheck;
46
46
  if (elapsed < intervalMs) {
47
47
  writeLog(`Fast-path: ${pluginName} skipping update check (checked ${Math.floor(elapsed / 60_000)} min ago, interval ${updateInterval}h)`);
48
+ // even when skipping the network check, keep embedded submodules pinned to
49
+ // this checkout — a loader running against a stale core/core-auth is the
50
+ // top cause of "looks broken but it's just stale". Rebuild if they moved.
51
+ if (fs.existsSync(path.join(targetDir, ".gitmodules"))) {
52
+ let before = "";
53
+ try {
54
+ before = execSync("git submodule status --recursive", { cwd: targetDir }).toString();
55
+ }
56
+ catch { /* ignore */ }
57
+ executeGit("git submodule sync --recursive", targetDir);
58
+ executeGit("git submodule update --init --recursive", targetDir);
59
+ let after = "";
60
+ try {
61
+ after = execSync("git submodule status --recursive", { cwd: targetDir }).toString();
62
+ }
63
+ catch { /* ignore */ }
64
+ if (before !== after) {
65
+ writeLog(`Fast-path: ${pluginName} submodules were out of sync — resynced, forcing rebuild`);
66
+ return { success: true, changed: true };
67
+ }
68
+ }
48
69
  return { success: true, changed: false };
49
70
  }
50
71
  fs.writeFileSync(lastCheckFile, Date.now().toString());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plugin-updater",
3
- "version": "1.0.42",
3
+ "version": "1.0.43",
4
4
  "description": "Plugin lifecycle manager for OpenCode and Claude Code launchers",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",