feat(launcher): add map adaptation pack updates

This commit is contained in:
N0VAN0M4LY committed 2026-12-06 19:53:45 +08:00
1 parent 9ba92f289d
commit 036a479aab
24 files changed
+770 -86

No files matched your search

@@ -42,7 +42,7 @@ export async function checkPackUpdate(): Promise<PackCheck> {
return { status, active, latest: release(found), problem: null };
} catch (error) {
console.warn('[patch-pack] update check failed:', error);
return { status: 'failed', active, latest: null, problem: problemOf(error) };
return { status: 'failed', active, latest: null, problem: packUpdateProblem(error) };
}
}
@@ -69,7 +69,7 @@ export async function applyPackUpdate(version: string): Promise<PackApplyResult>
return { ok: true, active: activePatchSet() };
} catch (error) {
console.warn('[patch-pack] update failed:', error);
return { ok: false, problem: problemOf(error) };
return { ok: false, problem: packUpdateProblem(error) };
}
}
@@ -110,7 +110,7 @@ function isNewer(candidate: string, active: string | null): boolean {
return active === null || comparePackVersions(candidate, active) > 0;
}
function problemOf(error: unknown): PackProblem {
export function packUpdateProblem(error: unknown): PackProblem {
if (error instanceof ReleasePageLimitError) return 'page_limit';
if (error instanceof FeedUnreachableError) return 'network';
if (error instanceof PatchPackError) {