Skip to content

fix(workbench): report the package version and ship workbench.json - #4

Merged
yaojin3616 merged 1 commit into
dataelement:mainfrom
cinderzhan:fix/workbench-registration-version
Sep 22, 2026
Merged

yaojin3616 merged 1 commit into
dataelement:mainfrom
cinderzhan:fix/workbench-registration-version

Conversation

@cinderzhan

Copy link
Copy Markdown
Collaborator

问题

在 DSH Desktop 工作台市场里,玄学人生登记的是 v0.1.1,但安装后卡片显示 v1.2.0。原因是 lib/client.js 注册工作台时写死了 version: '1.2.0',这个值是适配器的内部里程碑号,不是包版本。

另外,包里没有 workbench.json,Desktop 安装时拿不到工作台 ID(安装记录里是 workbenchId: null),只能等重启后再靠标题去猜对应关系。

修改

  • lib/client.js:注册时改用 WORKBENCH_VERSION(0.1.1),和 package.json 保持一致。
  • 新增 workbench.json,写明 id: ming-life、标题、描述、版本、icon: ☯、入口,并加进 package.json 的 files。
  • 测试:
    • tests/test-original-adapter.mjs 新增断言:注册描述、package.json、workbench.json 三处的 ID、版本、图标一致。
    • scripts/check-distribution.mjs 会检查打出的包里有 workbench.json,且版本对得上。

以后发新版本,需要同时改 package.json、workbench.json 和 WORKBENCH_VERSION。三处对不上时,测试会失败提醒。

验证

  • npm run check:全部通过。
  • npm run check:distribution:打包加 pnpm 安装的检查通过。

要让市场上的版本也生效,合并后需要重新发一次 Release。

🤖 Generated with Claude Code

The Desktop registration hardcoded version 1.2.0 (the adapter's internal
milestone), so the market showed v1.2.0 for the v0.1.1 package. Register
the package version instead, and ship a workbench.json so Desktop learns
the runtime ID `ming-life` at install time rather than guessing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@yaojin3616
yaojin3616 merged commit 4f979b9 into dataelement:main Sep 22, 2026
2 checks passed
@cinderzhan cinderzhan mentioned this pull request Sep 22, 2026
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.

2 participants