@laraveladmin/dsh-stay-awake 0.2.9 → 0.2.11
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/CHANGELOG.md +18 -0
- package/README.en.md +25 -5
- package/README.md +25 -5
- package/docs/RELEASING.md +73 -0
- package/docs/REQUIREMENTS.md +14 -0
- package/market/index.json +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# 变更记录 · Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.11 — 2026-12-03
|
|
4
|
+
|
|
5
|
+
### 文档与发布流程
|
|
6
|
+
|
|
7
|
+
- README 中英新增「更新」章节:registry / Discover / Git / 本地目录四种安装方式各自的更新路径,以及
|
|
8
|
+
"更新只替换包、配置保留"" 更新后保存为精确版本"" 插件自身不联网检查更新"三个要点。
|
|
9
|
+
- Discover 索引源首选地址改为 GitHub raw(推送即生效),jsDelivr 降为备用(需缓存刷新)。
|
|
10
|
+
- REQUIREMENTS 新增 FR-11「更新与发布运维」,明确更新职责在 DSH 插件管理器。
|
|
11
|
+
- 新增 `docs/RELEASING.md` 发布清单;`scripts/build-index.mjs` 支持 `--purge-only` 刷新 jsDelivr 缓存。
|
|
12
|
+
|
|
13
|
+
## 0.2.10 — 2026-12-03
|
|
14
|
+
|
|
15
|
+
### 维护
|
|
16
|
+
|
|
17
|
+
- 新增 GitHub Actions CI(`.github/workflows/ci.yml`):语法检查 + 79 个单测/接线测试 + 市场索引一致性,
|
|
18
|
+
让社区目录可以看到持续集成的绿灯。
|
|
19
|
+
- README 中英加 CI 状态徽章。
|
|
20
|
+
|
|
3
21
|
## 0.2.9 — 2026-12-03
|
|
4
22
|
|
|
5
23
|
### 元数据(为社区目录收录做准备)
|
package/README.en.md
CHANGED
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
`@laraveladmin/dsh-stay-awake` · macOS / Windows / Linux
|
|
8
8
|
|
|
9
9
|
<p>
|
|
10
|
-
<img alt="version" src="https://img.shields.io/badge/version-0.2.
|
|
10
|
+
<img alt="version" src="https://img.shields.io/badge/version-0.2.11-blue">
|
|
11
11
|
<img alt="platform" src="https://img.shields.io/badge/platform-macOS%20%7C%20Windows%20%7C%20Linux-4c6ef5">
|
|
12
|
+
<img alt="ci" src="https://github.com/laraveladmin-cn/dsh-stay-awake/actions/workflows/ci.yml/badge.svg">
|
|
12
13
|
<img alt="license" src="https://img.shields.io/badge/license-MIT-green">
|
|
13
14
|
</p>
|
|
14
15
|
|
|
@@ -63,7 +64,7 @@ A short alert when a task finishes, played on the machine that runs the DSH host
|
|
|
63
64
|
|
|
64
65
|
**Requirements**: DSH 0.2.x (Desktop or `dsh web`). The plugin has no third-party runtime dependencies and needs no Node toolchain.
|
|
65
66
|
|
|
66
|
-
Published on npm: [`@laraveladmin/dsh-stay-awake@0.2.
|
|
67
|
+
Published on npm: [`@laraveladmin/dsh-stay-awake@0.2.11`](https://www.npmjs.com/package/@laraveladmin/dsh-stay-awake)
|
|
67
68
|
|
|
68
69
|
### Option 1 — install from npm (recommended)
|
|
69
70
|
|
|
@@ -83,13 +84,14 @@ DSH ships no index source. Add the index file this npm package publishes and the
|
|
|
83
84
|
2. Open **Discover** → **Add index source** and paste:
|
|
84
85
|
|
|
85
86
|
```text
|
|
86
|
-
https://
|
|
87
|
+
https://raw.githubusercontent.com/laraveladmin-cn/dsh-stay-awake/main/market/index.json
|
|
87
88
|
```
|
|
88
89
|
|
|
89
90
|
3. Search for "Stay awake" or `dsh-stay-awake` and install a version.
|
|
90
91
|
|
|
91
|
-
> The index is a plugin-market format 1 document validated with DSH's own validator.
|
|
92
|
-
> `https://
|
|
92
|
+
> The index is a plugin-market format 1 document, updated with every release and validated with DSH's own validator.
|
|
93
|
+
> Alternate: jsDelivr `https://cdn.jsdelivr.net/npm/@laraveladmin/dsh-stay-awake/market/index.json` (its cache must be purged before it exposes a new release);
|
|
94
|
+
> or a version-pinned mirror URL: `https://registry.npmmirror.com/@laraveladmin/dsh-stay-awake/0.2.11/files/market/index.json`
|
|
93
95
|
|
|
94
96
|
### Option 3 — install from the DSH UI (local source directory)
|
|
95
97
|
|
|
@@ -120,6 +122,24 @@ Send this to the agent in DSH:
|
|
|
120
122
|
| macOS assertion | `pmset -g assertions \| grep caffeinate` shows an entry while a session is running |
|
|
121
123
|
| Idle release | About 30 seconds after the session ends, the same command prints nothing |
|
|
122
124
|
|
|
125
|
+
## Updating
|
|
126
|
+
|
|
127
|
+
How the plugin updates depends on how it was installed:
|
|
128
|
+
|
|
129
|
+
| Installed from | How to update |
|
|
130
|
+
|---|---|
|
|
131
|
+
| **npm / plugin manager** (recommended) | Open **Plugins**: the toolbar reports updatable plugins and the card shows **Update available**. Confirm; DSH's `pluginManager.updateBundle` verifies the target exists, declares a bundle and accepts the running DSH version, and rolls back on failure. Profiles without HMR ask for a restart |
|
|
132
|
+
| **Discover (index source)** | Once the index lists a newer version the entry shows both; installing the new version updates it |
|
|
133
|
+
| **A Git spec** | Update to a new commit (DSH only accepts Git targets pinned to a full commit) |
|
|
134
|
+
| **A local directory (`link:`)** | No versioning: `git pull`, the plugin hot-reloads; restart if prompted |
|
|
135
|
+
|
|
136
|
+
Worth knowing:
|
|
137
|
+
|
|
138
|
+
- **Settings survive**: an update only replaces the package; the `cordis.patch.yml` config and the plugin's state file (`~/.dsh/plugin-data/dsh-stay-awake/state.json`) are kept.
|
|
139
|
+
- **Updates are saved as an exact version**: DSH writes the exact installed version, so it does not follow `latest`; the next release needs another manual update.
|
|
140
|
+
- **The plugin never checks for updates itself** — deliberate, it promises no network access. Update detection belongs to the DSH plugin manager.
|
|
141
|
+
- Current version: the popover footer shows `vX.Y.Z`; `npm view @laraveladmin/dsh-stay-awake version` shows the latest published one.
|
|
142
|
+
|
|
123
143
|
## Configure
|
|
124
144
|
|
|
125
145
|
Override the row by id in the profile's `cordis.patch.yml`:
|
package/README.md
CHANGED
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
`@laraveladmin/dsh-stay-awake` · macOS / Windows / Linux
|
|
8
8
|
|
|
9
9
|
<p>
|
|
10
|
-
<img alt="version" src="https://img.shields.io/badge/version-0.2.
|
|
10
|
+
<img alt="version" src="https://img.shields.io/badge/version-0.2.11-blue">
|
|
11
11
|
<img alt="platform" src="https://img.shields.io/badge/platform-macOS%20%7C%20Windows%20%7C%20Linux-4c6ef5">
|
|
12
|
+
<img alt="ci" src="https://github.com/laraveladmin-cn/dsh-stay-awake/actions/workflows/ci.yml/badge.svg">
|
|
12
13
|
<img alt="license" src="https://img.shields.io/badge/license-MIT-green">
|
|
13
14
|
</p>
|
|
14
15
|
|
|
@@ -64,7 +65,7 @@ DSH 跑长任务时你离开电脑,系统按空闲策略休眠:进程被挂
|
|
|
64
65
|
|
|
65
66
|
**前置条件**:DSH 0.2.x(Desktop 或 `dsh web`)。插件零第三方运行时依赖,不需要 Node 工具链。
|
|
66
67
|
|
|
67
|
-
已发布到 npm:[`@laraveladmin/dsh-stay-awake@0.2.
|
|
68
|
+
已发布到 npm:[`@laraveladmin/dsh-stay-awake@0.2.11`](https://www.npmjs.com/package/@laraveladmin/dsh-stay-awake)
|
|
68
69
|
|
|
69
70
|
### 方式一:从 npm 安装(推荐)
|
|
70
71
|
|
|
@@ -84,13 +85,14 @@ DSH 默认不带任何索引源。添加本项目随 npm 包发布的索引文
|
|
|
84
85
|
2. 切到 **Discover** → **添加索引源**,粘贴:
|
|
85
86
|
|
|
86
87
|
```text
|
|
87
|
-
https://
|
|
88
|
+
https://raw.githubusercontent.com/laraveladmin-cn/dsh-stay-awake/main/market/index.json
|
|
88
89
|
```
|
|
89
90
|
|
|
90
91
|
3. 搜索「守夜」或 `dsh-stay-awake`,选择版本安装。
|
|
91
92
|
|
|
92
|
-
> 索引是插件市场的 format 1
|
|
93
|
-
> `https://
|
|
93
|
+
> 索引是插件市场的 format 1 文档,随每次发布更新,已用 DSH 自带校验器验证。
|
|
94
|
+
> 备用地址:jsDelivr `https://cdn.jsdelivr.net/npm/@laraveladmin/dsh-stay-awake/market/index.json`(发布后需缓存刷新才见到新版本);
|
|
95
|
+
> 或把版本号写死:`https://registry.npmmirror.com/@laraveladmin/dsh-stay-awake/0.2.11/files/market/index.json`
|
|
94
96
|
|
|
95
97
|
### 方式三:DSH 界面安装(从本地源码目录)
|
|
96
98
|
|
|
@@ -121,6 +123,24 @@ DSH 默认不带任何索引源。添加本项目随 npm 包发布的索引文
|
|
|
121
123
|
| macOS 断言 | 会话运行中 `pmset -g assertions \| grep caffeinate` 有输出 |
|
|
122
124
|
| 空闲释放 | 会话结束后约 30 秒,上面命令无输出 |
|
|
123
125
|
|
|
126
|
+
## 更新
|
|
127
|
+
|
|
128
|
+
更新方式取决于当初怎么装的:
|
|
129
|
+
|
|
130
|
+
| 安装方式 | 怎么更新 |
|
|
131
|
+
|---|---|
|
|
132
|
+
| **从 npm / 插件管理器**(推荐) | 打开 **插件(Plugins)** 页:有新版时工具栏会提示有插件可更新,卡片显示 **Update available**,点更新并确认即可。DSH 的 `pluginManager.updateBundle` 会先校验目标版本存在、声明了 bundle、且兼容当前 DSH;失败自动回滚到原版本。没有 HMR 的 profile 会提示重启 |
|
|
133
|
+
| **从 Discover(索引源)** | 索引更新后条目会显示已安装版本与新版本,安装新版本即完成更新 |
|
|
134
|
+
| **从 Git 地址** | 更新到新的 commit(DSH 只接受固定到完整 commit 的 Git 目标) |
|
|
135
|
+
| **从本地目录(`link:`)** | 没有版本概念:`git pull` 后插件热重载;需要时按提示重启 DSH |
|
|
136
|
+
|
|
137
|
+
几点要知道:
|
|
138
|
+
|
|
139
|
+
- **配置不会丢**:更新只替换插件包,`cordis.patch.yml` 里的 config 与插件状态文件(`~/.dsh/plugin-data/dsh-stay-awake/state.json`)都保留。
|
|
140
|
+
- **更新会保存为精确版本**:DSH 更新后把依赖写成确切版本,不会自动跟随 latest,下次有新版本仍需手动更新。
|
|
141
|
+
- **插件自己不会联网检查更新**:刻意如此(承诺不联网),更新检测交给 DSH 插件管理器。
|
|
142
|
+
- 当前版本:弹层底部有 `vX.Y.Z`;最新发布版本可用 `npm view @laraveladmin/dsh-stay-awake version` 查看。
|
|
143
|
+
|
|
124
144
|
## 配置
|
|
125
145
|
|
|
126
146
|
在 profile 的 `cordis.patch.yml` 里按行 id 覆盖:
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# 发布清单 · Release checklist
|
|
2
|
+
|
|
3
|
+
每次发版按顺序做完。更新能力由 DSH 插件管理器提供,这里保证的是「新版本真的能被用户拿到」。
|
|
4
|
+
|
|
5
|
+
## 0. 前置
|
|
6
|
+
|
|
7
|
+
- [ ] 改动已合并,`git status` 干净
|
|
8
|
+
- [ ] `CHANGELOG.md` 写了新版本一节(用户能看到改了什么)
|
|
9
|
+
- [ ] `package.json` 的 `version` 已按 semver 更新(修 bug → patch,新功能 → minor)
|
|
10
|
+
|
|
11
|
+
## 1. 重建索引并自检
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
node scripts/build-index.mjs # 由 package.json 生成 market/index.json
|
|
15
|
+
node --test test/*.test.js # 79 项;含索引与 manifest 的一致性检查
|
|
16
|
+
npm pack --dry-run # 确认 market/index.json、assets/icon-180.png 都在包里
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## 2. 提交并推送两个远端
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
git add -A && git commit -m "chore: release vX.Y.Z"
|
|
23
|
+
git push origin main # Gitee(主仓库)
|
|
24
|
+
git push github main # GitHub 镜像(社区目录抓的是这个)
|
|
25
|
+
git tag -a vX.Y.Z -m "vX.Y.Z" && git push origin vX.Y.Z && git push github vX.Y.Z
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## 3. 发布到 npm
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm publish --registry https://registry.npmjs.org --access public
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
> 账号开了 2FA:需要「带 Bypass 2FA 的 granular access token」或 `--otp=<code>`。
|
|
35
|
+
> 本机做法是用临时 npmrc 注入 token,发布后删除,不落盘到 `~/.npmrc`。
|
|
36
|
+
|
|
37
|
+
## 4. 校验发布产物
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npm view @laraveladmin/dsh-stay-awake version dist-tags.latest dist.shasum
|
|
41
|
+
|
|
42
|
+
# 拉回发布的包与本地构建包比对
|
|
43
|
+
npm pack @laraveladmin/dsh-stay-awake@X.Y.Z --pack-destination /tmp/verify
|
|
44
|
+
shasum /tmp/verify/*.tgz dist/laraveladmin-dsh-stay-awake-X.Y.Z.tgz
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
两个 `dist.shasum` 必须一致。新包名首次发布有几分钟传播延迟属正常,以 `registry.npmjs.org/<name>` 为准。
|
|
48
|
+
|
|
49
|
+
## 5. 刷新 Discover 索引缓存
|
|
50
|
+
|
|
51
|
+
首选索引地址是 GitHub raw(**推送即生效**):
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
https://raw.githubusercontent.com/laraveladmin-cn/dsh-stay-awake/main/market/index.json
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
jsDelivr 是备用地址,它对无版本 URL 有缓存,发版后必须主动刷新,否则用户会在 Discover 里看到旧版本:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
node scripts/build-index.mjs --purge-only
|
|
61
|
+
# 等价于:curl -sL 'https://purge.jsdelivr.net/npm/@laraveladmin/dsh-stay-awake/market/index.json'
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## 6. 本机验证(可选但推荐)
|
|
65
|
+
|
|
66
|
+
- 禁用再启用插件,让宿主加载新代码;刷新页面看弹层底部版本号
|
|
67
|
+
- 从 npm 安装的用户路径:**插件(Plugins)** 页应出现 **Update available**
|
|
68
|
+
|
|
69
|
+
## 备忘
|
|
70
|
+
|
|
71
|
+
- 插件自身**不联网检查更新**(README 有承诺),发现更新是 DSH 插件页的职责。
|
|
72
|
+
- 更新只替换包,`cordis.patch.yml` 配置和 `~/.dsh/plugin-data/dsh-stay-awake/state.json` 都会保留。
|
|
73
|
+
- DSH 更新后把依赖保存为**精确版本**,所以不会自动跟随 `latest`,下次发版仍需用户手动更新一次。
|
package/docs/REQUIREMENTS.md
CHANGED
|
@@ -247,6 +247,19 @@ wanted = config.enabled && hasWork
|
|
|
247
247
|
| FR-8.4 | 不提供设置面板;设置走 `Config`(避免双份状态源) |
|
|
248
248
|
| FR-8.5 | 指示器状态必须来自 Host(经同源 fetch 路由),不得在客户端自行推断 |
|
|
249
249
|
|
|
250
|
+
### FR-11 更新与发布运维
|
|
251
|
+
|
|
252
|
+
插件本身不实现更新,更新由 DSH 插件管理器完成;这里规定的是"发布之后怎么把新版本送到用户手里"。
|
|
253
|
+
|
|
254
|
+
| 序号 | 规则 |
|
|
255
|
+
|---|---|
|
|
256
|
+
| FR-11.1 | 从 npm 安装(含插件管理器 / Discover)的用户,通过 DSH 插件页的更新入口升级:页面按 `pluginManager.listVersions` 显示可更新项,确认后由 `pluginManager.updateBundle` 校验目标版本、bundle 声明与 DSH 兼容性,失败自动回滚,无 HMR 的 profile 提示重启 |
|
|
257
|
+
| FR-11.2 | 从 Git 安装的用户更新到新的固定 commit;从本地目录(`link:`)安装的用户 `git pull` 即更新,没有版本概念,也不会出现更新提示 |
|
|
258
|
+
| FR-11.3 | Discover 索引源随每次发布更新;**首选 GitHub raw 地址**(推送即生效),jsDelivr 作为备用并在发布流程中主动 purge(无版本 URL 有 CDN 缓存,不 purge 会长期读到旧索引) |
|
|
259
|
+
| FR-11.4 | 更新不得影响用户配置:`cordis.patch.yml` 的 config 与 `state.json` 保留;当前版本在弹层底部显示 |
|
|
260
|
+
| FR-11.5 | 插件**不联网检查更新**(与 NFR-4 的"不联网"一致),更新检测完全交给 DSH |
|
|
261
|
+
| FR-11.6 | 发布流程固定为:改版本 → 重建索引 → 全量测试 → 提交 → 双远端推送 → `npm publish` → purge CDN → 校验(见 `docs/RELEASING.md`) |
|
|
262
|
+
|
|
250
263
|
### FR-10 任务结束提示音
|
|
251
264
|
|
|
252
265
|
目标:用户离开电脑时,任务结束能"听见",不必回来看屏幕。
|
|
@@ -520,6 +533,7 @@ pgrep -fl "caffeinate -i -w"
|
|
|
520
533
|
| FR-1.2 维护期 | ✅ 实现,逻辑测试覆盖 | 事件接线由 `test/wiring.test.js` 验证;真机需用户手动 `/compact` 观察 |
|
|
521
534
|
| FR-1.3 后台任务 | ✅ 实现,逻辑测试覆盖 | `ctx.jobs` 事件 + `jobs.list(sessionId)` 对账;真机需用户在 agent idle 时跑后台任务观察 |
|
|
522
535
|
| FR-1.4 计划任务 | ❌ 未实现 | 仍为 P2 |
|
|
536
|
+
| FR-11 更新与发布运维 | ✅ 流程落地 | 更新由 DSH 插件管理器负责(registry 安装可一键更新、失败回滚);索引首选 GitHub raw,jsDelivr 发布后 purge;发布清单见 docs/RELEASING.md |
|
|
523
537
|
| FR-10 任务结束提示音 | ✅ 实现 | 工作段结束边沿触发、成功/失败区分、最短时长、仅用户任务、宿主端播放、弹层开关 + 试听;开关持久化 |
|
|
524
538
|
| FR-2 释放判定 | ✅ 实现并真机验证 | 防抖释放、竞争重算、禁用立即释放 |
|
|
525
539
|
| FR-3 三平台后端 | macOS ✅ 真机;Windows / Linux ✅ 实现 + 单测 | Windows/Linux 电源效果未真机验证 |
|
package/market/index.json
CHANGED