Initial support for validating extension engines.lens version (#2884)

This commit is contained in:
Jari Kolehmainen authored and GitHub committed 2021-06-09 09:24:58 -04:00
1 parent d6e72ddc1c
commit 3847a91758
12 files changed
+70 -43

No files matched your search

+3 -4
View File
@@ -24,18 +24,17 @@ import { action, observable, makeObservable } from "mobx";
import { FilesystemProvisionerStore } from "../main/extension-filesystem";
import logger from "../main/logger";
import type { ProtocolHandlerRegistration } from "./registries";
import type { PackageJson } from "type-fest";
import { Disposer, disposer } from "../common/utils";
export type LensExtensionId = string; // path to manifest (package.json)
export type LensExtensionConstructor = new (...args: ConstructorParameters<typeof LensExtension>) => LensExtension;
export interface LensExtensionManifest {
export interface LensExtensionManifest extends PackageJson {
name: string;
version: string;
description?: string;
main?: string; // path to %ext/dist/main.js
renderer?: string; // path to %ext/dist/renderer.js
lens?: object; // fixme: add more required fields for validation
}
export const Disposers = Symbol();
@@ -91,7 +90,7 @@ export class LensExtension {
try {
await this.onActivate();
this.isEnabled = true;
this[Disposers].push(...await register(this));
logger.info(`[EXTENSION]: enabled ${this.name}@${this.version}`);
} catch (error) {