fix(maker-squirrel): normalize semver versions for Squirrel.Windows - #4367
Open
lvyanyan wants to merge 1 commit into
Open
fix(maker-squirrel): normalize semver versions for Squirrel.Windows#4367lvyanyan wants to merge 1 commit into
lvyanyan wants to merge 1 commit into
Conversation
Squirrel.Windows (NuGet) only accepts 4-part version numbers, so a semver prerelease in package.json (e.g. 1.0.1-0 from npm version prerelease) made createWindowsInstaller fail with "'1.0.1-0' is not a valid version string". The base maker already ships normalizeWindowsVersion() for exactly this (used by the AppX maker); route the version passed to electron-winstaller through it and name the nupkg artifacts from the normalized version. Fixes electron#3533 Signed-off-by: lvyanyan <lvyanyan@users.noreply.github.com>
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.
Description of Change
Squirrel.Windows (NuGet) only accepts 4-part version numbers, so a semver prerelease in package.json (e.g.
1.0.1-0fromnpm version prerelease) madecreateWindowsInstallerfail with "'1.0.1-0' is not a valid version string".The base maker already ships
normalizeWindowsVersion()for exactly this — used by the AppX maker — but the Squirrel maker never picked it up (noted by @erickzhao in #3533). This routes the version passed to electron-winstaller through it, and names the nupkg artifacts from the normalized version.Tests: added
packages/maker/squirrel/spec/MakerSquirrel.spec.tscovering the prerelease case (1.0.1-0→1.0.1.0) and the plain case (1.2.3→1.2.3.0); red without the fix, green with it.Drafted with AI assistance and reviewed by the author.
Issues
Fixes #3533
Checklist
Release Notes
Notes: Fixed creating Windows Squirrel installers for apps using semver prerelease versions such as
1.0.1-0.