dsh-bulk-update 0.0.0-stage → 1.1.2
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 +21 -0
- package/README.en.md +91 -0
- package/README.md +89 -2
- package/client.js +1041 -0
- package/cordis.patch.yml +7 -0
- package/docs/DETAIL.md +1 -0
- package/docs/DETAIL.zh.md +1 -0
- package/docs/preview.svg +50 -0
- package/icon.svg +6 -0
- package/index.js +8 -0
- package/locale/en.json +7 -0
- package/locale/zh.json +7 -0
- package/package.json +60 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 用户
|
|
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.en.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# dsh-bulk-update
|
|
2
|
+
|
|
3
|
+
[简体中文](README.md) | English
|
|
4
|
+
|
|
5
|
+
Adds a **Bulk update** tab to the DSH Plugins page: tick the third-party plugins you installed, check which have a newer release, then update the ticked ones in order with one click.
|
|
6
|
+
|
|
7
|
+
It works through DSH's own `pluginManager` service (`listBundles`, `listVersions`, `updateBundle`). It adds **no background checks, no automatic updates and no second installer** — nothing changes until you press **Update selected**.
|
|
8
|
+
|
|
9
|
+
## Why this exists
|
|
10
|
+
|
|
11
|
+
DSH updates one plugin at a time: open it, check it, install it. With a dozen third-party plugins installed, that is a daily chore. This tab turns it into one pass: check everything, tick what you want, install them in sequence.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
**From GitHub** (the only distribution channel for now):
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
dsh plugin --profile desktop add git+https://github.com/sphere-01/dsh-bulk-update.git#v1.1.0
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
DSH requires a Git install to pin a specific reference, not a branch name. The command above uses the version tag `v1.1.0`. If your Git rejects tags, replace it with the full 40-character commit that `git rev-parse v1.1.0` prints.
|
|
22
|
+
|
|
23
|
+
Refresh the page afterwards and the **Bulk update** tab appears on the Plugins page.
|
|
24
|
+
|
|
25
|
+
> You can also clone the repository and install from a local directory, which suits editing the code yourself.
|
|
26
|
+
|
|
27
|
+
### Updating to a newer version
|
|
28
|
+
|
|
29
|
+
Installed from Git, this plugin **cannot update itself** — a Git repository publishes no version list. For a newer release:
|
|
30
|
+
|
|
31
|
+
```powershell
|
|
32
|
+
dsh plugin --profile desktop remove dsh-bulk-update
|
|
33
|
+
dsh plugin --profile desktop add git+https://github.com/sphere-01/dsh-bulk-update.git#<new tag>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## How to use it
|
|
37
|
+
|
|
38
|
+
1. Open the Plugins page → **Bulk update**
|
|
39
|
+
2. The list holds the third-party plugins you can update in place, all ticked by default
|
|
40
|
+
3. Press **Check for updates**; each row shows `installed → latest`
|
|
41
|
+
4. Untick anything you want to leave alone, then press **Update selected**
|
|
42
|
+
5. The progress panel above the list reports each result
|
|
43
|
+
|
|
44
|
+
The summary line at the top tells you how many plugins are listed, how many are enabled, how many you ticked, and how many of those actually have a newer release.
|
|
45
|
+
|
|
46
|
+
## What it lists
|
|
47
|
+
|
|
48
|
+
Only **third-party plugins installed in this profile that the Host can replace in place**: installed, `availability: 'profile'`, not official, not a management bundle, and carrying an `update` kind.
|
|
49
|
+
|
|
50
|
+
Plugins DSH ships, on-demand official bundles, and dependencies without a bundle declaration **never appear**, so they cannot be updated by accident.
|
|
51
|
+
|
|
52
|
+
A plugin installed from Git **is listed but cannot be ticked** — DSH only moves it to another pinned commit, which has to be supplied by hand.
|
|
53
|
+
|
|
54
|
+
## What an update does
|
|
55
|
+
|
|
56
|
+
- **Check** asks the Host for each package's newer versions, at most 4 at a time (a read-only call, so it parallelises)
|
|
57
|
+
- **Pick** only the newest **stable** release that still declares a bundle, accepts the running DSH, and is not deprecated. Prereleases and deprecated versions are never selected automatically
|
|
58
|
+
- **Update** calls `updateBundle` for each package in list order, **strictly one at a time**. DSH locks the profile's `package.json` for the whole install, so concurrent installs would only wait out that lock and risk the lockfile
|
|
59
|
+
- **Tolerate** a failed install: it is recorded and the run **continues to the next plugin**, so one broken package cannot strand the rest
|
|
60
|
+
- **Stop** waits for the install in flight to finish, then halts the queue
|
|
61
|
+
|
|
62
|
+
A check finished within the last five minutes is reused by a run, so pressing Check and then Update asks the registry once rather than twice.
|
|
63
|
+
|
|
64
|
+
The ticks are kept in the browser's `localStorage`, so a refresh keeps your choice.
|
|
65
|
+
|
|
66
|
+
## Limits
|
|
67
|
+
|
|
68
|
+
- **In-place replacement needs DSH's hot-reload path.** Without it the outcome says a restart is required, and the new version loads after DSH restarts
|
|
69
|
+
- **Some versions are skipped**: when a version's `engines.dsh` or DSH peer requirements reject the running DSH, the row says so instead of forcing the install
|
|
70
|
+
- **Nothing runs while the tab is closed.** There is no background task
|
|
71
|
+
- **The install in flight cannot be cancelled.** Stop takes effect between two installs — deliberately, because cutting pnpm off mid-write can leave a damaged `package.json`
|
|
72
|
+
|
|
73
|
+
## Compatibility
|
|
74
|
+
|
|
75
|
+
Requires DSH `>= 0.2.2-rc.1`.
|
|
76
|
+
|
|
77
|
+
## Development
|
|
78
|
+
|
|
79
|
+
There is no build step: `client.js` is hand-written in the form DSH's module loader consumes directly.
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
node --check client.js
|
|
83
|
+
node test/harness.mjs # the basic paths and defects already fixed
|
|
84
|
+
node test/modes.mjs # 32 real usage scenarios
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
The tests drive a mocked `pluginManager`, so they need no DSH installation.
|
|
88
|
+
|
|
89
|
+
## License
|
|
90
|
+
|
|
91
|
+
MIT
|
package/README.md
CHANGED
|
@@ -1,3 +1,90 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-bulk-update
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
简体中文 | [English](README.en.md)
|
|
4
|
+
|
|
5
|
+
在 DSH 的插件页加一个**「批量更新」**标签页:勾选你自己安装的第三方插件,检查哪些有新版本,然后一键按顺序更新完。
|
|
6
|
+
|
|
7
|
+
它通过 DSH 自带的 `pluginManager` 服务(`listBundles`、`listVersions`、`updateBundle`)工作,**不后台检查、不自动更新、没有第二套安装器**——你不点「一键更新」,它什么都不改。
|
|
8
|
+
|
|
9
|
+
## 为什么做这个
|
|
10
|
+
|
|
11
|
+
DSH 原本只能一个一个插件地点开、检查、更新。装了十几个第三方插件之后,这件事每天重复一遍很烦。这个插件把「检查全部 → 勾选要更新的 → 依次装完」合并成一次操作。
|
|
12
|
+
|
|
13
|
+
## 安装
|
|
14
|
+
|
|
15
|
+
**从 GitHub 安装**(当前唯一的分发方式):
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
dsh plugin --profile desktop add git+https://github.com/sphere-01/dsh-bulk-update.git#v1.1.0
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
DSH 的 Git 安装要求固定到一个具体的引用,不能只写分支名。这里用的是版本标签 `v1.1.0`,方便阅读。标签不接受时,用 `git rev-parse v1.1.0` 打印出的完整 40 位 commit 替换它。
|
|
22
|
+
|
|
23
|
+
装完后刷新页面,插件页就会出现「批量更新」标签。
|
|
24
|
+
|
|
25
|
+
> 也可以把仓库克隆下来,用本地目录方式安装,适合你想改代码的情况。
|
|
26
|
+
|
|
27
|
+
### 怎么更新到新版本
|
|
28
|
+
|
|
29
|
+
这个插件从 Git 安装,所以**不能被「批量更新」自己更新**(Git 仓库没有版本列表可以查询)。有新版本时:
|
|
30
|
+
|
|
31
|
+
```powershell
|
|
32
|
+
dsh plugin --profile desktop remove dsh-bulk-update
|
|
33
|
+
dsh plugin --profile desktop add git+https://github.com/sphere-01/dsh-bulk-update.git#<新版本标签>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
## 怎么用
|
|
38
|
+
|
|
39
|
+
1. 打开插件页 → **批量更新**
|
|
40
|
+
2. 列表里是你能自动更新的第三方插件,默认全部勾选
|
|
41
|
+
3. 点 **检查更新**,每行会显示 `当前版本 → 最新版本`
|
|
42
|
+
4. 取消勾选你不想动的,点 **一键更新**
|
|
43
|
+
5. 底部进度区会逐个显示结果
|
|
44
|
+
|
|
45
|
+
顶部那行汇总会告诉你:共几个插件、几个已启用、你勾了几个、其中几个真有新版本。
|
|
46
|
+
|
|
47
|
+
## 它列出哪些插件
|
|
48
|
+
|
|
49
|
+
只列**这个 profile 里安装的、Host 能就地替换的第三方插件**:已安装、`availability` 为 `profile`、非官方、不是管理类插件、且带 `update` 类型。
|
|
50
|
+
|
|
51
|
+
DSH 自带的插件、官方按需捆绑包、以及没有 bundle 声明的依赖**不会出现**,所以不可能被误更新。
|
|
52
|
+
|
|
53
|
+
从 Git 安装的插件**会列出来,但勾不上**——DSH 只接受「换到另一个固定 commit」这种操作,必须人工指定具体 commit。
|
|
54
|
+
|
|
55
|
+
## 更新时做了什么
|
|
56
|
+
|
|
57
|
+
- **检查**:向 Host 查询每个包的新版本,最多 4 个并发(只读操作,可以并行)
|
|
58
|
+
- **挑选**:只选最新的**正式版**,且必须声明了 bundle、兼容当前 DSH、未被弃用。预发布版和已弃用版永远不会被自动选中
|
|
59
|
+
- **更新**:按列表顺序逐个调用 `updateBundle`,**严格串行**。因为 DSH 在安装期间会锁住 profile 的 `package.json`,并发安装只会撞锁并可能写坏 lockfile
|
|
60
|
+
- **容错**:某个插件装失败会被记录,**继续装下一个**,不会因为一个坏插件卡住整批
|
|
61
|
+
- **停止**:点「停止」会等当前正在装的那个装完,然后不再继续
|
|
62
|
+
|
|
63
|
+
勾选状态存在浏览器的 `localStorage` 里,刷新页面会保留。
|
|
64
|
+
|
|
65
|
+
## 使用限制
|
|
66
|
+
|
|
67
|
+
- **就地替换需要 DSH 的热重载支持**。如果没有,结果会明确写「需要重启 DSH」,新版在重启后才生效
|
|
68
|
+
- **某些版本会被跳过**:如果某版本的 `engines.dsh` 或 DSH peer 依赖拒绝当前运行的 DSH,它会显示原因而不是强行安装
|
|
69
|
+
- **标签页关掉就不跑了**。没有后台任务
|
|
70
|
+
- **不能中途取消正在安装的那一个**。停止只在两次安装之间生效——这是刻意的,写到一半硬砍可能留下损坏的 `package.json`
|
|
71
|
+
|
|
72
|
+
## 兼容性
|
|
73
|
+
|
|
74
|
+
需要 DSH `>= 0.2.2-rc.1`。
|
|
75
|
+
|
|
76
|
+
## 开发
|
|
77
|
+
|
|
78
|
+
源码没有构建步骤,`client.js` 是手写的、DSH 模块加载器能直接吃的形式。
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
node --check client.js
|
|
82
|
+
node test/harness.mjs # 基础路径与已修复的缺陷
|
|
83
|
+
node test/modes.mjs # 32 个真实使用场景
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
测试用 mock 的 `pluginManager` 驱动,不需要装 DSH 也能跑。
|
|
87
|
+
|
|
88
|
+
## 许可
|
|
89
|
+
|
|
90
|
+
MIT
|