mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-24 01:05:49 +00:00
chore(workflow-engine): 封包发布到 npm
- 移除 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>
This commit is contained in:
21
packages/workflow-engine/scripts/build.ts
Normal file
21
packages/workflow-engine/scripts/build.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
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')
|
||||
Reference in New Issue
Block a user