@lvce-editor/shared-process 0.122.4 → 0.122.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/package.json
CHANGED
|
@@ -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', 'a91e0ee', 'extensions')
|
|
7
7
|
return builtinExtensionsPath
|
|
8
8
|
}
|
|
@@ -1,21 +1,49 @@
|
|
|
1
|
+
import * as BuiltinExtensionsPath from '../BuiltinExtensionsPath/BuiltinExtensionsPath.js'
|
|
1
2
|
import * as DirentType from '../DirentType/DirentType.js'
|
|
2
3
|
import * as ExtensionManifest from '../ExtensionManifest/ExtensionManifest.js'
|
|
4
|
+
import * as ExtensionManifestStatus from '../ExtensionManifestStatus/ExtensionManifestStatus.js'
|
|
3
5
|
import * as FileSystem from '../FileSystem/FileSystem.js'
|
|
4
6
|
import * as IsEnoentError from '../IsEnoentError/IsEnoentError.js'
|
|
7
|
+
import * as Platform from '../Platform/Platform.js'
|
|
5
8
|
import * as ToAbsolutePaths from '../ToAbsolutePaths/ToAbsolutePaths.js'
|
|
6
9
|
import { VError } from '../VError/VError.js'
|
|
7
10
|
|
|
11
|
+
let builtinManifests
|
|
12
|
+
|
|
13
|
+
const readExtensionManifests = async (path) => {
|
|
14
|
+
const dirents = await FileSystem.readDirWithFileTypes(path)
|
|
15
|
+
const folderNames = dirents.filter((dirent) => dirent.type === DirentType.Directory).map((dirent) => dirent.name)
|
|
16
|
+
const absolutePaths = ToAbsolutePaths.toAbsolutePaths(path, folderNames)
|
|
17
|
+
return Promise.all(absolutePaths.map(ExtensionManifest.get))
|
|
18
|
+
}
|
|
19
|
+
|
|
8
20
|
export const getExtensionManifests = async (path) => {
|
|
21
|
+
let cached
|
|
9
22
|
try {
|
|
10
23
|
if (!path) {
|
|
11
24
|
return []
|
|
12
25
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
26
|
+
// Packaged builtins are fixed for this process. User and development extensions stay live.
|
|
27
|
+
if (!Platform.isProduction || path !== BuiltinExtensionsPath.getBuiltinExtensionsPath()) {
|
|
28
|
+
return await readExtensionManifests(path)
|
|
29
|
+
}
|
|
30
|
+
if (!builtinManifests || builtinManifests.path !== path) {
|
|
31
|
+
builtinManifests = { path, promise: readExtensionManifests(path) }
|
|
32
|
+
}
|
|
33
|
+
cached = builtinManifests
|
|
34
|
+
const manifests = await cached.promise
|
|
35
|
+
if (manifests.some((manifest) => manifest.status === ExtensionManifestStatus.Rejected)) {
|
|
36
|
+
if (builtinManifests === cached) {
|
|
37
|
+
builtinManifests = undefined
|
|
38
|
+
}
|
|
39
|
+
return manifests
|
|
40
|
+
}
|
|
41
|
+
// Keep request-local metadata and nested contributions independent of the cached values.
|
|
42
|
+
return structuredClone(manifests)
|
|
18
43
|
} catch (error) {
|
|
44
|
+
if (cached && builtinManifests === cached) {
|
|
45
|
+
builtinManifests = undefined
|
|
46
|
+
}
|
|
19
47
|
if (IsEnoentError.isEnoentError(error)) {
|
|
20
48
|
return []
|
|
21
49
|
}
|
|
@@ -56,11 +56,11 @@ export const getSetupName = () => {
|
|
|
56
56
|
return 'Lvce-Setup'
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
export const version = '0.122.
|
|
59
|
+
export const version = '0.122.5'
|
|
60
60
|
|
|
61
|
-
export const commit = '
|
|
61
|
+
export const commit = 'a91e0ee'
|
|
62
62
|
|
|
63
|
-
export const date = '2026-10-
|
|
63
|
+
export const date = '2026-10-12T07:39:47.000Z'
|
|
64
64
|
|
|
65
65
|
export const getVersion = () => {
|
|
66
66
|
return version
|
|
@@ -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', 'a91e0ee', 'packages', 'preload', 'dist', 'index.js')
|
|
6
6
|
}
|