microsoft/vscode-vsce

Support Non-Semver Engine Versions in VSCE Validation and Comparison

mohankumarelec opened this issue · 0 comments

The Regex used for checking valid engine version, can have values like 1.96.x, which is not a valid semver.
When using these kinds of version, the semver version comparison fails.

if (!/^\*$|^(\^|>=)?((\d+)|x)\.((\d+)|x)\.((\d+)|x)(\-.*)?$/.test(version)) {
throw new Error(`Invalid vscode engine compatibility version '${version}'`);
}

if (engineVersion !== 'latest' && !semver.satisfies(engineVersion, '>=1.61', { includePrerelease: true })) {