@ray1270/dsh-restart 0.3.6 → 0.3.7
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/README.md +35 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -41,11 +41,19 @@
|
|
|
41
41
|
|
|
42
42
|
## 安装
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
已发布到 npm,一行命令:
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
```bash
|
|
47
|
+
dsh plugin --profile desktop add @ray1270/dsh-restart
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
装完**重启一次应用**才会加载(这一次只能手动重启 —— 鸡生蛋),之后就靠这两个按钮了。
|
|
51
|
+
|
|
52
|
+
`dsh plugin add` 走的是 `pnpm add` 到 profile 里,再把包名追加进 `dsh.profile.bundles`,不用手改任何文件。应用里的 **插件 → 添加插件** 走的是同一条路,只是多一个填路径的输入框。
|
|
47
53
|
|
|
48
|
-
|
|
54
|
+
不想走 npm 就下载附件:到 [Releases](https://github.com/Ray1270/dsh-restart/releases) 拿最新的 `ray1270-dsh-restart-<版本>.tgz`,在 **插件 → 添加插件** 里填它的绝对路径。两条路装的是同一个文件 —— release 附件和 npm 上那份 tgz 的 sha256 逐字节相同(每个版本都核对过)。
|
|
55
|
+
|
|
56
|
+
想自己再核对一遍:
|
|
49
57
|
|
|
50
58
|
```powershell
|
|
51
59
|
Get-FileHash .\ray1270-dsh-restart-<版本>.tgz -Algorithm SHA256 # 与同名 .sha256 文件比对
|
|
@@ -57,7 +65,7 @@ Get-FileHash .\ray1270-dsh-restart-<版本>.tgz -Algorithm SHA256 # 与同名
|
|
|
57
65
|
dsh plugin --profile desktop add "<这个目录的绝对路径>"
|
|
58
66
|
```
|
|
59
67
|
|
|
60
|
-
|
|
68
|
+
装完同样要重启一次应用。
|
|
61
69
|
|
|
62
70
|
---
|
|
63
71
|
|
|
@@ -212,7 +220,7 @@ node scripts/install-check.mjs # 13 项:把 tgz 真的装进一个新建的
|
|
|
212
220
|
```bash
|
|
213
221
|
# 1. 改 package.json 的 version(tag 必须与之一致,否则 release 流程第一步就红)
|
|
214
222
|
# 2. 提交
|
|
215
|
-
git tag v0.3.
|
|
223
|
+
git tag v0.3.7
|
|
216
224
|
git push origin main --tags
|
|
217
225
|
```
|
|
218
226
|
|
|
@@ -223,13 +231,31 @@ git push origin main --tags
|
|
|
223
231
|
3. 用同一个 checkout 打 `npm pack`,附上 `.sha256`;
|
|
224
232
|
4. 连着验两次这个 tgz。`package-check` 把它解开:`files` 承诺的、`main` / `exports` 指向的、bundle patch 和 `lib/helper.ps1` 都必须在包里,最后把**包里那份** `lib/index.js` 和 `lib/client.js` 拉起来跑各自的 smoke(37 项 / 27 项)。`install-check` 再往前一步:把它真的装进一个刚建的 profile,让真 launcher 组合一遍,再读回它组合出来的东西(13 项);
|
|
225
233
|
5. 删掉这个 tag 上可能已有的 release,重新建一个公开的,正文由 `scripts/release-notes.mjs` 从上一个 tag 之后的提交生成。
|
|
226
|
-
6.
|
|
234
|
+
6. 把**同一个 tgz**(不是重新打包)`npm publish` 到 npm。默认走 trusted publishing:这一步拿 runner 的 OIDC 身份换一个只够发一次的凭据,`--provenance` 顺带给 tarball 签一份来源证明,仓库里没有任何 npm 密钥。发完把 npm 现在提供的那个文件下载回来、和本地 `.sha256` 比一遍——字节一致才算过。只有「既没配 trusted publisher、也没有 `NPM_TOKEN`」(比如本地打 tag)才打印一行跳过;该发而没发出去是红的。
|
|
235
|
+
|
|
236
|
+
trusted publishing 已经配好了,**不用再去网页上点设置**。当前关系随时可复核:
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
npm trust list @ray1270/dsh-restart
|
|
240
|
+
# type: github / id: 7414ac6a-742e-44c2-aa23-866885d25bed
|
|
241
|
+
# file: release.yml / repository: Ray1270/dsh-restart
|
|
242
|
+
# permissions: publish, stage publish
|
|
243
|
+
```
|
|
227
244
|
|
|
228
|
-
|
|
245
|
+
它是用 CLI 建的,代价只有一次 OTP(2FA),不需要开浏览器:
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
npm trust github @ray1270/dsh-restart --file release.yml \
|
|
249
|
+
--repo Ray1270/dsh-restart --allow-publish -y
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
要复刻到别的包上,前提和约束是:
|
|
229
253
|
|
|
230
254
|
- npm 上 `@ray1270` 得先是你的(注册同名账号即自动持有这个 scope);
|
|
231
|
-
-
|
|
232
|
-
-
|
|
255
|
+
- `--file` 填 workflow 的**文件名**(`release.yml`),不是路径;`environment` 留空就是不绑定 environment;发布这一步必须和它写在同一个文件里(复用 workflow 会改变 npm 看到的那个文件名);
|
|
256
|
+
- 仓库里**不用加任何 secret**:`release.yml` 已经有 `permissions: id-token: write`,发布步骤靠 runner 的 OIDC 身份换凭据。npm CLI 得 ≥ 11.5.2(node 24 自带的够用),发布步骤会先查版本,太老就带着明确信息红掉,而不是丢一句「认证失败」。
|
|
257
|
+
|
|
258
|
+
`NPM_TOKEN` secret 仍然被支持(有就优先用它):Classic 的 **Automation**,或者 Granular 里勾 **Read and write**、只给这一个包。但 npm 已公布 bypass-2FA token 的直接发布会在 2027 年 1 月收回([changelog](https://github.blog/changelog/2026-07-31-restricting-npm-bypass-2fa-granular-access-tokens/)),所以默认路径是 OIDC。
|
|
233
259
|
|
|
234
260
|
之后打的 tag 会自动多一份 npm 镜像;已经发过的版本不会被重复发布(重跑同一个 tag 会打印 `already there — left alone`),所以 `workflow_dispatch` 那条恢复路径仍然安全。
|
|
235
261
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ray1270/dsh-restart",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7",
|
|
4
4
|
"description": "Refresh and one-click restart for the DeepSeek Harness desktop app: 刷新 reloads the client on the same Session, 重启 restarts the shell back on that Session through a helper the WMI service starts outside the application's process tree",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|