feat: add async SQLite on Node 24 and improve messaging diagnostics (#520)

Move database work off the main thread on Node.js 24 and improve message handling and runtime diagnostics.

Preserve migration, restart, and concurrency coverage with the async SQLite driver.
This commit is contained in:
MliKiowa authored and GitHub committed 2026-10-13 10:12:47 +08:00
1 parent 20f48d11ec
commit c7428363cb
170 files changed
+7748 -3913

No files matched your search

+6 -5
View File
@@ -57,7 +57,6 @@ export function downloadBlob(blob: Blob, filename: string): void {
setTimeout(() => URL.revokeObjectURL(url), 1000);
}
/** Clipboard write that still works on LAN HTTP and inside a modal focus trap. */
/** WebKit `<input type="color">` only accepts `#rrggbb`. */
export function toColorInputValue(raw: string, fallback = '#0ea5e9'): string {
const v = raw.trim();
@@ -73,6 +72,7 @@ export function toColorInputValue(raw: string, fallback = '#0ea5e9'): string {
return fallback;
}
/** Clipboard write that still works on LAN HTTP and inside a modal focus trap. */
export async function copyText(value: string): Promise<boolean> {
try {
if (navigator.clipboard?.writeText) {
@@ -83,8 +83,9 @@ export async function copyText(value: string): Promise<boolean> {
/* insecure origin / permission — fall through */
}
const ta = document.createElement('textarea');
try {
const ta = document.createElement('textarea');
ta.value = value;
ta.setAttribute('readonly', '');
ta.style.position = 'fixed';
@@ -95,10 +96,10 @@ export async function copyText(value: string): Promise<boolean> {
host.appendChild(ta);
ta.focus();
ta.setSelectionRange(0, ta.value.length);
const ok = document.execCommand('copy');
host.removeChild(ta);
return ok;
return document.execCommand('copy');
} catch {
return false;
} finally {
ta.remove();
}
}