@lvce-editor/shared-process 0.30.1 → 0.30.3
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/ContentSecurityPolicyDocument/ContentSecurityPolicyDocument.js +2 -0
- package/src/parts/GetElectronFileResponseContent/GetElectronFileResponseContent.js +6 -2
- package/src/parts/GetIcon/GetIcon.js +5 -4
- package/src/parts/GetTypeScriptPath/GetTypeScriptPath.js +3 -3
- package/src/parts/Platform/Platform.js +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/shared-process",
|
|
3
|
-
"version": "0.30.
|
|
3
|
+
"version": "0.30.3",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@lvce-editor/assert": "^1.2.0",
|
|
21
|
-
"@lvce-editor/extension-host-helper-process": "0.30.
|
|
22
|
-
"@lvce-editor/ipc": "^9.
|
|
21
|
+
"@lvce-editor/extension-host-helper-process": "0.30.3",
|
|
22
|
+
"@lvce-editor/ipc": "^9.3.0",
|
|
23
23
|
"@lvce-editor/json-rpc": "^1.3.0",
|
|
24
24
|
"@lvce-editor/jsonc-parser": "^1.4.0",
|
|
25
25
|
"@lvce-editor/pretty-error": "^1.5.0",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as GetContentSecurityPolicy from '../GetContentSecurityPolicy/GetContentSecurityPolicy.js';
|
|
2
|
+
import * as IsElectron from '../IsElectron/IsElectron.js';
|
|
2
3
|
export const value = GetContentSecurityPolicy.getContentSecurityPolicy([
|
|
3
4
|
`default-src 'none'`,
|
|
4
5
|
`font-src 'self'`,
|
|
@@ -6,4 +7,5 @@ export const value = GetContentSecurityPolicy.getContentSecurityPolicy([
|
|
|
6
7
|
`media-src 'self'`,
|
|
7
8
|
`script-src 'self'`,
|
|
8
9
|
`style-src 'self'`,
|
|
10
|
+
...(IsElectron.isElectron ? [] : [`manifest-src 'self'`]),
|
|
9
11
|
]);
|
|
@@ -8,7 +8,9 @@ export const getElectronFileResponseContent = async (request, absolutePath, url)
|
|
|
8
8
|
if (ShouldTranspileTypescript.shouldTranspileTypescript(request, url)) {
|
|
9
9
|
const content = await readFile(absolutePath);
|
|
10
10
|
const newContent = await TranspileTypeScript.transpileTypeScript(content.toString());
|
|
11
|
-
|
|
11
|
+
const newContentString = newContent.outputText;
|
|
12
|
+
const newContentBuffer = Buffer.from(newContentString);
|
|
13
|
+
return newContentBuffer;
|
|
12
14
|
}
|
|
13
15
|
let content = await readFile(absolutePath);
|
|
14
16
|
if (!Platform.isProduction && url === `${Platform.scheme}://-/`) {
|
|
@@ -18,12 +20,14 @@ export const getElectronFileResponseContent = async (request, absolutePath, url)
|
|
|
18
20
|
if (!Platform.isProduction && url === '/') {
|
|
19
21
|
const preferences = await Preferences.getUserPreferences();
|
|
20
22
|
if (preferences['develop.rendererProcessPath']) {
|
|
21
|
-
console.log('custom renderer process path');
|
|
22
23
|
// @ts-ignore
|
|
23
24
|
content = content
|
|
24
25
|
.toString()
|
|
25
26
|
.replace('/packages/renderer-worker/node_modules/@lvce-editor/renderer-process/dist/rendererProcessMain.js', '/remote' + pathToFileURL(preferences['develop.rendererProcessPath']).toString().slice(7));
|
|
26
27
|
}
|
|
27
28
|
}
|
|
29
|
+
if (typeof content === 'string') {
|
|
30
|
+
content = Buffer.from(content);
|
|
31
|
+
}
|
|
28
32
|
return content;
|
|
29
33
|
};
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import * as IsLinux from '../IsLinux/IsLinux.js';
|
|
2
|
+
import * as IsProduction from '../IsProduction/IsProduction.js';
|
|
2
3
|
import * as IsWindows from '../IsWindows/IsWindows.js';
|
|
3
4
|
import * as Path from '../Path/Path.js';
|
|
4
5
|
import * as Platform from '../Platform/Platform.js';
|
|
5
6
|
import * as Root from '../Root/Root.js';
|
|
6
7
|
export const getIcon = () => {
|
|
7
|
-
if (!
|
|
8
|
+
if (!IsProduction.isProduction && IsLinux.isLinux) {
|
|
8
9
|
return Path.join(Root.root, 'packages', 'build', 'files', 'icon.png');
|
|
9
10
|
}
|
|
10
|
-
if (!
|
|
11
|
+
if (!IsProduction.isProduction && IsWindows.isWindows) {
|
|
11
12
|
return Path.join(Root.root, 'packages', 'build', 'files', 'icon.png');
|
|
12
13
|
}
|
|
13
|
-
if (
|
|
14
|
+
if (IsProduction.isProduction && Platform.isArchLinux) {
|
|
14
15
|
return Path.join(Root.root, 'static', 'icons', 'icon.png');
|
|
15
16
|
}
|
|
16
|
-
if (
|
|
17
|
+
if (IsProduction.isProduction && Platform.isAppImage) {
|
|
17
18
|
return Path.join(Root.root, 'static', 'icons', 'icon.png');
|
|
18
19
|
}
|
|
19
20
|
return undefined;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { join } from 'node:path';
|
|
2
|
+
import { pathToFileURL } from 'node:url';
|
|
2
3
|
import * as IsBuiltServer from '../IsBuiltServer/IsBuiltServer.js';
|
|
4
|
+
import * as IsProduction from '../IsProduction/IsProduction.js';
|
|
3
5
|
import * as PlatformPaths from '../PlatformPaths/PlatformPaths.js';
|
|
4
|
-
import * as Platform from '../Platform/Platform.js';
|
|
5
|
-
import { pathToFileURL } from 'node:url';
|
|
6
6
|
export const getTypeScriptUri = () => {
|
|
7
|
-
if (!
|
|
7
|
+
if (!IsProduction.isProduction || IsBuiltServer.isBuiltServer) {
|
|
8
8
|
return 'typescript';
|
|
9
9
|
}
|
|
10
10
|
const typescriptPath = join(PlatformPaths.getBuiltinExtensionsPath(), 'builtin.language-features-typescript', 'node', 'node_modules', 'typescript', 'lib', 'typescript.js');
|
|
@@ -8,7 +8,7 @@ export const isWindows = platform === 'win32';
|
|
|
8
8
|
export const isMacOs = platform === 'darwin';
|
|
9
9
|
export const isDeb = false;
|
|
10
10
|
export const isLinux = platform === 'linux';
|
|
11
|
-
export const isProduction =
|
|
11
|
+
export const isProduction = true;
|
|
12
12
|
export const isArchLinux = false;
|
|
13
13
|
export const isAppImage = false;
|
|
14
14
|
export const scheme = 'lvce-oss';
|
|
@@ -41,9 +41,9 @@ export const getAppImageName = () => {
|
|
|
41
41
|
export const getSetupName = () => {
|
|
42
42
|
return 'Lvce-Setup';
|
|
43
43
|
};
|
|
44
|
-
export const version = '0.30.
|
|
45
|
-
export const commit = '
|
|
46
|
-
export const date = '2024-06-
|
|
44
|
+
export const version = '0.30.3';
|
|
45
|
+
export const commit = '0a84d51';
|
|
46
|
+
export const date = '2024-06-23T14:15:55.000Z';
|
|
47
47
|
export const getVersion = () => {
|
|
48
48
|
return version;
|
|
49
49
|
};
|