@lvce-editor/shared-process 0.35.5 → 0.35.7

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/shared-process",
3
- "version": "0.35.5",
3
+ "version": "0.35.7",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@lvce-editor/assert": "^1.3.0",
21
- "@lvce-editor/extension-host-helper-process": "0.35.5",
21
+ "@lvce-editor/extension-host-helper-process": "0.35.7",
22
22
  "@lvce-editor/ipc": "^11.0.1",
23
23
  "@lvce-editor/json-rpc": "^4.1.0",
24
24
  "@lvce-editor/jsonc-parser": "^1.4.0",
@@ -97,6 +97,9 @@ const applyOverrides = async ({ root, commitHash, pathPrefix, serverStaticPath }
97
97
  await replace(Path.join(root, 'dist', commitHash, 'packages', 'renderer-worker', 'dist', 'rendererWorkerMain.js'), `/${commitHash}`, `${pathPrefix}/${commitHash}`);
98
98
  await replace(Path.join(root, 'dist', commitHash, 'packages', 'renderer-worker', 'dist', 'rendererWorkerMain.js'), `return \`\${assetDir}/extensions/builtin.theme-\${colorThemeId}/color-theme.json\``, `return \`\${assetDir}/themes/\${colorThemeId}.json\``);
99
99
  await replace(Path.join(root, 'dist', commitHash, 'packages', 'extension-host-worker', 'dist', 'extensionHostWorkerMain.js'), `/${commitHash}`, `${pathPrefix}/${commitHash}`);
100
+ await replace(Path.join(root, 'dist', commitHash, 'packages', 'extension-host-worker', 'dist', 'extensionHostWorkerMain.js'), `const platform = Remote`, `const platform = Web`);
101
+ await replace(Path.join(root, 'dist', commitHash, 'packages', 'iframe-worker', 'dist', 'iframeWorkerMain.js'), `const platform = Remote`, `const platform = Web`);
102
+ await replace(Path.join(root, 'dist', commitHash, 'packages', 'iframe-worker', 'dist', 'iframeWorkerMain.js'), `/${commitHash}`, `${pathPrefix}/${commitHash}`);
100
103
  await replace(Path.join(root, 'dist', commitHash, 'packages', 'renderer-worker', 'dist', 'rendererWorkerMain.js'), `return \`\${assetDir}/extensions/builtin.\${iconThemeId}/icon-theme.json\``, `return \`\${assetDir}/icon-themes/\${iconThemeId}.json\``);
101
104
  const extensionDirents = await FileSystem.readDir(Path.join(serverStaticPath, commitHash, 'extensions'));
102
105
  const languageBasicsDirents = extensionDirents.filter(isLanguageBasics);
@@ -1,8 +1,8 @@
1
1
  import { readlink } from 'node:fs/promises';
2
2
  import * as ExtensionManifest from '../ExtensionManifest/ExtensionManifest.js';
3
- import * as ExtensionManifestStatus from '../ExtensionManifestStatus/ExtensionManifestStatus.js';
4
3
  import * as FileSystem from '../FileSystem/FileSystem.js';
5
4
  import * as IsEnoentError from '../IsEnoentError/IsEnoentError.js';
5
+ import * as MergeWithSymlinks from '../MergeWithSymlinks/MergeWithSymlinks.js';
6
6
  import * as ToAbsolutePaths from '../ToAbsolutePaths/ToAbsolutePaths.js';
7
7
  import { VError } from '../VError/VError.js';
8
8
  const readSymlink = async (absolutePath) => {
@@ -17,21 +17,6 @@ const readSymlink = async (absolutePath) => {
17
17
  const readSymlinks = (absolutePaths) => {
18
18
  return Promise.all(absolutePaths.map(readSymlink));
19
19
  };
20
- const mergeWithSymLinks = (manifests, symlinks) => {
21
- const { length } = manifests;
22
- const merged = [];
23
- for (let i = 0; i < length; i++) {
24
- const manifest = manifests[i];
25
- const symlink = symlinks[i];
26
- if (manifest.status === ExtensionManifestStatus.Rejected) {
27
- merged.push(manifest);
28
- }
29
- else {
30
- merged.push({ ...manifest, symlink });
31
- }
32
- }
33
- return merged;
34
- };
35
20
  export const getExtensionManifests = async (path) => {
36
21
  try {
37
22
  if (!path) {
@@ -41,7 +26,7 @@ export const getExtensionManifests = async (path) => {
41
26
  const absolutePaths = ToAbsolutePaths.toAbsolutePaths(path, dirents);
42
27
  const manifests = await Promise.all(absolutePaths.map(ExtensionManifest.get));
43
28
  const symlinks = await readSymlinks(absolutePaths);
44
- const merged = mergeWithSymLinks(manifests, symlinks);
29
+ const merged = MergeWithSymlinks.mergeWithSymLinks(manifests, symlinks);
45
30
  return merged;
46
31
  }
47
32
  catch (error) {
@@ -0,0 +1,5 @@
1
+ import * as GetExtensions from './GetExtensions.js';
2
+ export const name = 'GetExtensions';
3
+ export const Commands = {
4
+ getExtensions: GetExtensions.getExtensions,
5
+ };
@@ -0,0 +1,4 @@
1
+ import * as ExtensionManagement from '../ExtensionManagement/ExtensionManagement.js';
2
+ export const getExtensions = () => {
3
+ return ExtensionManagement.getExtensions();
4
+ };
@@ -0,0 +1,16 @@
1
+ import * as ExtensionManifestStatus from '../ExtensionManifestStatus/ExtensionManifestStatus.js';
2
+ export const mergeWithSymLinks = (manifests, symlinks) => {
3
+ const { length } = manifests;
4
+ const merged = [];
5
+ for (let i = 0; i < length; i++) {
6
+ const manifest = manifests[i];
7
+ const symlink = symlinks[i];
8
+ if (manifest.status === ExtensionManifestStatus.Rejected) {
9
+ merged.push(manifest);
10
+ }
11
+ else {
12
+ merged.push({ ...manifest, symlink });
13
+ }
14
+ }
15
+ return merged;
16
+ };
@@ -131,6 +131,8 @@ export const load = (moduleId) => {
131
131
  return import('../FileWatcher/FileWatcher.ipc.js');
132
132
  case ModuleId.WebViewServer:
133
133
  return import('../WebViewServer/WebViewServer.ipc.js');
134
+ case ModuleId.GetExtensions:
135
+ return import('../GetExtensions/GetExtensions.ipc.js');
134
136
  default:
135
137
  throw new Error(`module ${moduleId} not found`);
136
138
  }
@@ -69,3 +69,4 @@ export const HandleMessagePortForSearchProcess = 74;
69
69
  export const FileWatcher = 75;
70
70
  export const WebViewServer = 76;
71
71
  export const Transferrable = 77;
72
+ export const GetExtensions = 78;
@@ -285,6 +285,8 @@ export const getModuleId = (commandId) => {
285
285
  case 'WebViewServer.setHandler':
286
286
  case 'WebViewServer.registerProtocol':
287
287
  return ModuleId.WebViewServer;
288
+ case 'GetExtensions.getExtensions':
289
+ return ModuleId.GetExtensions;
288
290
  default:
289
291
  throw new CommandNotFoundError(commandId);
290
292
  }
@@ -41,9 +41,9 @@ export const getAppImageName = () => {
41
41
  export const getSetupName = () => {
42
42
  return 'Lvce-Setup';
43
43
  };
44
- export const version = '0.35.5';
45
- export const commit = '1a69d51';
46
- export const date = '2024-10-04T16:30:38.000Z';
44
+ export const version = '0.35.7';
45
+ export const commit = '23a14f3';
46
+ export const date = '2024-10-06T05:23:37.000Z';
47
47
  export const getVersion = () => {
48
48
  return version;
49
49
  };