feat(core): add Electron runtime, services, and app composition

This commit is contained in:
2026-02-22 21:43:43 -08:00
parent 448ce03fd4
commit d3fd47f0ec
562 changed files with 69719 additions and 0 deletions

17
src/config/parse.ts Normal file
View File

@@ -0,0 +1,17 @@
import { parse as parseJsonc, type ParseError } from 'jsonc-parser';
export function parseConfigContent(configPath: string, data: string): unknown {
if (!configPath.endsWith('.jsonc')) {
return JSON.parse(data);
}
const errors: ParseError[] = [];
const result = parseJsonc(data, errors, {
allowTrailingComma: true,
disallowComments: false,
});
if (errors.length > 0) {
throw new Error(`Invalid JSONC (${errors[0]?.error ?? 'unknown'})`);
}
return result;
}