Files
83fb08926d feat: 补充构建配置,实现 Claude Code 源码编译
添加缺失的项目配置文件,使源码快照可以成功编译和运行:
- package.json: 85+ 依赖项 + 构建脚本
- tsconfig.json: TypeScript + JSX + src/ 路径别名
- globals.d.ts: MACRO 构建常量 + bun:bundle 类型声明
- scripts/build.ts: Bun 构建脚本(feature flag polyfill + MACRO 注入 + 内部包 stub + 缺失源文件自动 stub)
- BUILD_GUIDE.md: 中文编译文档
- 修 Commander.js v13 的 -d2e 短标志兼容问题

构建脚本通过 missingSourceStubPlugin 插件自动检测并 stub 缺失的源文件,
无需在源码树中手动创建 stub 文件。

构建结果:dist/cli.js (11.7 MB),CLI 可正常启动并显示交互式终端 UI。

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-01 12:01:06 +08:00

105 lines
3.1 KiB
JSON

{
"name": "@anthropic-ai/claude-code",
"version": "1.0.0-research",
"description": "Claude Code CLI - Source snapshot for research",
"type": "module",
"main": "src/entrypoints/cli.tsx",
"bin": {
"claude": "dist/cli.js"
},
"scripts": {
"build": "bun run scripts/build.ts",
"dev": "bun run src/entrypoints/cli.tsx",
"typecheck": "bun x tsc --noEmit"
},
"dependencies": {
"@alcalzone/ansi-tokenize": "^0.1.0",
"@anthropic-ai/bedrock-sdk": "^0.12.0",
"@anthropic-ai/sdk": "^0.39.0",
"@anthropic-ai/vertex-sdk": "^0.6.0",
"@aws-sdk/client-bedrock": "^3.750.0",
"@aws-sdk/client-bedrock-runtime": "^3.750.0",
"@aws-sdk/client-sts": "^3.750.0",
"@azure/identity": "^4.6.0",
"@commander-js/extra-typings": "^13.1.0",
"@growthbook/growthbook": "^1.4.0",
"@modelcontextprotocol/sdk": "^1.11.0",
"@opentelemetry/api": "^1.9.0",
"@opentelemetry/api-logs": "^0.200.0",
"@opentelemetry/core": "^2.0.0",
"@opentelemetry/resources": "^2.0.0",
"@opentelemetry/sdk-logs": "^0.200.0",
"@opentelemetry/sdk-metrics": "^2.0.0",
"@opentelemetry/sdk-trace-base": "^2.0.0",
"@opentelemetry/semantic-conventions": "^1.28.0",
"ajv": "^8.17.0",
"asciichart": "^1.5.0",
"auto-bind": "^5.0.0",
"axios": "^1.7.0",
"bidi-js": "^1.0.0",
"chalk": "^5.4.0",
"chokidar": "^4.0.0",
"cli-boxes": "^3.0.0",
"code-excerpt": "^4.0.0",
"commander": "^13.1.0",
"diff": "^7.0.0",
"emoji-regex": "^10.4.0",
"env-paths": "^3.0.0",
"execa": "^9.5.0",
"fflate": "^0.8.0",
"figures": "^6.1.0",
"fuse.js": "^7.0.0",
"get-east-asian-width": "^1.3.0",
"google-auth-library": "^9.15.0",
"highlight.js": "^11.11.0",
"https-proxy-agent": "^7.0.0",
"ignore": "^7.0.0",
"indent-string": "^5.0.0",
"jsonc-parser": "^3.3.0",
"lodash-es": "^4.17.0",
"lru-cache": "^11.0.0",
"marked": "^15.0.0",
"p-map": "^7.0.0",
"picomatch": "^4.0.0",
"proper-lockfile": "^4.1.0",
"qrcode": "^1.5.0",
"react": "^19.0.0",
"react-reconciler": "0.33.0",
"semver": "^7.6.0",
"sharp": "^0.33.0",
"shell-quote": "^1.8.0",
"signal-exit": "^4.1.0",
"stack-utils": "^2.0.0",
"strip-ansi": "^7.1.0",
"supports-hyperlinks": "^3.1.0",
"tree-kill": "^1.2.0",
"turndown": "^7.2.0",
"type-fest": "^4.30.0",
"undici": "^7.3.0",
"usehooks-ts": "^3.1.0",
"vscode-jsonrpc": "^8.2.0",
"vscode-languageserver-protocol": "^3.17.0",
"vscode-languageserver-types": "^3.17.0",
"wrap-ansi": "^9.0.0",
"ws": "^8.18.0",
"xss": "^1.0.0",
"yaml": "^2.7.0",
"zod": "^3.25.0"
},
"devDependencies": {
"@types/bun": "^1.2.0",
"@types/diff": "^7.0.0",
"@types/lodash-es": "^4.17.0",
"@types/node": "^22.0.0",
"@types/proper-lockfile": "^4.1.0",
"@types/qrcode": "^1.5.0",
"@types/react": "^19.0.0",
"@types/react-reconciler": "^0.28.0",
"@types/semver": "^7.5.0",
"@types/shell-quote": "^1.7.0",
"@types/stack-utils": "^2.0.0",
"@types/ws": "^8.5.0",
"typescript": "^5.7.0"
}
}