@lvce-editor/shared-process 0.103.20 → 0.103.22

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.103.20",
3
+ "version": "0.103.22",
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.103.20",
21
+ "@lvce-editor/extension-host-helper-process": "0.103.22",
22
22
  "@lvce-editor/ipc": "16.11.0",
23
23
  "@lvce-editor/json-rpc": "8.6.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', 'e2306f5', 'extensions')
6
+ const builtinExtensionsPath = join(staticServerPath, '..', '..', 'static', '5af6a2b', 'extensions')
7
7
  return builtinExtensionsPath
8
8
  }
@@ -6,6 +6,4 @@ export const Web = 'web'
6
6
  export const SandBox = 'sandbox'
7
7
  export const Install = 'install'
8
8
  export const List = 'list'
9
- export const Link = 'link'
10
- export const Unlink = 'unlink'
11
9
  export const Status = 'status'
@@ -16,12 +16,8 @@ export const getModule = (parsedArgs) => {
16
16
  switch (argv0) {
17
17
  case CliCommandType.Install:
18
18
  return import('../CliInstall/CliInstall.js')
19
- case CliCommandType.Link:
20
- return import('../CliLink/CliLink.js')
21
19
  case CliCommandType.List:
22
20
  return import('../CliList/CliList.js')
23
- case CliCommandType.Unlink:
24
- return import('../CliUnlink/CliUnlink.js')
25
21
  default:
26
22
  throw new Error(`command not found ${argv0}`)
27
23
  }
@@ -58,10 +58,6 @@ export const list = async () => {
58
58
  })
