@shellraining/dsh-plugin-updates 0.0.0-stage → 0.1.0

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 shellRaining
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,41 @@
1
- # Temporary Holding Version
1
+ # dsh-plugin-updates
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ 在插件页加一个「更新」标签,检查从 npm 安装的插件有没有新版本,可以逐个更新、全部更新,或者在插件详情页里挑一个版本安装。
4
+
5
+ ## 安装
6
+
7
+ ```sh
8
+ dsh plugin --profile web add @shellraining/dsh-plugin-updates
9
+ ```
10
+
11
+ ## 使用
12
+
13
+ - **已安装插件列表**:有新版本时,「已安装插件」标题旁出现「全部更新(N)」,对应插件卡片的开关左边出现「更新到 x.y.z」。点卡片其他位置照常进入详情页。
14
+ - **更新标签**:打开侧栏的「插件」,切到「更新」,列出所有从 npm 安装的插件,以及当前版本、最新版本和检查状态。点插件名或「详情」会打开官方的插件详情页。
15
+ - **插件详情页**:有新版本时,标题旁显示「可更新」标签,右上角多一个「更新到 x.y.z」按钮。页面底部有版本列表,每个版本都能单独安装,不兼容当前 DSH 的版本不能点。
16
+
17
+ 只检查依赖记录为 `包名@版本范围` 的插件。Git、本地目录、tarball 来源的插件和 DSH 官方插件都会跳过。
18
+
19
+ 打开标签页或详情页时检查一次,结果缓存 10 分钟,点「检查更新」会重新查询。查询直接从浏览器读 npm registry,用的是 profile 中 pnpm 配置的源,查不到时再试插件管理器配置的备选源(默认是 npmmirror)。需要认证的私有源无法检查。
20
+
21
+ ## 更新是怎么做的
22
+
23
+ 插件不改 profile 文件,所有改动都调用宿主插件管理器的接口:先卸载旧版本,再安装 `包名@版本`,用精确版本号保存,并保留原来的启用状态。版本兼容检查、构建脚本审批和锁文件回滚都由宿主处理。
24
+
25
+ 卸载后安装失败时,插件会保持未安装状态,提示里会显示 pnpm 的输出,并提供「恢复」按钮,按原来的版本重新安装。发布不足 24 小时的版本会标为「新发布」,pnpm 开启 `minimumReleaseAge` 时,这类版本可能装不上。
26
+
27
+ 本插件不能在页面里更新自己,因为卸载自己时界面也会一起卸载。需要更新时,列表会给出对应的 `dsh plugin` 命令,退出 DSH 后在终端运行即可。
28
+
29
+ 官方列表没有给卡片开放扩展点,列表上的按钮靠 `data-plugin-group="bundles"`、`data-plugin-package` 和开关的 `role="switch"` 这几个语义属性定位,见 `src/client/anchors.ts`。DSH 改了这部分结构时,列表上的按钮会消失,「更新」标签和详情页不受影响。
30
+
31
+ ## 开发
32
+
33
+ ```sh
34
+ pnpm --filter @shellraining/dsh-plugin-updates build
35
+ ```
36
+
37
+ 只有浏览器半侧,源码在 `src/client/`。semver 打包进 `lib/client.js`,React、React DOM 和 `@deepseek-ai/dsh-client-ui-primitives` 由宿主提供。
38
+
39
+ ## 许可
40
+
41
+ MIT
@@ -0,0 +1,4 @@
1
+ # 插件页的「更新」标签与插件详情页的版本区块,只有浏览器半侧。
2
+ - insert:
3
+ - id: plugin-updates
4
+ name: '@shellraining/dsh-plugin-updates'