@lvce-editor/shared-process 0.27.1 → 0.28.0
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 +7 -8
- package/src/parts/GetTypeFromUrl/GetTypeFromUrl.js +1 -0
- package/src/parts/GetTypeScriptPath/GetTypeScriptPath.js +2 -1
- package/src/parts/HandleIpcSearchProcess/HandleIpcSearchProcess.js +23 -1
- package/src/parts/HandleMessagePortForSearchProcess/HandleMessagePortForSearchProcess.js +4 -7
- package/src/parts/HandleWebSocketForSearchProcess/HandleWebSocketForSearchProcess.js +5 -0
- package/src/parts/HandleWebSocketForUnknown/HandleWebSocketForUnknown.js +3 -7
- package/src/parts/HandleWebSocketModule/HandleWebSocketModule.js +2 -0
- package/src/parts/LaunchNetworkProcess/LaunchNetworkProcess.js +4 -2
- package/src/parts/LaunchSearchProcess/LaunchSearchProcess.js +4 -2
- package/src/parts/LaunchTypeScriptCompileProcess/LaunchTypeScriptCompileProcess.js +17 -0
- package/src/parts/Module/Module.js +0 -2
- package/src/parts/ModuleId/ModuleId.js +0 -1
- package/src/parts/ModuleMap/ModuleMap.js +0 -2
- package/src/parts/Platform/Platform.js +3 -3
- package/src/parts/ProtocolType/ProtocolType.js +1 -0
- package/src/parts/SearchProcessPath/SearchProcessPath.js +1 -3
- package/src/parts/SymLink/SymLink.js +3 -3
- package/src/parts/TypeScriptCompileProcessPath/TypeScriptCompileProcessPath.js +3 -0
- package/src/parts/WebSocketServer/WebSocketServer.ipc.js +0 -5
- package/src/parts/WebSocketServer/WebSocketServer.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/shared-process",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -18,20 +18,17 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@lvce-editor/assert": "^1.2.0",
|
|
21
|
-
"@lvce-editor/extension-host-helper-process": "0.
|
|
22
|
-
"@lvce-editor/ipc": "^8.0
|
|
21
|
+
"@lvce-editor/extension-host-helper-process": "0.28.0",
|
|
22
|
+
"@lvce-editor/ipc": "^8.2.0",
|
|
23
23
|
"@lvce-editor/json-rpc": "^1.3.0",
|
|
24
24
|
"@lvce-editor/jsonc-parser": "^1.2.0",
|
|
25
|
-
"@lvce-editor/network-process": "0.27.1",
|
|
26
25
|
"@lvce-editor/pretty-error": "^1.5.0",
|
|
27
|
-
"@lvce-editor/pty-host": "0.
|
|
26
|
+
"@lvce-editor/pty-host": "0.28.0",
|
|
28
27
|
"@lvce-editor/verror": "^1.2.0",
|
|
29
|
-
"@lvce-editor/web-socket-server": "^1.1.0",
|
|
30
28
|
"debug": "^4.3.4",
|
|
31
29
|
"execa": "^8.0.1",
|
|
32
30
|
"exit-hook": "^4.0.0",
|
|
33
31
|
"is-object": "^1.0.2",
|
|
34
|
-
"tar-fs": "^3.0.6",
|
|
35
32
|
"xdg-basedir": "^5.1.0"
|
|
36
33
|
},
|
|
37
34
|
"optionalDependencies": {
|
|
@@ -39,6 +36,8 @@
|
|
|
39
36
|
"open": "^10.1.0",
|
|
40
37
|
"tail": "^2.2.6",
|
|
41
38
|
"tmp-promise": "^3.0.3",
|
|
42
|
-
"trash": "^8.1.1"
|
|
39
|
+
"trash": "^8.1.1",
|
|
40
|
+
"@lvce-editor/network-process": "0.28.0",
|
|
41
|
+
"@lvce-editor/search-process": "0.28.0"
|
|
43
42
|
}
|
|
44
43
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { join } from 'node:path';
|
|
2
2
|
import * as IsBuiltServer from '../IsBuiltServer/IsBuiltServer.js';
|
|
3
3
|
import * as PlatformPaths from '../PlatformPaths/PlatformPaths.js';
|
|
4
|
+
import * as Platform from '../Platform/Platform.js';
|
|
4
5
|
import { pathToFileURL } from 'node:url';
|
|
5
6
|
export const getTypeScriptUri = () => {
|
|
6
|
-
if (IsBuiltServer.isBuiltServer) {
|
|
7
|
+
if (!Platform.isProduction || IsBuiltServer.isBuiltServer) {
|
|
7
8
|
return 'typescript';
|
|
8
9
|
}
|
|
9
10
|
const typescriptPath = join(PlatformPaths.getBuiltinExtensionsPath(), 'builtin.language-features-typescript', 'node', 'node_modules', 'typescript', 'lib', 'typescript.js');
|
|
@@ -1 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
import * as SearchProcess from '../SearchProcess/SearchProcess.js';
|
|
2
|
+
export const targetWebSocket = () => {
|
|
3
|
+
return SearchProcess.getOrCreate();
|
|
4
|
+
};
|
|
5
|
+
export const upgradeWebSocket = (handle, message) => {
|
|
6
|
+
return {
|
|
7
|
+
type: 'send',
|
|
8
|
+
method: 'HandleWebSocket.handleWebSocket',
|
|
9
|
+
params: [message],
|
|
10
|
+
transfer: handle,
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export const targetMessagePort = () => {
|
|
14
|
+
return SearchProcess.getOrCreate();
|
|
15
|
+
};
|
|
16
|
+
export const upgradeMessagePort = (port) => {
|
|
17
|
+
return {
|
|
18
|
+
type: 'send',
|
|
19
|
+
method: 'HandleElectronMessagePort.handleElectronMessagePort',
|
|
20
|
+
params: [],
|
|
21
|
+
transfer: [port],
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Assert.object(port);
|
|
6
|
-
const ipc = await SearchProcess.getOrCreate();
|
|
7
|
-
await JsonRpc.invokeAndTransfer(ipc, [port], 'HandleElectronMessagePort.handleElectronMessagePort');
|
|
1
|
+
import * as HandleIncomingIpc from '../HandleIncomingIpc/HandleIncomingIpc.js';
|
|
2
|
+
import * as IpcId from '../IpcId/IpcId.js';
|
|
3
|
+
export const handleMessagePortForSearchProcess = (port) => {
|
|
4
|
+
return HandleIncomingIpc.handleIncomingIpc(IpcId.SearchProcess, port, {});
|
|
8
5
|
};
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import * as Logger from '../Logger/Logger.js';
|
|
2
|
+
import * as DestroySocket from '../DestroySocket/DestroySocket.js';
|
|
2
3
|
export const handleWebSocket = (message, handle, protocol) => {
|
|
3
|
-
Logger.warn(`[shared-process] unsupported sec-websocket-
|
|
4
|
-
|
|
5
|
-
handle.destroy();
|
|
6
|
-
}
|
|
7
|
-
catch {
|
|
8
|
-
// ignore
|
|
9
|
-
}
|
|
4
|
+
Logger.warn(`[shared-process] unsupported sec-websocket-protocol ${protocol}`);
|
|
5
|
+
DestroySocket.destroySocket(handle);
|
|
10
6
|
};
|
|
@@ -11,6 +11,8 @@ export const load = (protocol) => {
|
|
|
11
11
|
return import('../HandleWebSocketForExtensionHostHelperProcess/HandleWebSocketForExtensionHostHelperProcess.js');
|
|
12
12
|
case ProtocolType.TerminalProcess:
|
|
13
13
|
return import('../HandleWebSocketForTerminalProcess/HandleWebSocketForTerminalProcess.js');
|
|
14
|
+
case ProtocolType.SearchProcess:
|
|
15
|
+
return import('../HandleWebSocketForSearchProcess/HandleWebSocketForSearchProcess.js');
|
|
14
16
|
default:
|
|
15
17
|
return import('../HandleWebSocketForUnknown/HandleWebSocketForUnknown.js');
|
|
16
18
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import * as NetworkProcessPath from '../NetworkProcessPath/NetworkProcessPath.js';
|
|
2
1
|
import * as HandleIpc from '../HandleIpc/HandleIpc.js';
|
|
3
2
|
import * as IpcParent from '../IpcParent/IpcParent.js';
|
|
4
3
|
import * as IpcParentType from '../IpcParentType/IpcParentType.js';
|
|
4
|
+
import * as IsElectron from '../IsElectron/IsElectron.js';
|
|
5
|
+
import * as NetworkProcessPath from '../NetworkProcessPath/NetworkProcessPath.js';
|
|
5
6
|
export const launchNetworkProcess = async () => {
|
|
7
|
+
const method = IsElectron.isElectron() ? IpcParentType.ElectronUtilityProcess : IpcParentType.NodeForkedProcess;
|
|
6
8
|
const networkProcess = await IpcParent.create({
|
|
7
|
-
method
|
|
9
|
+
method,
|
|
8
10
|
path: NetworkProcessPath.networkProcessPath,
|
|
9
11
|
argv: [],
|
|
10
12
|
stdio: 'inherit',
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import * as SearchProcessPath from '../SearchProcessPath/SearchProcessPath.js';
|
|
2
1
|
import * as HandleIpc from '../HandleIpc/HandleIpc.js';
|
|
3
2
|
import * as IpcParent from '../IpcParent/IpcParent.js';
|
|
4
3
|
import * as IpcParentType from '../IpcParentType/IpcParentType.js';
|
|
4
|
+
import * as IsElectron from '../IsElectron/IsElectron.js';
|
|
5
|
+
import * as SearchProcessPath from '../SearchProcessPath/SearchProcessPath.js';
|
|
5
6
|
export const launchSearchProcess = async () => {
|
|
7
|
+
const method = IsElectron.isElectron() ? IpcParentType.ElectronUtilityProcess : IpcParentType.NodeForkedProcess;
|
|
6
8
|
const searchProcess = await IpcParent.create({
|
|
7
|
-
method
|
|
9
|
+
method,
|
|
8
10
|
path: SearchProcessPath.searchProcessPath,
|
|
9
11
|
argv: [],
|
|
10
12
|
stdio: 'inherit',
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as HandleIpc from '../HandleIpc/HandleIpc.js';
|
|
2
|
+
import * as IpcParent from '../IpcParent/IpcParent.js';
|
|
3
|
+
import * as IpcParentType from '../IpcParentType/IpcParentType.js';
|
|
4
|
+
import * as IsElectron from '../IsElectron/IsElectron.js';
|
|
5
|
+
import * as TypeScriptCompileProcessPath from '../TypeScriptCompileProcessPath/TypeScriptCompileProcessPath.js';
|
|
6
|
+
export const launchTypeScriptCompileProcess = async () => {
|
|
7
|
+
const method = IsElectron.isElectron() ? IpcParentType.ElectronUtilityProcess : IpcParentType.NodeForkedProcess;
|
|
8
|
+
const typescriptCompileProcess = await IpcParent.create({
|
|
9
|
+
method,
|
|
10
|
+
path: TypeScriptCompileProcessPath.typescriptCompileProcessPath,
|
|
11
|
+
argv: [],
|
|
12
|
+
stdio: 'inherit',
|
|
13
|
+
name: 'TypeScript Compile Process',
|
|
14
|
+
});
|
|
15
|
+
HandleIpc.handleIpc(typescriptCompileProcess);
|
|
16
|
+
return typescriptCompileProcess;
|
|
17
|
+
};
|
|
@@ -105,8 +105,6 @@ export const load = (moduleId) => {
|
|
|
105
105
|
return import('../TextDocument/TextDocument.ipc.js');
|
|
106
106
|
case ModuleId.Search:
|
|
107
107
|
return import('../TextSearch/TextSearch.ipc.js');
|
|
108
|
-
case ModuleId.WebSocketServer:
|
|
109
|
-
return import('../WebSocketServer/WebSocketServer.ipc.js');
|
|
110
108
|
case ModuleId.Workspace:
|
|
111
109
|
return import('../Workspace/Workspace.ipc.js');
|
|
112
110
|
case ModuleId.ElectronNet:
|
|
@@ -14,7 +14,6 @@ export const ElectronWindowProcessExplorer = 12;
|
|
|
14
14
|
export const SearchFile = 13;
|
|
15
15
|
export const Terminal = 14;
|
|
16
16
|
export const TextDocument = 15;
|
|
17
|
-
export const WebSocketServer = 16;
|
|
18
17
|
export const Workspace = 17;
|
|
19
18
|
export const ChromeExtension = 18;
|
|
20
19
|
export const Download = 19;
|
|
@@ -232,8 +232,6 @@ export const getModuleId = (commandId) => {
|
|
|
232
232
|
return ModuleId.Terminal;
|
|
233
233
|
case 4820:
|
|
234
234
|
return ModuleId.TextDocument;
|
|
235
|
-
case 'WebSocketServer.handleUpgrade':
|
|
236
|
-
return ModuleId.WebSocketServer;
|
|
237
235
|
case 'ElectronWindow.close':
|
|
238
236
|
case 'ElectronWindow.focus':
|
|
239
237
|
case 'ElectronWindow.getZoom':
|
|
@@ -41,9 +41,9 @@ export const getAppImageName = () => {
|
|
|
41
41
|
export const getSetupName = () => {
|
|
42
42
|
return 'Lvce-Setup';
|
|
43
43
|
};
|
|
44
|
-
export const version = '0.
|
|
45
|
-
export const commit = '
|
|
46
|
-
export const date = '2024-
|
|
44
|
+
export const version = '0.28.0';
|
|
45
|
+
export const commit = '24ec280';
|
|
46
|
+
export const date = '2024-05-02T22:22:33.000Z';
|
|
47
47
|
export const getVersion = () => {
|
|
48
48
|
return version;
|
|
49
49
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export const ExtensionHost = 'extension-host';
|
|
2
2
|
export const ExtensionHostHelperProcess = 'extension-host-helper-process';
|
|
3
|
+
export const SearchProcess = 'search-process';
|
|
3
4
|
export const SharedProcess = 'shared-process';
|
|
4
5
|
export const TerminalProcess = 'terminal-process';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
export const createSymLink =
|
|
3
|
-
|
|
1
|
+
import * as NetworkProcess from '../NetworkProcess/NetworkProcess.js';
|
|
2
|
+
export const createSymLink = (target, path) => {
|
|
3
|
+
return NetworkProcess.invoke('Symlink.createSymLink', target, path);
|
|
4
4
|
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@lvce-editor/web-socket-server';
|