dsh-dingtalk 0.3.2 → 0.3.4
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 +9 -0
- package/README.en.md +1 -1
- package/README.md +1 -1
- package/lib/update-client.js +28 -13
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
[返回简介](README.md) · [使用说明](docs/USAGE.md) · [验证记录](docs/VALIDATION.md)
|
|
4
4
|
|
|
5
|
+
## 0.3.4 (2026-10-29)
|
|
6
|
+
|
|
7
|
+
- 同步仓库与 npm 的简明介绍、中英文 README 和反馈入口;本次为文档与包元数据更新。
|
|
8
|
+
- Sync npm descriptions and both README guides with the repository, including issue and pull-request links.
|
|
9
|
+
|
|
10
|
+
## 0.3.3 (2026-10-27)
|
|
11
|
+
|
|
12
|
+
- 修复分批更新时的新旧更新控件混用:保留原页面、草稿与安装保护,空闲后接管旧控制器,兼容旧入口。
|
|
13
|
+
|
|
5
14
|
## 0.3.2 (2026-10-27)
|
|
6
15
|
|
|
7
16
|
- 更新控件移至原有工作台或原生插件详情页底部;更新记录与选项原地展开,移除独立更新菜单与页面。
|
package/README.en.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|
|
|
7
|
-
Send task
|
|
7
|
+
Send DSH task results to a DingTalk custom group robot as text or Markdown. Configure your robot URL and signing options, then check the connection before sending.
|
|
8
8
|
|
|
9
9
|
[](https://www.npmjs.com/package/dsh-dingtalk) [](https://www.npmjs.com/package/dsh-dingtalk)
|
|
10
10
|
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
把 DSH 中的任务结果发送到钉钉自定义群机器人,支持纯文本和 Markdown 通知。填写自己的机器人地址与签名配置后,可先自检再发送。
|
|
8
8
|
|
|
9
9
|
[](https://www.npmjs.com/package/dsh-dingtalk) [](https://www.npmjs.com/package/dsh-dingtalk)
|
|
10
10
|
|
package/lib/update-client.js
CHANGED
|
@@ -176,7 +176,7 @@ function __stardustUpdatesGuard(React, name, { dirty = false, busy = false, reta
|
|
|
176
176
|
function __StardustPluginUpdatesFooter({ React, name }) {
|
|
177
177
|
const [, render] = React.useState(0), pool = __stardustUpdatesGuards();
|
|
178
178
|
React.useEffect(() => { const fn = () => render(value => value + 1); pool.viewListeners.add(fn); return () => pool.viewListeners.delete(fn); }, []);
|
|
179
|
-
const client = [...pool.clients].find(client => client.has(name));
|
|
179
|
+
const client = [...pool.clients].find(client => typeof client.Footer === 'function' && client.has(name));
|
|
180
180
|
if (!client) return null;
|
|
181
181
|
return React.createElement(client.Footer, { name });
|
|
182
182
|
}
|
|
@@ -238,14 +238,22 @@ function __stardustUpdatesJoin(host, React, require, participant) {
|
|
|
238
238
|
if (typeof root.plugin !== 'function') return;
|
|
239
239
|
let record = pools.get(root);
|
|
240
240
|
if (!record) {
|
|
241
|
-
record = { refs: new Map(), timer: null, version: participant.version, alive: true, hold: false };
|
|
241
|
+
record = { refs: new Map(), timer: null, version: participant.version, alive: true, hold: false, uiRevision: 2 };
|
|
242
242
|
pools.set(root, record);
|
|
243
|
+
__stardustUpdatesActivate(record, pools, root, React, require);
|
|
244
|
+
} else if (record.uiRevision !== 2 && !record.migration) {
|
|
245
|
+
// The first loaded participant may still own a pre-footer client. Keep
|
|
246
|
+
// its references and draft guards, wait for any admitted install, then
|
|
247
|
+
// replace that one client fiber instead of running two window heartbeats.
|
|
243
248
|
const shared = record;
|
|
244
|
-
record.
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
+
record.migration = Promise.resolve().then(async () => {
|
|
250
|
+
while (shared.alive && shared.hold) await new Promise(resolve => setTimeout(resolve, 500));
|
|
251
|
+
if (!shared.alive || !shared.refs.size) return;
|
|
252
|
+
await shared.fiber?.dispose?.();
|
|
253
|
+
if (!shared.refs.size) return;
|
|
254
|
+
shared.alive = true; shared.uiRevision = 2; pools.set(root, shared);
|
|
255
|
+
__stardustUpdatesActivate(shared, pools, root, React, require);
|
|
256
|
+
}).catch(() => { /* The original page remains usable if host disposal fails. */ });
|
|
249
257
|
}
|
|
250
258
|
clearTimeout(record.timer);
|
|
251
259
|
const ref = {}; record.refs.set(ref, participant);
|
|
@@ -259,10 +267,17 @@ function __stardustUpdatesJoin(host, React, require, participant) {
|
|
|
259
267
|
if (!record.refs.size) record.timer = setTimeout(stop, 1000);
|
|
260
268
|
});
|
|
261
269
|
}
|
|
270
|
+
function __stardustUpdatesActivate(shared, pools, root, React, require) {
|
|
271
|
+
shared.fiber = root.plugin({ name: 'stardustlc-plugin-updates-client', inject: ['slots', 'locale', 'remote', 'remote.pluginManager'], apply(ctx) {
|
|
272
|
+
const client = __stardustUpdatesClient(ctx, React, require, shared);
|
|
273
|
+
ctx.effect(() => () => { shared.alive = false; client.dispose(); if (pools.get(root) === shared) pools.delete(root); });
|
|
274
|
+
} });
|
|
275
|
+
Promise.resolve(shared.fiber).catch(() => { shared.alive = false; if (pools.get(root) === shared) pools.delete(root); });
|
|
276
|
+
}
|
|
262
277
|
function __stardustUpdatesClient(ctx, React, require, shared) {
|
|
263
278
|
const h = React.createElement, W = createWorkbenchUI(React), route = new URL('api/stardustlc/plugin-updates', document.baseURI);
|
|
264
279
|
const { useState, useEffect } = React, id = crypto.randomUUID(), listeners = new Set(), pool = __stardustUpdatesGuards(), requests = new Set(), notified = new Set(), knownRows = new Map();
|
|
265
|
-
let alive = true, registered = false, state = null, lastInteraction = Date.now(), inPoll = false, manualOperation = false;
|
|
280
|
+
let alive = true, registered = false, state = null, lastInteraction = Date.now(), inPoll = false, manualOperation = false, legacyHint = null;
|
|
266
281
|
const language = () => String(ctx.locale?.getSnapshot?.().active || '').startsWith('en') ? 'en' : 'zh';
|
|
267
282
|
const t = (zh, en) => language() === 'en' ? en : zh;
|
|
268
283
|
const preferences = name => state?.preferences.packages[name] || { checkEnabled: true, autoInstall: false, deferredUntil: 0, ignoredVersion: null };
|
|
@@ -387,11 +402,11 @@ function __stardustUpdatesClient(ctx, React, require, shared) {
|
|
|
387
402
|
function Reminder() {
|
|
388
403
|
useSnapshot();
|
|
389
404
|
const row = state?.rows.find(row => { const prefs = preferences(row.name); return row.available && !row.updating && !row.bundledBy && prefs.checkEnabled && prefs.deferredUntil <= Date.now() && prefs.ignoredVersion !== row.release.version && !notified.has(row.name + '@' + row.release.version); });
|
|
390
|
-
if (!row) return null;
|
|
405
|
+
if (!row && !legacyHint) return null;
|
|
391
406
|
let Toast; try { Toast = require('@deepseek-ai/dsh-client-ui-primitives').Toast; } catch { return null; }
|
|
392
407
|
if (!Toast) return null;
|
|
393
|
-
const key = row.name + '@' + row.release.version;
|
|
394
|
-
return h(Toast, { key, text: (language() === 'en' ? row.labelEn : row.label) + t('有新版本,可在页面底部查看。', ' has an update. Review it at the bottom of its page.'), icon: h(W.Icon, { name: 'refresh', size: 18 }), holdMs: 7000, onDone: () => { notified.add(key); notify(); } });
|
|
408
|
+
const hint = legacyHint, key = hint ? 'legacy-' + hint : row.name + '@' + row.release.version;
|
|
409
|
+
return h(Toast, { key, text: hint ? hint + t(':请打开「插件」中的此插件详情页,在底部管理更新。', ': open its details in Plugins to manage updates at the bottom.') : (language() === 'en' ? row.labelEn : row.label) + t('有新版本,可在页面底部查看。', ' has an update. Review it at the bottom of its page.'), icon: h(W.Icon, { name: 'refresh', size: 18 }), holdMs: 7000, onDone: () => { if (hint) legacyHint = null; else notified.add(key); notify(); } });
|
|
395
410
|
}
|
|
396
411
|
function register() {
|
|
397
412
|
if (!alive) return;
|
|
@@ -410,7 +425,7 @@ function __stardustUpdatesClient(ctx, React, require, shared) {
|
|
|
410
425
|
finally { inPoll = false; }
|
|
411
426
|
}
|
|
412
427
|
const timer = setInterval(() => { void poll(); }, 15000), first = setTimeout(() => { void poll(); }, 100);
|
|
413
|
-
const client = { t, Footer: Panel, has: name => registered && !!originalRow(name), row: rowFor, dispose() {
|
|
428
|
+
const client = { t, Footer: Panel, Button: W.Button, open(name) { const footer = [...document.querySelectorAll('[data-plugin-update-footer]')].find(node => node.getAttribute('data-plugin-update-footer') === name); if (footer) footer.scrollIntoView({ block: 'end', behavior: 'smooth' }); else { legacyHint = name; notify(); } }, has: name => registered && !!originalRow(name), row: rowFor, dispose() {
|
|
414
429
|
close(); alive = false; clearTimeout(first); clearInterval(timer); pool.clients.delete(client);
|
|
415
430
|
pool.listeners.delete(guardChanged); listeners.clear();
|
|
416
431
|
for (const event of ['pointerdown', 'keydown', 'input']) document.removeEventListener(event, interaction, true);
|
|
@@ -422,7 +437,7 @@ function __stardustUpdatesClient(ctx, React, require, shared) {
|
|
|
422
437
|
}
|
|
423
438
|
|
|
424
439
|
/* STARDUSTLC_UPDATE_CLIENT_BODY_START */
|
|
425
|
-
window.__ModuleLoader__.load(__stardustUpdatesWrap({id:"dsh-dingtalk",factory:require=>({apply(){}})},{"name":"dsh-dingtalk","version":"0.1.0","hasWorkbench":false,"packageVersion":"0.3.
|
|
440
|
+
window.__ModuleLoader__.load(__stardustUpdatesWrap({id:"dsh-dingtalk",factory:require=>({apply(){}})},{"name":"dsh-dingtalk","version":"0.1.0","hasWorkbench":false,"packageVersion":"0.3.4","label":"钉钉","labelEn":"DingTalk","suiteComponent":true}));
|
|
426
441
|
|
|
427
442
|
/* STARDUSTLC_UPDATE_CLIENT_BODY_END */
|
|
428
443
|
})();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-dingtalk",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.3.4",
|
|
4
|
+
"description": "DSH 钉钉通知:向自定义群机器人发送文本或 Markdown,支持签名配置与自检。欢迎提交 issues 和 PR。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|
|
@@ -72,6 +72,6 @@
|
|
|
72
72
|
},
|
|
73
73
|
"homepage": "https://github.com/STARDUSTLC666/dsh-dingtalk#readme",
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@stardustlc/dsh-updates": "0.1.
|
|
75
|
+
"@stardustlc/dsh-updates": "0.1.3"
|
|
76
76
|
}
|
|
77
77
|
}
|