1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

ignore Lens's prerelease tag when checking extension compatibility

Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com>
This commit is contained in:
Jim Ehrismann 2021-07-08 18:56:59 -04:00
parent 77f8ea67bd
commit 301d8a14c0

View File

@ -364,13 +364,12 @@ export class ExtensionDiscovery extends Singleton {
const absolutePath = (isProduction && await fse.pathExists(npmPackage)) ? npmPackage : extensionDir;
let isCompatible = isBundled;
if (manifest.engines?.lens) {
/* assume bundled extensions are compatibile */
if (!isBundled && manifest.engines?.lens) {
const appSemVerLatestImplied = appSemVer;
if (appSemVerLatestImplied.prerelease?.[0] === "latest") {
/* remove the "latest" prerelease tag so as not to require the extension to specify it */
appSemVerLatestImplied.prerelease = [];
}
/* remove any prerelease tag so the extension's compatibility is not limited by it */
appSemVerLatestImplied.prerelease = [];
isCompatible = semver.satisfies(appSemVerLatestImplied, manifest.engines.lens);
}