feat(live-update): add Electron platform support#921
Open
robingenz wants to merge 1 commit into
Open
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Electron platform support to @capawesome/capacitor-live-update by introducing a new Electron adapter implementation, wiring up build tooling, and updating public docs/API annotations to reflect Electron availability.
Changes:
- Add an Electron main-process adapter (
LiveUpdateElectron) backed by@capawesome/electron-live-update/engine. - Add Electron build pipeline (TS + Rollup), plugin version syncing, and package metadata updates.
- Update docs and API JSDoc to mark methods/options as available on Electron and document Electron-specific behavior.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/live-update/src/definitions.ts | Updates platform availability/docs for Electron across config/methods/types. |
| packages/live-update/scripts/sync-plugin-version.mjs | Extends version sync script to update the Electron version constant. |
| packages/live-update/README.md | Documents Electron support and updates generated doc sections for Electron availability. |
| packages/live-update/package.json | Adds Electron packaging/scripts and introduces the Electron engine dependency. |
| packages/live-update/electron/tsconfig.json | Adds Electron-specific TypeScript config for building the adapter. |
| packages/live-update/electron/src/version.ts | New version constant consumed by the Electron adapter/engine config. |
| packages/live-update/electron/src/index.ts | New Electron adapter implementation mapping plugin API to the engine. |
| packages/live-update/electron/src/definitions.ts | Defines the minimal Electron platform context contract used by the adapter. |
| packages/live-update/electron/rollup.config.mjs | Builds the Electron adapter into an ESM bundle for the platform loader. |
| .changeset/live-update-electron-platform.md | Declares a minor release for introducing Electron support. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+13
to
+20
| "paths": { | ||
| // Type-check against the local engine repository until | ||
| // `@capawesome/electron-live-update` is published. TypeScript falls | ||
| // back to `node_modules` resolution when the mapped file is missing. | ||
| "@capawesome/electron-live-update/engine": [ | ||
| "../../../../electron-live-update/dist/engine/index.d.ts" | ||
| ] | ||
| }, |
Comment on lines
+28
to
+33
| "include": [ | ||
| "src/**/*.ts", | ||
| // Ambient Electron types from the local engine repository until | ||
| // `electron` is installed as a dev dependency. | ||
| "../../../../electron-live-update/node_modules/electron/electron.d.ts" | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds the Electron platform implementation to
@capawesome/capacitor-live-update, targeting the@capawesome/capacitor-electronplatform. The adapter is a thin mapping layer: all download/verify/store/rollback logic lives in the@capawesome/electron-live-updateengine (./enginesubpath, main-process only — zero runtime impact for mobile/web consumers).electron/src/index.ts:LiveUpdateElectronimplementing all 26LiveUpdatePluginmethods with the platform's static marker metadata.initialize()lifecycle hook runsengine.initialize()(kill-safe boot rollback) and repoints viaservices.bundles.setActiveBundle(..., { bootWatchdog: false })before the first window load — the engine owns rollback, the platform watchdog stays disarmed.autoUpdateStrategy: 'background'(throttled sync on ready/window-focus/power resume).setConfig/resetConfigreject as unimplemented on Electron.runtime=capacitor+platform=2+ the plugin package version aspluginVersion— same cloud app andappIdas the mobile targets.electron/dist/plugin.mjs(rollup),capacitor.electron.src,build:electron/verify:electronscripts, version constant synced by the existing release script.definitions.ts+ docgen, README Electron installation section. Changeset:minor.Verification
verify:web,build:electron/verify:electron, eslint, prettier — all green (swiftlint failures are pre-existing in untouched iOS files).verify:electrontype-resolves the engine from the sibling repo checkout until@capawesome/electron-live-update@0.1.0is published (release-order gate).Related PRs
🤖 Generated with Claude Code