Skip to content

fix(sdk): publish neutral declarations without Zod leakage - #120

Merged
Disdjj merged 2 commits into
mainfrom
fix/sdk-0.20.1-declaration-pack
Aug 29, 2026
Merged

fix(sdk): publish neutral declarations without Zod leakage#120
Disdjj merged 2 commits into
mainfrom
fix/sdk-0.20.1-declaration-pack

Conversation

@Disdjj

@Disdjj Disdjj commented Aug 29, 2026

Copy link
Copy Markdown
Member

问题

sdk-v0.20.0 的发布在 tarball 校验阶段失败:mailbox device 声明通过 z.infer 暴露了 Zod 内部模块路径,打包后的 dist/device.d.ts 引用了包内不存在的 dist/v4/classic/external.cjs

修复

  • WireDeviceOperationListRequest 改为显式 wire 接口,并让运行时 schema 通过 ZodType 校验该接口
  • 将 SDK 中性声明的 Zod 泄漏检查扩展到 root/device/client/store 全部入口
  • 增加 device 声明回归测试
  • @tool-bridge/sdk 升至 0.20.1
  • 放宽两个在并发 CI 中已复现的测试等待预算,不改变运行时代码或断言语义

验证

  • pnpm verify
  • pnpm turbo run build
  • node scripts/pack-and-verify-package.mjs packages/sdk --output-dir <tmp>
  • 仓库外安装并导入 SDK root/device/client/store 入口
  • 受影响的 federation 与 integration dialog 测试各连续运行 3 次
  • 构建后的 packages/sdk/dist/index.js 包含 0.20.1

Disdjj added 2 commits August 29, 2026 13:59
The 0.20.0 publish was blocked because z.infer made the neutral SDK declaration bundle reference an unpacked Zod path. Freeze the public request shape explicitly, keep the runtime schema checked against it, and extend the package gate to reject the same leak from every neutral entry. Bump SDK to 0.20.1 so the failed 0.20.0 tag remains an immutable audit record.
The release PR exposed two timing-sensitive tests under the shared CI runner: federation hydration could consume its deadline before the assertion path, and the integration dialog could render after RTL's one-second default. Give both tests explicit budgets that preserve their behavior while avoiding unrelated release failures.
@Disdjj
Disdjj merged commit b9e6bb2 into main Aug 29, 2026
4 checks passed
@Disdjj
Disdjj deleted the fix/sdk-0.20.1-declaration-pack branch August 29, 2026 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant