@lvce-editor/shared-process 0.49.23 → 0.50.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/shared-process",
3
- "version": "0.49.23",
3
+ "version": "0.50.0",
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.49.23",
21
+ "@lvce-editor/extension-host-helper-process": "0.50.0",
22
22
  "@lvce-editor/ipc": "13.8.0",
23
23
  "@lvce-editor/json-rpc": "5.4.0",
24
24
  "@lvce-editor/jsonc-parser": "1.5.0",
@@ -35,8 +35,9 @@
35
35
  "@lvce-editor/preload": "1.4.0",
36
36
  "@lvce-editor/preview-process": "9.1.0",
37
37
  "@lvce-editor/pty-host": "3.2.0",
38
- "@lvce-editor/search-process": "6.1.0",
38
+ "@lvce-editor/search-process": "6.2.0",
39
39
  "@lvce-editor/typescript-compile-process": "2.3.0",
40
+ "@lvce-editor/file-system-process": "1.2.0",
40
41
  "open": "^10.1.1",
41
42
  "tail": "^2.2.6",
42
43
  "tmp-promise": "^3.0.3",
@@ -2,6 +2,6 @@ import { join } from 'path';
2
2
  import { fileURLToPath } from 'url';
3
3
  export const getBuiltinExtensionsPath = () => {
4
4
  const staticServerPath = fileURLToPath(import.meta.resolve('@lvce-editor/static-server'));
5
- const builtinExtensionsPath = join(staticServerPath, '..', '..', 'static', 'eacd2c0', 'extensions');
5
+ const builtinExtensionsPath = join(staticServerPath, '..', '..', 'static', '80a664c', 'extensions');
6
6
  return builtinExtensionsPath;
7
7
  };
@@ -21,7 +21,7 @@ const getManifestSrc = () => {
21
21
  };
22
22
  const getFrameAncestors = () => {
23
23
  if (IsGitpod.isGitpod) {
24
- return [`frame-ancestors: *.gitpod.io`];
24
+ return [`frame-ancestors *.gitpod.io`];
25
25
  }
26
26
  return [`frame-ancestors 'none'`];
27
27
  };
@@ -0,0 +1,2 @@
1
+ import * as GetContentSecurityPolicy from '../GetContentSecurityPolicy/GetContentSecurityPolicy.js';
2
+ export const value = GetContentSecurityPolicy.getContentSecurityPolicy([`default-src 'none'`, `connect-src 'self'`]);
@@ -0,0 +1,18 @@
1
+ import * as LaunchFileSystemProcess from '../LaunchFileSystemProcess/LaunchFileSystemProcess.js';
2
+ import * as JsonRpc from '../JsonRpc/JsonRpc.js';
3
+ export const state = {
4
+ /**
5
+ * @type {any}
6
+ */
7
+ ipc: undefined,
8
+ };
9
+ export const getOrCreate = async () => {
10
+ if (!state.ipc) {
11
+ state.ipc = LaunchFileSystemProcess.launchFileSystemProcess();
12
+ }
13
+ return state.ipc;
14
+ };
15
+ export const invoke = async (method, ...params) => {
16
+ const ipc = await getOrCreate();
17
+ return JsonRpc.invoke(ipc, method, ...params);
18
+ };
@@ -0,0 +1,2 @@
1
+ import * as ResolveBin from '../ResolveBin/ResolveBin.js';
2
+ export const fileSystemProcessPath = ResolveBin.resolveBin('@lvce-editor/file-system-process');
@@ -1,6 +1,9 @@
1
1
  import * as fs from 'node:fs/promises';
2
2
  import { join } from 'node:path';
