@noob-stupid/dsh-plugin-console 0.5.7 → 0.5.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/client.js +16 -6
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -5048,12 +5048,22 @@ setMessage(t("failed") + ":" + (data?.reason ?? "未知"));
5048
5048
  // 且仅当 configured = ledger.bundles.has(pkg.name) 为真 —— 我们是 profile bundle,天然满足。
5049
5049
  // 所以入口长在那一页「已安装 → 我们的 bundle」详情里,用的是官方容器与官方风格,不是 DOM 注入。
5050
5050
  // 之前那个独立的「升级安全」tab 已按用户要求关闭(错误落点不占位);原 tab(id=console) 一行未动。
5051
- ctx.slots.inject("plugins.bundle.config", () => ctx.slots.register({
5052
- name: "plugins.bundle.config",
5053
- key: "@noob-stupid/dsh-plugin-console",
5054
- locale: NS,
5055
- inject: () => ({}),
5056
- }, PluginSafetyTab));
5051
+ //
5052
+ // 老框架兼容(2026-09-25 用户提问后加固):`plugins.bundle.config` 是**官方插件管理页声明的子插槽**,
5053
+ // 老版本框架里可能根本不存在这个插槽。此时绝不能让它把一个异常抛到 apply() 外面 —— 那样会连带
5054
+ // 把上面那个「插件」tab 一起拖没(前端半边整个 pending/异常)。这里包一层 try/catch:
5055
+ // 插槽不存在 → 只是这个新入口不显示,其余功能(含原 tab)照常。
5056
+ try {
5057
+ ctx.slots.inject("plugins.bundle.config", () => ctx.slots.register({
5058
+ name: "plugins.bundle.config",
5059
+ key: "@noob-stupid/dsh-plugin-console",
5060
+ locale: NS,
5061
+ inject: () => ({}),
5062
+ }, PluginSafetyTab));
5063
+ } catch (error) {
5064
+ // 静默降级:老框架没有该子插槽属预期情况,不该在用户控制台里刷错误
5065
+ ctx.logger?.debug?.("plugin-console: plugins.bundle.config 插槽不可用,已跳过「升级安全」入口", error)
5066
+ }
5057
5067
  }
5058
5068
  exports.NS = NS;
5059
5069
  exports.apply = apply;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noob-stupid/dsh-plugin-console",
3
- "version": "0.5.7",
3
+ "version": "0.5.8",
4
4
  "description": "DSH 框架升级安全与插件升级门控:一键升级、失败自动回滚、升级后回滚上版、旧插件不适配自动禁用;内置多源插件市场为发现层,插件源全部可自定义,可指向公司内网私有源 / 私有索引 / 本地 Git 仓库,纯内网离线可用 | Framework upgrade safety & plugin version gating for DSH, with a customizable multi-source plugin market: point every source at internal mirrors or a local file:// repo for intranet-only, offline installs.",
5
5
  "repository": {
6
6
  "type": "git",