mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-23 16:55:51 +00:00
- 移除 private,补全 exports/types/files/publishConfig/license/repository 等 - 添加 LICENSE (MIT) 与 README - 添加 scripts/build.ts + tsconfig.build.json,用 tsc emit 输出 dist/**/*.js + .d.ts (Bun bundle + external zod 会丢失 createWorkflowTool/workflowInputSchema/persistInlineScript 符号,改用 tsc emit) - 修 src/index.ts 的 WORKFLOW_TOOL_NAME 重复 export;tool/* 的 named re-export 改为 import + 再 export Co-Authored-By: glm-5.2 <zai-org@claude-code-best.win>
22 lines
579 B
TypeScript
22 lines
579 B
TypeScript
import { mkdir, rm } from 'node:fs/promises'
|
|
|
|
const ROOT = new URL('../', import.meta.url)
|
|
const DIST = new URL('../dist/', import.meta.url)
|
|
|
|
await rm(DIST, { recursive: true, force: true })
|
|
await mkdir(DIST, { recursive: true })
|
|
|
|
// Emit dist/**/*.js + dist/**/*.d.ts (+ maps) via tsc.
|
|
const proc = Bun.spawn(['bunx', 'tsc', '-p', 'tsconfig.build.json'], {
|
|
cwd: ROOT.pathname,
|
|
stdout: 'inherit',
|
|
stderr: 'inherit',
|
|
})
|
|
const exitCode = await proc.exited
|
|
if (exitCode !== 0) {
|
|
console.error('tsc emit failed')
|
|
process.exit(exitCode)
|
|
}
|
|
|
|
console.log('✓ build complete')
|