@lvce-editor/shared-process 0.105.8 → 0.105.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 +2 -2
- package/src/parts/BuiltinExtensionsPath/BuiltinExtensionsPath.js +1 -1
- package/src/parts/LinkedWorkerPreferences/LinkedWorkerPreferences.js +43 -0
- package/src/parts/Platform/Platform.js +3 -3
- package/src/parts/Preferences/Preferences.js +7 -1
- package/src/parts/PreloadUrl/PreloadUrl.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/shared-process",
|
|
3
|
-
"version": "0.105.
|
|
3
|
+
"version": "0.105.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.9.0",
|
|
21
|
-
"@lvce-editor/extension-host-helper-process": "0.105.
|
|
21
|
+
"@lvce-editor/extension-host-helper-process": "0.105.9",
|
|
22
22
|
"@lvce-editor/ipc": "16.12.0",
|
|
23
23
|
"@lvce-editor/json-rpc": "8.7.0",
|
|
24
24
|
"@lvce-editor/jsonc-parser": "1.5.0",
|
|
@@ -3,6 +3,6 @@ import { fileURLToPath } from 'url'
|
|
|
3
3
|
|
|
4
4
|
export const getBuiltinExtensionsPath = () => {
|
|
5
5
|
const staticServerPath = fileURLToPath(import.meta.resolve('@lvce-editor/static-server'))
|
|
6
|
-
const builtinExtensionsPath = join(staticServerPath, '..', '..', 'static', '
|
|
6
|
+
const builtinExtensionsPath = join(staticServerPath, '..', '..', 'static', 'b9ff48c', 'extensions')
|
|
7
7
|
return builtinExtensionsPath
|
|
8
8
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import workers from '../Workers/Workers.json' with { type: 'json' }
|
|
2
|
+
import * as FileSystem from '../FileSystem/FileSystem.js'
|
|
3
|
+
import * as Path from '../Path/Path.js'
|
|
4
|
+
import * as TransientLinkedExtensions from '../TransientLinkedExtensions/TransientLinkedExtensions.js'
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
const getPackageName = (worker) => {
|
|
12
|
+
const marker = '/node_modules/'
|
|
13
|
+
const index = worker.defaultPath.indexOf(marker)
|
|
14
|
+
if (index === -1) {
|
|
15
|
+
return ''
|
|
16
|
+
}
|
|
17
|
+
const packagePath = worker.defaultPath.slice(index + marker.length)
|
|
18
|
+
const parts = packagePath.split('/')
|
|
19
|
+
return packagePath.startsWith('@') ? parts.slice(0, 2).join('/') : parts[0]
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const workersByPackageName = new Map((workers).map((worker) => [getPackageName(worker), worker]))
|
|
23
|
+
|
|
24
|
+
const getPackageJson = async (path) => {
|
|
25
|
+
try {
|
|
26
|
+
return await FileSystem.readJson(Path.join(path, 'package.json'))
|
|
27
|
+
} catch {
|
|
28
|
+
return undefined
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const getLinkedWorkerPreferences = async () => {
|
|
33
|
+
const preferences = {}
|
|
34
|
+
for (const link of TransientLinkedExtensions.getLinkedExtensions()) {
|
|
35
|
+
const packageJson = await getPackageJson(link.resolvedPath)
|
|
36
|
+
const worker = workersByPackageName.get(packageJson?.name)
|
|
37
|
+
if (!worker || typeof packageJson.main !== 'string') {
|
|
38
|
+
continue
|
|
39
|
+
}
|
|
40
|
+
preferences[worker.settingName] = Path.join(link.resolvedPath, packageJson.main)
|
|
41
|
+
}
|
|
42
|
+
return preferences
|
|
43
|
+
}
|
|
@@ -61,11 +61,11 @@ export const getSetupName = () => {
|
|
|
61
61
|
return 'Lvce-Setup'
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
export const version = '0.105.
|
|
64
|
+
export const version = '0.105.9'
|
|
65
65
|
|
|
66
|
-
export const commit = '
|
|
66
|
+
export const commit = 'b9ff48c'
|
|
67
67
|
|
|
68
|
-
export const date = '2026-08-
|
|
68
|
+
export const date = '2026-08-20T22:10:53.000Z'
|
|
69
69
|
|
|
70
70
|
export const getVersion = () => {
|
|
71
71
|
return version
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as ApplyCustomWorkerPathCliOverride from '../ApplyCustomWorkerPathCliOverride/ApplyCustomWorkerPathCliOverride.js'
|
|
2
2
|
import * as IsEnoentError from '../IsEnoentError/IsEnoentError.js'
|
|
3
3
|
import * as JsoncFile from '../JsoncFile/JsoncFile.js'
|
|
4
|
+
import * as LinkedWorkerPreferences from '../LinkedWorkerPreferences/LinkedWorkerPreferences.js'
|
|
4
5
|
import * as Logger from '../Logger/Logger.js'
|
|
5
6
|
import * as PlatformPaths from '../PlatformPaths/PlatformPaths.js'
|
|
6
7
|
import * as Process from '../Process/Process.js'
|
|
@@ -82,7 +83,12 @@ export const getAll = async () => {
|
|
|
82
83
|
// } catch {
|
|
83
84
|
// // ignore
|
|
84
85
|
// }
|
|
85
|
-
|
|
86
|
+
const preferencesWithoutCustomWorkerPaths = ApplyCustomWorkerPathCliOverride.applyCustomWorkerPathCliOverride(preferences)
|
|
87
|
+
const linkedWorkerPreferences = await LinkedWorkerPreferences.getLinkedWorkerPreferences()
|
|
88
|
+
return {
|
|
89
|
+
...preferencesWithoutCustomWorkerPaths,
|
|
90
|
+
...linkedWorkerPreferences,
|
|
91
|
+
}
|
|
86
92
|
} catch (error) {
|
|
87
93
|
throw new VError(error, 'Failed to get all preferences')
|
|
88
94
|
}
|
|
@@ -2,5 +2,5 @@ import { join } from 'node:path'
|
|
|
2
2
|
import * as Root from '../Root/Root.js'
|
|
3
3
|
|
|
4
4
|
export const getPreloadUrl = () => {
|
|
5
|
-
return join(Root.root, 'static', '
|
|
5
|
+
return join(Root.root, 'static', 'b9ff48c', 'packages', 'preload', 'dist', 'index.js')
|
|
6
6
|
}
|