@lvce-editor/shared-process 0.81.3 → 0.81.5
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/config/defaultSettings.json +1 -1
- package/package.json +2 -2
- package/src/parts/BuiltinExtensionsPath/BuiltinExtensionsPath.js +1 -1
- package/src/parts/GetResolvedTestPath/GetResolvedTestPath.js +12 -0
- package/src/parts/GetTestPath/GetTestPath.js +2 -10
- package/src/parts/GetTestRequestResponse/GetTestRequestResponse.js +2 -3
- package/src/parts/IsEnoentErrorWindows/IsEnoentErrorWindows.js +3 -1
- package/src/parts/Platform/Platform.js +3 -3
- package/src/parts/PlatformPaths/PlatformPaths.js +3 -7
- package/src/parts/Preferences/Preferences.js +5 -1
- package/src/parts/PreloadUrl/PreloadUrl.js +1 -1
- package/src/parts/Workers/Workers.json +7 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/shared-process",
|
|
3
|
-
"version": "0.81.
|
|
3
|
+
"version": "0.81.5",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@lvce-editor/assert": "1.5.1",
|
|
21
21
|
"@lvce-editor/auth-process": "1.6.0",
|
|
22
|
-
"@lvce-editor/extension-host-helper-process": "0.81.
|
|
22
|
+
"@lvce-editor/extension-host-helper-process": "0.81.5",
|
|
23
23
|
"@lvce-editor/ipc": "16.0.0",
|
|
24
24
|
"@lvce-editor/json-rpc": "8.0.0",
|
|
25
25
|
"@lvce-editor/jsonc-parser": "1.5.0",
|
|
@@ -2,6 +2,6 @@ import { join } from 'path';
|
|
|
2
2
|
import { fileURLToPath } from 'url';
|
|
3
3
|
export const getBuiltinExtensionsPath = () => {
|
|
4
4
|
const staticServerPath = fileURLToPath(import.meta.resolve('@lvce-editor/static-server'));
|
|
5
|
-
const builtinExtensionsPath = join(staticServerPath, '..', '..', 'static', '
|
|
5
|
+
const builtinExtensionsPath = join(staticServerPath, '..', '..', 'static', '2e6d065', 'extensions');
|
|
6
6
|
return builtinExtensionsPath;
|
|
7
7
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { isAbsolute, join } from 'node:path';
|
|
2
|
+
import * as Root from '../Root/Root.js';
|
|
3
|
+
export const getResolvedTestPath = () => {
|
|
4
|
+
const { TEST_PATH } = process.env;
|
|
5
|
+
if (TEST_PATH) {
|
|
6
|
+
if (isAbsolute(TEST_PATH)) {
|
|
7
|
+
return TEST_PATH;
|
|
8
|
+
}
|
|
9
|
+
return join(process.cwd(), TEST_PATH);
|
|
10
|
+
}
|
|
11
|
+
return join(Root.root, 'packages', 'extension-host-worker-tests');
|
|
12
|
+
};
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as Root from '../Root/Root.js';
|
|
1
|
+
import * as GetResolvedTestPath from '../GetResolvedTestPath/GetResolvedTestPath.js';
|
|
3
2
|
export const getTestPath = () => {
|
|
4
|
-
|
|
5
|
-
const testPath = process.env.TEST_PATH;
|
|
6
|
-
if (isAbsolute(testPath)) {
|
|
7
|
-
return testPath;
|
|
8
|
-
}
|
|
9
|
-
return join(process.cwd(), testPath);
|
|
10
|
-
}
|
|
11
|
-
return join(Root.root, 'packages', 'extension-host-worker-tests');
|
|
3
|
+
return GetResolvedTestPath.getResolvedTestPath();
|
|
12
4
|
};
|
|
@@ -7,7 +7,6 @@ import * as CrossOriginEmbedderPolicy from '../CrossOriginEmbedderPolicy/CrossOr
|
|
|
7
7
|
import * as CrossOriginOpenerPolicy from '../CrossOriginOpenerPolicy/CrossOriginOpenerPolicy.js';
|
|
8
8
|
import * as CrossOriginResourcePolicy from '../CrossOriginResourcePolicy/CrossOriginResourcePolicy.js';
|
|
9
9
|
import * as GetContentResponse from '../GetContentResponse/GetContentResponse.js';
|
|
10
|
-
import * as GetMultipleChoiceResponse from '../GetMultipleChoiceResponse/GetMultipleChoiceResponse.js';
|
|
11
10
|
import * as GetPathName from '../GetPathName/GetPathName.js';
|
|
12
11
|
import * as GetTestPath from '../GetTestPath/GetTestPath.js';
|
|
13
12
|
import * as GetNotFoundResponse from '../GetNotFoundResponse/GetNotFoundResponse.js';
|
|
@@ -34,13 +33,13 @@ export const getTestRequestResponse = async (request, indexHtmlPath) => {
|
|
|
34
33
|
const testPathSrc = join(testPath, 'src');
|
|
35
34
|
const body = await CreateTestOverview.createTestOverview(testPathSrc);
|
|
36
35
|
const headers = {
|
|
37
|
-
[HttpHeader.CacheControl]: '
|
|
36
|
+
[HttpHeader.CacheControl]: 'no-store',
|
|
38
37
|
[HttpHeader.CrossOriginEmbedderPolicy]: CrossOriginEmbedderPolicy.value,
|
|
39
38
|
[HttpHeader.CrossOriginOpenerPolicy]: CrossOriginOpenerPolicy.value,
|
|
40
39
|
[HttpHeader.ContentSecurityPolicy]: "default-src 'none'",
|
|
41
40
|
[HttpHeader.ContentType]: 'text/html',
|
|
42
41
|
};
|
|
43
|
-
return
|
|
42
|
+
return GetContentResponse.getContentResponse(body, headers);
|
|
44
43
|
}
|
|
45
44
|
return GetNotFoundResponse.getNotFoundResponse();
|
|
46
45
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export const isEnoentErrorWindows = (error) => {
|
|
2
|
-
return error &&
|
|
2
|
+
return (error &&
|
|
3
|
+
error.message &&
|
|
4
|
+
(error.message.includes('The system cannot find the file specified.') || error.message.includes('The system cannot find the path specified.')));
|
|
3
5
|
};
|
|
@@ -41,9 +41,9 @@ export const getAppImageName = () => {
|
|
|
41
41
|
export const getSetupName = () => {
|
|
42
42
|
return 'Lvce-Setup';
|
|
43
43
|
};
|
|
44
|
-
export const version = '0.81.
|
|
45
|
-
export const commit = '
|
|
46
|
-
export const date = '2026-05-
|
|
44
|
+
export const version = '0.81.5';
|
|
45
|
+
export const commit = '2e6d065';
|
|
46
|
+
export const date = '2026-05-18T15:19:33.000Z';
|
|
47
47
|
export const getVersion = () => {
|
|
48
48
|
return version;
|
|
49
49
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { homedir, tmpdir } from 'node:os';
|
|
2
|
-
import {
|
|
2
|
+
import { join, resolve, sep } from 'node:path';
|
|
3
3
|
import { pathToFileURL } from 'node:url';
|
|
4
4
|
import { xdgCache, xdgConfig, xdgData, xdgState } from 'xdg-basedir';
|
|
5
|
+
import * as GetResolvedTestPath from '../GetResolvedTestPath/GetResolvedTestPath.js';
|
|
5
6
|
import * as Path from '../Path/Path.js';
|
|
6
7
|
import * as Platform from '../Platform/Platform.js';
|
|
7
8
|
import * as Process from '../Process/Process.js';
|
|
@@ -78,12 +79,7 @@ export const getDefaultSettingsPath = () => {
|
|
|
78
79
|
return Path.join(Root.root, 'config', 'defaultSettings.json');
|
|
79
80
|
};
|
|
80
81
|
export const getTestPath = () => {
|
|
81
|
-
|
|
82
|
-
const absolutePath = isAbsolute(env.TEST_PATH) ? env.TEST_PATH : Path.join(process.cwd(), env.TEST_PATH);
|
|
83
|
-
const testPath = '/remote' + pathToFileURL(absolutePath).toString().slice(7);
|
|
84
|
-
return testPath;
|
|
85
|
-
}
|
|
86
|
-
const absolutePath = join(Root.root, 'packages/extension-host-worker-tests');
|
|
82
|
+
const absolutePath = GetResolvedTestPath.getResolvedTestPath();
|
|
87
83
|
const testPath = '/remote' + pathToFileURL(absolutePath).toString().slice(7);
|
|
88
84
|
return testPath;
|
|
89
85
|
};
|
|
@@ -5,6 +5,9 @@ import * as PlatformPaths from '../PlatformPaths/PlatformPaths.js';
|
|
|
5
5
|
import * as Process from '../Process/Process.js';
|
|
6
6
|
import { VError } from '../VError/VError.js';
|
|
7
7
|
// TODO need jsonc parser for settings with comments
|
|
8
|
+
const builtinPreferences = {
|
|
9
|
+
'window.titleBarStyle': 'custom',
|
|
10
|
+
};
|
|
8
11
|
export const getUserPreferences = async () => {
|
|
9
12
|
try {
|
|
10
13
|
const userSettingsPath = PlatformPaths.getUserSettingsPath();
|
|
@@ -63,6 +66,7 @@ export const getAll = async () => {
|
|
|
63
66
|
// TODO separate backend and frontend preferences, ui only needs frontend preferences
|
|
64
67
|
const preferences = {
|
|
65
68
|
...defaultPreferences,
|
|
69
|
+
...builtinPreferences,
|
|
66
70
|
...userPreferences,
|
|
67
71
|
...overrides,
|
|
68
72
|
};
|
|
@@ -87,7 +91,7 @@ export const getAllSafe = async () => {
|
|
|
87
91
|
}
|
|
88
92
|
catch (error) {
|
|
89
93
|
Logger.error(`[shared-process] Failed to load preferences on startup, continuing with defaults: ${error}`);
|
|
90
|
-
return
|
|
94
|
+
return builtinPreferences;
|
|
91
95
|
}
|
|
92
96
|
};
|
|
93
97
|
// TODO when preferences cannot be loaded, ui should show useful error message
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { join } from 'node:path';
|
|
2
2
|
import * as Root from '../Root/Root.js';
|
|
3
3
|
export const getPreloadUrl = () => {
|
|
4
|
-
return join(Root.root, 'static', '
|
|
4
|
+
return join(Root.root, 'static', '2e6d065', 'packages', 'preload', 'dist', 'index.js');
|
|
5
5
|
};
|
|
@@ -92,11 +92,16 @@
|
|
|
92
92
|
{
|
|
93
93
|
"id": "chatViewModelWorker",
|
|
94
94
|
"fileName": "chatViewModelWorkerMain.js",
|
|
95
|
-
"contentSecurityPolicy": [
|
|
95
|
+
"contentSecurityPolicy": [
|
|
96
|
+
"default-src 'none'",
|
|
97
|
+
"connect-src https://openrouter.ai https://api.openai.com https://lvce-editor.dev",
|
|
98
|
+
"sandbox allow-same-origin"
|
|
99
|
+
],
|
|
96
100
|
"defaultPath": "/packages/renderer-worker/node_modules/@lvce-editor/chat-view-model/dist/chatViewModelWorkerMain.js",
|
|
97
101
|
"productionPath": "/packages/chat-view-model/dist/chatViewModelWorkerMain.js",
|
|
98
102
|
"settingName": "develop.chatViewModelWorkerPath",
|
|
99
|
-
"hotReloadCommand": ""
|
|
103
|
+
"hotReloadCommand": "",
|
|
104
|
+
"TODO": "remove connect src from this worker"
|
|
100
105
|
},
|
|
101
106
|
{
|
|
102
107
|
"id": "chatView",
|