dsh-selfupdater 0.4.29 → 0.4.30
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/lib/updater.mjs +14 -7
- package/package.json +1 -1
package/lib/updater.mjs
CHANGED
|
@@ -425,18 +425,25 @@ function koffiBinaryFound() {
|
|
|
425
425
|
* 校验 staging 内原生模块的构建产物是否齐全。
|
|
426
426
|
* - koffi:见 koffiBinaryFound(2.x/3.x 双结构兼容);
|
|
427
427
|
* - fs-ext:node-gyp 编译,产物在 build/Release/fs-ext.node(NAS 需编译工具链)。
|
|
428
|
-
*
|
|
428
|
+
*
|
|
429
|
+
* 校验语义是"依赖树里有则必须完整",而非"必须有":上游会调整依赖
|
|
430
|
+
* (0.1.5-alpha.2 起移除了 fs-ext),无条件校验会对本就不存在的包误报,
|
|
431
|
+
* 把成功的升级拦下(0.4.29 实测踩坑)。任一缺失即抛错终止本次升级
|
|
432
|
+
* (尚未换装,旧版原样运行,天然安全)。
|
|
429
433
|
*/
|
|
430
434
|
function verifyNativeModules() {
|
|
431
435
|
const problems = [];
|
|
432
|
-
|
|
436
|
+
const nmDir = join(stagingDir, 'node_modules');
|
|
437
|
+
if (existsSync(join(nmDir, 'koffi')) && !koffiBinaryFound()) {
|
|
433
438
|
problems.push('koffi 缺少原生二进制(install 脚本未执行或平台子包未装上)');
|
|
434
439
|
}
|
|
435
|
-
const fsExtDir = join(
|
|
436
|
-
if (
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
+
const fsExtDir = join(nmDir, 'fs-ext');
|
|
441
|
+
if (existsSync(fsExtDir)) {
|
|
442
|
+
if (!existsSync(join(fsExtDir, 'fs-ext.js'))) {
|
|
443
|
+
problems.push('fs-ext 包文件不完整(缺少 fs-ext.js)');
|
|
444
|
+
} else if (!findFileByExt(join(fsExtDir, 'build'), '.node')) {
|
|
445
|
+
problems.push('fs-ext 缺少编译产物 build/Release/fs-ext.node(NAS 需要 python3/make/g++ 工具链)');
|
|
446
|
+
}
|
|
440
447
|
}
|
|
441
448
|
if (problems.length > 0) throw new Error(`原生模块校验失败:${problems.join(';')}`);
|
|
442
449
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-selfupdater",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.30",
|
|
4
4
|
"description": "Self-update plugin for DeepSeek Harness: DSH core upgrades via detached swap script; plugin self-update installs in-place without killing the host and prompts for restart. DSH 主程序与已装插件的一站式在线更新插件。",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|