Repository navigation
dsh-notify 0.3.2
⚠️ 本版只适用于 DSH ≤ 0.1.5。 在 DSH 0.1.7+ 上,本版的inject仍依赖已被移除的settingsScope服务,插件会永远停在pending、完全不加载。请改用 0.4.0。
dsh-notify 0.3.2
⚠️ 装过 0.3.1 的(GitHub Release 或 npm)请务必升级到本版。 0.3.1 的包名改造只做了一半,装完后插件在 DSH 启动时直接加载失败——不是静默降级,是起不来。
0.3.1 坏在哪
0.3.1 把包名从 dsh-notify 改成了 @having5548/dsh-notify(为的是避开 npm 上同名的第三方包 Pasumao/dsh-plugin-notify),但只改了 package.json 的 name。DSH 还会把这个包名用在另外两处模块解析上,它们当时都还是裸名:
| 位置 | 0.3.1 的值 | 正确值 |
|---|---|---|
cordis.patch.yml 里 insert 的 name |
dsh-notify |
@having5548/dsh-notify |
lib/client.js 的 __ModuleLoader__.load({ id }) |
dsh-notify |
@having5548/dsh-notify |
- 前者是插件的模块说明符,必须能被
require.resolve解析; - 后者是客户端 bundle 注册的 id,DSH 侧会校验,不匹配会抛
bundle ... loaded without registering "<id>"。
从 profile 目录实测:
dsh-notify -> MODULE_NOT_FOUND
@having5548/dsh-notify -> OK
本版修复
cordis.patch.yml:name改为'@having5548/dsh-notify'lib/client.js:__ModuleLoader__的 id 改为'@having5548/dsh-notify'- 补上 npm 元数据:
repository/homepage/bugs,以及publishConfig.access: public(作用域包默认 restricted,不加会发布失败) - 版本号 0.3.1 → 0.3.2。
pnpm pack的产物名由包名派生,作用域包会输出having5548-dsh-notify-<版本>.tgz,README 的安装示例同步更新
故意保持不变的内部标识
settings 命名空间、locale 命名空间、/dsh-notify/* 路由、settings.section 的 id 全部仍是 dsh-notify —— 改了会重置你已有的通知设置。服务端导出的插件名也仍然是 dsh-notify(官方 dshmarket 的包名是 dshmarket、导出名却是 dsh-market,可见这里没有强制一致的要求)。
安装
# 从 npm(推荐,作用域名不会被别人占用)
dsh plugin --profile web add @having5548/dsh-notify
# 或从本页附件
dsh plugin --profile web add having5548-dsh-notify-0.3.2.tgz安装后重启 DSH Web GUI 生效(重启会中断当前会话,先保存手头任务)。
环境
- Windows 10+ / macOS,DSH Web GUI(
dsh web) - 全部所用 API 已在 dsh 0.1.5-rc.2 上逐条核对
完整改动
Assets
having5548-dsh-notify-0.3.2.tgz— 插件安装包- SHA256:
B9B1FE81CAD60A2784BB38E500005772B257BF05208B62942371EE5ED9371967