mirror of
https://github.com/YuJunZhiXue/dsh-purge.git
synced 2026-11-28 13:50:22 +08:00
feat: 发布 1.1.12,测试版 Skill 进入正式版
正式版带上 Skill 导入,并保留不再钉上一轮全文、按提交号标当前和拒绝跨站请求。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
commit
d3b3bc3551
9 files changed
+1389
-108
No files matched your search
+18
-7
@@ -70,6 +70,11 @@ function isBetaName(name) {
|
||||
return /(?:^|[-._])(beta|rc|pre|preview|test)(?:\d|$|[-._])/i.test(String(name || ""));
|
||||
}
|
||||
|
||||
function withdrawnVersion(item) {
|
||||
const text = [item?.version, item?.ref, item?.id].filter(Boolean).join(" ");
|
||||
return /(?:^|[\sv])1\.1\.11-beta/i.test(String(text).replace(/^v/i, " "));
|
||||
}
|
||||
|
||||
function splitVersion(raw) {
|
||||
const text = String(raw || "").trim().replace(/^v/i, "");
|
||||
const cut = text.split("-");
|
||||
@@ -124,7 +129,8 @@ function currentChannelRef(state = readChannelState()) {
|
||||
|
||||
function readHistory() {
|
||||
const raw = readJson(historyPath());
|
||||
return Array.isArray(raw) ? raw : [];
|
||||
const rows = Array.isArray(raw) ? raw : [];
|
||||
return rows.filter((item) => item && !withdrawnVersion(item));
|
||||
}
|
||||
|
||||
function pushHistory(entry) {
|
||||
@@ -564,9 +570,11 @@ async function listRemoteVersions() {
|
||||
latest: true,
|
||||
});
|
||||
}
|
||||
for (const tag of tags) add(tag);
|
||||
for (const tag of tags) {
|
||||
if (!withdrawnVersion(tag)) add(tag);
|
||||
}
|
||||
for (const item of readHistory()) {
|
||||
if (!item || !item.ref) continue;
|
||||
if (!item || !item.ref || withdrawnVersion(item)) continue;
|
||||
add({
|
||||
...item,
|
||||
label: item.label || versionLabel(item.version, item.channel, item.sha),
|
||||
@@ -577,7 +585,7 @@ async function listRemoteVersions() {
|
||||
const localVer = localVersion();
|
||||
const localSha = (gitOk() ? gitHead(PLUGIN_ROOT) : "") || readStamp();
|
||||
return {
|
||||
versions: markCurrent(out, state, localVer, localSha),
|
||||
versions: markCurrent(out.filter((item) => !withdrawnVersion(item)), state, localVer, localSha),
|
||||
hasBeta: Boolean(betaSha || out.some((item) => item.channel === "beta" && item.kind === "tag")),
|
||||
stableSha,
|
||||
betaSha,
|
||||
@@ -840,7 +848,7 @@ export async function applyUpdate(jobs = planUpdates(), options = {}) {
|
||||
await overlayFromZip(zipDirs, ref);
|
||||
vias.add("zip");
|
||||
}
|
||||
const sha = (await remoteHeadSha(ref)) || (gitOk() ? gitHead(PLUGIN_ROOT) : "");
|
||||
const sha = (gitOk() ? gitHead(PLUGIN_ROOT) : "") || (await remoteHeadSha(ref).catch(() => ""));
|
||||
if (sha) writeStamp(sha);
|
||||
const via = vias.size > 1 ? "mixed" : [...vias][0] || detectVia();
|
||||
const pin = options.pin === false ? "" : (options.pin || state.pin || "");
|
||||
@@ -866,7 +874,8 @@ export async function applyUpdate(jobs = planUpdates(), options = {}) {
|
||||
remoteVersion: localVer,
|
||||
localSha: sha ? String(sha).slice(0, 7) : "",
|
||||
remoteSha: sha ? String(sha).slice(0, 7) : "",
|
||||
needRestart: true,
|
||||
needRestart: false,
|
||||
reloadClient: true,
|
||||
via,
|
||||
versions: listed.versions,
|
||||
lanes: lanesOf(listed, saved, localVer, sha),
|
||||
@@ -915,7 +924,9 @@ function listedUpdateRef(target, listed) {
|
||||
}
|
||||
|
||||
export async function switchVersion(ref) {
|
||||
const target = safeUpdateRef(ref);
|
||||
const raw = String(ref || "").trim();
|
||||
if (withdrawnVersion({ ref: raw, version: raw })) throw new Error("该版本已下线");
|
||||
const target = safeUpdateRef(raw);
|
||||
if (!target) throw new Error("请选择要回退的版本");
|
||||
const listed = await listRemoteVersions();
|
||||
const resolved = listedUpdateRef(target, listed);
|
||||
|
||||
Reference in new issue
Block a user