mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-02 08:33:36 +00:00
Extract the monolithic main.ts (~1000 lines) into focused modules: - electron/constants.ts - Window sizing, port defaults, filenames - electron/state.ts - Shared state container - electron/utils/ - Port availability and icon utilities - electron/security/ - API key management - electron/windows/ - Window bounds and main window creation - electron/server/ - Backend and static server management - electron/ipc/ - IPC handlers with shared channel constants Benefits: - Improved testability with isolated modules - Better discoverability and maintainability - Single source of truth for IPC channels (used by both main and preload) - Clear separation of concerns Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
33 lines
827 B
TypeScript
33 lines
827 B
TypeScript
/**
|
|
* Electron main process modules
|
|
*
|
|
* Re-exports for convenient importing.
|
|
*/
|
|
|
|
// Constants and types
|
|
export * from './constants';
|
|
export { state } from './state';
|
|
|
|
// Utilities
|
|
export { isPortAvailable, findAvailablePort } from './utils/port-manager';
|
|
export { getIconPath } from './utils/icon-manager';
|
|
|
|
// Security
|
|
export { ensureApiKey, getApiKey } from './security/api-key-manager';
|
|
|
|
// Windows
|
|
export {
|
|
loadWindowBounds,
|
|
saveWindowBounds,
|
|
validateBounds,
|
|
scheduleSaveWindowBounds,
|
|
} from './windows/window-bounds';
|
|
export { createWindow } from './windows/main-window';
|
|
|
|
// Server
|
|
export { startStaticServer, stopStaticServer } from './server/static-server';
|
|
export { startServer, waitForServer, stopServer } from './server/backend-server';
|
|
|
|
// IPC
|
|
export { IPC_CHANNELS, registerAllHandlers } from './ipc';
|