claude-code-inspector 0.1.5 → 0.1.6
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/.yarnrc +1 -0
- package/bin/cli.js +26 -2
- package/package.json +5 -2
package/.yarnrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
engine-strict false
|
package/bin/cli.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
const { execSync } = require('child_process');
|
|
3
4
|
const path = require('path');
|
|
4
5
|
const fs = require('fs');
|
|
5
6
|
const { createServer } = require('http');
|
|
@@ -11,8 +12,31 @@ const { parse } = require('url');
|
|
|
11
12
|
const installDir = path.resolve(__dirname, '..');
|
|
12
13
|
process.chdir(installDir);
|
|
13
14
|
|
|
14
|
-
//
|
|
15
|
-
//
|
|
15
|
+
// 检查并安装 @types/node 和 @types/react,防止 Next.js 自动安装
|
|
16
|
+
// 使用 npm 而不是 yarn 来避免 eslint-visitor-keys 兼容性问题
|
|
17
|
+
function installTypesIfNeeded() {
|
|
18
|
+
try {
|
|
19
|
+
const typesNodePath = path.join(installDir, 'node_modules', '@types', 'node');
|
|
20
|
+
const typesReactPath = path.join(installDir, 'node_modules', '@types', 'react');
|
|
21
|
+
|
|
22
|
+
if (!fs.existsSync(typesNodePath) || !fs.existsSync(typesReactPath)) {
|
|
23
|
+
console.log('[CLI] Installing @types/node and @types/react...');
|
|
24
|
+
execSync('npm install --no-save @types/node @types/react', {
|
|
25
|
+
stdio: 'inherit',
|
|
26
|
+
env: { ...process.env, npm_config_legacy_peer_deps: 'true' }
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
} catch (error) {
|
|
30
|
+
console.error('[CLI] Failed to install types:', error.message);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
installTypesIfNeeded();
|
|
35
|
+
|
|
36
|
+
// 临时重命名 tsconfig.json,防止 Next.js 尝试自动安装依赖
|
|
37
|
+
// Next.js 会检测 tsconfig.json 并尝试安装 @types/node 和 @types/react
|
|
38
|
+
// 但由于 eslint-visitor-keys 兼容性问题 (Node 23),yarn 安装会失败
|
|
39
|
+
// 解决方案:移动原始 tsconfig.json,创建一个简化版仅包含路径别名
|
|
16
40
|
const tsconfigPath = path.join(installDir, 'tsconfig.json');
|
|
17
41
|
const tsconfigBackupPath = path.join(installDir, 'tsconfig.json.bak');
|
|
18
42
|
let tsconfigMoved = false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-code-inspector",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"bin": {
|
|
6
6
|
"cc-inspector": "./bin/cli.js"
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"next.config.js",
|
|
18
18
|
"tsconfig.json",
|
|
19
19
|
"postcss.config.mjs",
|
|
20
|
-
"server.ts"
|
|
20
|
+
"server.ts",
|
|
21
|
+
".yarnrc"
|
|
21
22
|
],
|
|
22
23
|
"scripts": {
|
|
23
24
|
"dev": "tsx server.ts",
|
|
@@ -30,6 +31,8 @@
|
|
|
30
31
|
},
|
|
31
32
|
"dependencies": {
|
|
32
33
|
"@tailwindcss/postcss": "^4",
|
|
34
|
+
"@types/node": "^20",
|
|
35
|
+
"@types/react": "^19",
|
|
33
36
|
"axios": "^1.13.6",
|
|
34
37
|
"better-sqlite3": "^12.8.0",
|
|
35
38
|
"next": "16.1.6",
|