Rework extension API into parts (#2879)

* `Main`, `Common`, and `Renderer`
* move registry types to Common.Types

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton authored and GitHub committed 2021-05-27 14:56:33 -04:00
1 parent db54a658a2
commit df1f6e128e
28 files changed
+227 -161

No files matched your search

+4 -2
View File
@@ -23,7 +23,8 @@
import "../common/system-ca";
import * as Mobx from "mobx";
import * as LensExtensionsCoreApi from "../extensions/core-api";
import * as LensExtensionsCommonApi from "../extensions/common-api";
import * as LensExtensionsMainApi from "../extensions/main-api";
import { app, autoUpdater, ipcMain, dialog, powerMonitor } from "electron";
import { appName, isMac, productName } from "../common/vars";
import path from "path";
@@ -279,7 +280,8 @@ app.on("open-url", (event, rawUrl) => {
* e.g. global.Mobx, global.LensExtensions
*/
const LensExtensions = {
...LensExtensionsCoreApi,
Common: LensExtensionsCommonApi,
Main: LensExtensionsMainApi,
};
export {
@@ -24,7 +24,7 @@ import * as uuid from "uuid";
import { broadcastMessage } from "../../../common/ipc";
import { ProtocolHandlerExtension, ProtocolHandlerInternal } from "../../../common/protocol-handler";
import { noop } from "../../../common/utils";
import { LensMainExtension } from "../../../extensions/core-api";
import { LensExtension } from "../../../extensions/main-api";
import { ExtensionLoader } from "../../../extensions/extension-loader";
import { ExtensionsStore } from "../../../extensions/extensions-store";
import { LensProtocolRouterMain } from "../router";
@@ -78,7 +78,7 @@ describe("protocol router tests", () => {
it.only("should not throw when has valid host", async () => {
const extId = uuid.v4();
const ext = new LensMainExtension({
const ext = new LensExtension({
id: extId,
manifestPath: "/foo/bar",
manifest: {
@@ -155,7 +155,7 @@ describe("protocol router tests", () => {
const lpr = LensProtocolRouterMain.getInstance();
const extId = uuid.v4();
const ext = new LensMainExtension({
const ext = new LensExtension({
id: extId,
manifestPath: "/foo/bar",
manifest: {
@@ -195,7 +195,7 @@ describe("protocol router tests", () => {
{
const extId = uuid.v4();
const ext = new LensMainExtension({
const ext = new LensExtension({
id: extId,
manifestPath: "/foo/bar",
manifest: {
@@ -219,7 +219,7 @@ describe("protocol router tests", () => {
{
const extId = uuid.v4();
const ext = new LensMainExtension({
const ext = new LensExtension({
id: extId,
manifestPath: "/foo/bar",
manifest: {