claude-code-hud 0.3.9 → 0.3.10

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/package.json +1 -1
  2. package/tui/hud.tsx +9 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-hud",
3
- "version": "0.3.9",
3
+ "version": "0.3.10",
4
4
  "description": "Terminal HUD for Claude Code — real-time token usage, git status, project monitor",
5
5
  "type": "module",
6
6
  "bin": {
package/tui/hud.tsx CHANGED
@@ -95,13 +95,13 @@ type ProjectInfo = {
95
95
  dirTree: DirNode;
96
96
  };
97
97
 
98
- async function scanProject(cwd: string): Promise<ProjectInfo> {
98
+ async function scanProject(cwd: string, deep = 8): Promise<ProjectInfo> {
99
99
  const { default: fg } = await import('fast-glob');
100
100
 
101
101
  // File counts by extension
102
102
  const files: string[] = (await fg('**/*', {
103
103
  cwd, ignore: ['**/node_modules/**', '**/.git/**', '**/dist/**', '**/build/**', '**/__pycache__/**', '**/target/**', '**/.next/**', '**/.nuxt/**'],
104
- onlyFiles: true, dot: false, deep: 8,
104
+ onlyFiles: true, dot: false, deep,
105
105
  })).slice(0, 3000);
106
106
 
107
107
  const byExt: Record<string, number> = {};
@@ -155,7 +155,7 @@ async function scanProject(cwd: string): Promise<ProjectInfo> {
155
155
 
156
156
  // Endpoint detection
157
157
  const srcFiles: string[] = await fg('**/*.{ts,tsx,js,jsx,py,java,go}', {
158
- cwd, ignore: ['**/node_modules/**', '**/.git/**', '**/*.test.*', '**/*.spec.*'], onlyFiles: true, deep: 8,
158
+ cwd, ignore: ['**/node_modules/**', '**/.git/**', '**/*.test.*', '**/*.spec.*'], onlyFiles: true, deep,
159
159
  });
160
160
  const endpoints: Record<string, number> = { GET: 0, POST: 0, PUT: 0, DELETE: 0, PATCH: 0 };
161
161
  const PATTERNS: [string, RegExp][] = [
@@ -797,7 +797,11 @@ function App() {
797
797
 
798
798
  useEffect(() => {
799
799
  // Scan project once
800
- scanProject(cwd).then(p => { setProject(p); setLoading(false); }).catch(() => { setLoading(false); });
800
+ // Quick shallow scan first show UI immediately
801
+ scanProject(cwd, 2).then(p => { setProject(p); setLoading(false); })
802
+ .catch(() => { setLoading(false); });
803
+ // Full deep scan in background → update silently
804
+ scanProject(cwd, 8).then(p => { setProject(p); }).catch(() => {});
801
805
  // Initial API usage fetch
802
806
  getUsage().then(setRateLimits).catch(() => {});
803
807
  // Initial timeline load
@@ -912,7 +916,7 @@ function App() {
912
916
  refresh();
913
917
  setProject(null);
914
918
  setSelectedFile(null); setFileLines([]); setFileScroll(0);
915
- scanProject(cwd).then(p => { setProject(p); setTreeCursor(0); }).catch(() => {});
919
+ scanProject(cwd, 8).then(p => { setProject(p); setTreeCursor(0); }).catch(() => {});
916
920
  }
917
921
 
918
922
  if (input === 'j' || input === 'ㅓ' || key.downArrow) {