Eliminate console.* remnants in bootstrap, session-manager, migrations, and app entry so startup and login failures are captured in log files. Add log.error before all 14 throw sites in ERP services (auth, extractor, cleaner, browser manager) to ensure critical automation failures are traceable. Introduce capturePageContext utility for defensive Playwright page state capture during error logging. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
27 lines
856 B
TypeScript
27 lines
856 B
TypeScript
import { app, ipcMain } from 'electron'
|
|
import { createMainWindow, registerMainWindowLifecycle } from './bootstrap/main-window'
|
|
import {
|
|
configurePlaywrightBrowsersPath,
|
|
ensurePlaywrightRuntime,
|
|
initializeMainProcessServices,
|
|
setupElectronRuntime
|
|
} from './bootstrap/runtime'
|
|
import { setupProcessGuards } from './bootstrap/process-guards'
|
|
import { createLogger } from './services/logger'
|
|
|
|
const log = createLogger('App')
|
|
|
|
app.whenReady().then(async () => {
|
|
setupProcessGuards()
|
|
registerMainWindowLifecycle()
|
|
const playwrightBrowsersPath = configurePlaywrightBrowsersPath()
|
|
const browsersExist = ensurePlaywrightRuntime(playwrightBrowsersPath)
|
|
log.info('Playwright browsers check', { browsersExist })
|
|
await initializeMainProcessServices()
|
|
setupElectronRuntime()
|
|
|
|
ipcMain.on('ping', () => log.debug('pong'))
|
|
|
|
createMainWindow()
|
|
})
|