mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-15 12:55:51 +00:00
feat: 简化 debug 方式
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
"scripts": {
|
||||
"build": "bun run build.ts",
|
||||
"dev": "bun run scripts/dev.ts",
|
||||
"dev:inspect": "bun --inspect-wait=localhost:8888/2dc3gzl5xot run -d 'MACRO.VERSION:\"2.1.888\"' -d 'MACRO.BUILD_TIME:\"\"' -d 'MACRO.FEEDBACK_CHANNEL:\"\"' -d 'MACRO.ISSUES_EXPLAINER:\"\"' -d 'MACRO.NATIVE_PACKAGE_URL:\"\"' -d 'MACRO.PACKAGE_URL:\"\"' -d 'MACRO.VERSION_CHANGELOG:\"\"' --feature BUDDY --feature TRANSCRIPT_CLASSIFIER src/entrypoints/cli.tsx",
|
||||
"dev:inspect": "bun run scripts/dev-debug.ts",
|
||||
"prepublishOnly": "bun run build",
|
||||
"lint": "biome lint src/",
|
||||
"lint:fix": "biome lint --fix src/",
|
||||
|
||||
2
scripts/dev-debug.ts
Normal file
2
scripts/dev-debug.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
process.env.BUN_INSPECT="localhost:8888/2dc3gzl5xot"
|
||||
await import("./dev")
|
||||
@@ -26,8 +26,13 @@ const envFeatures = Object.entries(process.env)
|
||||
const allFeatures = [...new Set([...DEFAULT_FEATURES, ...envFeatures])];
|
||||
const featureArgs = allFeatures.flatMap((name) => ["--feature", name]);
|
||||
|
||||
// If BUN_INSPECT is set, pass --inspect-wait to the child process
|
||||
const inspectArgs = process.env.BUN_INSPECT
|
||||
? ["--inspect-wait=" + process.env.BUN_INSPECT]
|
||||
: [];
|
||||
|
||||
const result = Bun.spawnSync(
|
||||
["bun", "run", ...defineArgs, ...featureArgs, "src/entrypoints/cli.tsx", ...process.argv.slice(2)],
|
||||
["bun", ...inspectArgs, "run", ...defineArgs, ...featureArgs, "src/entrypoints/cli.tsx", ...process.argv.slice(2)],
|
||||
{ stdio: ["inherit", "inherit", "inherit"] },
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user