@lvce-editor/shared-process 0.110.13 → 0.110.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 +2 -1
- package/src/parts/BuiltinExtensionsPath/BuiltinExtensionsPath.js +1 -1
- package/src/parts/FileWatcherExplorer/FileWatcherExplorer.ipc.js +7 -0
- package/src/parts/FileWatcherExplorer/FileWatcherExplorer.js +51 -0
- package/src/parts/FileWatcherExplorerPath/FileWatcherExplorerPath.js +3 -0
- package/src/parts/HandleIncomingIpc/HandleIncomingIpc.js +4 -0
- package/src/parts/HandleIpcFileWatcherExplorer/HandleIpcFileWatcherExplorer.js +27 -0
- package/src/parts/HandleIpcModule/HandleIpcModule.js +3 -0
- package/src/parts/HandleMessagePortForFileWatcherExplorer/HandleMessagePortForFileWatcherExplorer.ipc.js +7 -0
- package/src/parts/HandleMessagePortForFileWatcherExplorer/HandleMessagePortForFileWatcherExplorer.js +8 -0
- package/src/parts/HandleWebSocketForFileWatcherExplorer/HandleWebSocketForFileWatcherExplorer.js +6 -0
- package/src/parts/HandleWebSocketModule/HandleWebSocketModule.js +3 -0
- package/src/parts/IpcId/IpcId.js +1 -0
- package/src/parts/LaunchFileWatcherExplorer/LaunchFileWatcherExplorer.js +17 -0
- package/src/parts/Module/Module.js +6 -0
- package/src/parts/ModuleId/ModuleId.js +3 -0
- package/src/parts/ModuleMap/ModuleMap.js +7 -0
- package/src/parts/Platform/Platform.js +3 -3
- package/src/parts/PreloadUrl/PreloadUrl.js +1 -1
- package/src/parts/ProtocolType/ProtocolType.js +1 -0
- package/src/parts/RemoteCli/RemoteCli.ipc.js +14 -0
- package/src/parts/RemoteCli/RemoteCli.js +62 -0
- package/src/parts/SendIncomingIpc/SendIncomingIpc.js +1 -0
- package/src/parts/Workers/Workers.json +33 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/shared-process",
|
|
3
|
-
"version": "0.110.
|
|
3
|
+
"version": "0.110.15",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@lvce-editor/assert": "1.9.0",
|
|
21
|
+
"@lvce-editor/file-watcher-explorer": "0.1.1",
|
|
21
22
|
"@lvce-editor/ipc": "16.12.1",
|
|
22
23
|
"@lvce-editor/json-rpc": "8.7.0",
|
|
23
24
|
"@lvce-editor/jsonc-parser": "1.5.2",
|
|
@@ -3,6 +3,6 @@ import { fileURLToPath } from 'url'
|
|
|
3
3
|
|
|
4
4
|
export const getBuiltinExtensionsPath = () => {
|
|
5
5
|
const staticServerPath = fileURLToPath(import.meta.resolve('@lvce-editor/static-server'))
|
|
6
|
-
const builtinExtensionsPath = join(staticServerPath, '..', '..', 'static', '
|
|
6
|
+
const builtinExtensionsPath = join(staticServerPath, '..', '..', 'static', 'd74c4b9', 'extensions')
|
|
7
7
|
return builtinExtensionsPath
|
|
8
8
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as LaunchFileWatcherExplorer from '../LaunchFileWatcherExplorer/LaunchFileWatcherExplorer.js'
|
|
2
|
+
|
|
3
|
+
export const state = {
|
|
4
|
+
/**
|
|
5
|
+
* @type {any}
|
|
6
|
+
*/
|
|
7
|
+
ipc: undefined,
|
|
8
|
+
refCount: 0,
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const getOrCreate = async () => {
|
|
12
|
+
if (!state.ipc) {
|
|
13
|
+
state.ipc = LaunchFileWatcherExplorer.launchFileWatcherExplorer()
|
|
14
|
+
}
|
|
15
|
+
return state.ipc
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const acquire = async () => {
|
|
19
|
+
state.refCount++
|
|
20
|
+
try {
|
|
21
|
+
return await getOrCreate()
|
|
22
|
+
} catch (error) {
|
|
23
|
+
decreaseRefCount()
|
|
24
|
+
throw error
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const disposeLater = (ipcPromise) => {
|
|
29
|
+
setTimeout(async () => {
|
|
30
|
+
try {
|
|
31
|
+
const ipc = await ipcPromise
|
|
32
|
+
await ipc.dispose()
|
|
33
|
+
} catch {
|
|
34
|
+
// ignore disposal errors
|
|
35
|
+
}
|
|
36
|
+
}, 0)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const decreaseRefCount = () => {
|
|
40
|
+
if (state.refCount > 0) {
|
|
41
|
+
state.refCount--
|
|
42
|
+
}
|
|
43
|
+
if (state.refCount === 0) {
|
|
44
|
+
const { ipc } = state
|
|
45
|
+
state.ipc = undefined
|
|
46
|
+
if (ipc) {
|
|
47
|
+
disposeLater(ipc)
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return state.refCount
|
|
51
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as ApplyIncomingIpcResponse from '../ApplyIncomingIpcResponse/ApplyIncomingIpcResponse.js'
|
|
2
2
|
import * as Assert from '../Assert/Assert.js'
|
|
3
|
+
import * as FileWatcherExplorer from '../FileWatcherExplorer/FileWatcherExplorer.js'
|
|
3
4
|
import * as HandleIncomingIpcMessagePort from '../HandleIncomingIpcMessagePort/HandleIncomingIpcMessagePort.js'
|
|
4
5
|
import * as HandleIncomingIpcWebSocket from '../HandleIncomingIpcWebSocket/HandleIncomingIpcWebSocket.js'
|
|
5
6
|
import * as HandleIpcModule from '../HandleIpcModule/HandleIpcModule.js'
|
|
@@ -47,5 +48,8 @@ export const handleIncomingIpc = async (ipcId, handle, message) => {
|
|
|
47
48
|
if (ipcId === IpcId.ProcessExplorer) {
|
|
48
49
|
ProcessExplorer.decreaseRefCount()
|
|
49
50
|
}
|
|
51
|
+
if (ipcId === IpcId.FileWatcherExplorer) {
|
|
52
|
+
FileWatcherExplorer.decreaseRefCount()
|
|
53
|
+
}
|
|
50
54
|
console.error(error)
|
|
51
55
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as Assert from '../Assert/Assert.js'
|
|
2
|
+
import * as FileWatcherExplorer from '../FileWatcherExplorer/FileWatcherExplorer.js'
|
|
3
|
+
|
|
4
|
+
export const targetMessagePort = () => {
|
|
5
|
+
return FileWatcherExplorer.acquire()
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const targetWebSocket = () => {
|
|
9
|
+
return FileWatcherExplorer.acquire()
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const upgradeMessagePort = (port) => {
|
|
13
|
+
Assert.object(port)
|
|
14
|
+
return {
|
|
15
|
+
method: 'HandleElectronMessagePort.handleElectronMessagePort',
|
|
16
|
+
params: [port],
|
|
17
|
+
type: 'send',
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const upgradeWebSocket = (handle, message) => {
|
|
22
|
+
return {
|
|
23
|
+
method: 'HandleWebSocket.handleWebSocket',
|
|
24
|
+
params: [handle, message],
|
|
25
|
+
type: 'send',
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -3,6 +3,7 @@ import * as HandleIpcAuthProcess from '../HandleIpcAuthProcess/HandleIpcAuthProc
|
|
|
3
3
|
import * as HandleIpcClipBoardProcess from '../HandleIpcClipBoardProcess/HandleIpcClipBoardProcess.js'
|
|
4
4
|
import * as HandleIpcEmbedsProcess from '../HandleIpcEmbedsProcess/HandleIpcEmbedsProcess.js'
|
|
5
5
|
import * as HandleIpcFileSystemProcess from '../HandleIpcFileSystemProcess/HandleIpcFileSystemProcess.js'
|
|
6
|
+
import * as HandleIpcFileWatcherExplorer from '../HandleIpcFileWatcherExplorer/HandleIpcFileWatcherExplorer.js'
|
|
6
7
|
import * as HandleIpcProcessExplorer from '../HandleIpcProcessExplorer/HandleIpcProcessExplorer.js'
|
|
7
8
|
import * as HandleIpcSearchProcess from '../HandleIpcSearchProcess/HandleIpcSearchProcess.js'
|
|
8
9
|
import * as HandleIpcSharedProcess from '../HandleIpcSharedProcess/HandleIpcSharedProcess.js'
|
|
@@ -20,6 +21,8 @@ export const getModule = (ipcId) => {
|
|
|
20
21
|
return HandleIpcEmbedsProcess
|
|
21
22
|
case IpcId.FileSystemProcess:
|
|
22
23
|
return HandleIpcFileSystemProcess
|
|
24
|
+
case IpcId.FileWatcherExplorer:
|
|
25
|
+
return HandleIpcFileWatcherExplorer
|
|
23
26
|
case IpcId.ProcessExplorer:
|
|
24
27
|
return HandleIpcProcessExplorer
|
|
25
28
|
case IpcId.SearchProcess:
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as HandleMessagePortForFileWatcherExplorer from './HandleMessagePortForFileWatcherExplorer.js'
|
|
2
|
+
|
|
3
|
+
export const name = 'HandleMessagePortForFileWatcherExplorer'
|
|
4
|
+
|
|
5
|
+
export const Commands = {
|
|
6
|
+
handleMessagePortForFileWatcherExplorer: HandleMessagePortForFileWatcherExplorer.handleMessagePortForFileWatcherExplorer,
|
|
7
|
+
}
|
package/src/parts/HandleMessagePortForFileWatcherExplorer/HandleMessagePortForFileWatcherExplorer.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as Assert from '../Assert/Assert.js'
|
|
2
|
+
import * as HandleIncomingIpc from '../HandleIncomingIpc/HandleIncomingIpc.js'
|
|
3
|
+
import * as IpcId from '../IpcId/IpcId.js'
|
|
4
|
+
|
|
5
|
+
export const handleMessagePortForFileWatcherExplorer = (port) => {
|
|
6
|
+
Assert.object(port)
|
|
7
|
+
return HandleIncomingIpc.handleIncomingIpc(IpcId.FileWatcherExplorer, port, {})
|
|
8
|
+
}
|
package/src/parts/HandleWebSocketForFileWatcherExplorer/HandleWebSocketForFileWatcherExplorer.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as HandleIncomingIpc from '../HandleIncomingIpc/HandleIncomingIpc.js'
|
|
2
|
+
import * as IpcId from '../IpcId/IpcId.js'
|
|
3
|
+
|
|
4
|
+
export const handleWebSocket = (message, handle) => {
|
|
5
|
+
return HandleIncomingIpc.handleIncomingIpc(IpcId.FileWatcherExplorer, handle, message)
|
|
6
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as HandleWebSocketForClipBoardProcess from '../HandleWebSocketForClipBoardProcess/HandleWebSocketForClipBoardProcess.js'
|
|
2
2
|
import * as HandleWebSocketForExtensionNodeProcess from '../HandleWebSocketForExtensionNodeProcess/HandleWebSocketForExtensionNodeProcess.js'
|
|
3
3
|
import * as HandleWebSocketForFileSystemProcess from '../HandleWebSocketForFileSystemProcess/HandleWebSocketForFileSystemProcess.js'
|
|
4
|
+
import * as HandleWebSocketForFileWatcherExplorer from '../HandleWebSocketForFileWatcherExplorer/HandleWebSocketForFileWatcherExplorer.js'
|
|
4
5
|
import * as HandleWebSocketForProcessExplorer from '../HandleWebSocketForProcessExplorer/HandleWebSocketForProcessExplorer.js'
|
|
5
6
|
import * as HandleWebSocketForSearchProcess from '../HandleWebSocketForSearchProcess/HandleWebSocketForSearchProcess.js'
|
|
6
7
|
import * as HandleWebSocketForSharedProcess from '../HandleWebSocketForSharedProcess/HandleWebSocketForSharedProcess.js'
|
|
@@ -20,6 +21,8 @@ export const load = (protocol) => {
|
|
|
20
21
|
return HandleWebSocketForExtensionNodeProcess
|
|
21
22
|
case ProtocolType.FileSystemProcess:
|
|
22
23
|
return HandleWebSocketForFileSystemProcess
|
|
24
|
+
case ProtocolType.FileWatcherExplorer:
|
|
25
|
+
return HandleWebSocketForFileWatcherExplorer
|
|
23
26
|
case ProtocolType.ProcessExplorer:
|
|
24
27
|
return HandleWebSocketForProcessExplorer
|
|
25
28
|
case ProtocolType.SearchProcess:
|
package/src/parts/IpcId/IpcId.js
CHANGED
|
@@ -14,4 +14,5 @@ export const ExtensionHostWorker = RpcId.ExtensionHostWorker
|
|
|
14
14
|
export const FileSystemProcess = RpcId.FileSystemProcess
|
|
15
15
|
export const FileWatcherProcess = 220
|
|
16
16
|
export const TypescriptCompileProcess = 221
|
|
17
|
+
export const FileWatcherExplorer = 223
|
|
17
18
|
export const ClipBoardProcess = RpcId.ClipBoardProcess
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as FileWatcherExplorerPath from '../FileWatcherExplorerPath/FileWatcherExplorerPath.js'
|
|
2
|
+
import * as HandleIpc from '../HandleIpc/HandleIpc.js'
|
|
3
|
+
import * as IpcId from '../IpcId/IpcId.js'
|
|
4
|
+
import * as IsElectron from '../IsElectron/IsElectron.js'
|
|
5
|
+
import * as LaunchProcess from '../LaunchProcess/LaunchProcess.js'
|
|
6
|
+
|
|
7
|
+
export const launchFileWatcherExplorer = async () => {
|
|
8
|
+
const ipc = await LaunchProcess.launchProcess({
|
|
9
|
+
defaultPath: FileWatcherExplorerPath.fileWatcherExplorerPath,
|
|
10
|
+
isElectron: IsElectron.isElectron,
|
|
11
|
+
name: 'File Watcher Explorer',
|
|
12
|
+
settingName: 'develop.fileWatcherExplorerPath',
|
|
13
|
+
targetRpcId: IpcId.FileWatcherExplorer,
|
|
14
|
+
})
|
|
15
|
+
HandleIpc.unhandleIpc(ipc)
|
|
16
|
+
return ipc
|
|
17
|
+
}
|
|
@@ -60,6 +60,8 @@ export const load = (moduleId) => {
|
|
|
60
60
|
return import('../FileSystemDisk/FileSystemDisk.ipc.js')
|
|
61
61
|
case ModuleId.FileWatcher:
|
|
62
62
|
return import('../FileWatcher/FileWatcher.ipc.js')
|
|
63
|
+
case ModuleId.FileWatcherExplorer:
|
|
64
|
+
return import('../FileWatcherExplorer/FileWatcherExplorer.ipc.js')
|
|
63
65
|
case ModuleId.FirefoxCookieImport:
|
|
64
66
|
return import('../FirefoxCookieImport/FirefoxCookieImport.ipc.js')
|
|
65
67
|
case ModuleId.GetElectronFileResponse:
|
|
@@ -88,6 +90,8 @@ export const load = (moduleId) => {
|
|
|
88
90
|
return import('../HandleMessagePortForExtensionNodeProcess/HandleMessagePortForExtensionNodeProcess.ipc.js')
|
|
89
91
|
case ModuleId.HandleMessagePortForFileSystemProcess:
|
|
90
92
|
return import('../HandleMessagePortForFileSystemProcess/HandleMessagePortForFileSystemProcess.ipc.js')
|
|
93
|
+
case ModuleId.HandleMessagePortForFileWatcherExplorer:
|
|
94
|
+
return import('../HandleMessagePortForFileWatcherExplorer/HandleMessagePortForFileWatcherExplorer.ipc.js')
|
|
91
95
|
case ModuleId.HandleMessagePortForProcessExplorer:
|
|
92
96
|
return import('../HandleMessagePortForProcessExplorer/HandleMessagePortForProcessExplorer.ipc.js')
|
|
93
97
|
case ModuleId.HandleMessagePortForSearchProcess:
|
|
@@ -136,6 +140,8 @@ export const load = (moduleId) => {
|
|
|
136
140
|
return import('../RebuildNodePty/RebuildNodePty.ipc.js')
|
|
137
141
|
case ModuleId.RecentlyOpened:
|
|
138
142
|
return import('../RecentlyOpened/RecentlyOpened.ipc.js')
|
|
143
|
+
case ModuleId.RemoteCli:
|
|
144
|
+
return import('../RemoteCli/RemoteCli.ipc.js')
|
|
139
145
|
case ModuleId.Screen:
|
|
140
146
|
return import('../Screen/Screen.ipc.js')
|
|
141
147
|
case ModuleId.SendMessagePortToMainProcess:
|
|
@@ -78,3 +78,6 @@ export const SendMessagePortToMainProcess = 88
|
|
|
78
78
|
export const FirefoxCookieImport = 91
|
|
79
79
|
export const IpcTrace = 92
|
|
80
80
|
export const HandleMessagePortForExtensionNodeProcess = 93
|
|
81
|
+
export const FileWatcherExplorer = 94
|
|
82
|
+
export const HandleMessagePortForFileWatcherExplorer = 95
|
|
83
|
+
export const RemoteCli = 96
|
|
@@ -148,6 +148,8 @@ export const getModuleId = (commandId) => {
|
|
|
148
148
|
case 'FileWatcher.watch':
|
|
149
149
|
case 'FileWatcher.watchFile2':
|
|
150
150
|
return ModuleId.FileWatcher
|
|
151
|
+
case 'FileWatcherExplorer.decreaseRefCount':
|
|
152
|
+
return ModuleId.FileWatcherExplorer
|
|
151
153
|
case 'FirefoxCookieImport.getInfo':
|
|
152
154
|
case 'FirefoxCookieImport.importCookies':
|
|
153
155
|
return ModuleId.FirefoxCookieImport
|
|
@@ -182,6 +184,8 @@ export const getModuleId = (commandId) => {
|
|
|
182
184
|
return ModuleId.HandleMessagePortForExtensionNodeProcess
|
|
183
185
|
case 'HandleMessagePortForFileSystemProcess.handleMessagePortForFileSystemProcess':
|
|
184
186
|
return ModuleId.HandleMessagePortForFileSystemProcess
|
|
187
|
+
case 'HandleMessagePortForFileWatcherExplorer.handleMessagePortForFileWatcherExplorer':
|
|
188
|
+
return ModuleId.HandleMessagePortForFileWatcherExplorer
|
|
185
189
|
case 'HandleMessagePortForProcessExplorer.handleMessagePortForProcessExplorer':
|
|
186
190
|
return ModuleId.HandleMessagePortForProcessExplorer
|
|
187
191
|
case 'HandleMessagePortForSearchProcess.handleMessagePortForSearchProcess':
|
|
@@ -279,6 +283,9 @@ export const getModuleId = (commandId) => {
|
|
|
279
283
|
return ModuleId.RebuildNodePty
|
|
280
284
|
case 'RecentlyOpened.addPath':
|
|
281
285
|
return ModuleId.RecentlyOpened
|
|
286
|
+
case 'RemoteCli.open':
|
|
287
|
+
case 'RemoteCli.waitForOpenRequest':
|
|
288
|
+
return ModuleId.RemoteCli
|
|
282
289
|
case 'Screen.getBounds':
|
|
283
290
|
case 'Screen.getHeight':
|
|
284
291
|
case 'Screen.getWidth':
|
|
@@ -61,11 +61,11 @@ export const getSetupName = () => {
|
|
|
61
61
|
return 'Lvce-Setup'
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
export const version = '0.110.
|
|
64
|
+
export const version = '0.110.15'
|
|
65
65
|
|
|
66
|
-
export const commit = '
|
|
66
|
+
export const commit = 'd74c4b9'
|
|
67
67
|
|
|
68
|
-
export const date = '2026-08-
|
|
68
|
+
export const date = '2026-08-28T01:12:50.000Z'
|
|
69
69
|
|
|
70
70
|
export const getVersion = () => {
|
|
71
71
|
return version
|
|
@@ -2,5 +2,5 @@ import { join } from 'node:path'
|
|
|
2
2
|
import * as Root from '../Root/Root.js'
|
|
3
3
|
|
|
4
4
|
export const getPreloadUrl = () => {
|
|
5
|
-
return join(Root.root, 'static', '
|
|
5
|
+
return join(Root.root, 'static', 'd74c4b9', 'packages', 'preload', 'dist', 'index.js')
|
|
6
6
|
}
|
|
@@ -2,6 +2,7 @@ export const ExtensionHost = 'extension-host'
|
|
|
2
2
|
export const ExtensionNodeProcess = 'extension-node-process'
|
|
3
3
|
export const SearchProcess = 'search-process'
|
|
4
4
|
export const ProcessExplorer = 'process-explorer'
|
|
5
|
+
export const FileWatcherExplorer = 'file-watcher-explorer'
|
|
5
6
|
export const FileSystemProcess = 'file-system-process'
|
|
6
7
|
export const SharedProcess = 'shared-process'
|
|
7
8
|
export const ClipBoardProcess = 'clipboard-process'
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
const waiters = []
|
|
12
|
+
|
|
13
|
+
const isOpenRequest = (value) => {
|
|
14
|
+
const request = value
|
|
15
|
+
return Boolean(
|
|
16
|
+
request &&
|
|
17
|
+
(request.kind === 'file' || request.kind === 'folder') &&
|
|
18
|
+
typeof request.path === 'string' &&
|
|
19
|
+
request.path.startsWith('/') &&
|
|
20
|
+
!request.path.includes('\0'),
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const open = (request) => {
|
|
25
|
+
if (!isOpenRequest(request)) {
|
|
26
|
+
throw new TypeError('Invalid remote CLI open request')
|
|
27
|
+
}
|
|
28
|
+
const waiter = waiters.pop()
|
|
29
|
+
if (!waiter) {
|
|
30
|
+
return false
|
|
31
|
+
}
|
|
32
|
+
clearTimeout(waiter.timeout)
|
|
33
|
+
waiter.resolve(request)
|
|
34
|
+
return true
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const waitForOpenRequest = (
|
|
38
|
+
timeoutMs = 30_000,
|
|
39
|
+
) => {
|
|
40
|
+
return new Promise((resolve) => {
|
|
41
|
+
const waiter = {
|
|
42
|
+
resolve,
|
|
43
|
+
timeout: setTimeout(() => {
|
|
44
|
+
const index = waiters.indexOf(waiter)
|
|
45
|
+
if (index !== -1) {
|
|
46
|
+
waiters.splice(index, 1)
|
|
47
|
+
}
|
|
48
|
+
resolve(undefined)
|
|
49
|
+
}, timeoutMs),
|
|
50
|
+
}
|
|
51
|
+
waiter.timeout.unref()
|
|
52
|
+
waiters.push(waiter)
|
|
53
|
+
})
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export const _reset = () => {
|
|
57
|
+
for (const waiter of waiters) {
|
|
58
|
+
clearTimeout(waiter.timeout)
|
|
59
|
+
waiter.resolve(undefined)
|
|
60
|
+
}
|
|
61
|
+
waiters.length = 0
|
|
62
|
+
}
|
|
@@ -1232,6 +1232,39 @@
|
|
|
1232
1232
|
"capabilities": { "directRender": true, "events": true, "render": true, "resize": true, "rootRender": true }
|
|
1233
1233
|
}
|
|
1234
1234
|
},
|
|
1235
|
+
{
|
|
1236
|
+
"id": "fileWatcherView",
|
|
1237
|
+
"fileName": "file-watcher-view/index.js",
|
|
1238
|
+
"contentSecurityPolicy": ["default-src 'none'", "connect-src 'self' https: wss: http://127.0.0.1:* http://localhost:* ws://127.0.0.1:* ws://localhost:*"],
|
|
1239
|
+
"defaultPath": "/packages/renderer-worker/node_modules/@lvce-editor/file-watcher-view/index.js",
|
|
1240
|
+
"productionPath": "/packages/file-watcher-view/index.js",
|
|
1241
|
+
"settingName": "develop.fileWatcherViewPath",
|
|
1242
|
+
"hotReloadCommand": "",
|
|
1243
|
+
"viewlet": {
|
|
1244
|
+
"name": "FileWatcherExplorer",
|
|
1245
|
+
"css": ["/css/parts/ViewletFileWatcherExplorer.css"],
|
|
1246
|
+
"state": { "idKey": "uid", "fields": ["parentUid", "uri", "x", "y", "width", "height"], "contextFields": ["platform", "assetDir"] },
|
|
1247
|
+
"commandPrefix": "FileWatcherExplorer",
|
|
1248
|
+
"methods": {
|
|
1249
|
+
"create": { "name": "FileWatcherExplorer.create", "parameters": [
|
|
1250
|
+
{ "source": "state", "name": "uid" }, { "source": "state", "name": "uri" }, { "source": "state", "name": "x" },
|
|
1251
|
+
{ "source": "state", "name": "y" }, { "source": "state", "name": "width" }, { "source": "state", "name": "height" },
|
|
1252
|
+
{ "source": "literal", "value": null }, { "source": "state", "name": "parentUid" }, { "source": "state", "name": "platform" },
|
|
1253
|
+
{ "source": "state", "name": "assetDir" }
|
|
1254
|
+
] },
|
|
1255
|
+
"loadContent": { "name": "FileWatcherExplorer.loadContent", "parameters": [{ "source": "state", "name": "uid" }, { "source": "argument", "name": "savedState" }] },
|
|
1256
|
+
"diff": { "name": "FileWatcherExplorer.diff2", "parameters": [{ "source": "state", "name": "uid" }] },
|
|
1257
|
+
"render": { "name": "FileWatcherExplorer.render2", "parameters": [{ "source": "state", "name": "uid" }, { "source": "result", "name": "diff" }] },
|
|
1258
|
+
"dispose": { "name": "FileWatcherExplorer.dispose", "parameters": [{ "source": "state", "name": "uid" }] },
|
|
1259
|
+
"terminate": { "name": "FileWatcherExplorer.terminate", "parameters": [] },
|
|
1260
|
+
"getCommandIds": { "name": "FileWatcherExplorer.getCommandIds", "parameters": [] },
|
|
1261
|
+
"getKeyBindings": { "name": "FileWatcherExplorer.getKeyBindings", "parameters": [] },
|
|
1262
|
+
"renderEventListeners": { "name": "FileWatcherExplorer.renderEventListeners", "parameters": [] }
|
|
1263
|
+
},
|
|
1264
|
+
"renderComparison": "emptyCommands",
|
|
1265
|
+
"capabilities": { "directRender": true, "events": true, "render": true, "rootRender": true }
|
|
1266
|
+
}
|
|
1267
|
+
},
|
|
1235
1268
|
{
|
|
1236
1269
|
"id": "processExplorer",
|
|
1237
1270
|
"fileName": "process-explorer-worker/index.js",
|