@lvce-editor/shared-process 0.29.8 → 0.30.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 +3 -3
- package/src/parts/ExportStatic/ExportStatic.js +5 -2
- package/src/parts/HandleWebSocket/HandleWebSocket.js +2 -2
- package/src/parts/HandleWebSocketModule/HandleWebSocketModule.js +10 -5
- package/src/parts/IsIgnoredError/IsIgnoredError.js +4 -0
- package/src/parts/Platform/Platform.js +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/shared-process",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@lvce-editor/assert": "^1.2.0",
|
|
21
|
-
"@lvce-editor/extension-host-helper-process": "0.
|
|
21
|
+
"@lvce-editor/extension-host-helper-process": "0.30.0",
|
|
22
22
|
"@lvce-editor/ipc": "^9.2.0",
|
|
23
23
|
"@lvce-editor/json-rpc": "^1.3.0",
|
|
24
|
-
"@lvce-editor/jsonc-parser": "^1.
|
|
24
|
+
"@lvce-editor/jsonc-parser": "^1.4.0",
|
|
25
25
|
"@lvce-editor/pretty-error": "^1.5.0",
|
|
26
26
|
"@lvce-editor/verror": "^1.3.0",
|
|
27
27
|
"debug": "^4.3.5",
|
|
@@ -76,9 +76,12 @@ const clean = async (root) => {
|
|
|
76
76
|
const copyStaticFiles = async (root, commitHash) => {
|
|
77
77
|
await FileSystem.copy(Path.join(root, 'node_modules', '@lvce-editor', 'server', 'static'), Path.join(root, 'dist'));
|
|
78
78
|
};
|
|
79
|
-
const
|
|
80
|
-
await replace(Path.join(root, 'dist', commitHash, 'packages', 'renderer-process', 'dist', 'rendererProcessMain.js'), 'platform =
|
|
79
|
+
const applyOverridesRendererProcess = async ({ root, commitHash, pathPrefix }) => {
|
|
80
|
+
await replace(Path.join(root, 'dist', commitHash, 'packages', 'renderer-process', 'dist', 'rendererProcessMain.js'), 'platform = Remote;', 'platform = Web');
|
|
81
81
|
await replace(Path.join(root, 'dist', commitHash, 'packages', 'renderer-process', 'dist', 'rendererProcessMain.js'), `/${commitHash}`, `${pathPrefix}/${commitHash}`);
|
|
82
|
+
};
|
|
83
|
+
const applyOverrides = async ({ root, commitHash, pathPrefix }) => {
|
|
84
|
+
await applyOverridesRendererProcess({ root, commitHash, pathPrefix });
|
|
82
85
|
await replace(Path.join(root, 'dist', commitHash, 'packages', 'renderer-worker', 'dist', 'rendererWorkerMain.js'), 'platform = Remote;', 'platform = Web$1;');
|
|
83
86
|
await replace(Path.join(root, 'dist', commitHash, 'packages', 'renderer-worker', 'dist', 'rendererWorkerMain.js'), `/${commitHash}`, `${pathPrefix}/${commitHash}`);
|
|
84
87
|
await replace(Path.join(root, 'dist', commitHash, 'packages', 'renderer-worker', 'dist', 'rendererWorkerMain.js'), `return \`\${assetDir}/extensions/builtin.theme-\${colorThemeId}/color-theme.json\``, `return \`\${assetDir}/themes/\${colorThemeId}.json\``);
|
|
@@ -10,8 +10,8 @@ export const handleWebSocket = async (handle, message) => {
|
|
|
10
10
|
const { url } = message;
|
|
11
11
|
const type = GetTypeFromUrl.getTypeFromUrl(url);
|
|
12
12
|
handle.pause();
|
|
13
|
-
const module =
|
|
14
|
-
|
|
13
|
+
const module = HandleWebSocketModule.load(type);
|
|
14
|
+
module.handleWebSocket(message, handle, type);
|
|
15
15
|
}
|
|
16
16
|
catch (error) {
|
|
17
17
|
DestroyWebSocket.destroySocket(handle);
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import * as HandleWebSocketForExtensionHostHelperProcess from '../HandleWebSocketForExtensionHostHelperProcess/HandleWebSocketForExtensionHostHelperProcess.js';
|
|
2
|
+
import * as HandleWebSocketForSearchProcess from '../HandleWebSocketForSearchProcess/HandleWebSocketForSearchProcess.js';
|
|
3
|
+
import * as HandleWebSocketForSharedProcess from '../HandleWebSocketForSharedProcess/HandleWebSocketForSharedProcess.js';
|
|
4
|
+
import * as HandleWebSocketForTerminalProcess from '../HandleWebSocketForTerminalProcess/HandleWebSocketForTerminalProcess.js';
|
|
5
|
+
import * as HandleWebSocketForUnknown from '../HandleWebSocketForUnknown/HandleWebSocketForUnknown.js';
|
|
1
6
|
import * as ProtocolType from '../ProtocolType/ProtocolType.js';
|
|
2
7
|
import { VError } from '../VError/VError.js';
|
|
3
8
|
export const load = (protocol) => {
|
|
@@ -6,14 +11,14 @@ export const load = (protocol) => {
|
|
|
6
11
|
}
|
|
7
12
|
switch (protocol) {
|
|
8
13
|
case ProtocolType.SharedProcess:
|
|
9
|
-
return
|
|
14
|
+
return HandleWebSocketForSharedProcess;
|
|
10
15
|
case ProtocolType.ExtensionHostHelperProcess:
|
|
11
|
-
return
|
|
16
|
+
return HandleWebSocketForExtensionHostHelperProcess;
|
|
12
17
|
case ProtocolType.TerminalProcess:
|
|
13
|
-
return
|
|
18
|
+
return HandleWebSocketForTerminalProcess;
|
|
14
19
|
case ProtocolType.SearchProcess:
|
|
15
|
-
return
|
|
20
|
+
return HandleWebSocketForSearchProcess;
|
|
16
21
|
default:
|
|
17
|
-
return
|
|
22
|
+
return HandleWebSocketForUnknown;
|
|
18
23
|
}
|
|
19
24
|
};
|
|
@@ -9,5 +9,9 @@ export const isIgnoredError = (error) => {
|
|
|
9
9
|
// parent process is disposed, ignore
|
|
10
10
|
return true;
|
|
11
11
|
}
|
|
12
|
+
if (error && error.code === ErrorCodes.ECONNRESET) {
|
|
13
|
+
// TODO investigate why this error occurs sometimes when reloading the page
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
12
16
|
return false;
|
|
13
17
|
};
|
|
@@ -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-06-
|
|
44
|
+
export const version = '0.30.0';
|
|
45
|
+
export const commit = '1d13af6';
|
|
46
|
+
export const date = '2024-06-13T18:16:21.000Z';
|
|
47
47
|
export const getVersion = () => {
|
|
48
48
|
return version;
|
|
49
49
|
};
|