perf: optimize app startup and background lifecycles

This commit is contained in:
inman committed 2026-08-19 00:56:15 +08:00
1 parent 31332f6d76
commit 927e13349b
121 files changed
+4359 -1400

No files matched your search

@@ -4,14 +4,14 @@ import { describe, expect, it } from 'vitest';
describe('AI hardware Host API registration', () => {
it('registers the dedicated handler in the Host API route chain', async () => {
const source = await readFile(resolve('electron/api/server.ts'), 'utf8');
const source = await readFile(resolve('electron/api/route-handlers.ts'), 'utf8');
expect(source).toMatch(
/import\s+\{\s*handleAiHardwareRoutes\s*\}\s+from\s+['"]\.\/routes\/ai-hardware['"]/,
);
const routeList = source.match(
/const\s+coreRouteHandlers\s*:\s*RouteHandler\[\]\s*=\s*\[([\s\S]*?)\];/,
/hostApiRouteHandlers[^=]*=\s*\[([\s\S]*?)\];/,
);
expect(routeList?.[1]).toBeDefined();
expect(routeList?.[1].match(/\bhandleAiHardwareRoutes\b/g)).toHaveLength(1);