Skip to content

feat(live-update): add Electron platform support#921

Open
robingenz wants to merge 1 commit into
mainfrom
feat/live-update-electron-platform
Open

feat(live-update): add Electron platform support#921
robingenz wants to merge 1 commit into
mainfrom
feat/live-update-electron-platform

Conversation

@robingenz

Copy link
Copy Markdown
Member

What

Adds the Electron platform implementation to @capawesome/capacitor-live-update, targeting the @capawesome/capacitor-electron platform. The adapter is a thin mapping layer: all download/verify/store/rollback logic lives in the @capawesome/electron-live-update engine (./engine subpath, main-process only — zero runtime impact for mobile/web consumers).

  • electron/src/index.ts: LiveUpdateElectron implementing all 26 LiveUpdatePlugin methods with the platform's static marker metadata. initialize() lifecycle hook runs engine.initialize() (kill-safe boot rollback) and repoints via services.bundles.setActiveBundle(..., { bootWatchdog: false }) before the first window load — the engine owns rollback, the platform watchdog stays disarmed.
  • Full parity with mobile: zip + manifest (delta) artifacts, channels, code signing, blocked bundles, autoUpdateStrategy: 'background' (throttled sync on ready/window-focus/power resume). setConfig/resetConfig reject as unimplemented on Electron.
  • Sends runtime=capacitor + platform=2 + the plugin package version as pluginVersion — same cloud app and appId as the mobile targets.
  • Packaging: ESM electron/dist/plugin.mjs (rollup), capacitor.electron.src, build:electron/verify:electron scripts, version constant synced by the existing release script.
  • Docs: per-method platform availability in 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).
  • Compile-level only; runtime e2e (example app on the Electron platform) follows in a separate PR.
  • Note: verify:electron type-resolves the engine from the sibling repo checkout until @capawesome/electron-live-update@0.1.0 is published (release-order gate).

Related PRs

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants