@morehao/dsh-github-trending 0.7.3 → 0.7.5

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 CHANGED
@@ -1,5 +1,35 @@
1
1
  # Changelog
2
2
 
3
+ ## [v0.7.5] - 2026-11-01
4
+
5
+ > 升级核心 `dsh.core.version` 0.8.0 → 0.8.1:发版订阅在周期分支缺 `subscriptions.yaml` 时回退基准分支读取,「生成变更分析」不再因 0 订阅而 skipped。
6
+
7
+ ### 升级
8
+
9
+ - **核心 0.8.1**:`dsh.core.version` 由 `scripts/set-core-version.mjs` 写入为 `0.8.1`。核心修复了
10
+ `ReadRepoWithFallback`——按周期分支(如 `trending/weekly/2026-W44`)读取 `subscriptions.yaml`
11
+ 时,若该分支或文件不存在,回退到基准分支(`repo.baseBranch`,默认 `main`)再读一次,两者都缺才空。
12
+ 此前周期分支缺文件会解析成 0 订阅,release-only 运行被 skipped,界面表现为「生成变更分析」跑不出内容。
13
+ - 契约 wire 不变(`ipcSchema/digestSchema=2`),无需改动插件解析逻辑;`REPO_MIN_CORE_VERSION`
14
+ (0.8.0)已满足,单仓触发无需降级。
15
+
16
+ ## [v0.7.4] - 2026-11-01
17
+
18
+ > 修复「生成变更分析」一闪而过、却看不到发生了什么:解析兼容 + 跳过原因说明。
19
+
20
+ ### 修复
21
+
22
+ - **skipped 运行被误判为失败**:核心在「`--stages releases` 但订阅为空 / 内容无变化」时退出码 0、输出
23
+ `files:null`(契约 `RunResult.files` 必填为数组),插件按契约严格校验会抛 `IPC_INVALID`,界面表现为
24
+ 「生成变更分析」一闪而过报错。现在解析前把 `files:null/undefined` 归一成 `[]`,不再整次判错。
25
+
26
+ ### 改进
27
+
28
+ - **跳过原因说清楚**:核心判定跳过时,若该周期分支上解析到的订阅数为 0(`subscriptions.yaml` 未落到该分支 /
29
+ 基准分支),明确提示「当前周期分支没有订阅列表,请确认订阅已提交到基准分支」并带上分支名;有订阅但无变化时
30
+ 提示「无变化」。不再显示误导性的「已生成 · 0 个仓库有更新」,也不再一闪而过、不明所以。
31
+ - 发版运行记录新增 `subscribed`(该周期分支订阅数),用于区分「没订阅」与「无变化」。
32
+
3
33
  ## [v0.7.3] - 2026-11-01
4
34
 
5
35
  > 订阅页三处修复:待首次分析的仓库不再点出必败请求、添加订阅改弹窗、变更预览抽屉改紧凑 md 预览。
