@lvce-editor/main-process
v6.58.1
Published
The `main-process` is a NodeJS process that runs Electron.
Readme
main-process
The main-process is a NodeJS process that runs Electron.
main-processis created when the Electron application is launchedmain-processcan create Windows using Apis from Electron.main-processspawnsshared-processmain-processandshared-processcan communicate via ipc
Profiling the main process
Set "application.useProtocolRegisterSource": true in the application's settings.json
and restart to load packaged resources through Electron's native directory source API.
The default is false; missing or invalid settings leave it disabled. Both modes keep
the existing application URLs, response security headers, and dynamic /remote IPC
loading. The application handler forwards bundled requests to a separate source scheme
in enabled mode, so it still runs on the main thread. Development builds use their
existing IPC loader, and runtimes without registerSource use the existing file loader.
killall electron &&
npx electron --wait src/profile.jsThis will create a profile.cpuprofile file, which can be loaded inside the chrome devtools performance panel.
Benchmarking application startup
Use --wait-10-seconds to keep the application attached to the terminal and quit it after 10 seconds:
time lvce --wait-10-secondsmacOS update helper
ElectronMacUpdater.stage(diskImagePath, version) accepts an already downloaded and checksum-verified DMG. The update worker owns release discovery, architecture-specific asset selection, downloading, checksum validation, and Install Update/Restart prompts. This native helper mounts the image read-only, copies the bundle beside the installed application, and verifies bundle identity, version, executable architecture, code signature, and signing-team continuity.
ElectronMacUpdater.restart() requests normal application shutdown. Replacement happens at will-quit, so a cancelled window close leaves the installed app untouched. The previous bundle remains in a private .lvce-update-*/previous.app folder next to the app for recovery; replacement failures attempt to restore it. A failed install prevents exit and shows a native error. No elevated permissions, re-signing, or quarantine removal are performed. The installed app's parent directory must be writable; apps running from a DMG, a translocated path, or a symlink must first be moved to a normal application folder.
These commands require a packaged macOS build and coordinated host/update-worker integration. Unit tests cover staging, rollback, validation failures and restart ordering; they do not establish a shipped application's end-to-end update behavior.
