@lvce-editor/shared-process 0.34.5 → 0.34.6
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/shared-process",
|
|
3
|
-
"version": "0.34.
|
|
3
|
+
"version": "0.34.6",
|
|
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.34.
|
|
21
|
+
"@lvce-editor/extension-host-helper-process": "0.34.6",
|
|
22
22
|
"@lvce-editor/ipc": "^11.0.1",
|
|
23
23
|
"@lvce-editor/json-rpc": "^4.0.0",
|
|
24
24
|
"@lvce-editor/jsonc-parser": "^1.4.0",
|
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
2
|
import { isAbsolute, join } from 'node:path';
|
|
3
3
|
import * as FileSystem from '../FileSystem/FileSystem.js';
|
|
4
|
+
import * as GetContentSecurityPolicy from '../GetContentSecurityPolicy/GetContentSecurityPolicy.js';
|
|
4
5
|
import * as JsonFile from '../JsonFile/JsonFile.js';
|
|
5
6
|
import * as Path from '../Path/Path.js';
|
|
7
|
+
const staticContentSecurityPolicy = GetContentSecurityPolicy.getContentSecurityPolicy([
|
|
8
|
+
`default-src 'none'`,
|
|
9
|
+
`font-src 'self'`,
|
|
10
|
+
`img-src 'self' https: data: blob:`, // TODO maybe disallow https and data images
|
|
11
|
+
`manifest-src 'self'`,
|
|
12
|
+
`media-src 'self'`,
|
|
13
|
+
`script-src 'self'`,
|
|
14
|
+
`style-src 'self'`,
|
|
15
|
+
`frame-src 'self' blob:`,
|
|
16
|
+
]);
|
|
6
17
|
const readExtensionManifest = async (path) => {
|
|
7
18
|
const json = await JsonFile.readJson(path);
|
|
8
19
|
return { ...json, path };
|
|
@@ -137,13 +148,16 @@ const applyOverrides = async ({ root, commitHash, pathPrefix, serverStaticPath }
|
|
|
137
148
|
const iconThemeId = iconThemeDirent.slice('builtin.'.length);
|
|
138
149
|
await FileSystem.copy(Path.join(serverStaticPath, commitHash, 'extensions', iconThemeDirent, 'icon-theme.json'), Path.join(root, 'dist', commitHash, 'icon-themes', `${iconThemeId}.json`));
|
|
139
150
|
}
|
|
140
|
-
|
|
151
|
+
const indexHtmlPath = Path.join(root, 'dist', 'index.html');
|
|
152
|
+
await replace(indexHtmlPath, `/${commitHash}`, `${pathPrefix}/${commitHash}`);
|
|
153
|
+
await replace(indexHtmlPath, '</title>', `</title>
|
|
154
|
+
<meta http-equiv="Content-Security-Policy" content="${staticContentSecurityPolicy}">`);
|
|
141
155
|
if (pathPrefix) {
|
|
142
|
-
await replace(
|
|
156
|
+
await replace(indexHtmlPath, '</title>', `</title>
|
|
143
157
|
<link rel="shortcut icon" type="image/x-icon" href="${pathPrefix}/favicon.ico">`);
|
|
144
158
|
}
|
|
145
159
|
else {
|
|
146
|
-
await replace(
|
|
160
|
+
await replace(indexHtmlPath, '</title>', `</title>
|
|
147
161
|
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">`);
|
|
148
162
|
}
|
|
149
163
|
if (pathPrefix) {
|
|
@@ -41,9 +41,9 @@ export const getAppImageName = () => {
|
|
|
41
41
|
export const getSetupName = () => {
|
|
42
42
|
return 'Lvce-Setup';
|
|
43
43
|
};
|
|
44
|
-
export const version = '0.34.
|
|
45
|
-
export const commit = '
|
|
46
|
-
export const date = '2024-09-
|
|
44
|
+
export const version = '0.34.6';
|
|
45
|
+
export const commit = 'a8931f9';
|
|
46
|
+
export const date = '2024-09-15T14:22:54.000Z';
|
|
47
47
|
export const getVersion = () => {
|
|
48
48
|
return version;
|
|
49
49
|
};
|