dsh-multipane 1.0.18 → 1.0.20
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 +9 -0
- package/lib/client.js +32 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -246,6 +246,15 @@ C:\Users\weiai\.dsh\plugin-src\_probe\sync-client.ps1 -Push # 台式机 ->
|
|
|
246
246
|
|
|
247
247
|
## 更新记录
|
|
248
248
|
|
|
249
|
+
### 1.0.20(2026-11-10)
|
|
250
|
+
- **说清「已是最新」到底是不是真的最新**:插件市场自己的同步比 npm registry 慢(实测约 20 分钟)。
|
|
251
|
+
以前刚发版就点检查,只会看到「已是最新」并以为功能坏了;现在会补一句
|
|
252
|
+
「npm 上已有 X,插件市场还没同步(通常要 20 分钟左右),稍后再点一次」。
|
|
253
|
+
|
|
254
|
+
### 1.0.19(2026-11-10)
|
|
255
|
+
- **打开设置页就自动检查一次**(静默,不弹窗):一进去就能看到「有新版本 X」或「已是最新(X,12:30 检查)」,
|
|
256
|
+
不用先点按钮、也就不会有「点了没反应」的错觉。手动点「检查更新」时才会弹窗。
|
|
257
|
+
|
|
249
258
|
### 1.0.18(2026-11-10)
|
|
250
259
|
- 更新弹窗里多一行「检查时间」,一眼看出这个版本号是什么时候问的市场,方便判断是不是缓存滞后。
|
|
251
260
|
|
package/lib/client.js
CHANGED
|
@@ -17,7 +17,7 @@ window.__ModuleLoader__.load({
|
|
|
17
17
|
*/
|
|
18
18
|
const PLUGIN_LABEL = "多栏视图";
|
|
19
19
|
/* 与 package.json 的 version 必须一致(发版时两处同改;check-names.cjs 会校验)。 */
|
|
20
|
-
const PLUGIN_VERSION = "1.0.
|
|
20
|
+
const PLUGIN_VERSION = "1.0.20";
|
|
21
21
|
const NPM_LATEST_URL = "https://registry.npmjs.org/dsh-multipane/latest";
|
|
22
22
|
/* 插件市场的公开更新 API v1(dshmarket 提供,见其 UPDATE-API-V1.md)。
|
|
23
23
|
它自己负责装包/校验版本/回滚,我们只负责触发和显示结果——
|
|
@@ -6433,7 +6433,8 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
|
|
|
6433
6433
|
checkedAt: ""
|
|
6434
6434
|
});
|
|
6435
6435
|
const closeModal = () => setUpdate((prev) => ({ ...prev, modal: false }));
|
|
6436
|
-
const checkUpdate = async () => {
|
|
6436
|
+
const checkUpdate = async (silent) => {
|
|
6437
|
+
const quiet = silent === true;
|
|
6437
6438
|
setUpdate({
|
|
6438
6439
|
phase: "checking",
|
|
6439
6440
|
text: "正在检查…",
|
|
@@ -6465,7 +6466,7 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
|
|
|
6465
6466
|
text: `发现新版本 ${latest}`,
|
|
6466
6467
|
canUpdate: true,
|
|
6467
6468
|
opId: "",
|
|
6468
|
-
modal: true,
|
|
6469
|
+
modal: quiet !== true,
|
|
6469
6470
|
installed,
|
|
6470
6471
|
latest,
|
|
6471
6472
|
forceHint: "",
|
|
@@ -6484,12 +6485,29 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
|
|
|
6484
6485
|
installed,
|
|
6485
6486
|
latest,
|
|
6486
6487
|
forceHint: "插件市场对刚发布的版本有观察期(通常十几分钟到几小时,防供应链投毒),这段时间装会被市场拒绝。过一会儿点「重新检查」,放行后再更新即可。",
|
|
6487
|
-
progress: null
|
|
6488
|
+
progress: null,
|
|
6489
|
+
checkedAt: new Date().toLocaleTimeString("zh-CN", { hour: "2-digit", minute: "2-digit" })
|
|
6488
6490
|
});
|
|
6489
6491
|
} else {
|
|
6492
|
+
/* 市场说「已最新」不代表真的没新版:市场自己的同步比 npm registry 慢
|
|
6493
|
+
(实测约 20 分钟)。这里直接问一次 registry,把差额写清楚,
|
|
6494
|
+
否则用户刚发版就点,只会看到「已是最新」并以为功能坏了。 */
|
|
6495
|
+
let lagNote = "";
|
|
6496
|
+
try {
|
|
6497
|
+
const regRes = await fetch(`${NPM_LATEST_URL}?t=${Date.now()}`, { cache: "no-store" });
|
|
6498
|
+
if (regRes.ok === true) {
|
|
6499
|
+
const regData = await regRes.json();
|
|
6500
|
+
const regLatest = String((regData && regData.version) || "");
|
|
6501
|
+
if (regLatest !== "" && compareVersion(regLatest, installed) > 0) {
|
|
6502
|
+
lagNote = `;npm 上已有 ${regLatest},插件市场还没同步(通常要 20 分钟左右),稍后再点一次`;
|
|
6503
|
+
}
|
|
6504
|
+
}
|
|
6505
|
+
} catch {
|
|
6506
|
+
/* 忽略:查不到 registry 就只报市场的结果 */
|
|
6507
|
+
}
|
|
6490
6508
|
setUpdate({
|
|
6491
6509
|
phase: "latest",
|
|
6492
|
-
text: `已是最新版本(${installed},${new Date().toLocaleTimeString("zh-CN", { hour: "2-digit", minute: "2-digit" })}
|
|
6510
|
+
text: `已是最新版本(${installed},${new Date().toLocaleTimeString("zh-CN", { hour: "2-digit", minute: "2-digit" })} 检查)${lagNote}`,
|
|
6493
6511
|
canUpdate: false,
|
|
6494
6512
|
opId: "",
|
|
6495
6513
|
modal: false,
|
|
@@ -6512,7 +6530,7 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
|
|
|
6512
6530
|
text: newer ? `发现新版本 ${latest}` : `已是最新版本(${PLUGIN_VERSION})`,
|
|
6513
6531
|
canUpdate: false,
|
|
6514
6532
|
opId: "",
|
|
6515
|
-
modal: newer,
|
|
6533
|
+
modal: newer && quiet !== true,
|
|
6516
6534
|
installed: PLUGIN_VERSION,
|
|
6517
6535
|
latest,
|
|
6518
6536
|
forceHint: newer ? "本机没有可用的插件市场(dshmarket),无法在这里自动安装。到「插件」页填 " + PKG_NAME + "@" + latest + " 安装。" : "",
|
|
@@ -6522,6 +6540,14 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
|
|
|
6522
6540
|
setUpdate({ phase: "error", text: `检查失败:${String((err && err.message) || err)}`, canUpdate: false, opId: "" });
|
|
6523
6541
|
}
|
|
6524
6542
|
};
|
|
6543
|
+
/* 一进设置页就静默查一次(不弹窗):省得每次都要手动点,也避免「点了没反应」的错觉。
|
|
6544
|
+
必须放在 checkUpdate 之后 —— const 不提升,提前引用会踩 TDZ。 */
|
|
6545
|
+
const autoChecked = react.useRef(false);
|
|
6546
|
+
react.useEffect(() => {
|
|
6547
|
+
if (autoChecked.current === true) return;
|
|
6548
|
+
autoChecked.current = true;
|
|
6549
|
+
checkUpdate(true);
|
|
6550
|
+
}, []);
|
|
6525
6551
|
const runUpdate = async (force) => {
|
|
6526
6552
|
setUpdate((prev) => ({ ...prev, phase: "updating", text: "正在更新…", canUpdate: false, progress: 0 }));
|
|
6527
6553
|
try {
|
package/package.json
CHANGED