mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Pass updateChecker for LensExtension instances
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
e69b8375c5
commit
f8476cff0b
@ -50,7 +50,7 @@
|
|||||||
"bundledKubectlVersion": "1.21.2",
|
"bundledKubectlVersion": "1.21.2",
|
||||||
"bundledHelmVersion": "3.6.3",
|
"bundledHelmVersion": "3.6.3",
|
||||||
"sentryDsn": "",
|
"sentryDsn": "",
|
||||||
"extensionUpdateUrl": "https://lens-binaries.s3-eu-west-1.amazonaws.com/extensions/versions.json"
|
"extensionUpdateUrl": "https://lens-binaries.s3-eu-west-1.amazonaws.com/extensions"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14 <15"
|
"node": ">=14 <15"
|
||||||
|
|||||||
@ -26,7 +26,7 @@ export class BundledVersionChecker implements LensExtensionLatestVersionChecker
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const json = await this.getJson(extensionUpdateUrl);
|
const json = await this.getJson(`${extensionUpdateUrl}/versions.json`);
|
||||||
|
|
||||||
if (!json || json.error || !json[manifest.name]) {
|
if (!json || json.error || !json[manifest.name]) {
|
||||||
logger.info(`[BUNDLED-EXTENSIONS-UPDATER]: No version found for ${manifest.name}.`);
|
logger.info(`[BUNDLED-EXTENSIONS-UPDATER]: No version found for ${manifest.name}.`);
|
||||||
|
|||||||
@ -8,11 +8,12 @@ import {
|
|||||||
LensExtensionDependencies,
|
LensExtensionDependencies,
|
||||||
setLensExtensionDependencies,
|
setLensExtensionDependencies,
|
||||||
} from "../../lens-extension-set-dependencies";
|
} from "../../lens-extension-set-dependencies";
|
||||||
|
import type { LensExtensionUpdateChecker } from "../../lens-extension-update-checker";
|
||||||
|
|
||||||
export const createExtensionInstance =
|
export const createExtensionInstance =
|
||||||
(dependencies: LensExtensionDependencies) =>
|
(dependencies: LensExtensionDependencies) =>
|
||||||
(ExtensionClass: LensExtensionConstructor, extension: InstalledExtension) => {
|
(ExtensionClass: LensExtensionConstructor, extension: InstalledExtension, updateChecker?: LensExtensionUpdateChecker) => {
|
||||||
const instance = new ExtensionClass(extension);
|
const instance = new ExtensionClass(extension, updateChecker);
|
||||||
|
|
||||||
instance[setLensExtensionDependencies](dependencies);
|
instance[setLensExtensionDependencies](dependencies);
|
||||||
|
|
||||||
|
|||||||
@ -124,7 +124,7 @@ export class LensExtension {
|
|||||||
|
|
||||||
|
|
||||||
public async checkForUpdate() {
|
public async checkForUpdate() {
|
||||||
return this.updateChecker?.run(this.manifest);
|
return this.updateChecker?.run(this.manifest, this.isBundled);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected onActivate(): Promise<void> | void {
|
protected onActivate(): Promise<void> | void {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user