fix: handle prerelease platform versions in engine requirement checks#986
Open
GitToTheHub wants to merge 2 commits intomasterfrom
Open
fix: handle prerelease platform versions in engine requirement checks#986GitToTheHub wants to merge 2 commits intomasterfrom
GitToTheHub wants to merge 2 commits intomasterfrom
Conversation
- This PR fixes plugin engine requirement checks for prerelease platform versions such as 8.0.2-dev.0. - Added tests - Generated-By: GPT-5.3-Codex Co-authored-by: Copilot <copilot@github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #986 +/- ##
=======================================
Coverage 89.61% 89.61%
=======================================
Files 41 41
Lines 5190 5190
=======================================
Hits 4651 4651
Misses 539 539 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Member
- Rather than modifying the version with inc, we probably want to just pass the same flags to satisfies that we did in #935 so our version handling is consistent.
Author
|
Good point I changed it to just use |
dpogue
approved these changes
Apr 25, 2026
Author
|
I see there are two other conditions above without using if (pluginMap[trimmedReq] && !semver.satisfies(pluginMap[trimmedReq], reqs[req])) {
badInstalledVersion = pluginMap[req];
} else if (trimmedReq === 'cordova' && !semver.satisfies(version, reqs[req])) {
badInstalledVersion = cordovaVersion;Should the options |
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.
Platforms affected
All
Motivation and Context
Description
When adding a plugin, Cordova validates engine constraints in plugin metadata. For platform constraints, prerelease versions are compared directly with semver.satisfies(). Since semver excludes prerelease versions from normal ranges by default, versions like 8.0.2-dev.0 may not satisfy >=7.0.0, even though they should be treated as the corresponding release line.
This can trigger warnings such as:
Root cause
The cordova requirement path already normalizes prerelease cordova versions before comparison, but platform versions were not normalized the same way.
Fix
Normalize prerelease platform versions before semver engine checks, mirroring existing behavior for the cordova version check.
Testing
Checklist
(platform)if this change only applies to one platform (e.g.(android))