cc-viewer 1.0.1 → 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.
package/interceptor.js CHANGED
@@ -18,7 +18,9 @@ function generateLogFilePath() {
18
18
  + String(now.getHours()).padStart(2, '0')
19
19
  + String(now.getMinutes()).padStart(2, '0')
20
20
  + String(now.getSeconds()).padStart(2, '0');
21
- const projectName = basename(process.cwd()).replace(/[^a-zA-Z0-9_\-\.]/g, '_');
21
+ let cwd;
22
+ try { cwd = process.cwd(); } catch { cwd = homedir(); }
23
+ const projectName = basename(cwd).replace(/[^a-zA-Z0-9_\-\.]/g, '_');
22
24
  const dir = join(homedir(), '.claude', 'cc-viewer');
23
25
  try { mkdirSync(dir, { recursive: true }); } catch {}
24
26
  return join(dir, `${projectName}_${ts}.jsonl`);
@@ -208,7 +210,7 @@ export function setupInterceptor() {
208
210
 
209
211
  requestEntry = {
210
212
  timestamp,
211
- project: basename(process.cwd()),
213
+ project: (() => { try { return basename(process.cwd()); } catch { return 'unknown'; } })(),
212
214
  url: urlStr,
213
215
  method: options?.method || 'GET',
214
216
  headers,
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "cc-viewer",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Claude Code Logger visualization management tool",
5
5
  "license": "MIT",
6
- "main": "lib/server.js",
6
+ "main": "server.js",
7
7
  "type": "module",
8
8
  "exports": {
9
- ".": "./lib/server.js",
10
- "./server.js": "./lib/server.js",
9
+ ".": "./server.js",
10
+ "./server.js": "./server.js",
11
11
  "./interceptor.js": "./interceptor.js"
12
12
  },
13
13
  "author": "weiesky",
@@ -17,7 +17,7 @@
17
17
  "scripts": {
18
18
  "dev": "vite",
19
19
  "build": "node build.js",
20
- "start": "node lib/server.js",
20
+ "start": "node server.js",
21
21
  "prepublishOnly": "npm run build"
22
22
  },
23
23
  "keywords": [
@@ -41,7 +41,8 @@
41
41
  "node": ">=18"
42
42
  },
43
43
  "files": [
44
- "lib/",
44
+ "dist/",
45
+ "server.js",
45
46
  "cli.js",
46
47
  "interceptor.js",
47
48
  "i18n.js",
@@ -3,8 +3,8 @@ import { readFileSync, existsSync, watchFile, unwatchFile, statSync, writeFileSy
3
3
  import { fileURLToPath } from 'node:url';
4
4
  import { dirname, join, extname, basename } from 'node:path';
5
5
  import { homedir } from 'node:os';
6
- import { LOG_FILE } from '../interceptor.js';
7
- import { t } from '../i18n.js';
6
+ import { LOG_FILE } from './interceptor.js';
7
+ import { t } from './i18n.js';
8
8
 
9
9
  const LOG_DIR = join(homedir(), '.claude', 'cc-viewer');
10
10
  const SHOW_ALL_FILE = '/tmp/cc-viewer-show-all';
File without changes
File without changes
File without changes