@lvce-editor/shared-process 0.69.5 → 0.70.1
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 +4 -4
- package/src/parts/BuiltinExtensionsPath/BuiltinExtensionsPath.js +1 -1
- package/src/parts/ExportStatic/ExportStatic.js +5 -1
- package/src/parts/ExtensionManagement/ExtensionManagement.js +10 -6
- package/src/parts/FileSystem/FileSystem.js +11 -4
- package/src/parts/Platform/Platform.js +3 -3
- package/src/parts/PlatformPaths/PlatformPaths.ipc.js +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/shared-process",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.70.1",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@lvce-editor/assert": "1.5.1",
|
|
21
|
-
"@lvce-editor/extension-host-helper-process": "0.
|
|
22
|
-
"@lvce-editor/ipc": "14.
|
|
21
|
+
"@lvce-editor/extension-host-helper-process": "0.70.1",
|
|
22
|
+
"@lvce-editor/ipc": "14.7.0",
|
|
23
23
|
"@lvce-editor/json-rpc": "7.0.0",
|
|
24
24
|
"@lvce-editor/jsonc-parser": "1.5.0",
|
|
25
25
|
"@lvce-editor/pretty-error": "2.0.0",
|
|
26
|
-
"@lvce-editor/rpc-registry": "5.
|
|
26
|
+
"@lvce-editor/rpc-registry": "5.11.0",
|
|
27
27
|
"@lvce-editor/verror": "1.7.0",
|
|
28
28
|
"is-object": "^1.0.2",
|
|
29
29
|
"xdg-basedir": "^5.1.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', '6e66e1c', 'extensions');
|
|
6
6
|
return builtinExtensionsPath;
|
|
7
7
|
};
|
|
@@ -99,7 +99,11 @@ const applyOverrides = async ({ root, commitHash, pathPrefix, serverStaticPath }
|
|
|
99
99
|
await replace(Path.join(root, 'dist', commitHash, 'packages', 'extension-host-worker', 'dist', 'extensionHostWorkerMain.js'), `return \`\${assetDir}/extensions/builtin.theme-\${colorThemeId}/color-theme.json\``, `return \`\${assetDir}/themes/\${colorThemeId}.json\``);
|
|
100
100
|
await replace(Path.join(root, 'dist', commitHash, 'packages', 'extension-host-worker', 'dist', 'extensionHostWorkerMain.js'), `/${commitHash}`, `${pathPrefix}/${commitHash}`);
|
|
101
101
|
await replace(Path.join(root, 'dist', commitHash, 'packages', 'extension-host-worker', 'dist', 'extensionHostWorkerMain.js'), `const platform = Remote`, `const platform = Web`);
|
|
102
|
-
await replace(
|
|
102
|
+
// await replace(
|
|
103
|
+
// Path.join(root, 'dist', commitHash, 'packages', 'extension-host-worker', 'dist', 'extensionHostWorkerMain.js'),
|
|
104
|
+
// `return \`\${assetDir}/extensions/builtin.\${iconThemeId}/icon-theme.json\``,
|
|
105
|
+
// `return \`\${assetDir}/icon-themes/\${iconThemeId}.json\``,
|
|
106
|
+
// )
|
|
103
107
|
const extensionDirents = await FileSystem.readDir(Path.join(serverStaticPath, commitHash, 'extensions'));
|
|
104
108
|
const languageBasicsDirents = extensionDirents.filter(isLanguageBasics);
|
|
105
109
|
const themeDirents = extensionDirents.filter(isTheme);
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
|
-
import { mkdir, readFile,
|
|
2
|
+
import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
3
3
|
import { dirname } from 'node:path';
|
|
4
4
|
import * as BuiltinExtensionsPath from '../BuiltinExtensionsPath/BuiltinExtensionsPath.js';
|
|
5
5
|
import * as ExtensionManifestInputType from '../ExtensionManifestInputType/ExtensionManifestInputType.js';
|
|
6
6
|
import * as ExtensionManifests from '../ExtensionManifests/ExtensionManifests.js';
|
|
7
7
|
import * as GetEtagFromStats from '../GetEtagFromStats/GetEtagFromStats.js';
|
|
8
8
|
import * as GetExtensionEtags from '../GetExtensionEtags/GetExtensionEtags.js';
|
|
9
|
-
import * as Path from '../Path/Path.js';
|
|
10
9
|
import * as PlatformPaths from '../PlatformPaths/PlatformPaths.js';
|
|
11
10
|
import { VError } from '../VError/VError.js';
|
|
12
11
|
export const enable = async (id) => {
|
|
13
12
|
try {
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
const disabledExtensionsJsonPath = PlatformPaths.getDisabledExtensionsJsonPath();
|
|
14
|
+
const oldDisabledExtensionIds = await getDisabledExtensionIds();
|
|
15
|
+
if (!oldDisabledExtensionIds.includes(id)) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const newDisabledExtensionIds = oldDisabledExtensionIds.filter((extensionId) => extensionId !== id);
|
|
19
|
+
const content = getNewDisabledExtensionContent(newDisabledExtensionIds);
|
|
20
|
+
await mkdir(dirname(disabledExtensionsJsonPath), { recursive: true });
|
|
21
|
+
await writeFile(disabledExtensionsJsonPath, content);
|
|
18
22
|
}
|
|
19
23
|
catch (error) {
|
|
20
24
|
throw new VError(error, `Failed to enable extension "${id}"`);
|
|
@@ -52,18 +52,25 @@ export const readFile = async (path, encoding = EncodingType.Utf8) => {
|
|
|
52
52
|
throw new VError(error, `Failed to read file "${path}"`);
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
|
-
|
|
55
|
+
const toPath = (uri) => {
|
|
56
|
+
if (uri.startsWith('file://')) {
|
|
57
|
+
return fileURLToPath(uri);
|
|
58
|
+
}
|
|
59
|
+
return uri;
|
|
60
|
+
};
|
|
61
|
+
export const readJson = async (uri) => {
|
|
56
62
|
try {
|
|
57
|
-
Assert.string(
|
|
63
|
+
Assert.string(uri);
|
|
64
|
+
const path = toPath(uri);
|
|
58
65
|
const content = await fs.readFile(path, 'utf8');
|
|
59
66
|
const parsed = JSON.parse(content);
|
|
60
67
|
return parsed;
|
|
61
68
|
}
|
|
62
69
|
catch (error) {
|
|
63
70
|
if (IsEnoentError.isEnoentError(error)) {
|
|
64
|
-
throw new FileNotFoundError(
|
|
71
|
+
throw new FileNotFoundError(uri);
|
|
65
72
|
}
|
|
66
|
-
throw new VError(error, `Failed to read file as json "${
|
|
73
|
+
throw new VError(error, `Failed to read file as json "${uri}"`);
|
|
67
74
|
}
|
|
68
75
|
};
|
|
69
76
|
export const readFileAsBuffer = async (path) => {
|
|
@@ -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 = '
|
|
44
|
+
export const version = '0.70.1';
|
|
45
|
+
export const commit = '6e66e1c';
|
|
46
|
+
export const date = '2026-01-03T12:13:32.000Z';
|
|
47
47
|
export const getVersion = () => {
|
|
48
48
|
return version;
|
|
49
49
|
};
|
|
@@ -9,6 +9,7 @@ export const Commands = {
|
|
|
9
9
|
getConfigDir: PlatformPaths.getConfigDir,
|
|
10
10
|
getDataDir: PlatformPaths.getDataDir,
|
|
11
11
|
getDisabledExtensionsPath: PlatformPaths.getDisabledExtensionsPath,
|
|
12
|
+
getDisabledExtensionsJsonPath: PlatformPaths.getDisabledExtensionsJsonPath,
|
|
12
13
|
getDownloadDir: PlatformPaths.getDownloadDir,
|
|
13
14
|
getExtensionsPath: PlatformPaths.getExtensionsPath,
|
|
14
15
|
getHomeDir: PlatformPaths.getHomeDir,
|