Phase 1 Testing: workspace build scripts (#216) #217

Closed
opened 2026-05-12 10:13:24 +00:00 by xingyue · 1 comment
Owner

验证目标

init workspace 生成的工作区自带 build 脚本,能把 workflows/*-entry.ts 打成符合 bundle 合约的 .esm.js + .d.ts

Ref: #216

测试步骤

  • Step 1: init workspace + template — 新建 workspace 后 package.json 包含 scripts.bundle
  • Step 2: 写一个 workflows/my-flow-entry.ts — 引用 template 的 WorkflowDefinition + createHermesAgent
  • Step 3: bun install && bun run bundle — 构建成功
  • Step 4: dist/my-flow-entry.esm.js 和 dist/my-flow-entry.d.ts 都存在 — .esm.js 是合法 ESM
  • Step 5: uncaged-workflow workflow add my-flow dist/my-flow-entry.esm.js — bundle 被接受注册
  • Step 6: bun test 通过 — 无回归

验证完成标准

所有 checkbox 打勾
现有测试通过

## 验证目标 `init workspace` 生成的工作区自带 build 脚本,能把 `workflows/*-entry.ts` 打成符合 bundle 合约的 `.esm.js` + `.d.ts`。 Ref: #216 ## 测试步骤 - [ ] **Step 1: init workspace + template** — 新建 workspace 后 `package.json` 包含 `scripts.bundle` - [ ] **Step 2: 写一个 workflows/my-flow-entry.ts** — 引用 template 的 WorkflowDefinition + createHermesAgent - [ ] **Step 3: bun install && bun run bundle** — 构建成功 - [ ] **Step 4: dist/my-flow-entry.esm.js 和 dist/my-flow-entry.d.ts 都存在** — .esm.js 是合法 ESM - [ ] **Step 5: uncaged-workflow workflow add my-flow dist/my-flow-entry.esm.js** — bundle 被接受注册 - [ ] **Step 6: bun test 通过** — 无回归 ## 验证完成标准 ✅ 所有 checkbox 打勾 ✅ 现有测试通过
Author
Owner

验证结果

Step 1 init workspace my-projectpackage.jsonscripts.bundle

Step 2workflows/my-flow-entry.ts 引用 @uncaged/workflow-template-develop + hermes agent

Step 3 bun run bundle → 构建成功

Step 4 dist/my-flow-entry.esm.js + .d.ts 存在,ESM 格式正确

⚠️ Step 5 workflow add 报 module resolve 错误 — 这是 #206 的已知问题(bundle external deps 从 dist/ 目录无法 resolve),不属于本 issue 范畴

Step 6 211 tests pass, 0 fail

## 验证结果 ✅ **Step 1** `init workspace my-project` → `package.json` 含 `scripts.bundle` ✅ ✅ **Step 2** 写 `workflows/my-flow-entry.ts` 引用 `@uncaged/workflow-template-develop` + hermes agent ✅ **Step 3** `bun run bundle` → 构建成功 ✅ **Step 4** `dist/my-flow-entry.esm.js` + `.d.ts` 存在,ESM 格式正确 ⚠️ **Step 5** `workflow add` 报 module resolve 错误 — 这是 #206 的已知问题(bundle external deps 从 dist/ 目录无法 resolve),不属于本 issue 范畴 ✅ **Step 6** 211 tests pass, 0 fail
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#217