feat(editor): integrate local backend IPC handlers

- Add setupBackendIPC() call in app.on('ready')
- Add backendManager.stopAll() cleanup on app before-quit
- Backend IPC now available for renderer process

Test with DevTools:
  await require('@electron/remote').ipcRenderer.invoke('backend:list')
  await require('@electron/remote').ipcRenderer.invoke('backend:create', 'Test')
  await require('@electron/remote').ipcRenderer.invoke('backend:start', backendId)
This commit is contained in:
Richard Osborne
2026-01-15 16:37:21 +01:00
parent 8c0f0c6797
commit c2e9f37129

View File

@@ -7,6 +7,7 @@ const AutoUpdater = require('./src/autoupdater');
const FloatingWindow = require('./src/floating-window');
const startServer = require('./src/web-server');
const { startCloudFunctionServer, closeRuntimeWhenWindowCloses } = require('./src/cloud-function-server');
const { setupBackendIPC, backendManager } = require('./src/local-backend');
const DesignToolImportServer = require('./src/design-tool-import-server');
const jsonstorage = require('../shared/utils/jsonstorage');
const StorageApi = require('./src/StorageApi');
@@ -555,6 +556,9 @@ function launchApp() {
startCloudFunctionServer(app, cloudServicesGetActive);
closeRuntimeWhenWindowCloses(win);
// Initialize local backend IPC handlers
setupBackendIPC();
DesignToolImportServer.start(projectGetInfo);
try {
@@ -587,6 +591,15 @@ function launchApp() {
}
});
// Stop all local backends on quit
app.on('before-quit', async () => {
try {
await backendManager.stopAll();
} catch (e) {
console.log('Error stopping backends:', e);
}
});
app.on('activate', () => {
// On macOS it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.