@lvce-editor/shared-process 0.0.12 → 0.0.15
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.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"verror": "^1.10.1",
|
|
33
33
|
"ws": "^8.8.0",
|
|
34
34
|
"xdg-basedir": "^5.1.0",
|
|
35
|
-
"@lvce-editor/pty-host": "0.0.
|
|
36
|
-
"@lvce-editor/extension-host": "0.0.
|
|
35
|
+
"@lvce-editor/pty-host": "0.0.15",
|
|
36
|
+
"@lvce-editor/extension-host": "0.0.15"
|
|
37
37
|
},
|
|
38
38
|
"optionalDependencies": {
|
|
39
39
|
"electron-clipboard-ex": "^1.3.3",
|
|
@@ -15,10 +15,19 @@ export const state = {
|
|
|
15
15
|
electronPortMap: new Map(),
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
// TODO apparent there are multiple ways for listening to ipc
|
|
19
|
+
// 1. parentPort
|
|
20
|
+
// 2. process.send
|
|
21
|
+
// instead of if/else use interface and abstraction: ParentPortIpc.listen(), ProcessIpc.listen(), ParentPortIpc.send(message), ProcessIpc.send(message)
|
|
22
|
+
|
|
18
23
|
export const electronSend = (message) => {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
24
|
+
if (parentPort) {
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
// process.send(message)
|
|
27
|
+
parentPort.postMessage(message)
|
|
28
|
+
} else if (process.send) {
|
|
29
|
+
process.send(message)
|
|
30
|
+
}
|
|
22
31
|
}
|
|
23
32
|
|
|
24
33
|
const handleMessageFromParentProcess = async (message, handle) => {
|