Migrate to Vite+ unified toolchain (#428)

This commit is contained in:
Gregory Schier
2026-03-13 09:27:56 -07:00
committed by GitHub
parent aed7bd12ea
commit 45262edfbd
166 changed files with 1762 additions and 1519 deletions

View File

@@ -1,4 +1,5 @@
import { getCurrentWebviewWindow } from '@tauri-apps/api/webviewWindow';
import { fireAndForget } from '../fireAndForget';
export type Appearance = 'light' | 'dark';
@@ -22,13 +23,13 @@ export function subscribeToWindowAppearanceChange(
unsubscribe: () => {},
};
getCurrentWebviewWindow()
fireAndForget(getCurrentWebviewWindow()
.onThemeChanged((t) => {
cb(t.payload);
})
.then((l) => {
container.unsubscribe = l;
});
}));
return () => container.unsubscribe();
}
@@ -43,6 +44,6 @@ export function resolveAppearance(
export function subscribeToPreferredAppearance(cb: (a: Appearance) => void) {
cb(getCSSAppearance());
getWindowAppearance().then(cb);
fireAndForget(getWindowAppearance().then(cb));
subscribeToWindowAppearanceChange(cb);
}

View File

@@ -279,7 +279,7 @@ export function getThemeCSS(theme: Theme): string {
theme.components.toast = theme.components.toast ?? theme.components.menu ?? {};
const { components, id, label } = theme;
const colors = Object.keys(theme.base).reduce((prev, key) => {
// biome-ignore lint/performance/noAccumulatingSpread: none
// oxlint-disable-next-line no-accumulating-spread
return { ...prev, [key]: theme.base[key as YaakColorKey] };
}, {}) as ThemeComponentColors;