@lvce-editor/shared-process 0.25.11 → 0.25.12

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.25.11",
3
+ "version": "0.25.12",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -18,12 +18,12 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@lvce-editor/assert": "^1.2.0",
21
- "@lvce-editor/extension-host-helper-process": "0.25.11",
22
- "@lvce-editor/ipc": "^3.7.1",
21
+ "@lvce-editor/extension-host-helper-process": "0.25.12",
22
+ "@lvce-editor/ipc": "^4.0.1",
23
23
  "@lvce-editor/json-rpc": "^1.3.0",
24
24
  "@lvce-editor/jsonc-parser": "^1.2.0",
25
25
  "@lvce-editor/pretty-error": "^1.5.0",
26
- "@lvce-editor/pty-host": "0.25.11",
26
+ "@lvce-editor/pty-host": "0.25.12",
27
27
  "@lvce-editor/verror": "^1.2.0",
28
28
  "@lvce-editor/web-socket-server": "^1.1.0",
29
29
  "debug": "^4.3.4",
@@ -0,0 +1,2 @@
1
+ import * as GetContentSecurityPolicy from '../GetContentSecurityPolicy/GetContentSecurityPolicy.js';
2
+ export const value = GetContentSecurityPolicy.getContentSecurityPolicy([`default-src 'none'`, `script-src 'self'`]);
@@ -10,5 +10,6 @@ export const handleElectronMessagePort = async (messagePort, ...params) => {
10
10
  });
11
11
  HandleIpc.handleIpc(ipc);
12
12
  // TODO find better way to associate configuration with ipc
13
+ // @ts-ignore
13
14
  ipc.windowId = params[1];
14
15
  };
@@ -11,10 +11,10 @@ const logError = (error, prettyError) => {
11
11
  PrintPrettyError.printPrettyError(prettyError, `[shared-process] `);
12
12
  }
13
13
  };
14
+ const handleMessage = (event) => {
15
+ return JsonRpc.handleJsonRpcMessage(event.target, event.data, Command.execute, Callback.resolve, preparePrettyError, logError, RequiresSocket.requiresSocket);
16
+ };
14
17
  export const handleIpc = (ipc) => {
15
- const handleMessage = (message) => {
16
- return JsonRpc.handleJsonRpcMessage(ipc, message, Command.execute, Callback.resolve, preparePrettyError, logError, RequiresSocket.requiresSocket);
17
- };
18
18
  ipc.on('message', handleMessage);
19
19
  if (ipc.start) {
20
20
  ipc.start();
@@ -16,7 +16,11 @@ export const wrap = (messagePort) => {
16
16
  if (event === 'message') {
17
17
  const wrappedListener = (event) => {
18
18
  const actualData = getActualData(event);
19
- listener(actualData);
19
+ const syntheticEvent = {
20
+ data: actualData,
21
+ target: this,
22
+ };
23
+ listener(syntheticEvent);
20
24
  };
21
25
  this.messagePort.on(event, wrappedListener);
22
26
  }
@@ -30,7 +30,11 @@ export const wrap = (port) => {
30
30
  break;
31
31
  case 'message':
32
32
  const wrapped = (event) => {
33
- listener(event.data);
33
+ const syntheticEvent = {
34
+ data: event.data,
35
+ target: this,
36
+ };
37
+ listener(syntheticEvent);
34
38
  };
35
39
  this.port.on(event, wrapped);
36
40
  break;
@@ -41,9 +41,9 @@ export const getAppImageName = () => {
41
41
  export const getSetupName = () => {
42
42
  return 'Lvce-Setup';
43
43
  };
44
- export const version = '0.25.11';
45
- export const commit = 'da5cd48';
46
- export const date = '2024-04-15T19:21:13.000Z';
44
+ export const version = '0.25.12';
45
+ export const commit = '0181bc1';
46
+ export const date = '2024-04-16T20:00:32.000Z';
47
47
  export const getVersion = () => {
48
48
  return version;
49
49
  };
@@ -28,6 +28,7 @@ const createPtyHost = async (method) => {
28
28
  });
29
29
  HandleIpc.handleIpc(ptyHost);
30
30
  const handleClose = () => {
31
+ // @ts-ignore
31
32
  ptyHost.off('close', handleClose);
32
33
  PtyHostState.state.ipc = undefined;
33
34
  PtyHostState.state.ptyHostPromise = undefined;