refactor(electron): improve build process and configuration

- Enhance electron build configuration with proper asset handling
- Add comprehensive logging and error tracking
- Implement CSP headers for security
- Fix module exports for logger compatibility
- Update TypeScript and Vite configs for better build support
- Improve development workflow with better dev tools integration
This commit is contained in:
Matthew Raymer
2025-05-01 09:30:02 +00:00
parent b999a04595
commit cb1d979431
7 changed files with 502 additions and 86 deletions

View File

@@ -3,7 +3,7 @@ import { logToDb } from "../db";
function safeStringify(obj: unknown) {
const seen = new WeakSet();
return JSON.stringify(obj, (key, value) => {
return JSON.stringify(obj, (_key, value) => {
if (typeof value === "object" && value !== null) {
if (seen.has(value)) {
return "[Circular]";
@@ -69,3 +69,11 @@ export const logger = {
logToDb(message + argsString);
},
};
// Add CommonJS export for Electron
if (typeof module !== "undefined" && module.exports) {
module.exports = { logger };
}
// Add default export for ESM
export default { logger };