@pandablessing/dsh-user-sync 1.0.17 → 1.0.19
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/client.js +5 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -221,6 +221,8 @@ if (typeof window !== 'undefined' && window.__ModuleLoader__) {
|
|
|
221
221
|
const [overwriteDialog, setOverwriteDialog] = R.useState(null);
|
|
222
222
|
// 版本检查结果:有新版本时在面板顶部提示(不自动安装)
|
|
223
223
|
const [updateInfo, setUpdateInfo] = R.useState(null);
|
|
224
|
+
// 更新完成弹窗(重启提示放在弹窗里,底部状态行看不到)
|
|
225
|
+
const [updateDone, setUpdateDone] = R.useState(null);
|
|
224
226
|
// 一键更新:调宿主 /update(走 DSH 官方安装器),成功后提示重启
|
|
225
227
|
const updatePlugin = async () => {
|
|
226
228
|
const target = updateInfo?.latest;
|
|
@@ -235,7 +237,7 @@ if (typeof window !== 'undefined' && window.__ModuleLoader__) {
|
|
|
235
237
|
});
|
|
236
238
|
if (result.ok) {
|
|
237
239
|
setUpdateInfo(null);
|
|
238
|
-
|
|
240
|
+
setUpdateDone(`已更新到 v${result.version ?? target},请重启 DSH 生效`);
|
|
239
241
|
}
|
|
240
242
|
else {
|
|
241
243
|
setNotice({ kind: 'error', data: { detail: `更新失败:${result.error ?? '未知错误'}` } });
|
|
@@ -587,6 +589,8 @@ if (typeof window !== 'undefined' && window.__ModuleLoader__) {
|
|
|
587
589
|
void applyRemote(target.name);
|
|
588
590
|
},
|
|
589
591
|
}, overwriteDialog.kind === 'upload' ? '用本机覆盖远端' : '用远端覆盖本机'), R.createElement('button', { style: styles.secondary, onClick: () => setOverwriteDialog(null) }, '取消'))))
|
|
592
|
+
: null, updateDone
|
|
593
|
+
? R.createElement('div', { style: styles.overlay, onClick: () => setUpdateDone(null) }, R.createElement('div', { style: styles.dialog, onClick: (event) => event.stopPropagation?.() }, R.createElement('strong', null, '更新完成'), R.createElement('p', { style: styles.muted }, updateDone), R.createElement('div', { style: styles.actions }, R.createElement('button', { style: styles.primary, onClick: () => setUpdateDone(null) }, '知道了'))))
|
|
590
594
|
: null);
|
|
591
595
|
}
|
|
592
596
|
function apply(ctx) {
|
package/lib/index.js
CHANGED
|
@@ -431,7 +431,7 @@ export function apply(ctx) {
|
|
|
431
431
|
if (!rt)
|
|
432
432
|
return json({ ok: false, error: 'E_NO_PNPM' }, 503);
|
|
433
433
|
// 新版本刚发布时 pnpm 的 minimumReleaseAge 会拒绝安装,显式放行;同时避免 frozen-lockfile 阻断
|
|
434
|
-
await runCommand(rt.node, [rt.pnpmCjs, 'add', spec, '--config.minimumReleaseAge=0'
|
|
434
|
+
await runCommand(rt.node, [rt.pnpmCjs, 'add', spec, '--config.minimumReleaseAge=0'], {
|
|
435
435
|
cwd: paths.profileDir,
|
|
436
436
|
timeout: 240_000,
|
|
437
437
|
});
|