plugin-updater 1.0.44 → 1.0.45

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 +11 -10
  2. package/package.json +1 -1
package/dist/git.js CHANGED
@@ -63,19 +63,20 @@ export function updatePlugin(pluginName, gitUrl, branch, commitHash, updateInter
63
63
  // this checkout — a loader running against a stale core/core-auth is the
64
64
  // top cause of "looks broken but it's just stale". Rebuild if they moved.
65
65
  if (fs.existsSync(path.join(targetDir, ".gitmodules"))) {
66
- let before = "";
66
+ // Cheap LOCAL drift check first: `git submodule status` prefixes a line
67
+ // with '+' when the submodule is off its pinned commit and '-' when it is
68
+ // uninitialized. Only pay for the expensive recursive sync/update when one
69
+ // of those is true — otherwise this ran a full submodule update on every
70
+ // plugin every launch, which was the bulk of the startup delay.
71
+ let status = "";
67
72
  try {
68
- before = execSync("git submodule status --recursive", { cwd: targetDir }).toString();
73
+ status = execSync("git submodule status --recursive", { cwd: targetDir }).toString();
69
74
  }
70
75
  catch { /* ignore */ }
71
- executeGit("git submodule sync --recursive", targetDir);
72
- executeGit("git submodule update --init --recursive", targetDir);
73
- let after = "";
74
- try {
75
- after = execSync("git submodule status --recursive", { cwd: targetDir }).toString();
76
- }
77
- catch { /* ignore */ }
78
- if (before !== after) {
76
+ const drifted = status.split("\n").some((line) => line.startsWith("+") || line.startsWith("-"));
77
+ if (drifted) {
78
+ executeGit("git submodule sync --recursive", targetDir);
79
+ executeGit("git submodule update --init --recursive", targetDir);
79
80
  writeLog(`Fast-path: ${pluginName} submodules were out of sync — resynced, forcing rebuild`);
80
81
  return { success: true, changed: true };
81
82
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plugin-updater",
3
- "version": "1.0.44",
3
+ "version": "1.0.45",
4
4
  "description": "Plugin lifecycle manager for OpenCode and Claude Code launchers",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",