@quecue/dev-notify 0.1.2 → 0.1.3
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 +6 -0
- package/README.md +2 -2
- package/SECURITY.md +1 -1
- package/dist/cli.js +2 -2
- package/dist/update.js +20 -13
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
跨平台开发任务通知工具,使用 **TypeScript / Node.js**,通过 npm 分发,不需要独立可执行文件或其他脚本运行时。通用通知不依赖 Claude Code、Unity 或项目目录。
|
|
4
4
|
|
|
5
|
-
**npm 包名为 `@quecue/dev-notify`。`0.1.
|
|
5
|
+
**npm 包名为 `@quecue/dev-notify`。`0.1.3` 提供 Claude Code 回复、原生 PC 与 Telegram 双端答题及结果反馈。** 版本变更与升级说明见 [CHANGELOG.md](CHANGELOG.md);公开版本以 npm registry 为准。
|
|
6
6
|
|
|
7
7
|
## 安装与使用
|
|
8
8
|
|
|
@@ -49,7 +49,7 @@ dev-notify update --yes # 跳过确认(适合脚本)
|
|
|
49
49
|
dev-notify update --no-post # 只更新包,不执行 hooks/桥接维护
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
实际的完整性校验、registry 配置、权限处理和原生依赖解析仍由 npm 完成。安装成功后,`update` 会自动重新安装绑定当前配置的 Claude Code hooks(已存在且配置匹配时),并重启正在运行的回复桥接;不需要时可用 `--no-post`
|
|
52
|
+
实际的完整性校验、registry 配置、权限处理和原生依赖解析仍由 npm 完成。安装成功后,`update` 会自动重新安装绑定当前配置的 Claude Code hooks(已存在且配置匹配时),并重启正在运行的回复桥接;不需要时可用 `--no-post` 跳过。在 0.1.3 及以后,即使已经是最新版本,`update` 也会执行同样的维护,因此可以用同一条命令完成升级后的收尾。
|
|
53
53
|
|
|
54
54
|
## 已提供的功能
|
|
55
55
|
|
package/SECURITY.md
CHANGED
package/dist/cli.js
CHANGED
|
@@ -15,7 +15,7 @@ import { accessReplies, configureReplies, disableReplies } from './reply-state.j
|
|
|
15
15
|
import { startBridge, stopBridge, bridgeStatus, runBridge } from './reply-bridge.js';
|
|
16
16
|
import { updatePackage } from './update.js';
|
|
17
17
|
import { postUpdate } from './maintenance.js';
|
|
18
|
-
export const VERSION = '0.1.
|
|
18
|
+
export const VERSION = '0.1.3';
|
|
19
19
|
const HELP = `dev-notify ${VERSION} — 跨平台开发任务通知
|
|
20
20
|
|
|
21
21
|
命令:
|
|
@@ -30,7 +30,7 @@ const HELP = `dev-notify ${VERSION} — 跨平台开发任务通知
|
|
|
30
30
|
paths 显示配置路径(不会写入文件)
|
|
31
31
|
doctor / status 离线检查(不会发送消息)
|
|
32
32
|
update [--check] [--yes] [--no-post]
|
|
33
|
-
检查并更新到 npm
|
|
33
|
+
检查并更新到 npm 最新版本,并维护 hooks 和桥接
|
|
34
34
|
integration list 列出可用集成
|
|
35
35
|
integration claude-code install / status / remove
|
|
36
36
|
单独安装、查询或移除用户级 hooks(install/remove 可用 --yes)
|
package/dist/update.js
CHANGED
|
@@ -63,6 +63,20 @@ async function confirmUpdate(latest, options) {
|
|
|
63
63
|
const prompts = options.prompts ?? terminalPrompts();
|
|
64
64
|
return /^(y|yes)$/i.test(await prompts.text(`更新到 ${latest}?[y/N] `));
|
|
65
65
|
}
|
|
66
|
+
async function runMaintenance(options, updated) {
|
|
67
|
+
if (!options.post) {
|
|
68
|
+
if (updated)
|
|
69
|
+
options.out('如有 Claude Code hooks,请运行 dev-notify integration claude-code install;如使用远程回复,请重启桥接。');
|
|
70
|
+
return 0;
|
|
71
|
+
}
|
|
72
|
+
const code = await options.post();
|
|
73
|
+
if (code !== 0) {
|
|
74
|
+
options.out(updated ? '更新已完成,但后续维护步骤没有全部成功;请按上面的提示检查。' : '维护步骤没有全部成功;请按上面的提示检查。');
|
|
75
|
+
return code;
|
|
76
|
+
}
|
|
77
|
+
options.out(updated ? '更新后的维护步骤已完成。' : '维护步骤已完成。');
|
|
78
|
+
return 0;
|
|
79
|
+
}
|
|
66
80
|
export async function updatePackage(current, options) {
|
|
67
81
|
if (!VERSION.test(current))
|
|
68
82
|
throw new ConfigError('当前版本号格式不受支持,无法检查更新。');
|
|
@@ -71,7 +85,11 @@ export async function updatePackage(current, options) {
|
|
|
71
85
|
throw new ConfigError('npm registry 返回的版本号格式不受支持。');
|
|
72
86
|
if (compareVersions(latest, current) <= 0) {
|
|
73
87
|
options.out(`已是最新版本 ${current}。`);
|
|
74
|
-
|
|
88
|
+
if (options.check)
|
|
89
|
+
return 0;
|
|
90
|
+
if (options.post)
|
|
91
|
+
options.out('将执行 Claude Code hooks 和回复桥接维护。');
|
|
92
|
+
return await runMaintenance(options, false);
|
|
75
93
|
}
|
|
76
94
|
options.out(`当前版本 ${current},npm 最新版本 ${latest}。`);
|
|
77
95
|
if (options.check) {
|
|
@@ -89,16 +107,5 @@ export async function updatePackage(current, options) {
|
|
|
89
107
|
if (result.status !== 0)
|
|
90
108
|
throw new ConfigError(`更新没有完成。请检查 npm 权限,或手动运行 npm install -g ${NAME}@latest。`);
|
|
91
109
|
options.out(`已更新到 ${latest}。请重新打开终端后运行 dev-notify --version 确认。`);
|
|
92
|
-
|
|
93
|
-
const code = await options.post();
|
|
94
|
-
if (code !== 0) {
|
|
95
|
-
options.out('更新已完成,但后续维护步骤没有全部成功;请按上面的提示检查。');
|
|
96
|
-
return code;
|
|
97
|
-
}
|
|
98
|
-
options.out('更新后的维护步骤已完成。');
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
-
options.out('如有 Claude Code hooks,请运行 dev-notify integration claude-code install;如使用远程回复,请重启桥接。');
|
|
102
|
-
}
|
|
103
|
-
return 0;
|
|
110
|
+
return await runMaintenance(options, true);
|
|
104
111
|
}
|