Skip to content

feat(init): add --electron-version flag - #4037

Merged
erickzhao merged 5 commits into
mainfrom
electron-version-flag
Oct 21, 2025
Merged

feat(init): add --electron-version flag#4037
erickzhao merged 5 commits into
mainfrom
electron-version-flag

Conversation

@erickzhao

@erickzhao erickzhao commented Oct 20, 2025

Copy link
Copy Markdown
Member

Follow-up to #4009.

The --electron-version flag allows us to install a deterministic version of Electron with the init command.

This flag accepts valid SemVer versions as well as the latest, beta, and nightly labels.

The interactive CLI equivalent just allows you to choose between electron@beta, electron@latest, and electron-nightly@latest.

Future improvements:

  • Allow passing in a custom SemVer string in the CLI.
  • Guard against SemVer values greater than the existing Electron version with something like the latest-version npm package.

@erickzhao
erickzhao marked this pull request as ready for review October 21, 2025 00:53
@erickzhao
erickzhao requested a review from a team as a code owner October 21, 2025 00:53

@BlackHole1 BlackHole1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would supporting the v prefix be better? For example: v38.0.0.

@erickzhao

Copy link
Copy Markdown
Member Author

@BlackHole1 4b9f338 uses semver.clean to clean the version's leading v tag and whitespace. Additional init tests are also added.

@erickzhao
erickzhao added this pull request to the merge queue Oct 21, 2025
Merged via the queue into main with commit 2914cd1 Oct 21, 2025
11 checks passed
@erickzhao
erickzhao deleted the electron-version-flag branch October 21, 2025 22:04
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.

3 participants