@lvce-editor/shared-process 0.20.10 → 0.20.11
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.20.
|
|
3
|
+
"version": "0.20.11",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -18,16 +18,16 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@babel/code-frame": "^7.23.5",
|
|
21
|
-
"@lvce-editor/extension-host": "0.20.
|
|
22
|
-
"@lvce-editor/extension-host-helper-process": "0.20.
|
|
21
|
+
"@lvce-editor/extension-host": "0.20.11",
|
|
22
|
+
"@lvce-editor/extension-host-helper-process": "0.20.11",
|
|
23
23
|
"@lvce-editor/jsonc-parser": "^1.1.0",
|
|
24
24
|
"@lvce-editor/pretty-error": "^1.2.2",
|
|
25
|
-
"@lvce-editor/pty-host": "0.20.
|
|
25
|
+
"@lvce-editor/pty-host": "0.20.11",
|
|
26
26
|
"@lvce-editor/verror": "^1.1.2",
|
|
27
27
|
"debug": "^4.3.4",
|
|
28
28
|
"execa": "^8.0.1",
|
|
29
29
|
"exit-hook": "^4.0.0",
|
|
30
|
-
"got": "^
|
|
30
|
+
"got": "^13.0.0",
|
|
31
31
|
"is-object": "^1.0.2",
|
|
32
32
|
"lines-and-columns": "^2.0.4",
|
|
33
33
|
"p-queue": "^7.4.1",
|
|
@@ -1,39 +1,26 @@
|
|
|
1
|
+
import * as Assert from '../Assert/Assert.js'
|
|
1
2
|
import * as Id from '../Id/Id.js'
|
|
3
|
+
import * as Logger from '../Logger/Logger.js'
|
|
2
4
|
import * as Promises from '../Promises/Promises.js'
|
|
3
5
|
|
|
4
6
|
export const state = {
|
|
5
7
|
callbacks: Object.create(null),
|
|
6
|
-
onceListeners: new Set(),
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
export const registerPromise = () => {
|
|
10
11
|
const id = Id.create()
|
|
11
|
-
const { resolve,
|
|
12
|
-
state.callbacks[id] =
|
|
12
|
+
const { resolve, promise } = Promises.withResolvers()
|
|
13
|
+
state.callbacks[id] = resolve
|
|
13
14
|
return { id, promise }
|
|
14
15
|
}
|
|
15
16
|
|
|
16
|
-
// TODO merge resolve and resolveEmpty
|
|
17
17
|
export const resolve = (id, args) => {
|
|
18
|
-
|
|
19
|
-
if (!(id in callbacks)) {
|
|
20
|
-
console.
|
|
18
|
+
Assert.number(id)
|
|
19
|
+
if (!(id in state.callbacks)) {
|
|
20
|
+
console.log(args)
|
|
21
|
+
Logger.warn(`callback ${id} may already be disposed`)
|
|
21
22
|
return
|
|
22
23
|
}
|
|
23
|
-
callbacks[id]
|
|
24
|
-
delete callbacks[id]
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export const reject = (id, error) => {
|
|
28
|
-
const { callbacks } = state
|
|
29
|
-
if (!(id in callbacks)) {
|
|
30
|
-
console.warn(`callback (rejected) ${id} may already be disposed`)
|
|
31
|
-
return
|
|
32
|
-
}
|
|
33
|
-
callbacks[id].reject(error)
|
|
34
|
-
delete callbacks[id]
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export const isAllEmpty = () => {
|
|
38
|
-
return Object.keys(state.callbacks).length === 0 && state.onceListeners.size === 0
|
|
24
|
+
state.callbacks[id](args)
|
|
25
|
+
delete state.callbacks[id]
|
|
39
26
|
}
|
|
@@ -51,11 +51,11 @@ export const getSetupName = () => {
|
|
|
51
51
|
return 'Lvce-Setup'
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
export const version = '0.20.
|
|
54
|
+
export const version = '0.20.11'
|
|
55
55
|
|
|
56
|
-
export const commit = '
|
|
56
|
+
export const commit = '49d995f'
|
|
57
57
|
|
|
58
|
-
export const date = '2023-
|
|
58
|
+
export const date = '2023-12-02T12:20:42.000Z'
|
|
59
59
|
|
|
60
60
|
export const getVersion = () => {
|
|
61
61
|
return version
|