@lvce-editor/extension-management-worker 1.15.0 → 1.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1149,10 +1149,6 @@ const WebWorkerRpcClient = {
1149
1149
  create: create$4
1150
1150
  };
1151
1151
 
1152
- const Web = 1;
1153
- const Electron = 2;
1154
- const Remote = 3;
1155
-
1156
1152
  const ExtensionHostWorker = 44;
1157
1153
  const FileSystemWorker = 209;
1158
1154
  const RendererWorker = 1;
@@ -1160,6 +1156,9 @@ const SharedProcess = 1;
1160
1156
 
1161
1157
  const rpcs$1 = Object.create(null);
1162
1158
  const set$7 = (id, rpc) => {
1159
+ if (rpcs$1[id]) {
1160
+ throw new Error(`rpc with id ${id} is already registered`);
1161
+ }
1163
1162
  rpcs$1[id] = rpc;
1164
1163
  };
1165
1164
  const get$4 = id => {
@@ -1381,6 +1380,10 @@ const get$2 = id => {
1381
1380
  return rpcs[id];
1382
1381
  };
1383
1382
 
1383
+ const Web = 1;
1384
+ const Electron = 2;
1385
+ const Remote = 3;
1386
+
1384
1387
  const getUrlPrefix = (platform, extensionPath) => {
1385
1388
  if (extensionPath.startsWith('http://') || extensionPath.startsWith('https://')) {
1386
1389
  return extensionPath;
@@ -1461,6 +1464,10 @@ const activateExtension3 = async (extension, absolutePath, activationEvent, plat
1461
1464
  await activateExtension2(extensionId, extension, absolutePath);
1462
1465
  };
1463
1466
 
1467
+ const state$1 = {
1468
+ webExtensions: []
1469
+ };
1470
+
1464
1471
  const cache = Object.create(null);
1465
1472
  const id = 1;
1466
1473
  const clear = () => {
@@ -1510,6 +1517,8 @@ const getWebManifestPath = path => {
1510
1517
  const addWebExtension = async path => {
1511
1518
  const manifestPath = getWebManifestPath(path);
1512
1519
  const manifest = await getWebExtensionManifest(path, manifestPath);
1520
+ // TODO avoid mutation if possible
1521
+ state$1.webExtensions.push(manifest);
1513
1522
  clear();
1514
1523
  return manifest;
1515
1524
  };
@@ -1876,6 +1885,10 @@ const getColorThemeNames = async () => {
1876
1885
  return colorThemeNames;
1877
1886
  };
1878
1887
 
1888
+ const getDynamicWebExtensions = async assetDir => {
1889
+ return state$1.webExtensions;
1890
+ };
1891
+
1879
1892
  const getExtension = async id => {
1880
1893
  const allExtensions = await getAllExtensions();
1881
1894
  for (const extension of allExtensions) {
@@ -2100,6 +2113,7 @@ const commandMap = {
2100
2113
  'Extensions.getColorThemeCssFromJson': getColorThemeCssFromJson,
2101
2114
  'Extensions.getColorThemeJson': getColorThemeJson,
2102
2115
  'Extensions.getColorThemeNames': getColorThemeNames,
2116
+ 'Extensions.getDynamicWebExtensions': getDynamicWebExtensions,
2103
2117
  'Extensions.getExtension': getExtension,
2104
2118
  'Extensions.getLanguages': getLanguages,
2105
2119
  'Extensions.getRemoteUrlForWebView': getRemoteUrlForWebView,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/extension-management-worker",
3
- "version": "1.15.0",
3
+ "version": "1.16.0",
4
4
  "description": "Webworker for the Extension Management functionality in Lvce Editor.",
5
5
  "keywords": [
6
6
  "web-worker"