dshmarket 1.73.7 → 1.73.9
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 +2 -0
- package/README.zh.md +2 -0
- package/client/client.js +109 -37
- package/lib/backup.js +27 -2
- package/lib/discovery-compatibility.js +10 -0
- package/lib/drain-journal.js +33 -2
- package/lib/index.js +5 -1
- package/lib/official-desktop.js +49 -6
- package/lib/pending-updates.js +28 -1
- package/lib/pnpm-compat.js +13 -2
- package/lib/routes.js +7 -3
- package/lib/types/discovery-compatibility.d.ts +3 -0
- package/lib/types/pending-updates.d.ts +15 -0
- package/lib/types/registry.d.ts +12 -0
- package/lib/updates.js +12 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -143,6 +143,8 @@ Installs prefer repo-verified npm packages, then author-supplied prebuilt GitHub
|
|
|
143
143
|
|
|
144
144
|
## Data source
|
|
145
145
|
|
|
146
|
+
Catalog statistics preserve their source: npm counts cover the stated 30-day window; GitHub-only releases can show lifetime downloads of all public repository Release assets, including packages, checksums and companion files. The counts are never added together or called installations/users. Tooltips include the available collection time; npm-download sorting keeps its existing window. Catalog host declarations are accepted only for the exact pinned install URL, with the existing on-demand manifest lookup retained for older catalogs.
|
|
147
|
+
|
|
146
148
|
Fetched live on every open from [awesome-dsh-plugin.com/plugins.json](https://awesome-dsh-plugin.com/plugins.json) — curated entries, npm mapping, and star counts refreshed daily by CI, with no stale cache behind it. A failure reports the actual reason and elapsed time, with a Retry button.
|
|
147
149
|
|
|
148
150
|
There is deliberately no bundled snapshot to fall back on: for a catalog that grows daily, a stale answer is not a degraded one but a wrong one — a plugin published this morning would read as "does not exist".
|
package/README.zh.md
CHANGED
|
@@ -133,6 +133,8 @@ profile,因此不会出现在桌面端。请通过应用内的 **设置 →
|
|
|
133
133
|
|
|
134
134
|
## 数据源
|
|
135
135
|
|
|
136
|
+
目录统计保留来源与口径:npm 显示注明日期范围的近 30 天下载量;仅通过 GitHub 发行的插件可显示仓库所有公开发行附件的累计下载量,包括安装包、校验和配套文件。两者不会相加,也不表示安装次数或用户数。提示中保留可用的采集时间,npm 下载排序仍使用原有时间窗口。目录提供的宿主声明仅用于完全匹配的固定安装地址,旧目录继续按需读取包清单。
|
|
137
|
+
|
|
136
138
|
每次打开都实时请求 [awesome-dsh-plugin.com/plugins.json](https://awesome-dsh-plugin.com/plugins.json)——精选条目、npm 映射、star 数由 CI 每日刷新,不使用过期缓存兜底;连不上时会给出具体原因和耗时,并提供「重试」按钮。
|
|
137
139
|
|
|
138
140
|
刻意不做本地快照兜底:目录每天都在增长,过期的答案不是「差一点」而是「错的」——今早刚发布的插件会显示成「不存在」。
|
package/client/client.js
CHANGED
|
@@ -577,11 +577,14 @@ window.__ModuleLoader__.load({ id: "dshmarket", factory: (require) => {
|
|
|
577
577
|
sortDownloads: "npm 下载量(近 30 天)",
|
|
578
578
|
downloadsPeriod: "近30天",
|
|
579
579
|
downloadsMeaning: "近 30 天 npm 下载:{0}",
|
|
580
|
+
githubReleaseDownloadsMeaning: "GitHub 发行附件累计下载:{0}(包括安装包、校验和配套文件)",
|
|
581
|
+
starsMeaning: "GitHub Star:{0}",
|
|
582
|
+
statisticCheckedAt: ";采集于 {0}",
|
|
580
583
|
downloadsWindow: "({0} 至 {1})",
|
|
581
584
|
/** Discover/theme card byline tooltip for catalog `version`. */
|
|
582
585
|
catalogNpmLatest: "npm 当前 latest",
|
|
583
|
-
catalogVersionDated: "目录({0}
|
|
584
|
-
catalogVersionUndated: "
|
|
586
|
+
catalogVersionDated: "目录({0} 更新)记录的安装版本;新发行需等待目录更新",
|
|
587
|
+
catalogVersionUndated: "目录记录的安装版本;可能滞后于项目的新发行",
|
|
585
588
|
sortStars: "Star 数",
|
|
586
589
|
sortAdded: "收录时间",
|
|
587
590
|
recentlyAdded: "最近收录",
|
|
@@ -1359,11 +1362,14 @@ window.__ModuleLoader__.load({ id: "dshmarket", factory: (require) => {
|
|
|
1359
1362
|
sortDownloads: "npm downloads (30d)",
|
|
1360
1363
|
downloadsPeriod: "30d",
|
|
1361
1364
|
downloadsMeaning: "Last 30 days on npm: {0}",
|
|
1365
|
+
githubReleaseDownloadsMeaning: "GitHub Release asset downloads, all time: {0} (packages, checksums and companion files)",
|
|
1366
|
+
starsMeaning: "GitHub stars: {0}",
|
|
1367
|
+
statisticCheckedAt: "; checked {0}",
|
|
1362
1368
|
downloadsWindow: " ({0} – {1})",
|
|
1363
1369
|
/** Discover/theme card byline tooltip for catalog `version`. */
|
|
1364
1370
|
catalogNpmLatest: "npm latest",
|
|
1365
|
-
catalogVersionDated: "the
|
|
1366
|
-
catalogVersionUndated: "the
|
|
1371
|
+
catalogVersionDated: "the installable version as of the catalog's last refresh ({0}); a release published since then appears after the next refresh",
|
|
1372
|
+
catalogVersionUndated: "the installable version as of the catalog's last refresh — the catalog updates daily, so newer project releases may not appear yet",
|
|
1367
1373
|
sortStars: "Stars",
|
|
1368
1374
|
sortAdded: "Date added",
|
|
1369
1375
|
recentlyAdded: "Recently added",
|
|
@@ -2141,10 +2147,13 @@ window.__ModuleLoader__.load({ id: "dshmarket", factory: (require) => {
|
|
|
2141
2147
|
sortDownloads: "npm ダウンロード数(直近 30 日)",
|
|
2142
2148
|
downloadsPeriod: "30日",
|
|
2143
2149
|
downloadsMeaning: "直近 30 日の npm ダウンロード:{0}",
|
|
2150
|
+
githubReleaseDownloadsMeaning: "GitHub Release 添付ファイルの累計ダウンロード:{0}(パッケージ、チェックサム、関連ファイルを含む)",
|
|
2151
|
+
starsMeaning: "GitHub Star:{0}",
|
|
2152
|
+
statisticCheckedAt: ";取得日時 {0}",
|
|
2144
2153
|
downloadsWindow: "({0} ~ {1})",
|
|
2145
2154
|
catalogNpmLatest: "npm の現在の latest",
|
|
2146
|
-
catalogVersionDated: "
|
|
2147
|
-
catalogVersionUndated: "
|
|
2155
|
+
catalogVersionDated: "カタログ({0} 更新)に記録されたインストール用バージョンです。新しいリリースはカタログ更新後に表示されます",
|
|
2156
|
+
catalogVersionUndated: "カタログに記録されたインストール用バージョンです。新しいリリースがまだ反映されていない場合があります",
|
|
2148
2157
|
sortStars: "スター数",
|
|
2149
2158
|
sortAdded: "収録日時",
|
|
2150
2159
|
recentlyAdded: "最近の収録",
|
|
@@ -4873,6 +4882,29 @@ window.__ModuleLoader__.load({ id: "dshmarket", factory: (require) => {
|
|
|
4873
4882
|
}
|
|
4874
4883
|
//#endregion
|
|
4875
4884
|
//#region src/client/download-stats.ts
|
|
4885
|
+
const validCount = (value) => typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
|
|
4886
|
+
/** Keep the established npm window first; the two sources are never added together. */
|
|
4887
|
+
function downloadStatistic(plugin) {
|
|
4888
|
+
if (validCount(plugin.downloads)) return {
|
|
4889
|
+
count: plugin.downloads,
|
|
4890
|
+
source: "npm"
|
|
4891
|
+
};
|
|
4892
|
+
if (validCount(plugin.githubReleaseDownloads)) return {
|
|
4893
|
+
count: plugin.githubReleaseDownloads,
|
|
4894
|
+
source: "github"
|
|
4895
|
+
};
|
|
4896
|
+
return null;
|
|
4897
|
+
}
|
|
4898
|
+
function checkedAt(value, t) {
|
|
4899
|
+
if (dateOnly(value)) return t("statisticCheckedAt").replace("{0}", value);
|
|
4900
|
+
if (typeof value !== "string" || !/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(value)) return "";
|
|
4901
|
+
const date = new Date(value);
|
|
4902
|
+
if (!Number.isFinite(date.getTime()) || date.toISOString() !== value) return "";
|
|
4903
|
+
return t("statisticCheckedAt").replace("{0}", value.slice(0, 16).replace("T", " ") + " UTC");
|
|
4904
|
+
}
|
|
4905
|
+
function starStatsText(plugin, t) {
|
|
4906
|
+
return validCount(plugin.stars) ? t("starsMeaning").replace("{0}", String(plugin.stars)) + checkedAt(plugin.starsCheckedAt, t) : null;
|
|
4907
|
+
}
|
|
4876
4908
|
/** Date-only values stay date-only; never derive a window from today's date. */
|
|
4877
4909
|
function dateOnly(value) {
|
|
4878
4910
|
if (typeof value !== "string" || !/^\d{4}-\d{2}-\d{2}$/.test(value)) return false;
|
|
@@ -4881,8 +4913,10 @@ window.__ModuleLoader__.load({ id: "dshmarket", factory: (require) => {
|
|
|
4881
4913
|
}
|
|
4882
4914
|
/** Exact count and, when the catalog sent one, the 30-day window. */
|
|
4883
4915
|
function downloadStatsText(plugin, t) {
|
|
4884
|
-
const
|
|
4885
|
-
if (
|
|
4916
|
+
const statistic = downloadStatistic(plugin);
|
|
4917
|
+
if (statistic === null) return null;
|
|
4918
|
+
const { count, source } = statistic;
|
|
4919
|
+
if (source === "github") return t("githubReleaseDownloadsMeaning").replace("{0}", String(count)) + checkedAt(plugin.githubReleaseDownloadsCheckedAt, t);
|
|
4886
4920
|
const meaning = t("downloadsMeaning").replace("{0}", String(count));
|
|
4887
4921
|
if (!(dateOnly(plugin.downloadsStart) && dateOnly(plugin.downloadsEnd) && plugin.downloadsStart <= plugin.downloadsEnd)) return meaning;
|
|
4888
4922
|
return meaning + t("downloadsWindow").replace("{0}", plugin.downloadsStart).replace("{1}", plugin.downloadsEnd);
|
|
@@ -8135,6 +8169,28 @@ window.__ModuleLoader__.load({ id: "dshmarket", factory: (require) => {
|
|
|
8135
8169
|
* interpreted as markup); remaining text arrives as React children or
|
|
8136
8170
|
* controlled nodes only.
|
|
8137
8171
|
*/
|
|
8172
|
+
/**
|
|
8173
|
+
* An <img> whose src lives on raw.githubusercontent.com, walked through the
|
|
8174
|
+
* raw GitHub route candidates on failure (#1070 follow-up): the update-notes
|
|
8175
|
+
* dialog was the last place still loading those images directly, so on
|
|
8176
|
+
* networks where raw is unreachable the notes rendered with holes. When every
|
|
8177
|
+
* candidate fails the last one is the direct URL, exactly the old behavior.
|
|
8178
|
+
*/
|
|
8179
|
+
function GithubRoutedImg({ src, alt, className, key }) {
|
|
8180
|
+
const [routeIndex, setRouteIndex] = (0, react.useState)(0);
|
|
8181
|
+
const candidates = githubRouteCandidates("raw", src);
|
|
8182
|
+
const candidate = candidates[Math.min(routeIndex, candidates.length - 1)];
|
|
8183
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
|
|
8184
|
+
className,
|
|
8185
|
+
src: candidate.url,
|
|
8186
|
+
alt,
|
|
8187
|
+
loading: "lazy",
|
|
8188
|
+
onLoad: () => rememberGithubRoute("raw", candidate.proxy),
|
|
8189
|
+
onError: () => {
|
|
8190
|
+
if (routeIndex + 1 < candidates.length) setRouteIndex(routeIndex + 1);
|
|
8191
|
+
}
|
|
8192
|
+
}, key);
|
|
8193
|
+
}
|
|
8138
8194
|
function renderMarkdown(md) {
|
|
8139
8195
|
const out = [];
|
|
8140
8196
|
let bullets = null;
|
|
@@ -8176,11 +8232,10 @@ window.__ModuleLoader__.load({ id: "dshmarket", factory: (require) => {
|
|
|
8176
8232
|
const image = releaseNotesHttpsImage(trimmed);
|
|
8177
8233
|
if (image !== null) {
|
|
8178
8234
|
flushList();
|
|
8179
|
-
out.push(/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
8235
|
+
out.push(/* @__PURE__ */ (0, react_jsx_runtime.jsx)(GithubRoutedImg, {
|
|
8180
8236
|
className: Market_module_css_default.notesImg,
|
|
8181
8237
|
src: image.src,
|
|
8182
|
-
alt: image.alt
|
|
8183
|
-
loading: "lazy"
|
|
8238
|
+
alt: image.alt
|
|
8184
8239
|
}, `i${out.length}`));
|
|
8185
8240
|
continue;
|
|
8186
8241
|
}
|
|
@@ -8221,17 +8276,26 @@ window.__ModuleLoader__.load({ id: "dshmarket", factory: (require) => {
|
|
|
8221
8276
|
const [failed, setFailed] = (0, react.useState)(false);
|
|
8222
8277
|
const [routeIndex, setRouteIndex] = (0, react.useState)(0);
|
|
8223
8278
|
const [iconFailed, setIconFailed] = (0, react.useState)(false);
|
|
8279
|
+
const [iconRouteIndex, setIconRouteIndex] = (0, react.useState)(0);
|
|
8224
8280
|
const av = className === void 0 ? Market_module_css_default.av : `${Market_module_css_default.av} ${className}`;
|
|
8225
8281
|
const tile = iconFailed ? null : safeIcon(icon);
|
|
8226
|
-
if (tile !== null)
|
|
8227
|
-
|
|
8228
|
-
|
|
8229
|
-
|
|
8230
|
-
|
|
8231
|
-
|
|
8232
|
-
|
|
8233
|
-
|
|
8234
|
-
|
|
8282
|
+
if (tile !== null) {
|
|
8283
|
+
const candidates = githubRouteCandidates("raw", tile);
|
|
8284
|
+
const candidate = candidates[Math.min(iconRouteIndex, candidates.length - 1)];
|
|
8285
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
|
|
8286
|
+
className: av,
|
|
8287
|
+
src: candidate.url,
|
|
8288
|
+
alt: "",
|
|
8289
|
+
loading: "lazy",
|
|
8290
|
+
decoding: "async",
|
|
8291
|
+
referrerPolicy: "no-referrer",
|
|
8292
|
+
onLoad: () => rememberGithubRoute("raw", candidate.proxy),
|
|
8293
|
+
onError: () => {
|
|
8294
|
+
if (iconRouteIndex + 1 < candidates.length) setIconRouteIndex(iconRouteIndex + 1);
|
|
8295
|
+
else setIconFailed(true);
|
|
8296
|
+
}
|
|
8297
|
+
});
|
|
8298
|
+
}
|
|
8235
8299
|
if (failed || owner === "") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
8236
8300
|
className: av,
|
|
8237
8301
|
style: { background: avatarColor(name) },
|
|
@@ -9051,9 +9115,23 @@ window.__ModuleLoader__.load({ id: "dshmarket", factory: (require) => {
|
|
|
9051
9115
|
})
|
|
9052
9116
|
});
|
|
9053
9117
|
}
|
|
9054
|
-
/** Compact
|
|
9118
|
+
/** Compact count; hover names the exact figure, source and reporting scope. */
|
|
9055
9119
|
function DownloadCount({ plugin, t }) {
|
|
9056
9120
|
const tip = downloadStatsText(plugin, t);
|
|
9121
|
+
const statistic = downloadStatistic(plugin);
|
|
9122
|
+
if (tip === null || statistic === null) return null;
|
|
9123
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CardTip, {
|
|
9124
|
+
label: tip,
|
|
9125
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
9126
|
+
className: Market_module_css_default.star,
|
|
9127
|
+
tabIndex: 0,
|
|
9128
|
+
"aria-label": tip,
|
|
9129
|
+
children: "· " + (statistic.source === "github" ? "GitHub " : "") + "↓ " + formatCount(statistic.count)
|
|
9130
|
+
})
|
|
9131
|
+
});
|
|
9132
|
+
}
|
|
9133
|
+
function StarCount({ plugin, t }) {
|
|
9134
|
+
const tip = starStatsText(plugin, t);
|
|
9057
9135
|
if (tip === null) return null;
|
|
9058
9136
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CardTip, {
|
|
9059
9137
|
label: tip,
|
|
@@ -9061,7 +9139,7 @@ window.__ModuleLoader__.load({ id: "dshmarket", factory: (require) => {
|
|
|
9061
9139
|
className: Market_module_css_default.star,
|
|
9062
9140
|
tabIndex: 0,
|
|
9063
9141
|
"aria-label": tip,
|
|
9064
|
-
children: "·
|
|
9142
|
+
children: "· ★ " + formatCount(plugin.stars)
|
|
9065
9143
|
})
|
|
9066
9144
|
});
|
|
9067
9145
|
}
|
|
@@ -13867,12 +13945,9 @@ window.__ModuleLoader__.load({ id: "dshmarket", factory: (require) => {
|
|
|
13867
13945
|
plugin: p,
|
|
13868
13946
|
t
|
|
13869
13947
|
}),
|
|
13870
|
-
|
|
13871
|
-
|
|
13872
|
-
|
|
13873
|
-
className: Market_module_css_default.star,
|
|
13874
|
-
children: "· ★ " + formatCount(p.stars)
|
|
13875
|
-
})
|
|
13948
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StarCount, {
|
|
13949
|
+
plugin: p,
|
|
13950
|
+
t
|
|
13876
13951
|
})
|
|
13877
13952
|
]
|
|
13878
13953
|
})]
|
|
@@ -14021,12 +14096,9 @@ window.__ModuleLoader__.load({ id: "dshmarket", factory: (require) => {
|
|
|
14021
14096
|
plugin: p,
|
|
14022
14097
|
t
|
|
14023
14098
|
}),
|
|
14024
|
-
|
|
14025
|
-
|
|
14026
|
-
|
|
14027
|
-
className: Market_module_css_default.star,
|
|
14028
|
-
children: "· ★ " + formatCount(p.stars)
|
|
14029
|
-
})
|
|
14099
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StarCount, {
|
|
14100
|
+
plugin: p,
|
|
14101
|
+
t
|
|
14030
14102
|
})
|
|
14031
14103
|
]
|
|
14032
14104
|
})]
|
|
@@ -16524,9 +16596,9 @@ window.__ModuleLoader__.load({ id: "dshmarket", factory: (require) => {
|
|
|
16524
16596
|
plugin: confirming,
|
|
16525
16597
|
t
|
|
16526
16598
|
}),
|
|
16527
|
-
|
|
16528
|
-
|
|
16529
|
-
|
|
16599
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StarCount, {
|
|
16600
|
+
plugin: confirming,
|
|
16601
|
+
t
|
|
16530
16602
|
}),
|
|
16531
16603
|
confirming.added && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
16532
16604
|
className: Market_module_css_default.star,
|
package/lib/backup.js
CHANGED
|
@@ -16,7 +16,29 @@ export const BACKUP_FORMAT = 'dsh-profile-backup';
|
|
|
16
16
|
export const MAX_BACKUP_BYTES = 2 * 1024 * 1024;
|
|
17
17
|
const MAX_FILES = 256;
|
|
18
18
|
const SKIP_NAMES = new Set(['node_modules', '.dsh-market', '.git', 'pnpm-lock.yaml']);
|
|
19
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Directories that are caches by name, wherever they sit.
|
|
21
|
+
*
|
|
22
|
+
* The market's own cache is `.dsh-market` (skipped above), but another
|
|
23
|
+
* component writes `<profile>/cache` — not hidden, so the dot rule below let
|
|
24
|
+
* it through and the whole thing was read as configuration. With a few
|
|
25
|
+
* multi-megabyte json files in there the profile could not be backed up at
|
|
26
|
+
* all, and the error blamed the profile's own configuration (#1064).
|
|
27
|
+
*
|
|
28
|
+
* Only the exporter skips these; `validatedBackup` still accepts a document
|
|
29
|
+
* that carries them, because backups written before this rule put them in.
|
|
30
|
+
*/
|
|
31
|
+
const SKIP_DIRS = new Set(['cache']);
|
|
32
|
+
/**
|
|
33
|
+
* Said when the profile does not fit: the way out has to be one that works.
|
|
34
|
+
*
|
|
35
|
+
* The old sentence offered "只导出选中的插件" unconditionally, but that path
|
|
36
|
+
* walks the same profile once "包含配置文件" is ticked and fails with the
|
|
37
|
+
* same words (#1064) — so it now names the trap as well.
|
|
38
|
+
*/
|
|
39
|
+
const EXPORT_SELECTED_ZH = '可以改成只导出选中的插件,并且别勾「包含配置文件」,那会撞同一个上限';
|
|
40
|
+
const EXPORT_SELECTED_EN = 'export selected plugins instead, and leave "Include config files" unticked — ticking it hits the same cap';
|
|
41
|
+
const BACKUP_TOO_LARGE = `这个 profile 的配置超过 ${MAX_BACKUP_BYTES / (1024 * 1024)} MB,整份备份放不下。${EXPORT_SELECTED_ZH}。 / this profile's configuration is larger than ${MAX_BACKUP_BYTES / (1024 * 1024)} MB, which is too much for one whole-profile backup; ${EXPORT_SELECTED_EN}.`;
|
|
20
42
|
/** File names that routinely contain credentials (backup exports).
|
|
21
43
|
* Values are never masked in place — the export is one-to-one for
|
|
22
44
|
* faithful restores — but presence is surfaced by the UI warning. */
|
|
@@ -46,6 +68,9 @@ function profileFiles(root, dir = root) {
|
|
|
46
68
|
// `.env` and `.npmrc` are real profile config.
|
|
47
69
|
if (entry.isDirectory() && entry.name.startsWith('.'))
|
|
48
70
|
continue;
|
|
71
|
+
// Same rule, one name the dot check cannot cover (#1064).
|
|
72
|
+
if (entry.isDirectory() && SKIP_DIRS.has(entry.name))
|
|
73
|
+
continue;
|
|
49
74
|
const path = resolve(dir, entry.name);
|
|
50
75
|
if (entry.isSymbolicLink())
|
|
51
76
|
continue;
|
|
@@ -56,7 +81,7 @@ function profileFiles(root, dir = root) {
|
|
|
56
81
|
// Told in the user's words, with the way out: this is the cap a heavy
|
|
57
82
|
// profile actually hits, and the per-plugin export is the answer.
|
|
58
83
|
if (files.length > MAX_FILES) {
|
|
59
|
-
throw new Error(`这个 profile 的配置文件超过 ${MAX_FILES}
|
|
84
|
+
throw new Error(`这个 profile 的配置文件超过 ${MAX_FILES} 个,整份备份放不下。${EXPORT_SELECTED_ZH}。 / this profile has more than ${MAX_FILES} configuration files, which is too many for one whole-profile backup; ${EXPORT_SELECTED_EN}.`);
|
|
60
85
|
}
|
|
61
86
|
}
|
|
62
87
|
return files;
|
|
@@ -22,6 +22,16 @@ const FETCH_TIMEOUT_MS = 8_000;
|
|
|
22
22
|
const DEFAULT_CONCURRENCY = 8;
|
|
23
23
|
const MAX_CACHE_ENTRIES = 5_000;
|
|
24
24
|
const MAX_RANGE_LENGTH = 256;
|
|
25
|
+
/** Reuse catalog facts only for this repository's exact pinned install asset. */
|
|
26
|
+
export function catalogReleaseManifest(source) {
|
|
27
|
+
const facts = record(source.releaseManifest);
|
|
28
|
+
const repository = parseSourceUrl(source.url)?.repo;
|
|
29
|
+
const release = /^https:\/\/github\.com\/([^/]+\/[^/]+)\/releases\/download\/[^/]+\/[^/?#]+\.(?:tgz|tar\.gz)$/.exec(source.tarball ?? '');
|
|
30
|
+
if (facts === null || !repository || !release || release[1].toLowerCase() !== repository.toLowerCase()
|
|
31
|
+
|| facts.tarball !== source.tarball || !validFacts(facts))
|
|
32
|
+
return null;
|
|
33
|
+
return { version: facts.version, enginesDsh: facts.enginesDsh, peerDependencies: facts.peerDependencies };
|
|
34
|
+
}
|
|
25
35
|
/** Read the linked package at its selected release, never the repository root by accident. */
|
|
26
36
|
async function githubManifest(source, fetcher) {
|
|
27
37
|
const parsed = parseSourceUrl(source.url);
|
package/lib/drain-journal.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* counts and time. No prompts, transcripts, tool input, environment values, or
|
|
10
10
|
* paths.
|
|
11
11
|
*/
|
|
12
|
-
import { appendFileSync, existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from 'node:fs';
|
|
12
|
+
import { appendFileSync, closeSync, existsSync, mkdirSync, openSync, readFileSync, readSync, statSync, writeFileSync } from 'node:fs';
|
|
13
13
|
import { dirname } from 'node:path';
|
|
14
14
|
import { redactHomePaths } from './log-redaction.js';
|
|
15
15
|
const MAX_BYTES = 64 * 1024;
|
|
@@ -58,6 +58,32 @@ function parseLine(line) {
|
|
|
58
58
|
agentsAtEnd: row.agentsAtEnd,
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Whether the file is empty or its last byte is a newline — i.e. whether an
|
|
63
|
+
* append starts a line of its own. Reads one byte rather than the file: this
|
|
64
|
+
* runs on every completed operation, and the journal is bounded but not tiny.
|
|
65
|
+
*/
|
|
66
|
+
function endsWithNewline(file) {
|
|
67
|
+
try {
|
|
68
|
+
const size = statSync(file).size;
|
|
69
|
+
if (size === 0)
|
|
70
|
+
return true;
|
|
71
|
+
const fd = openSync(file, 'r');
|
|
72
|
+
try {
|
|
73
|
+
const last = Buffer.alloc(1);
|
|
74
|
+
readSync(fd, last, 0, 1, size - 1);
|
|
75
|
+
return last[0] === 0x0a;
|
|
76
|
+
}
|
|
77
|
+
finally {
|
|
78
|
+
closeSync(fd);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
// No file yet (a fresh append creates it) or unreadable: appending a
|
|
83
|
+
// leading newline to a missing file would only add a blank line.
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
61
87
|
export class DrainJournal {
|
|
62
88
|
file;
|
|
63
89
|
maxBytes;
|
|
@@ -82,7 +108,12 @@ export class DrainJournal {
|
|
|
82
108
|
if (this.records.length > MAX_RECORDS)
|
|
83
109
|
this.records.splice(0, this.records.length - MAX_RECORDS);
|
|
84
110
|
mkdirSync(dirname(this.file), { recursive: true });
|
|
85
|
-
|
|
111
|
+
// An interrupted write leaves a tail without its newline. Appending to it
|
|
112
|
+
// would glue this record onto the damaged one, so the file would carry a
|
|
113
|
+
// single unparseable line and BOTH would be lost on reopen — the record
|
|
114
|
+
// this append just completed included (#1084). The damaged tail is
|
|
115
|
+
// dropped by load() on its own; this only keeps the next record separate.
|
|
116
|
+
appendFileSync(this.file, `${endsWithNewline(this.file) ? '' : '\n'}${JSON.stringify(cleaned)}\n`);
|
|
86
117
|
if (existsSync(this.file) && statSync(this.file).size > this.maxBytes)
|
|
87
118
|
this.trim();
|
|
88
119
|
}
|
package/lib/index.js
CHANGED
|
@@ -10,6 +10,7 @@ import { setRequestGateSource, setTrustedHostsSource } from './http.js';
|
|
|
10
10
|
import { setLauncherInstallAnchorSource } from './dsh-install.js';
|
|
11
11
|
import { mountMarketRoutes } from './routes.js';
|
|
12
12
|
import { installDesktopMarketSettings, installMarketSettings } from './settings.js';
|
|
13
|
+
import { MAX_AUTO_REPAIR_ATTEMPTS } from './pending-updates.js';
|
|
13
14
|
export const name = 'dsh-market';
|
|
14
15
|
/**
|
|
15
16
|
* How long after the market mounts an interrupted update is repaired.
|
|
@@ -282,7 +283,10 @@ export function apply(ctx, config) {
|
|
|
282
283
|
void runtime.repairPendingUpdates().then(report => {
|
|
283
284
|
if (report.reinstalled.length === 0 && report.failed.length === 0)
|
|
284
285
|
return;
|
|
285
|
-
|
|
286
|
+
const abandoned = report.abandoned.length === 0
|
|
287
|
+
? ''
|
|
288
|
+
: `, ${String(report.abandoned.length)} given up on after ${String(MAX_AUTO_REPAIR_ATTEMPTS)} starts — reinstall from Settings → Plugins: ${report.abandoned.join(', ')}`;
|
|
289
|
+
console.warn(`dsh-market: ${String(report.reinstalled.length)} interrupted update(s) reinstalled, ${String(report.failed.length)} still pending${abandoned}`);
|
|
286
290
|
});
|
|
287
291
|
}, PENDING_UPDATE_REPAIR_DELAY_MS);
|
|
288
292
|
repairTimer.unref?.();
|
package/lib/official-desktop.js
CHANGED
|
@@ -13,11 +13,29 @@ import { activeRegion, DEFAULT_NPM_REGISTRY, routesFor } from './regions.js';
|
|
|
13
13
|
* resolve and the operation stays "updating" forever while holding the
|
|
14
14
|
* profile's write lock. These deadlines cannot cancel the host, but they end
|
|
15
15
|
* the market's wait, and the journal (`./pending-updates.ts`) makes the next
|
|
16
|
-
* start finish the job.
|
|
17
|
-
*
|
|
16
|
+
* start finish the job.
|
|
17
|
+
*
|
|
18
|
+
* Both are the same length on purpose (#1057). Removal is short when pnpm
|
|
19
|
+
* only unlinks, but the host runs every command through the profile's
|
|
20
|
+
* supply-chain verification first, and that reaches the network: the reported
|
|
21
|
+
* update died at 90 s while pnpm was doing the right thing
|
|
22
|
+
* (`GET … UND_ERR_CONNECT_TIMEOUT. Will retry in 10 seconds. 2 retries left`),
|
|
23
|
+
* and the host's own manager then rewrote the manifest from its stale
|
|
24
|
+
* snapshot two minutes later. A deadline is here to end an infinite wait, not
|
|
25
|
+
* to race pnpm's retry budget — a transient that resolves by itself must not
|
|
26
|
+
* turn into a permanent failure.
|
|
18
27
|
*/
|
|
19
|
-
const REMOVE_DEADLINE_MS =
|
|
28
|
+
const REMOVE_DEADLINE_MS = 300_000;
|
|
20
29
|
const INSTALL_DEADLINE_MS = 300_000;
|
|
30
|
+
/**
|
|
31
|
+
* The bound around a whole `add`, which may be an update and therefore holds
|
|
32
|
+
* two bounded phases in a row. It has to stay strictly longer than their sum:
|
|
33
|
+
* an outer bound equal to the inner one fires at the same instant and decides
|
|
34
|
+
* the answer instead — that is how a timeout stopped being reported as
|
|
35
|
+
* "the update did not finish" and started being reported as the plain
|
|
36
|
+
* operation refusal (#928's spec caught it).
|
|
37
|
+
*/
|
|
38
|
+
const OPERATION_DEADLINE_MS = REMOVE_DEADLINE_MS + INSTALL_DEADLINE_MS;
|
|
21
39
|
/**
|
|
22
40
|
* What a user can actually do when the market cannot perform an operation on
|
|
23
41
|
* the official Desktop profile: the app's own Plugins page runs the same
|
|
@@ -111,6 +129,14 @@ const REFUSAL_COPY = {
|
|
|
111
129
|
zh: '这个版本与当前 DSH 不兼容,宿主拒绝安装',
|
|
112
130
|
en: 'this version is not compatible with the running DSH, so the host refused it',
|
|
113
131
|
},
|
|
132
|
+
// An ordinary install or uninstall that the manager never answered (#1066).
|
|
133
|
+
// Deliberately not `update-incomplete`: that sentence ("the plugin may
|
|
134
|
+
// already be removed while its replacement never installed") is about the
|
|
135
|
+
// remove-then-install pair and reads as nonsense on a plain uninstall.
|
|
136
|
+
'operation-incomplete': {
|
|
137
|
+
zh: '桌面端没有在限定时间内答复这次操作:磁盘上可能已经改完了,市场只是没等到答复,所以没有回滚。重新打开 DSH 后市场会按磁盘状态核对;状态不对的话从「设置 → 插件」处理',
|
|
138
|
+
en: 'the desktop app did not answer this operation in time: the change may already be on disk, and the market got no reply, so it rolled nothing back. Reopen DSH and the market checks what is actually there; if it still looks wrong, use Settings → Plugins',
|
|
139
|
+
},
|
|
114
140
|
'update-incomplete': {
|
|
115
141
|
zh: '桌面端没有在限定时间内完成这次更新:插件可能已经被移除,新版本却还没装上。重新打开 DSH 后市场会自动补装;也可以现在从「设置 → 插件」重试',
|
|
116
142
|
en: 'the desktop app did not finish this update in time: the plugin may already be removed while its replacement never installed. Reopen DSH and the market will finish the install, or retry from Settings → Plugins now',
|
|
@@ -455,9 +481,26 @@ packageManager) {
|
|
|
455
481
|
// package: the journal must not put back what the user just removed.
|
|
456
482
|
if (command === 'remove')
|
|
457
483
|
updateContext?.journal.forget(profileName, target);
|
|
458
|
-
|
|
484
|
+
// The host's manager has no deadline of its own (#1066): a call that
|
|
485
|
+
// never settles held the profile's write lock and left the panel saying
|
|
486
|
+
// "working" forever, while its pnpm had in fact finished seconds later.
|
|
487
|
+
// The update path has had these deadlines for exactly that reason; an
|
|
488
|
+
// ordinary install or uninstall needs the same bound.
|
|
489
|
+
const deadline = command === 'remove' ? REMOVE_DEADLINE_MS : OPERATION_DEADLINE_MS;
|
|
490
|
+
operation = withDeadline(command === 'remove'
|
|
459
491
|
? manager.removeBundle(target)
|
|
460
|
-
: installOrReinstall(manager, spec, options, updateContext)
|
|
492
|
+
: installOrReinstall(manager, spec, options, updateContext), deadline, `${command} ${target}`).catch((error) => {
|
|
493
|
+
if (!(error instanceof DeadlineExceeded))
|
|
494
|
+
throw error;
|
|
495
|
+
return {
|
|
496
|
+
application: 'failed',
|
|
497
|
+
// Neither "nothing happened" nor "undo it": the manager may have
|
|
498
|
+
// written the change already. The next start reconciles against
|
|
499
|
+
// disk instead of the market inventing an answer here.
|
|
500
|
+
repairOnRestart: true,
|
|
501
|
+
error: { code: 'operation-incomplete' },
|
|
502
|
+
};
|
|
503
|
+
});
|
|
461
504
|
}
|
|
462
505
|
catch (error) {
|
|
463
506
|
progress.active = false;
|
|
@@ -520,7 +563,7 @@ packageManager) {
|
|
|
520
563
|
return current.done;
|
|
521
564
|
};
|
|
522
565
|
const repairPendingUpdates = async () => {
|
|
523
|
-
const empty = { reinstalled: [], finished: [], failed: [] };
|
|
566
|
+
const empty = { reinstalled: [], finished: [], failed: [], abandoned: [] };
|
|
524
567
|
if (disposed || repairing || active !== undefined)
|
|
525
568
|
return empty;
|
|
526
569
|
const manager = managerLookup();
|
package/lib/pending-updates.js
CHANGED
|
@@ -169,6 +169,23 @@ export async function withDeadline(work, ms, label) {
|
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
export const REPAIR_INSTALL_TIMEOUT_MS = 300_000;
|
|
172
|
+
/**
|
|
173
|
+
* How many starts may each spend up to REPAIR_INSTALL_TIMEOUT_MS trying to put
|
|
174
|
+
* one package back before the market stops trying by itself.
|
|
175
|
+
*
|
|
176
|
+
* Retrying is right while the cause might be transient (offline, a registry
|
|
177
|
+
* briefly down, the host still shutting down). It stops being right when every
|
|
178
|
+
* start pays the full timeout for a spec that will never install — the shape a
|
|
179
|
+
* reporter lived through on the Desktop host (#1061: five days of failing
|
|
180
|
+
* reinstalls on every boot, all of it invisible). The record is kept, so the
|
|
181
|
+
* package is not forgotten; only the automatic attempt stops, and the user is
|
|
182
|
+
* told where to act.
|
|
183
|
+
*/
|
|
184
|
+
export const MAX_AUTO_REPAIR_ATTEMPTS = 3;
|
|
185
|
+
/** What the user is told once the cap is reached: what, why, and what to do. */
|
|
186
|
+
function gaveUpCopy(name, attempts) {
|
|
187
|
+
return `${name} 还没装回来:之前 ${String(attempts)} 次启动都没能装好,市场不再自动重试。请到「设置 → 插件」重新安装它 / ${name} is still missing: ${String(attempts)} starts could not reinstall it, so the market stopped retrying — reinstall it from Settings → Plugins`;
|
|
188
|
+
}
|
|
172
189
|
function managerSucceeded(result) {
|
|
173
190
|
return result.application === 'applied'
|
|
174
191
|
|| result.application === 'restart-required'
|
|
@@ -253,7 +270,7 @@ export function clearStaleProfileLock(profileDirectory) {
|
|
|
253
270
|
*/
|
|
254
271
|
export async function repairInterruptedUpdates(options) {
|
|
255
272
|
const journal = options.journal ?? PendingUpdateJournal.forProfile(options.profileDirectory);
|
|
256
|
-
const report = { reinstalled: [], finished: [], failed: [] };
|
|
273
|
+
const report = { reinstalled: [], finished: [], failed: [], abandoned: [] };
|
|
257
274
|
const pending = journal.list().filter(entry => entry.profile === options.profile);
|
|
258
275
|
for (const entry of pending) {
|
|
259
276
|
const installed = readInstalledVersion(options.profile, entry.name, options.profileDirectory);
|
|
@@ -275,6 +292,16 @@ export async function repairInterruptedUpdates(options) {
|
|
|
275
292
|
});
|
|
276
293
|
continue;
|
|
277
294
|
}
|
|
295
|
+
if (entry.attempts >= MAX_AUTO_REPAIR_ATTEMPTS) {
|
|
296
|
+
// Not bumped: the count is already the reason this start does nothing,
|
|
297
|
+
// and growing it would re-log the same sentence on every boot.
|
|
298
|
+
if (entry.attempts === MAX_AUTO_REPAIR_ATTEMPTS) {
|
|
299
|
+
logEvent('error', 'update-repair', gaveUpCopy(entry.name, entry.attempts));
|
|
300
|
+
}
|
|
301
|
+
report.failed.push({ name: entry.name, reason: gaveUpCopy(entry.name, entry.attempts) });
|
|
302
|
+
report.abandoned.push(entry.name);
|
|
303
|
+
continue;
|
|
304
|
+
}
|
|
278
305
|
const spec = entry.to === '' ? entry.spec : `${entry.name}@${entry.to}`;
|
|
279
306
|
try {
|
|
280
307
|
// The interrupted update may have died holding the profile lock; its
|
package/lib/pnpm-compat.js
CHANGED
|
@@ -410,9 +410,20 @@ export function classifyPnpmFailure(output, exitCode) {
|
|
|
410
410
|
// `setupPolicyHandlers`, which an integration calling the CLI cannot wire,
|
|
411
411
|
// so the only answer is the one-shot override. Classifying it here is what
|
|
412
412
|
// connects it to that retry; without it the raw internal hint was surfaced.
|
|
413
|
-
|
|
413
|
+
// ...unless the lockfile is what is actually wrong (#1075). A profile whose
|
|
414
|
+
// lockfile is missing an entry makes pnpm re-resolve, and the resolver then
|
|
415
|
+
// applies the fresh-release policy from scratch — so the SAME log carries
|
|
416
|
+
// the lockfile's own error AND this policy code as collateral. Waiting or
|
|
417
|
+
// retrying cannot repair a missing lockfile entry, and the one-shot override
|
|
418
|
+
// this branch exists to trigger only lifts the age window, so classifying
|
|
419
|
+
// the pair as a wait names the wrong cause and promises a retry that must
|
|
420
|
+
// fail. The lockfile diagnoses below say what it is and how to repair it.
|
|
421
|
+
const lockfileContradictsItself = output.includes('ERR_PNPM_OUTDATED_LOCKFILE')
|
|
422
|
+
|| output.includes('ERR_PNPM_LOCKFILE_MISSING_DEPENDENCY')
|
|
423
|
+
|| /Broken lockfile/.test(output);
|
|
424
|
+
if (!lockfileContradictsItself && (output.includes('ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION')
|
|
414
425
|
|| output.includes('ERR_PNPM_NO_MATURE_MATCHING_VERSION')
|
|
415
|
-
|| output.includes('ERR_PNPM_RESOLUTION_POLICY_VIOLATIONS_UNHANDLED')) {
|
|
426
|
+
|| output.includes('ERR_PNPM_RESOLUTION_POLICY_VIOLATIONS_UNHANDLED'))) {
|
|
416
427
|
return {
|
|
417
428
|
code: 'release-age-violation',
|
|
418
429
|
recoverable: false,
|
package/lib/routes.js
CHANGED
|
@@ -17,7 +17,7 @@ import { settingsNamespaceState } from './settings.js';
|
|
|
17
17
|
import { buildEnvFromUnknown, cleanHotDir, hotMount, hotUnmount, listHotMounts, MAX_BLOCKED, MAX_BLOCKED_NAME, MAX_FAVORITES, MAX_NOTE, MAX_UPDATE_EXEMPT, mountClientOnlyDeps, purgeMarketState, readMarketState, writeMarketState, } from './hot.js';
|
|
18
18
|
import { createGroup, deleteGroup, removeFromGroups, renameGroup, setGroupMembers } from './groups.js';
|
|
19
19
|
import { dshHostInfo, findDshInstallDir } from './dsh-install.js';
|
|
20
|
-
import { deriveHostCompatibility, DiscoveryManifestIndex, findCompatibleVersion } from './discovery-compatibility.js';
|
|
20
|
+
import { catalogReleaseManifest, deriveHostCompatibility, DiscoveryManifestIndex, findCompatibleVersion } from './discovery-compatibility.js';
|
|
21
21
|
import { configurePersistentLog, exportLogs, logEvent, readPersistentLog } from './log.js';
|
|
22
22
|
import { marketFetch } from './net.js';
|
|
23
23
|
import { diagnosePackageManifests } from './diagnostics.js';
|
|
@@ -3009,11 +3009,15 @@ export function mountMarketRoutes(host, config, commandRuntime, agentsLookup, ho
|
|
|
3009
3009
|
const host = dshHostInfo();
|
|
3010
3010
|
const hostVersion = host?.version ?? null;
|
|
3011
3011
|
const hostPackages = corePackageNames(host?.directory ?? null);
|
|
3012
|
+
const catalogFacts = Object.fromEntries(entries.flatMap(entry => {
|
|
3013
|
+
const facts = catalogReleaseManifest(entry);
|
|
3014
|
+
return facts === null ? [] : [[entry.url, facts]];
|
|
3015
|
+
}));
|
|
3012
3016
|
const [npmFacts, githubFacts] = await Promise.all([
|
|
3013
3017
|
discoveryManifests.lookup(packages, routesFor(region).npmRegistry),
|
|
3014
|
-
githubDiscoveryManifests.lookupGitHub(entries),
|
|
3018
|
+
githubDiscoveryManifests.lookupGitHub(entries.filter(entry => catalogFacts[entry.url] === undefined)),
|
|
3015
3019
|
]);
|
|
3016
|
-
const facts = { ...npmFacts, ...githubFacts };
|
|
3020
|
+
const facts = { ...npmFacts, ...githubFacts, ...catalogFacts };
|
|
3017
3021
|
const plugins = Object.fromEntries([...packages, ...urls].map(name => [
|
|
3018
3022
|
name,
|
|
3019
3023
|
deriveHostCompatibility(facts[name] ?? null, hostVersion, hostPackages),
|
|
@@ -35,7 +35,10 @@ type FetchLike = (url: string, init?: {
|
|
|
35
35
|
export interface GitHubManifestSource {
|
|
36
36
|
url: string;
|
|
37
37
|
tarball?: string | null;
|
|
38
|
+
releaseManifest?: unknown;
|
|
38
39
|
}
|
|
40
|
+
/** Reuse catalog facts only for this repository's exact pinned install asset. */
|
|
41
|
+
export declare function catalogReleaseManifest(source: GitHubManifestSource): NpmManifestFacts | null;
|
|
39
42
|
/** Keep only the small public subset of an npm manifest needed by discovery. */
|
|
40
43
|
export declare function manifestFacts(value: unknown): NpmManifestFacts;
|
|
41
44
|
/**
|
|
@@ -120,8 +120,23 @@ export interface RepairReport {
|
|
|
120
120
|
name: string;
|
|
121
121
|
reason: string;
|
|
122
122
|
}>;
|
|
123
|
+
/** Packages the market has stopped retrying by itself (see MAX_AUTO_REPAIR_ATTEMPTS). */
|
|
124
|
+
abandoned: string[];
|
|
123
125
|
}
|
|
124
126
|
export declare const REPAIR_INSTALL_TIMEOUT_MS = 300000;
|
|
127
|
+
/**
|
|
128
|
+
* How many starts may each spend up to REPAIR_INSTALL_TIMEOUT_MS trying to put
|
|
129
|
+
* one package back before the market stops trying by itself.
|
|
130
|
+
*
|
|
131
|
+
* Retrying is right while the cause might be transient (offline, a registry
|
|
132
|
+
* briefly down, the host still shutting down). It stops being right when every
|
|
133
|
+
* start pays the full timeout for a spec that will never install — the shape a
|
|
134
|
+
* reporter lived through on the Desktop host (#1061: five days of failing
|
|
135
|
+
* reinstalls on every boot, all of it invisible). The record is kept, so the
|
|
136
|
+
* package is not forgotten; only the automatic attempt stops, and the user is
|
|
137
|
+
* told where to act.
|
|
138
|
+
*/
|
|
139
|
+
export declare const MAX_AUTO_REPAIR_ATTEMPTS = 3;
|
|
125
140
|
/**
|
|
126
141
|
* Drop a profile write lock whose owner is gone.
|
|
127
142
|
*
|
package/lib/types/registry.d.ts
CHANGED
|
@@ -14,6 +14,18 @@ export interface RegistryPlugin {
|
|
|
14
14
|
npm?: string | null;
|
|
15
15
|
tarball?: string | null;
|
|
16
16
|
stars?: number | null;
|
|
17
|
+
starsCheckedAt?: string | null;
|
|
18
|
+
/** All public Release assets in this repository, lifetime count; never npm's window. */
|
|
19
|
+
githubReleaseDownloads?: number | null;
|
|
20
|
+
githubReleaseDownloadsCheckedAt?: string | null;
|
|
21
|
+
/** Public package declarations at this exact pinned install tag. */
|
|
22
|
+
releaseManifest?: {
|
|
23
|
+
tarball: string;
|
|
24
|
+
checkedAt: string;
|
|
25
|
+
version: string | null;
|
|
26
|
+
enginesDsh: string | null;
|
|
27
|
+
peerDependencies: Record<string, string>;
|
|
28
|
+
};
|
|
17
29
|
/**
|
|
18
30
|
* npm downloads in the last 30 days, when the entry has a published
|
|
19
31
|
* package. `null`/absent means "no npm package" — a coverage gap, not a
|
package/lib/updates.js
CHANGED
|
@@ -885,7 +885,18 @@ options = {}) {
|
|
|
885
885
|
const mayFollowATag = !upgrade
|
|
886
886
|
&& (version?.includes('-') === true || (stable !== null && version !== null && isUpgrade(stable, version) === false && stable !== version));
|
|
887
887
|
const newerPrerelease = mayFollowATag ? await newerPrereleaseFor(name, version) : null;
|
|
888
|
-
|
|
888
|
+
// `channel === undefined` used to stand for "this row follows `latest`",
|
|
889
|
+
// and the market itself always has a channel (it is the one package
|
|
890
|
+
// the setting is for), so the mature-release fallback (#1019) skipped
|
|
891
|
+
// exactly the package that needs it most. The market releases about
|
|
892
|
+
// daily: every release restarted the age window on `/latest`, so the
|
|
893
|
+
// row showed "up to date" while releases from the previous two days
|
|
894
|
+
// were long past the window (#1087). What the guard actually means is
|
|
895
|
+
// "the target this row follows IS `latest`" — true on the stable
|
|
896
|
+
// channel, and false only when beta/dev resolve something newer, where
|
|
897
|
+
// a mature stable candidate is not the version the user asked for.
|
|
898
|
+
const followsLatest = channel === undefined || (stable !== null && latest === stable);
|
|
899
|
+
const desktopStable = options.holdYoungReleases === true && followsLatest
|
|
889
900
|
&& isStableReleaseVersion(version)
|
|
890
901
|
&& !/^https?:/i.test(spec) && !spec.includes(':') && !spec.includes('/');
|
|
891
902
|
const mature = desktopStable && upgrade
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dshmarket",
|
|
3
3
|
"description": "Visual plugin market inside DeepSeek Harness — browse, search, and one-click install community plugins. · DSH 可视化插件市场:逛一逛,点一下,装好。",
|
|
4
|
-
"version": "1.73.
|
|
4
|
+
"version": "1.73.9",
|
|
5
5
|
"icon": "assets/logo.svg",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "lib/index.js",
|