From 6bf5b7d906e2e193e36fcb5f9ad26376bb6726b3 Mon Sep 17 00:00:00 2001 From: John Date: Mon, 30 Oct 2023 19:36:03 +0700 Subject: [PATCH] #255: Read plugins manifest from CDN --- electron/core/plugin-manager/execution/facade.js | 5 ++++- plugins/data-plugin/package.json | 2 ++ plugins/inference-plugin/package.json | 2 ++ plugins/model-management-plugin/package.json | 2 ++ plugins/monitoring-plugin/package.json | 2 ++ 5 files changed, 12 insertions(+), 1 deletion(-) diff --git a/electron/core/plugin-manager/execution/facade.js b/electron/core/plugin-manager/execution/facade.js index c4f62f995..df75ce731 100644 --- a/electron/core/plugin-manager/execution/facade.js +++ b/electron/core/plugin-manager/execution/facade.js @@ -65,7 +65,10 @@ export async function getActive() { return; } // eslint-disable-next-line no-undef - const plgList = await window.pluggableElectronIpc.getActive(); + const plgList = await window.pluggableElectronIpc?.getActive() ?? + import( + /* webpackIgnore: true */ PLUGIN_CATALOG + `?t=${Date.now()}` + ).then((data) => data.default.filter((e) => e.supportCloudNative)); return plgList.map( (plugin) => new Plugin( diff --git a/plugins/data-plugin/package.json b/plugins/data-plugin/package.json index a685039b1..0845009c8 100644 --- a/plugins/data-plugin/package.json +++ b/plugins/data-plugin/package.json @@ -7,6 +7,8 @@ "module": "dist/cjs/module.js", "author": "Jan ", "license": "MIT", + "supportCloudNative": true, + "url": "/plugins/data-plugin/index.js", "activationPoints": [ "init" ], diff --git a/plugins/inference-plugin/package.json b/plugins/inference-plugin/package.json index 9d2fbd50b..30b0c073a 100644 --- a/plugins/inference-plugin/package.json +++ b/plugins/inference-plugin/package.json @@ -7,6 +7,8 @@ "module": "dist/module.js", "author": "Jan ", "license": "MIT", + "supportCloudNative": true, + "url": "/plugins/inference-plugin/index.js", "activationPoints": [ "init" ], diff --git a/plugins/model-management-plugin/package.json b/plugins/model-management-plugin/package.json index 21ce35f38..c122456c3 100644 --- a/plugins/model-management-plugin/package.json +++ b/plugins/model-management-plugin/package.json @@ -7,6 +7,8 @@ "module": "dist/module.js", "author": "Jan ", "license": "MIT", + "supportCloudNative": true, + "url": "/plugins/model-management-plugin/index.js", "activationPoints": [ "init" ], diff --git a/plugins/monitoring-plugin/package.json b/plugins/monitoring-plugin/package.json index 49f9e4b46..eb7cf9123 100644 --- a/plugins/monitoring-plugin/package.json +++ b/plugins/monitoring-plugin/package.json @@ -7,6 +7,8 @@ "module": "dist/module.js", "author": "Jan ", "license": "MIT", + "supportCloudNative": true, + "url": "/plugins/monitoring-plugin/index.js", "activationPoints": [ "init" ],