59
59
  const manifests = await ExtensionManifests.getAll([
60
60
  ...transientLinkedExtensions,
61
- {
62
- path: PlatformPaths.getLinkedExtensionsPath(),
63
- type: ExtensionManifestInputType.LinkedExtensionsFolder,
64
- },
65
61
  {
66
62
  path: PlatformPaths.getExtensionsPath(),
67
63
  type: ExtensionManifestInputType.Folder,
@@ -130,10 +130,6 @@ export const getExtensions = () => {
130
130
  type: ExtensionManifestInputType.OnlyExtension,
131
131
  },
132
132
  ...transientLinkedExtensions,
133
- {
134
- path: PlatformPaths.getLinkedExtensionsPath(),
135
- type: ExtensionManifestInputType.LinkedExtensionsFolder,
136
- },
137
133
  {
138
134
  path: PlatformPaths.getExtensionsPath(),
139
135
  type: ExtensionManifestInputType.Folder,
@@ -160,10 +156,6 @@ export const getExtensionsEtag = async () => {
160
156
  type: ExtensionManifestInputType.OnlyExtension,
161
157
  },
162
158
  ...transientLinkedExtensions,
163
- {
164
- path: PlatformPaths.getLinkedExtensionsPath(),
165
- type: ExtensionManifestInputType.LinkedExtensionsFolder,
166
- },
167
159
  {
168
160
  path: PlatformPaths.getExtensionsPath(),
169
161
  type: ExtensionManifestInputType.Folder,
@@ -2,6 +2,4 @@ export const Folder = 1
2
2
 
3
3
  export const OnlyExtension = 2
4
4
 
5
- export const LinkedExtensionsFolder = 3
6
-
7
5
  export const LinkedExtension = 4
@@ -3,7 +3,6 @@ import { getExtensionEnablement } from '../ExtensionManagement/ExtensionManageme
3
3
  import * as ExtensionManifestInputType from '../ExtensionManifestInputType/ExtensionManifestInputType.js'
4
4
  import * as ExtensionManifestsGetFromFolder from './ExtensionManifestsFromFolder.js'
5
5
  import * as ExtensionManifestsGetFromLinkedExtension from './ExtensionManifestsFromLinkedExtension.js'
6
- import * as ExtensionManifestsGetFromLinkedExtensionsFolder from './ExtensionManifestsFromLinkedExtensionsFolder.js'
7
6
  import * as ExtensionManifestsGetFromOnlyExtension from './ExtensionManifestsFromOnlyExtension.js'
8
7
 
9
8
  const getModule = (type) => {
@@ -12,8 +11,6 @@ const getModule = (type) => {
12
11
  return ExtensionManifestsGetFromFolder
13
12
  case ExtensionManifestInputType.LinkedExtension:
14
13
  return ExtensionManifestsGetFromLinkedExtension
15
- case ExtensionManifestInputType.LinkedExtensionsFolder:
16
- return ExtensionManifestsGetFromLinkedExtensionsFolder
17
14
  case ExtensionManifestInputType.OnlyExtension:
18
15
  return ExtensionManifestsGetFromOnlyExtension
19
16
  default:
@@ -35,14 +35,14 @@ const getOnly = async (path) => {
35
35
  return getManifestStats(path)
36
36
  }
37
37
 
38
- const isExtensionFolder = (dirent, includeSymlinks) => {
39
- return dirent.type === DirentType.Directory || (includeSymlinks && dirent.type === DirentType.Symlink)
38
+ const isExtensionFolder = (dirent) => {
39
+ return dirent.type === DirentType.Directory
40
40
  }
41
41
 
42
- const getFolder = async (path, includeSymlinks = false) => {
42
+ const getFolder = async (path) => {
43
43
  try {
44
44
  const dirents = await FileSystem.readDirWithFileTypes(path)
45
- const folderNames = dirents.filter((dirent) => isExtensionFolder(dirent, includeSymlinks)).map((dirent) => dirent.name)
45
+ const folderNames = dirents.filter(isExtensionFolder).map((dirent) => dirent.name)
46
46
  const stats = await Promise.all(
47
47
  folderNames.map(async (folderName) => {
48
48
  const extensionManifestPath = join(path, folderName, 'extension.json')
@@ -64,8 +64,6 @@ const get = (input) => {
64
64
  return getFolder(input.path)
65
65
  case ExtensionManifestInputType.LinkedExtension:
66
66
  return getOnly(input.path)
67
- case ExtensionManifestInputType.LinkedExtensionsFolder:
68
- return getFolder(input.path, true)
69
67
  case ExtensionManifestInputType.OnlyExtension:
70
68
  return getOnly(input.path)
71
69
  default:
@@ -6,6 +6,9 @@ export const getHelpString = () => {
6
6
  Usage:
7
7
  ${Platform.applicationName} [path]
8
8
 
9
+ Extension development:
10
+ --link <path> Link an extension for this run. May be repeated.
11
+
9
12
  Diagnostics:
10
13
  --trace-ipc=<worker-ids> Trace comma-separated worker IDs (or *) to JSONL.
11
14
  Traces can be large and contain source code.
@@ -61,11 +61,11 @@ export const getSetupName = () => {
61
61
  return 'Lvce-Setup'
62
62
  }
63
63
 
64
- export const version = '0.103.20'
64
+ export const version = '0.103.22'
65
65
 
66
- export const commit = 'e2306f5'
66
+ export const commit = '5af6a2b'
67
67
 
68
- export const date = '2026-08-17T12:51:26.000Z'
68
+ export const date = '2026-08-17T18:33:03.000Z'
69
69
 
70
70
  export const getVersion = () => {
71
71
  return version
@@ -58,10 +58,6 @@ export const getCachedChromeExtensionsPath = () => {
58
58
  return Path.join(cacheDir, 'cached-electron-browser-view-chrome-extensions')
59
59
  }
60
60
 
61
- export const getLinkedExtensionsPath = () => {
62
- return Path.join(dataDir, 'linked-extensions')
63
- }
64
-
65
61
  export const getChromeExtensionsPath = () => {
66
62
  return Path.join(dataDir, 'electron-browser-view-chrome-extensions')
67
63
  }
@@ -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', 'e2306f5', 'packages', 'preload', 'dist', 'index.js')
5
+ return join(Root.root, 'static', '5af6a2b', 'packages', 'preload', 'dist', 'index.js')
6
6
  }
@@ -1,19 +0,0 @@
1
- import * as ErrorCodes from '../ErrorCodes/ErrorCodes.js'
2
- import * as ExitCode from '../ExitCode/ExitCode.js'
3
- import * as ExtensionLink from '../ExtensionLink/ExtensionLink.js'
4
- import * as Logger from '../Logger/Logger.js'
5
- import * as Process from '../Process/Process.js'
6
-
7
- export const handleCliArgs = async (argv) => {
8
- try {
9
- const path = argv.length > 1 ? argv[1] : process.cwd()
10
- await ExtensionLink.link(path)
11
- } catch (error) {
12
- if (error && error.code === ErrorCodes.E_MANIFEST_NOT_FOUND) {
13
- Logger.error(error.message)
14
- Process.setExitCode(ExitCode.ExpectedError)
15
- return
16
- }
17
- throw error
18
- }
19
- }
@@ -1,19 +0,0 @@
1
- import * as ErrorCodes from '../ErrorCodes/ErrorCodes.js'
2
- import * as ExitCode from '../ExitCode/ExitCode.js'
3
- import * as ExtensionUnlink from '../ExtensionUnlink/ExtensionUnlink.js'
4
- import * as Logger from '../Logger/Logger.js'
5
- import * as Process from '../Process/Process.js'
6
-
7
- export const handleCliArgs = async (argv) => {
8
- try {
9
- const path = argv.length > 1 ? argv[1] : Process.cwd()
10
- await ExtensionUnlink.unlink(path)
11
- } catch (error) {
12
- if (error && error.code === ErrorCodes.E_MANIFEST_NOT_FOUND) {
13
- Logger.error(error.message)
14
- Process.setExitCode(ExitCode.ExpectedError)
15
- return
16
- }
17
- throw error
18
- }
19
- }
@@ -1,45 +0,0 @@
1
- import * as ErrorCodes from '../ErrorCodes/ErrorCodes.js'
2
- import * as ExtensionManifest from '../ExtensionManifest/ExtensionManifest.js'
3
- import * as ExtensionManifestStatus from '../ExtensionManifestStatus/ExtensionManifestStatus.js'
4
- import * as FileSystem from '../FileSystem/FileSystem.js'
5
- import * as Path from '../Path/Path.js'
6
- import * as PlatformPaths from '../PlatformPaths/PlatformPaths.js'
7
- import * as SymLink from '../SymLink/SymLink.js'
8
- import { VError } from '../VError/VError.js'
9
-
10
- const linkFallBack = async (path) => {
11
- try {
12
- const manifest = await ExtensionManifest.get(path)
13
- if (manifest.status === ExtensionManifestStatus.Rejected) {
14
- throw manifest.reason
15
- }
16
- const linkedExtensionsPath = PlatformPaths.getLinkedExtensionsPath()
17
- // @ts-ignore
18
- const to = Path.join(linkedExtensionsPath, manifest.id)
19
- await FileSystem.remove(to)
20
- await SymLink.createSymLink(path, to)
21
- } catch (error) {
22
- throw new VError(error, `Failed to link extension`)
23
- }
24
- }
25
-
26
- export const link = async (path) => {
27
- try {
28
- const manifest = await ExtensionManifest.get(path)
29
- if (manifest.status === ExtensionManifestStatus.Rejected) {
30
- throw manifest.reason
31
- }
32
- const linkedExtensionsPath = PlatformPaths.getLinkedExtensionsPath()
33
- // @ts-ignore
34
- const to = Path.join(linkedExtensionsPath, manifest.id)
35
- await SymLink.createSymLink(path, to)
36
- } catch (error) {
37
- if (error && error.code === ErrorCodes.E_MANIFEST_NOT_FOUND) {
38
- throw new VError(`Failed to link extension: Extension manifest not found '${error.path}'`)
39
- }
40
- if (error && error.code === ErrorCodes.EEXIST) {
41
- return linkFallBack(path)
42
- }
43
- throw new VError(error, `Failed to link extension`)
44
- }
45
- }
@@ -1,45 +0,0 @@
1
- import { readlink } from 'node:fs/promises'
2
- import * as DirentType from '../DirentType/DirentType.js'
3
- import * as ExtensionManifest from '../ExtensionManifest/ExtensionManifest.js'
4
- import * as FileSystem from '../FileSystem/FileSystem.js'
5
- import * as IsEnoentError from '../IsEnoentError/IsEnoentError.js'
6
- import * as MergeWithSymlinks from '../MergeWithSymlinks/MergeWithSymlinks.js'
7
- import * as ToAbsolutePaths from '../ToAbsolutePaths/ToAbsolutePaths.js'
8
- import { VError } from '../VError/VError.js'
9
-
10
- const readSymlink = async (absolutePath) => {
11
- try {
12
- const info = await readlink(absolutePath)
13
- return info
14
- } catch {
15
- return ''
16
- }
17
- }
18
-
19
- const readSymlinks = (absolutePaths) => {
20
- return Promise.all(absolutePaths.map(readSymlink))
21
- }
22
-
23
- const isExtensionFolder = (dirent) => {
24
- return dirent.type === DirentType.Directory || dirent.type === DirentType.Symlink
25
- }
26
-
27
- export const getExtensionManifests = async (path) => {
28
- try {
29
- if (!path) {
30
- return []
31
- }
32
- const dirents = await FileSystem.readDirWithFileTypes(path)
33
- const folderNames = dirents.filter(isExtensionFolder).map((dirent) => dirent.name)
34
- const absolutePaths = ToAbsolutePaths.toAbsolutePaths(path, folderNames)
35
- const manifests = await Promise.all(absolutePaths.map(ExtensionManifest.get))
36
- const symlinks = await readSymlinks(absolutePaths)
37
- const merged = MergeWithSymlinks.mergeWithSymLinks(manifests, symlinks)
38
- return merged
39
- } catch (error) {
40
- if (IsEnoentError.isEnoentError(error)) {
41
- return []
42
- }
43
- throw new VError(error, 'Failed to get extension manifests')
44
- }
45
- }
@@ -1,21 +0,0 @@
1
- import * as ExtensionManifest from '../ExtensionManifest/ExtensionManifest.js'
2
- import * as ExtensionManifestStatus from '../ExtensionManifestStatus/ExtensionManifestStatus.js'
3
- import * as Path from '../Path/Path.js'
4
- import * as PlatformPaths from '../PlatformPaths/PlatformPaths.js'
5
- import * as RemoveSymlink from '../RemoveSymlink/RemoveSymlink.js'
6
- import { VError } from '../VError/VError.js'
7
-
8
- export const unlink = async (path) => {
9
- try {
10
- const manifest = await ExtensionManifest.get(path)
11
- if (manifest.status === ExtensionManifestStatus.Rejected) {
12
- throw manifest.reason
13
- }
14
- const linkedExtensionsPath = PlatformPaths.getLinkedExtensionsPath()
15
- // @ts-ignore
16
- const to = Path.join(linkedExtensionsPath, manifest.id)
17
- await RemoveSymlink.removeSymlink(to)
18
- } catch (error) {
19
- throw new VError(error, `Failed to unlink extension`)
20
- }
21
- }
@@ -1,16 +0,0 @@
1
- import * as ExtensionManifestStatus from '../ExtensionManifestStatus/ExtensionManifestStatus.js'
2
-
3
- export const mergeWithSymLinks = (manifests, symlinks) => {
4
- const { length } = manifests
5
- const merged = []
6
- for (let i = 0; i < length; i++) {
7
- const manifest = manifests[i]
8
- const symlink = symlinks[i]
9
- if (manifest.status === ExtensionManifestStatus.Rejected) {
10
- merged.push(manifest)
11
- } else {
12
- merged.push({ ...manifest, symlink })
13
- }
14
- }
15
- return merged
16
- }
@@ -1,12 +0,0 @@
1
- import { rm } from 'node:fs/promises'
2
- import * as Assert from '../Assert/Assert.js'
3
- import { VError } from '../VError/VError.js'
4
-
5
- export const removeSymlink = async (path) => {
6
- try {
7
- Assert.string(path)
8
- await rm(path, { force: true })
9
- } catch (error) {
10
- throw new VError(error, `Failed to remove symlink ${path}`)
11
- }
12
- }
@@ -1,5 +0,0 @@
1
- import * as NetworkProcess from '../NetworkProcess/NetworkProcess.js'
2
-
3
- export const createSymLink = (target, path) => {
4
- return NetworkProcess.invoke('Symlink.createSymLink', target, path)
5
- }