git-watchtower 1.9.17 → 1.9.19

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.
@@ -964,6 +964,7 @@ async function refreshAllSparklines() {
964
964
  return; // Don't refresh too often
965
965
  }
966
966
 
967
+ const sparklineCache = new Map(store.get('sparklineCache'));
967
968
  const currentBranches = store.get('branches');
968
969
  for (const branch of currentBranches.slice(0, 20)) { // Limit to top 20
969
970
  if (branch.isDeleted) continue;
@@ -997,11 +998,12 @@ async function refreshAllSparklines() {
997
998
  }
998
999
 
999
1000
  const counts = Array.from(dayCounts.values());
1000
- store.get('sparklineCache').set(branch.name, generateSparkline(counts));
1001
+ sparklineCache.set(branch.name, generateSparkline(counts));
1001
1002
  } catch (e) {
1002
1003
  // Skip this branch - don't let one failure abort all sparkline updates
1003
1004
  }
1004
1005
  }
1006
+ store.setState({ sparklineCache });
1005
1007
  lastSparklineUpdate = now;
1006
1008
  }
1007
1009
 
@@ -2045,7 +2047,10 @@ function serveFile(res, filePath, logPath) {
2045
2047
  });
2046
2048
  }
2047
2049
 
2048
- const server = http.createServer((req, res) => {
2050
+ let server = null;
2051
+
2052
+ function createStaticServer() {
2053
+ return http.createServer((req, res) => {
2049
2054
  const url = new URL(req.url, `http://localhost:${PORT}`);
2050
2055
  let pathname = url.pathname;
2051
2056
  const logPath = pathname; // Keep original for logging
@@ -2084,7 +2089,8 @@ const server = http.createServer((req, res) => {
2084
2089
  }
2085
2090
 
2086
2091
  serveFile(res, filePath, logPath);
2087
- });
2092
+ });
2093
+ }
2088
2094
 
2089
2095
  // ============================================================================
2090
2096
  // File Watcher
@@ -2996,6 +3002,7 @@ async function start() {
2996
3002
  startServerProcess();
2997
3003
  } else {
2998
3004
  // Static mode
3005
+ server = createStaticServer();
2999
3006
  server.listen(PORT, () => {
3000
3007
  addLog(`Server started on http://localhost:${PORT}`, 'success');
3001
3008
  addLog(`Serving ${STATIC_DIR.replace(PROJECT_ROOT, '.')}`, 'info');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-watchtower",
3
- "version": "1.9.17",
3
+ "version": "1.9.19",
4
4
  "description": "Terminal-based Git branch monitor with activity sparklines and optional dev server with live reload",
5
5
  "main": "bin/git-watchtower.js",
6
6
  "bin": {