3
3
  export const getFolderSizeInternal = async (path) => {
4
+ if (path === '/') {
5
+ throw new Error('Invalid path for folder size');
6
+ }
4
7
  let total = 0;
5
8
  try {
6
9
  const stats = await fs.stat(path);
@@ -1,9 +1,9 @@
1
- import * as ContentSecurityPolicyTextSearchWorker from '../ContentSecurityPolicyTextSearchWorker/ContentSecurityPolicyTextSearchWorker.js';
1
+ import * as ContentSecurityPolicyErrorWorker from '../ContentSecurityPolicyErrorWorker/ContentSecurityPolicyErrorWorker.js';
2
2
  import * as CrossOriginEmbedderPolicy from '../CrossOriginEmbedderPolicy/CrossOriginEmbedderPolicy.js';
3
3
  import * as HttpHeader from '../HttpHeader/HttpHeader.js';
4
4
  export const getHeadersErrorWorker = () => {
5
5
  return {
6
6
  [HttpHeader.CrossOriginEmbedderPolicy]: CrossOriginEmbedderPolicy.value,
7
- [HttpHeader.ContentSecurityPolicy]: ContentSecurityPolicyTextSearchWorker.value,
7
+ [HttpHeader.ContentSecurityPolicy]: ContentSecurityPolicyErrorWorker.value,
8
8
  };
9
9
  };
@@ -0,0 +1,21 @@
1
+ import * as FileSystemProcess from '../FileSystemProcess/FileSystemProcess.js';
2
+ export const targetWebSocket = () => {
3
+ return FileSystemProcess.getOrCreate();
4
+ };
5
+ export const upgradeWebSocket = (handle, message) => {
6
+ return {
7
+ type: 'send',
8
+ method: 'HandleWebSocket.handleWebSocket',
9
+ params: [handle, message],
10
+ };
11
+ };
12
+ export const targetMessagePort = () => {
13
+ return FileSystemProcess.getOrCreate();
14
+ };
15
+ export const upgradeMessagePort = (port) => {
16
+ return {
17
+ type: 'send',
18
+ method: 'HandleElectronMessagePort.handleElectronMessagePort',
19
+ params: [port],
20
+ };
21
+ };
@@ -1,6 +1,7 @@
1
1
  import * as Assert from '../Assert/Assert.js';
2
2
  import * as HandleIpcEmbedsProcess from '../HandleIpcEmbedsProcess/HandleIpcEmbedsProcess.js';
3
3
  import * as HandleIpcExtensionHostHelperProcess from '../HandleIpcExtensionHostHelperProcess/HandleIpcExtensionHostHelperProcess.js';
4
+ import * as HandleIpcFileSystemProcess from '../HandleIpcFileSystemProcess/HandleIpcFileSystemProcess.js';
4
5
  import * as HandleIpcProcessExplorer from '../HandleIpcProcessExplorer/HandleIpcProcessExplorer.js';
5
6
  import * as HandleIpcSearchProcess from '../HandleIpcSearchProcess/HandleIpcSearchProcess.js';
6
7
  import * as HandleIpcSharedProcess from '../HandleIpcSharedProcess/HandleIpcSharedProcess.js';
@@ -21,6 +22,8 @@ export const getModule = (ipcId) => {
21
22
  return HandleIpcProcessExplorer;
22
23
  case IpcId.SearchProcess:
23
24
  return HandleIpcSearchProcess;
25
+ case IpcId.FileSystemProcess:
26
+ return HandleIpcFileSystemProcess;
24
27
  default:
25
28
  throw new Error(`unexpected incoming ipc`);
26
29
  }
@@ -0,0 +1,5 @@
1
+ import * as HandleIncomingIpc from '../HandleIncomingIpc/HandleIncomingIpc.js';
2
+ import * as IpcId from '../IpcId/IpcId.js';
3
+ export const handleWebSocket = (message, handle) => {
4
+ return HandleIncomingIpc.handleIncomingIpc(IpcId.FileSystemProcess, handle, message);
5
+ };
@@ -1,4 +1,5 @@
1
1
  import * as HandleWebSocketForExtensionHostHelperProcess from '../HandleWebSocketForExtensionHostHelperProcess/HandleWebSocketForExtensionHostHelperProcess.js';
2
+ import * as HandleWebSocketForFileSystemProcess from '../HandleWebSocketForFileSystemProcess/HandleWebSocketForFileSystemProcess.js';
2
3
  import * as HandleWebSocketForSearchProcess from '../HandleWebSocketForSearchProcess/HandleWebSocketForSearchProcess.js';
3
4
  import * as HandleWebSocketForSharedProcess from '../HandleWebSocketForSharedProcess/HandleWebSocketForSharedProcess.js';
4
5
  import * as HandleWebSocketForTerminalProcess from '../HandleWebSocketForTerminalProcess/HandleWebSocketForTerminalProcess.js';
@@ -18,6 +19,8 @@ export const load = (protocol) => {
18
19
  return HandleWebSocketForTerminalProcess;
19
20
  case ProtocolType.SearchProcess:
20
21
  return HandleWebSocketForSearchProcess;
22
+ case ProtocolType.FileSystemProcess:
23
+ return HandleWebSocketForFileSystemProcess;
21
24
  default:
22
25
  return HandleWebSocketForUnknown;
23
26
  }
@@ -9,3 +9,4 @@ export const TerminalProcess = 7;
9
9
  export const Unknown = 0;
10
10
  export const ProcessExplorerRenderer = 33;
11
11
  export const ExtensionHostWorker = 218;
12
+ export const FileSystemProcess = 219;
@@ -0,0 +1,29 @@
1
+ import * as FileSystemProcessPath from '../FileSystemProcessPath/FileSystemProcessPath.js';
2
+ import * as HandleIpc from '../HandleIpc/HandleIpc.js';
3
+ import * as IpcParent from '../IpcParent/IpcParent.js';
4
+ import * as IpcParentType from '../IpcParentType/IpcParentType.js';
5
+ import * as IsElectron from '../IsElectron/IsElectron.js';
6
+ import * as IsProduction from '../IsProduction/IsProduction.js';
7
+ import * as Preferences from '../Preferences/Preferences.js';
8
+ const getConfiguredUrl = async () => {
9
+ const preferences = await Preferences.getUserPreferences();
10
+ const customPreviewProcessPath = preferences['develop.fileSystemProcessPath'];
11
+ let previewProcessPath = customPreviewProcessPath || FileSystemProcessPath.fileSystemProcessPath;
12
+ if (IsProduction.isProduction) {
13
+ previewProcessPath = FileSystemProcessPath.fileSystemProcessPath;
14
+ }
15
+ return previewProcessPath;
16
+ };
17
+ export const launchFileSystemProcess = async () => {
18
+ const method = IsElectron.isElectron ? IpcParentType.ElectronUtilityProcess : IpcParentType.NodeForkedProcess;
19
+ const fileSystemProcessPath = await getConfiguredUrl();
20
+ const fileSystemProcess = await IpcParent.create({
21
+ method,
22
+ path: fileSystemProcessPath,
23
+ argv: [],
24
+ stdio: 'inherit',
25
+ name: 'File System Process',
26
+ });
27
+ HandleIpc.handleIpc(fileSystemProcess);
28
+ return fileSystemProcess;
29
+ };
@@ -41,9 +41,9 @@ export const getAppImageName = () => {
41
41
  export const getSetupName = () => {
42
42
  return 'Lvce-Setup';
43
43
  };
44
- export const version = '0.49.23';
45
- export const commit = 'eacd2c0';
46
- export const date = '2025-04-23T20:41:10.000Z';
44
+ export const version = '0.50.0';
45
+ export const commit = '80a664c';
46
+ export const date = '2025-04-25T20:57:51.000Z';
47
47
  export const getVersion = () => {
48
48
  return version;
49
49
  };
@@ -1,5 +1,6 @@
1
1
  export const ExtensionHost = 'extension-host';
2
2
  export const ExtensionHostHelperProcess = 'extension-host-helper-process';
3
3
  export const SearchProcess = 'search-process';
4
+ export const FileSystemProcess = 'file-system-process';
4
5
  export const SharedProcess = 'shared-process';
5
6
  export const TerminalProcess = 'terminal-process';