claude-usage-dashboard 1.0.2 → 1.0.3

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/bin/cli.js +17 -4
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -1,7 +1,20 @@
1
1
  #!/usr/bin/env node
2
+ import { spawn } from 'child_process';
3
+ import { fileURLToPath } from 'url';
4
+ import path from 'path';
2
5
 
3
- // Keep stdin open so the process stays in the terminal foreground
4
- // (workaround for npx not attaching the child to the foreground process group)
5
- process.stdin.resume();
6
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
7
+ const server = path.join(__dirname, '..', 'server', 'index.js');
6
8
 
7
- import '../server/index.js';
9
+ const child = spawn(process.execPath, [server], {
10
+ stdio: 'inherit',
11
+ // Attach child to the terminal's foreground process group
12
+ detached: false,
13
+ });
14
+
15
+ child.on('exit', (code) => process.exit(code ?? 0));
16
+
17
+ // Forward signals to child
18
+ for (const sig of ['SIGINT', 'SIGTERM']) {
19
+ process.on(sig, () => child.kill(sig));
20
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-usage-dashboard",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Dashboard that visualizes Claude Code usage from local session logs",
5
5
  "main": "server/index.js",
6
6
  "bin": {