package/client.js CHANGED
@@ -495,6 +495,10 @@ var DICT = {
495
495
  "subs.analyzing": "分析中…",
496
496
  "subs.analyze.done": "变更分析已生成 · {count} 个仓库有更新",
497
497
  "subs.analyze.doneOne": "{repo} 已更新",
498
+ "subs.analyze.skipped": "没有可分析的订阅,或内容无变化,未生成新的变更分析。",
499
+ "subs.analyze.skippedOne": "{repo} 暂无新变化,未生成新的变更分析。",
500
+ "subs.analyze.noSubs": "当前周期分支上没有订阅列表(subscriptions.yaml):核心在 {branch} 上找不到订阅,未生成变更分析。请确认订阅已随产物提交到基准分支后重试。",
501
+ "subs.analyze.noSubsOne": "该仓库所在周期分支上没有订阅列表(subscriptions.yaml),无法单独分析。请确认订阅已提交到基准分支后重试。",
498
502
  "subs.analyze.failed": "分析失败:{message}",
499
503
  "subs.row.removeRepo": "移除 {repo}",
500
504
  "subs.col.repo": "仓库",
@@ -1020,6 +1024,10 @@ var DICT = {
1020
1024
  "subs.analyzing": "Analyzing…",
1021
1025
  "subs.analyze.done": "Change analysis ready · {count} repos updated",
1022
1026
  "subs.analyze.doneOne": "{repo} updated",
1027
+ "subs.analyze.skipped": "No subscriptions to analyze, or nothing changed — no new analysis generated.",
1028
+ "subs.analyze.skippedOne": "No new changes for {repo} — no new analysis generated.",
1029
+ "subs.analyze.noSubs": "No subscription list (subscriptions.yaml) on the current period branch: the core found no subscriptions on {branch}, so no analysis was generated. Make sure subscriptions are committed to the base branch, then retry.",
1030
+ "subs.analyze.noSubsOne": "The period branch for this repo has no subscription list (subscriptions.yaml), so it cannot be analyzed alone. Make sure subscriptions are committed to the base branch, then retry.",
1023
1031
  "subs.analyze.failed": "Analysis failed: {message}",
1024
1032
  "subs.row.removeRepo": "Remove {repo}",
1025
1033
  "subs.col.repo": "Repo",
@@ -1915,6 +1923,7 @@ function normalizeReleaseRun(raw) {
1915
1923
  };
1916
1924
  const maybe = {
1917
1925
  tokens: typeof r.tokens === "number" ? r.tokens : void 0,
1926
+ subscribed: typeof r.subscribed === "number" ? r.subscribed : void 0,
1918
1927
  commit: opt(r.commit),
1919
1928
  prUrl: opt(r.prUrl),
1920
1929
  branch: opt(r.branch),
@@ -4783,7 +4792,17 @@ function SubscriptionsView(props) {
4783
4792
  setError(null);
4784
4793
  setResult(null);
4785
4794
  postReleasesRun(repo).then((record) => {
4786
- setResult({ scope: repo === void 0 ? "all" : "one", ...repo === void 0 ? {} : { repo }, ok: record.status !== "failed", changed: record.changed });
4795
+ const scope = repo === void 0 ? "all" : "one";
4796
+ setResult({
4797
+ scope,
4798
+ ...repo === void 0 ? {} : { repo },
4799
+ ok: record.status !== "failed",
4800
+ skipped: record.status === "skipped",
4801
+ changed: record.changed,
4802
+ checked: record.checked,
4803
+ ...record.subscribed === void 0 ? {} : { subscribed: record.subscribed },
4804
+ ...record.branch === void 0 ? {} : { branch: record.branch }
4805
+ });
4787
4806
  if (record.status === "failed" && record.errorMessage !== void 0) {
4788
4807
  const notReady = isNotReadyMessage(record.errorMessage);
4789
4808
  setError(notReady ? t("subs.row.triggerFresh") : t("subs.analyze.failed", { message: record.errorMessage }));
@@ -4792,7 +4811,7 @@ function SubscriptionsView(props) {
4792
4811
  }).catch((failure) => {
4793
4812
  const message = errorText(failure);
4794
4813
  setError(isNotReadyMessage(message) ? t("subs.row.triggerFresh") : message);
4795
- setResult({ scope: repo === void 0 ? "all" : "one", ...repo === void 0 ? {} : { repo }, ok: false, changed: 0 });
4814
+ setResult({ scope: repo === void 0 ? "all" : "one", ...repo === void 0 ? {} : { repo }, ok: false, skipped: false, changed: 0, checked: 0 });
4796
4815
  }).finally(() => setAnalyzing(null));
4797
4816
  };
4798
4817
  const onSort = (key) => {
@@ -4819,11 +4838,17 @@ function SubscriptionsView(props) {
4819
4838
  const alreadySubscribed = canAdd && rows.some((row) => row.name.toLowerCase() === addValue.trim().toLowerCase());
4820
4839
  const drawerRow = openRepo === null ? void 0 : rows.find((row) => row.name === openRepo);
4821
4840
  const globalBusy = analyzing !== null;
4822
- const banner = result === null ? null : result.ok ? h(
4841
+ const banner = result === null ? null : !result.ok ? null : result.skipped ? h(
4842
+ Alert,
4843
+ { kind: "warn" },
4844
+ // subscribed === 0 ⇒ 周期分支上根本没有订阅列表(最坑的「不知道发生了什么」场景);
4845
+ // 否则才是「有订阅但都没变化」。
4846
+ result.subscribed === 0 ? result.scope === "all" ? t("subs.analyze.noSubs", { branch: result.branch ?? "" }) : t("subs.analyze.noSubsOne") : result.scope === "all" ? t("subs.analyze.skipped") : t("subs.analyze.skippedOne", { repo: result.repo ?? "" })
4847
+ ) : h(
4823
4848
  Alert,
4824
4849
  { kind: "ok" },
4825
4850
  result.scope === "all" ? t("subs.analyze.done", { count: result.changed }) : t("subs.analyze.doneOne", { repo: result.repo ?? "" })
4826
- ) : null;
4851
+ );
4827
4852
  const rowNodes = sorted.map((row) => {
4828
4853
  const item = row.item;
4829
4854
  const tone = toneOf(item?.status);
@@ -1065,6 +1065,7 @@ function normalizeError(value) {
1065
1065
  }
1066
1066
  function parseRunResult(text, options) {
1067
1067
  const value = parseJsonObject(text);
1068
+ if (value.files === null || value.files === void 0) value.files = [];
1068
1069
  if (value.command !== "run" || value.ipcSchema !== IPC_SCHEMA_VERSION || !validators.runResult(value)) {
1069
1070
  throw new IpcError("IPC_INVALID", "\u6838\u5FC3 run --json \u4E0D\u662F\u5951\u7EA6 RunResult\uFF08ipcSchema=2 / command=run\uFF09");
1070
1071
  }
@@ -3138,6 +3139,7 @@ var Runner = class {
3138
3139
  finishedAt: (/* @__PURE__ */ new Date()).toISOString(),
3139
3140
  status,
3140
3141
  checked: counterOf(releases?.checked),
3142
+ ...releases === void 0 ? {} : { subscribed: counterOf(releases.repos) },
3141
3143
  changed: counterOf(releases?.changed),
3142
3144
  newTags: counterOf(releases?.newReleases),
3143
3145
  summarized: counterOf(releases?.summarized),
package/lib/index.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  createTrendingRunTool,
9
9
  createUpdateService,
10
10
  readPluginInfo
11
- } from "./chunk-R3EDPRRO.js";
11
+ } from "./chunk-RB6W2PK7.js";
12
12
  import "./chunk-R7BK7SJK.js";
13
13
 
14
14
  // src/index.ts
package/lib/internal.d.ts CHANGED
@@ -617,6 +617,8 @@ interface ReleaseRunRecord {
617
617
  finishedAt: string;
618
618
  status: 'ok' | 'failed' | 'skipped' | 'cancelled';
619
619
  checked: number;
620
+ /** 本轮该周期分支上解析到的订阅仓库总数(releases.repos)。用于区分「没订阅」与「无变化」。 */
621
+ subscribed?: number;
620
622
  changed: number;
621
623
  newTags: number;
622
624
  summarized: number;
package/lib/internal.js CHANGED
@@ -26,7 +26,7 @@ import {
26
26
  tools_exports,
27
27
  update_exports,
28
28
  version_exports
29
- } from "./chunk-R3EDPRRO.js";
29
+ } from "./chunk-RB6W2PK7.js";
30
30
  import {
31
31
  exec_exports
32
32
  } from "./chunk-R7BK7SJK.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@morehao/dsh-github-trending",
3
- "version": "0.7.3",
3
+ "version": "0.7.5",
4
4
  "description": "GitHub 趋势日报插件:每天定时 spawn 本地 trendradar 核心,抓取 Trending、生成中文简介与总结,提交到你的仓库并自动合并 PR。",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -59,7 +59,7 @@
59
59
  },
60
60
  "core": {
61
61
  "repo": "morehao/trendradar",
62
- "version": "0.8.0"
62
+ "version": "0.8.1"
63
63
  },
64
64
  "client": {
65
65
  "platform": "web",