@morehao/dsh-github-trending 0.6.0 → 0.6.1
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 +11 -0
- package/client.js +3 -2
- package/lib/internal.d.ts +6 -40
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [v0.6.1] - 2026-11-01
|
|
4
|
+
|
|
5
|
+
### 变更
|
|
6
|
+
|
|
7
|
+
- 契约依赖 `@morehao/trendradar-contract` 0.3.0 → 0.4.0:`SubscriptionStatus` / `SubscriptionItem` /
|
|
8
|
+
`SubscriptionVolume` / `SubscriptionDoc` 改为从契约包 `import type`,删除 `src/ipc.ts` 与
|
|
9
|
+
`client/api.ts` 里的本地兜底声明(0.6.0 的临时载体)。
|
|
10
|
+
- **无行为变化**:wire 仍 `ipcSchema=2` / `digestSchema=2`,`dsh.core.version` 仍为 `0.7.0`;
|
|
11
|
+
运行时守卫与错误文案保持原样(契约包的 `subscriptionDoc` 校验比本地守卫更严,换用会改变对旧核心
|
|
12
|
+
的接受范围,故不动)。
|
|
13
|
+
|
|
3
14
|
## [v0.6.0] - 2026-11-01
|
|
4
15
|
|
|
5
16
|
> **发版顺序**:先发布核心 `0.7.0`(含契约 0.4.0 的字段),再发布本插件——本版
|
package/client.js
CHANGED
|
@@ -4391,9 +4391,10 @@ function statusLabel(t, status) {
|
|
|
4391
4391
|
function mergeRows(list) {
|
|
4392
4392
|
if (list === null) return [];
|
|
4393
4393
|
const byName = /* @__PURE__ */ new Map();
|
|
4394
|
-
|
|
4394
|
+
const items = list.items ?? [];
|
|
4395
|
+
for (const item of items) byName.set(item.fullName, item);
|
|
4395
4396
|
const names = [...list.repos];
|
|
4396
|
-
for (const item of
|
|
4397
|
+
for (const item of items) {
|
|
4397
4398
|
if (!names.includes(item.fullName)) names.push(item.fullName);
|
|
4398
4399
|
}
|
|
4399
4400
|
return names.map((name) => {
|
package/lib/internal.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ErrorCode, FileArtifact, Usage, ReleasesReport, ErrorInfo, RunRequest, RunResult, State, StateRun, SubscriptionList } from '@morehao/trendradar-contract';
|
|
1
|
+
import { ErrorCode, FileArtifact, Usage, ReleasesReport, SubscriptionItem, SubscriptionDoc, SubscriptionStatus, ErrorInfo, RunRequest, RunResult, State, StateRun, SubscriptionList, SubscriptionVolume } from '@morehao/trendradar-contract';
|
|
2
2
|
import http from 'node:http';
|
|
3
3
|
import { Updater, PluginMeta, Logger } from '@morehao/dsh-plugin-kit/update';
|
|
4
4
|
|
|
@@ -112,40 +112,6 @@ interface RunOutcome {
|
|
|
112
112
|
durationMs: number;
|
|
113
113
|
coreVersion: string;
|
|
114
114
|
}
|
|
115
|
-
/**
|
|
116
|
-
* 契约 0.4.0(核心 0.7.0)新增的 wire 类型。
|
|
117
|
-
*
|
|
118
|
-
* 契约包尚未发布:npm 上的 `@morehao/trendradar-contract` 还停在 0.3.0,
|
|
119
|
-
* 因此这三块按 `contract/schema/releases.v2.json` 原样在本地声明,等 0.4.0 发布后
|
|
120
|
-
* 改回 `@morehao/trendradar-contract` 的 `import type`。除这里列出的字段外,
|
|
121
|
-
* 不补任何契约里没有的东西——本地声明只是「包还没发」的临时载体,不是第二份契约。
|
|
122
|
-
*/
|
|
123
|
-
type SubscriptionStatus = 'baseline' | 'ok' | 'no_change' | 'rate_limited' | 'failed';
|
|
124
|
-
/** 订阅表的一行:只放列表展示需要的字段,正文在 `SubscriptionDoc` 里(首屏体积预算)。 */
|
|
125
|
-
interface SubscriptionItem {
|
|
126
|
-
fullName: string;
|
|
127
|
-
url?: string;
|
|
128
|
-
latestTag?: string;
|
|
129
|
-
latestSummaryAt?: string;
|
|
130
|
-
lastCheckedAt?: string;
|
|
131
|
-
status: SubscriptionStatus;
|
|
132
|
-
}
|
|
133
|
-
/** 发版文档的一卷:每册都带两位序号,index N 是 `<repo>-0N.md`(第 1 册是 `-01`)。 */
|
|
134
|
-
interface SubscriptionVolume {
|
|
135
|
-
index: number;
|
|
136
|
-
file: string;
|
|
137
|
-
from?: string;
|
|
138
|
-
to?: string;
|
|
139
|
-
lines?: number;
|
|
140
|
-
}
|
|
141
|
-
/** 一个仓库某卷的发版文档;`markdown` 是文件原文,面板逐字渲染、不再二次摘要。 */
|
|
142
|
-
interface SubscriptionDoc {
|
|
143
|
-
fullName: string;
|
|
144
|
-
volume: number;
|
|
145
|
-
volumes?: SubscriptionVolume[];
|
|
146
|
-
updatedAt?: string;
|
|
147
|
-
markdown: string;
|
|
148
|
-
}
|
|
149
115
|
declare function isSubscriptionStatus(value: unknown): value is SubscriptionStatus;
|
|
150
116
|
/**
|
|
151
117
|
* `SubscriptionDoc` 的运行时守卫:缺 fullName/volume/markdown 的负载宁可抛
|
|
@@ -221,11 +187,11 @@ declare const ipc_State: typeof State;
|
|
|
221
187
|
declare const ipc_StateRun: typeof StateRun;
|
|
222
188
|
type ipc_SubscribeAction = SubscribeAction;
|
|
223
189
|
type ipc_SubscribeOutcome = SubscribeOutcome;
|
|
224
|
-
|
|
225
|
-
|
|
190
|
+
declare const ipc_SubscriptionDoc: typeof SubscriptionDoc;
|
|
191
|
+
declare const ipc_SubscriptionItem: typeof SubscriptionItem;
|
|
226
192
|
declare const ipc_SubscriptionList: typeof SubscriptionList;
|
|
227
|
-
|
|
228
|
-
|
|
193
|
+
declare const ipc_SubscriptionStatus: typeof SubscriptionStatus;
|
|
194
|
+
declare const ipc_SubscriptionVolume: typeof SubscriptionVolume;
|
|
229
195
|
declare const ipc_Usage: typeof Usage;
|
|
230
196
|
type ipc_VersionInfo = VersionInfo;
|
|
231
197
|
declare const ipc_isSubscriptionDoc: typeof isSubscriptionDoc;
|
|
@@ -236,7 +202,7 @@ declare const ipc_parseRunResult: typeof parseRunResult;
|
|
|
236
202
|
declare const ipc_parseSubscribeResult: typeof parseSubscribeResult;
|
|
237
203
|
declare const ipc_parseVersionInfo: typeof parseVersionInfo;
|
|
238
204
|
declare namespace ipc {
|
|
239
|
-
export { ipc_ErrorCode as ErrorCode, ipc_ErrorInfo as ErrorInfo, ipc_FileArtifact as FileArtifact, ipc_IPC_SCHEMA_VERSION as IPC_SCHEMA_VERSION, ipc_IpcError as IpcError, type ipc_ParseRunOptions as ParseRunOptions, ipc_ReleasesReport as ReleasesReport, type ipc_RunError as RunError, type ipc_RunOutcome as RunOutcome, ipc_RunRequest as RunRequest, ipc_RunResult as RunResult, ipc_SUPPORTED_CONTRACT_MAJOR as SUPPORTED_CONTRACT_MAJOR, ipc_SUPPORTED_DIGEST_SCHEMA as SUPPORTED_DIGEST_SCHEMA, ipc_State as State, ipc_StateRun as StateRun, type ipc_SubscribeAction as SubscribeAction, type ipc_SubscribeOutcome as SubscribeOutcome,
|
|
205
|
+
export { ipc_ErrorCode as ErrorCode, ipc_ErrorInfo as ErrorInfo, ipc_FileArtifact as FileArtifact, ipc_IPC_SCHEMA_VERSION as IPC_SCHEMA_VERSION, ipc_IpcError as IpcError, type ipc_ParseRunOptions as ParseRunOptions, ipc_ReleasesReport as ReleasesReport, type ipc_RunError as RunError, type ipc_RunOutcome as RunOutcome, ipc_RunRequest as RunRequest, ipc_RunResult as RunResult, ipc_SUPPORTED_CONTRACT_MAJOR as SUPPORTED_CONTRACT_MAJOR, ipc_SUPPORTED_DIGEST_SCHEMA as SUPPORTED_DIGEST_SCHEMA, ipc_State as State, ipc_StateRun as StateRun, type ipc_SubscribeAction as SubscribeAction, type ipc_SubscribeOutcome as SubscribeOutcome, ipc_SubscriptionDoc as SubscriptionDoc, ipc_SubscriptionItem as SubscriptionItem, ipc_SubscriptionList as SubscriptionList, ipc_SubscriptionStatus as SubscriptionStatus, ipc_SubscriptionVolume as SubscriptionVolume, ipc_Usage as Usage, type ipc_VersionInfo as VersionInfo, ipc_isSubscriptionDoc as isSubscriptionDoc, ipc_isSubscriptionStatus as isSubscriptionStatus, ipc_isVersionInfo as isVersionInfo, ipc_parseJsonObject as parseJsonObject, ipc_parseRunResult as parseRunResult, ipc_parseSubscribeResult as parseSubscribeResult, ipc_parseVersionInfo as parseVersionInfo };
|
|
240
206
|
}
|
|
241
207
|
|
|
242
208
|
type Provider = string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@morehao/dsh-github-trending",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "GitHub 趋势日报插件:每天定时 spawn 本地 trendradar 核心,抓取 Trending、生成中文简介与总结,提交到你的仓库并自动合并 PR。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@morehao/dsh-plugin-kit": "0.1.0",
|
|
54
|
-
"@morehao/trendradar-contract": "0.
|
|
54
|
+
"@morehao/trendradar-contract": "0.4.0"
|
|
55
55
|
},
|
|
56
56
|
"dsh": {
|
|
57
57
|
"bundle": {
|