@lvce-editor/extension-host-helper-process 0.26.0 → 0.26.2
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/extension-host-helper-process",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@lvce-editor/assert": "^1.2.0",
|
|
20
|
-
"@lvce-editor/ipc": "^
|
|
20
|
+
"@lvce-editor/ipc": "^7.2.0",
|
|
21
21
|
"@lvce-editor/json-rpc": "^1.3.0",
|
|
22
22
|
"@lvce-editor/pretty-error": "^1.5.0",
|
|
23
23
|
"@lvce-editor/verror": "^1.2.0",
|
|
@@ -1,23 +1,10 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as Command from '../Command/Command.js'
|
|
3
|
-
import * as JsonRpc from '../JsonRpc/JsonRpc.js'
|
|
4
|
-
import * as PrettyError from '../PrettyError/PrettyError.js'
|
|
5
|
-
import * as PrintPrettyError from '../PrintPrettyError/PrintPrettyError.js'
|
|
6
|
-
|
|
7
|
-
const preparePrettyError = PrettyError.prepare
|
|
8
|
-
|
|
9
|
-
const logError = (error, prettyError) => {
|
|
10
|
-
PrintPrettyError.printPrettyError(prettyError, `[extension-host-helper-process] `)
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const requiresSocket = () => {
|
|
14
|
-
return false
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const handleMessage = (event) => {
|
|
18
|
-
return JsonRpc.handleJsonRpcMessage(event.target, event.data, Command.execute, Callback.resolve, preparePrettyError, logError, requiresSocket)
|
|
19
|
-
}
|
|
1
|
+
import * as HandleMessage from '../HandleMessage/HandleMessage.js'
|
|
20
2
|
|
|
21
3
|
export const handleIpc = (ipc) => {
|
|
22
|
-
|
|
4
|
+
if ('addEventListener' in ipc) {
|
|
5
|
+
ipc.addEventListener('message', HandleMessage.handleMessage)
|
|
6
|
+
} else {
|
|
7
|
+
// deprecated
|
|
8
|
+
ipc.on('message', HandleMessage.handleMessage)
|
|
9
|
+
}
|
|
23
10
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as Callback from '../Callback/Callback.js'
|
|
2
|
+
import * as Command from '../Command/Command.js'
|
|
3
|
+
import * as JsonRpc from '../JsonRpc/JsonRpc.js'
|
|
4
|
+
import * as PrettyError from '../PrettyError/PrettyError.js'
|
|
5
|
+
import * as PrintPrettyError from '../PrintPrettyError/PrintPrettyError.js'
|
|
6
|
+
|
|
7
|
+
const preparePrettyError = PrettyError.prepare
|
|
8
|
+
|
|
9
|
+
const logError = (error, prettyError) => {
|
|
10
|
+
PrintPrettyError.printPrettyError(prettyError, `[extension-host-helper-process] `)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const requiresSocket = () => {
|
|
14
|
+
return false
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const handleMessage = (event) => {
|
|
18
|
+
return JsonRpc.handleJsonRpcMessage(event.target, event.data, Command.execute, Callback.resolve, preparePrettyError, logError, requiresSocket)
|
|
19
|
+
}
|