Skip to content

v0.0.2 - 修复 sharp/libvips 重复加载

Latest

Choose a tag to compare

@yejiming yejiming released this 31 Aug 08:08

修复内容

  • 不再把 sharp 作为插件私有运行时依赖发布,改为复用 DSH 宿主已经加载的 sharp/libvips 单例。
  • 将 sharp 声明为可选 peer dependency,避免 DSH profile 再安装一份原生库。
  • 开发与测试基线对齐到 sharp@0.35.4,并新增包契约回归测试,防止私有 sharp 依赖重新进入发布产物。

解决的问题

修复 macOS 下同一 DSH 进程同时加载两套 libvips-cpp 时出现的 Objective-C 重复类警告:

Class GNotificationCenterDelegate is implemented in both ...libvips-cpp...

该问题可能导致附件、图片处理或 PPT 工作流出现随机类型转换失败和原生崩溃。升级后,插件与 DSH 宿主共用同一份 sharp@0.35.4 / libvips 8.18.6。

兼容性

  • 没有工具 API 或配置格式的破坏性变更。
  • 适用于当前 DSH 0.1.2-alpha.2 运行时。
  • sharp peer 范围为 ^0.35.3。

验证

  • 53个单元/契约测试通过。
  • 21个集成测试通过,2个按设计跳过。
  • TypeScript 类型检查、构建和 tarball 内容检查通过。
  • 隔离 DSH Web 冷启动返回HTTP 200。
  • 运行进程只加载全局 DSH 的 libvips-cpp.8.18.6.dylib,未出现重复 Objective-C 类警告。
  • 发布 tarball SHA-256:f73e93231ef0aeb95af545282b1c95dbf1fffafc85f649556ab9aa6299a1eeb1。

升级

dsh plugin --profile web add @yejiming/dsh-ppt@0.0.2 --registry=https://registry.npmjs.org/
dsh plugin --profile headless add @yejiming/dsh-ppt@0.0.2 --registry=https://registry.npmjs.org/

升级正在运行的 DSH profile 后,需要重启对应 DSH 进程才能加载新代码。