Skip to content

fix(build): align electron-builder with Electron 42 and remove version drift#118

Merged
ThomasHalwax merged 2 commits into
mainfrom
fix/electron-builder-version
May 21, 2026
Merged

fix(build): align electron-builder with Electron 42 and remove version drift#118
ThomasHalwax merged 2 commits into
mainfrom
fix/electron-builder-version

Conversation

@ThomasHalwax
Copy link
Copy Markdown
Member

Summary

PR #117 bumped the electron devDependency to 42.2.0 but left electron-builder.yml pinned at electronVersion: 38.8.0. That field is the single source of truth for both packaging and the webpack build target (webpack.config.js derives the electronXX-* target from it), so release builds would have bundled Electron 38 — leaving the audit advisories #117 set out to close present in shipped artifacts.

This PR repairs the drift and removes the duplication that caused it.

Impact

No released artifact is affected: the Electron 42 bump is in no tagged release (the latest, v3.3.0, predates it by ~2 months). This lands before the next release.

Changes

  • electron-builder.yml — drop electronVersion. With the field absent, electron-builder auto-detects the version from the installed electron dependency.
  • webpack.config.js — derive the build target from require('electron/package.json').version instead of parsing electron-builder.yml; drop the now-unused fs and yaml requires.
  • package.json — pin node-abi to ^4.31.0 via overrides. Bumping the Electron version surfaced that node-abi@4.26.0 (under @electron/rebuild) cannot detect the Electron 42 ABI, which fails electron-builder install-app-deps.

Result

The electron dependency is now the single source of the Electron version. Both packaging and the webpack target read the installed package, so they cannot drift apart again.

Validation

  • electron-builder install-app-deps auto-detects electronVersion=42.2.0 and rebuilds leveldown for it
  • webpack compiles with the electron42.2-* target
  • npm run lint clean · 332 tests passing · npm audit 0 findings

PR #117 bumped the `electron` devDependency to 42.2.0 but left
electron-builder.yml pinned at `electronVersion: 38.8.0`. That field is
the single source of truth for both packaging and the webpack build
target (webpack.config.js derives electronXX-* from it), so release
builds would have bundled Electron 38 — leaving the audit advisories
that #117 set out to close still present in shipped artifacts.

No released artifact is affected: the Electron 42 bump is in no tagged
release (latest, v3.3.0, predates it by ~2 months); this lands before
the next release.

- electron-builder.yml: electronVersion 38.8.0 -> 42.2.0
- bumping electronVersion surfaced that node-abi@4.26.0 (under
  @electron/rebuild) cannot detect the Electron 42 ABI, which fails
  `electron-builder install-app-deps`. Pinned node-abi to ^4.31.0 via
  overrides.

Verified: install-app-deps rebuilds leveldown for Electron 42.2.0,
webpack compiles with the electron42.2 target, lint and tests green.
…urce

electron-builder.yml's `electronVersion` and the `electron` devDependency
were two places holding the Electron version, kept in sync by hand — the
drift that the previous commit had to repair.

- electron-builder.yml: drop `electronVersion`. With the field absent,
  electron-builder auto-detects the version from the installed `electron`
  dependency.
- webpack.config.js: derive the build target from
  `require('electron/package.json').version` instead of parsing
  electron-builder.yml; drop the now-unused fs and yaml requires.

The `electron` dependency is now the only source. Both packaging and the
webpack target read it, so they cannot drift apart again.

Verified: webpack compiles with the electron42.2 target, electron-builder
install-app-deps auto-detects electronVersion=42.2.0.
@ThomasHalwax ThomasHalwax merged commit 14de03a into main May 21, 2026
1 check passed
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.

1 participant