@lvce-editor/shared-process 0.35.7 → 0.35.9
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/AddCustomPathsToIndexHtml/AddCustomPathsToIndexHtml.js +12 -7
- package/src/parts/ContentSecurityPolicyIframeWorker/ContentSecurityPolicyIframeWorker.js +2 -0
- package/src/parts/GetHeaders/GetHeaders.js +3 -0
- package/src/parts/GetHeadersIframeWorker/GetHeadersIframeWorker.js +9 -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.35.
|
|
3
|
+
"version": "0.35.9",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@lvce-editor/assert": "^1.3.0",
|
|
21
|
-
"@lvce-editor/extension-host-helper-process": "0.35.
|
|
21
|
+
"@lvce-editor/extension-host-helper-process": "0.35.9",
|
|
22
22
|
"@lvce-editor/ipc": "^11.0.1",
|
|
23
23
|
"@lvce-editor/json-rpc": "^4.1.0",
|
|
24
24
|
"@lvce-editor/jsonc-parser": "^1.4.0",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@lvce-editor/preload": "^1.4.0",
|
|
35
35
|
"@lvce-editor/preview-process": "^3.8.1",
|
|
36
36
|
"@lvce-editor/pty-host": "^2.0.0",
|
|
37
|
-
"@lvce-editor/search-process": "^3.
|
|
37
|
+
"@lvce-editor/search-process": "^3.1.0",
|
|
38
38
|
"@lvce-editor/typescript-compile-process": "^1.3.0",
|
|
39
39
|
"open": "^10.1.0",
|
|
40
40
|
"tail": "^2.2.6",
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { pathToFileURL } from 'node:url';
|
|
2
2
|
import * as Platform from '../Platform/Platform.js';
|
|
3
3
|
import * as Preferences from '../Preferences/Preferences.js';
|
|
4
|
+
const getRemoteUrl = (path) => {
|
|
5
|
+
return '/remote' + pathToFileURL(path).toString().slice(7);
|
|
6
|
+
};
|
|
4
7
|
export const addCustomPathsToIndexHtml = async (content) => {
|
|
5
8
|
if (Platform.isProduction) {
|
|
6
9
|
return content;
|
|
@@ -10,15 +13,17 @@ export const addCustomPathsToIndexHtml = async (content) => {
|
|
|
10
13
|
if (preferences['develop.rendererProcessPath']) {
|
|
11
14
|
newContent = newContent
|
|
12
15
|
.toString()
|
|
13
|
-
.replace('/packages/renderer-worker/node_modules/@lvce-editor/renderer-process/dist/rendererProcessMain.js',
|
|
16
|
+
.replace('/packages/renderer-worker/node_modules/@lvce-editor/renderer-process/dist/rendererProcessMain.js', getRemoteUrl(preferences['develop.rendererProcessPath']));
|
|
14
17
|
}
|
|
18
|
+
const config = Object.create(null);
|
|
15
19
|
if (preferences['develop.extensionHostWorkerPath']) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
newContent = newContent.toString().replace('</title>', `</title>
|
|
21
|
-
<script type="application.json" id="Config">${config}</script>`);
|
|
20
|
+
config.extensionHostWorkerUrl = getRemoteUrl(preferences['develop.extensionHostWorkerPath']);
|
|
21
|
+
}
|
|
22
|
+
if (preferences['develop.editorWorkerPath']) {
|
|
23
|
+
config.extensionHostWorkerUrl = getRemoteUrl(preferences['develop.editorWorkerPath']);
|
|
22
24
|
}
|
|
25
|
+
const stringifiedConfig = JSON.stringify(config, null, 2);
|
|
26
|
+
newContent = newContent.toString().replace('</title>', `</title>
|
|
27
|
+
<script type="application.json" id="Config">${stringifiedConfig}</script>`);
|
|
23
28
|
return newContent;
|
|
24
29
|
};
|
|
@@ -5,6 +5,7 @@ import * as GetHeadersDefault from '../GetHeadersDefault/GetHeadersDefault.js';
|
|
|
5
5
|
import * as GetHeadersEditorWorker from '../GetHeadersEditorWorker/GetHeadersEditorWorker.js';
|
|
6
6
|
import * as GetHeadersEmbedsWorker from '../GetHeadersEmbedsWorker/GetHeadersEmbedsWorker.js';
|
|
7
7
|
import * as GetHeadersExtensionHostWorker from '../GetHeadersExtensionHostWorker/GetHeadersExtensionHostWorker.js';
|
|
8
|
+
import * as GetHeadersIframeWorker from '../GetHeadersIframeWorker/GetHeadersIframeWorker.js';
|
|
8
9
|
import * as GetHeadersMainFrame from '../GetHeadersMainFrame/GetHeadersMainFrame.js';
|
|
9
10
|
import * as GetHeadersOtherWorker from '../GetHeadersOtherWorker/GetHeadersOtherWorker.js';
|
|
10
11
|
import * as GetHeadersRendererWorker from '../GetHeadersRendererWorker/GetHeadersRendererWorker.js';
|
|
@@ -46,6 +47,8 @@ const getExtraHeaders = (pathName, fileExtension) => {
|
|
|
46
47
|
case 'searchWorkerMain.js':
|
|
47
48
|
case 'searchWorkerMain.ts':
|
|
48
49
|
return GetHeadersSearchWorker.getHeadersSearchWorker();
|
|
50
|
+
case 'iframeWorkerMain.js':
|
|
51
|
+
return GetHeadersIframeWorker.getHeadersIframeWorker();
|
|
49
52
|
default:
|
|
50
53
|
if (pathName.endsWith('WorkerMain.js') || pathName.endsWith('WorkerMain.ts')) {
|
|
51
54
|
return GetHeadersOtherWorker.getHeadersOtherWorker(pathName);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as ContentSecurityPolicyIframeWorker from '../ContentSecurityPolicyIframeWorker/ContentSecurityPolicyIframeWorker.js';
|
|
2
|
+
import * as CrossOriginEmbedderPolicy from '../CrossOriginEmbedderPolicy/CrossOriginEmbedderPolicy.js';
|
|
3
|
+
import * as HttpHeader from '../HttpHeader/HttpHeader.js';
|
|
4
|
+
export const getHeadersIframeWorker = () => {
|
|
5
|
+
return {
|
|
6
|
+
[HttpHeader.CrossOriginEmbedderPolicy]: CrossOriginEmbedderPolicy.value,
|
|
7
|
+
[HttpHeader.ContentSecurityPolicy]: ContentSecurityPolicyIframeWorker.value,
|
|
8
|
+
};
|
|
9
|
+
};
|
|
@@ -41,9 +41,9 @@ export const getAppImageName = () => {
|
|
|
41
41
|
export const getSetupName = () => {
|
|
42
42
|
return 'Lvce-Setup';
|
|
43
43
|
};
|
|
44
|
-
export const version = '0.35.
|
|
45
|
-
export const commit = '
|
|
46
|
-
export const date = '2024-10-
|
|
44
|
+
export const version = '0.35.9';
|
|
45
|
+
export const commit = '19a90fe';
|
|
46
|
+
export const date = '2024-10-06T14:35:33.000Z';
|
|
47
47
|
export const getVersion = () => {
|
|
48
48
|
return version;
|
|
49
49
|
};
|