@lvce-editor/shared-process 0.108.13 → 0.108.15

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.108.13",
3
+ "version": "0.108.15",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -23,7 +23,7 @@
23
23
  "@lvce-editor/jsonc-parser": "1.5.0",
24
24
  "@lvce-editor/pretty-error": "2.0.0",
25
25
  "@lvce-editor/process-explorer": "3.19.0",
26
- "@lvce-editor/rpc-registry": "9.54.0",
26
+ "@lvce-editor/rpc-registry": "9.55.0",
27
27
  "@lvce-editor/verror": "1.7.0",
28
28
  "is-object": "^1.0.2",
29
29
  "xdg-basedir": "^5.1.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', '241d72e', 'extensions')
6
+ const builtinExtensionsPath = join(staticServerPath, '..', '..', 'static', '3a7c201', 'extensions')
7
7
  return builtinExtensionsPath
8
8
  }
@@ -20,7 +20,7 @@ const getConnectSrc = () => {
20
20
  if (IsElectron.isElectron) {
21
21
  return []
22
22
  }
23
- return [`connect-src 'self' ws://127.0.0.1:* ws://localhost:*`]
23
+ return [`connect-src 'self' https: wss: http://127.0.0.1:* http://localhost:* ws://127.0.0.1:* ws://localhost:*`]
24
24
  }
25
25
 
26
26
  const getFrameAncestors = () => {
@@ -13,6 +13,7 @@ const backslashRegex = /\\/g
13
13
 
14
14
  const staticContentSecurityPolicy = GetContentSecurityPolicy.getContentSecurityPolicy([
15
15
  `default-src 'none'`,
16
+ `connect-src 'self' https: wss: http://127.0.0.1:* http://localhost:* ws://127.0.0.1:* ws://localhost:*`,
16
17
  `font-src 'self'`,
17
18
  `img-src 'self' https: data: blob:`, // TODO maybe disallow https and data images
18
19
  `manifest-src 'self'`,
@@ -12,6 +12,7 @@ export const getExtensionManifests = async (path) => {
12
12
  return [
13
13
  {
14
14
  ...manifest,
15
+ linked: true,
15
16
  symlink: path,
16
17
  },
17
18
  ]
@@ -12,6 +12,12 @@ export const handleElectronReady = async (parsedArgs, workingDirectory) => {
12
12
  Assert.string(workingDirectory)
13
13
  try {
14
14
  await TransientLinkedExtensions.validate()
15
+ } catch (error) {
16
+ Logger.error(error)
17
+ Process.exit(ExitCode.Error)
18
+ return
19
+ }
20
+ try {
15
21
  const preferences = await Preferences.getAllSafe()
16
22
  const preloadUrl = PreloadUrl.getPreloadUrl()
17
23
  await AppWindow.createAppWindow({ parsedArgs, preferences, preloadUrl, workingDirectory })
@@ -0,0 +1,42 @@
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
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+ const getPackageName = (worker) => {
16
+ const marker = '/node_modules/'
17
+ const index = worker.defaultPath.indexOf(marker)
18
+ if (index === -1) {
19
+ return ''
20
+ }
21
+ const packagePath = worker.defaultPath.slice(index + marker.length)
22
+ const parts = packagePath.split('/')
23
+ return packagePath.startsWith('@') ? parts.slice(0, 2).join('/') : parts[0]
24
+ }
25
+
26
+ const workersByPackageName = new Map((workers).map((worker) => [getPackageName(worker), worker]))
27
+
28
+ export const getLinkedWorkerPreference = async (path) => {
29
+ try {
30
+ const packageJson = await FileSystem.readJson(Path.join(path, 'package.json'))
31
+ const worker = workersByPackageName.get(packageJson?.name)
32
+ if (!worker || typeof packageJson.main !== 'string') {
33
+ return undefined
34
+ }
35
+ return {
36
+ path: Path.join(path, packageJson.main),
37
+ settingName: worker.settingName,
38
+ }
39
+ } catch {
40
+ return undefined
41
+ }
42
+ }
@@ -1,43 +1,14 @@
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'
1
+ import * as LinkedWorkerManifest from '../LinkedWorkerManifest/LinkedWorkerManifest.js'
4
2
  import * as TransientLinkedExtensions from '../TransientLinkedExtensions/TransientLinkedExtensions.js'
5
3
 
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
4
  export const getLinkedWorkerPreferences = async () => {
33
5
  const preferences = {}
34
6
  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') {
7
+ const preference = await LinkedWorkerManifest.getLinkedWorkerPreference(link.resolvedPath)
8
+ if (!preference) {
38
9
  continue
39
10
  }
40
- preferences[worker.settingName] = Path.join(link.resolvedPath, packageJson.main)
11
+ preferences[preference.settingName] = preference.path
41
12
  }
42
13
  return preferences
43
14
  }
@@ -61,11 +61,11 @@ export const getSetupName = () => {
61
61
  return 'Lvce-Setup'
62
62
  }
63
63
 
64
- export const version = '0.108.13'
64
+ export const version = '0.108.15'
65
65
 
66
- export const commit = '241d72e'
66
+ export const commit = '3a7c201'
67
67
 
68
- export const date = '2026-08-24T08:36:37.000Z'
68
+ export const date = '2026-08-24T22:06:46.000Z'
69
69
 
70
70
  export const getVersion = () => {
71
71
  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', '241d72e', 'packages', 'preload', 'dist', 'index.js')
5
+ return join(Root.root, 'static', '3a7c201', 'packages', 'preload', 'dist', 'index.js')
6
6
  }
@@ -1,5 +1,8 @@
1
1
  import * as ErrorCodes from '../ErrorCodes/ErrorCodes.js'
2
+ import * as ExtensionManifest from '../ExtensionManifest/ExtensionManifest.js'
3
+ import * as ExtensionManifestStatus from '../ExtensionManifestStatus/ExtensionManifestStatus.js'
2
4
  import * as FileSystem from '../FileSystem/FileSystem.js'
5
+ import * as LinkedWorkerManifest from '../LinkedWorkerManifest/LinkedWorkerManifest.js'
3
6
  import * as Path from '../Path/Path.js'
4
7
  import * as Process from '../Process/Process.js'
5
8
 
@@ -58,6 +61,14 @@ const createPathNotFoundError = (link) => {
58
61
  return error
59
62
  }
60
63
 
64
+ const createExtensionNotFoundError = (link) => {
65
+ const message = link.path === link.resolvedPath ? link.path : `${link.path} (resolved to ${link.resolvedPath})`
66
+ const error = new Error(`Failed to start: ${link.source} path does not contain an extension: ${message}`)
67
+ // @ts-ignore
68
+ error.code = ErrorCodes.E_MANIFEST_NOT_FOUND
69
+ return error
70
+ }
71
+
61
72
  export const validate = async () => {
62
73
  const links = getLinkedExtensions()
63
74
  for (const link of links) {
@@ -67,6 +78,10 @@ export const validate = async () => {
67
78
  if (!(await FileSystem.exists(link.resolvedPath))) {
68
79
  throw createPathNotFoundError(link)
69
80
  }
81
+ const manifest = await ExtensionManifest.get(link.resolvedPath)
82
+ if (manifest.status !== ExtensionManifestStatus.Resolved && !(await LinkedWorkerManifest.getLinkedWorkerPreference(link.resolvedPath))) {
83
+ throw createExtensionNotFoundError(link)
84
+ }
70
85
  }
71
86
  return links
72
87
  }
@@ -1235,7 +1235,7 @@
1235
1235
  {
1236
1236
  "id": "processExplorer",
1237
1237
  "fileName": "process-explorer-worker/index.js",
1238
- "contentSecurityPolicy": ["default-src 'none'", "connect-src 'self' ws://127.0.0.1:* ws://localhost:*"],
1238
+ "contentSecurityPolicy": ["default-src 'none'", "connect-src 'self' https: wss: http://127.0.0.1:* http://localhost:* ws://127.0.0.1:* ws://localhost:*"],
1239
1239
  "defaultPath": "/packages/renderer-worker/node_modules/@lvce-editor/process-explorer-worker/index.js",
1240
1240
  "productionPath": "/packages/process-explorer-worker/index.js",
1241
1241
  "settingName": "develop.processExplorerWorkerPath",
@@ -1541,7 +1541,7 @@
1541
1541
  {
1542
1542
  "id": "terminalWorker",
1543
1543
  "fileName": "terminalWorkerMain.js",
1544
- "contentSecurityPolicy": ["default-src 'none'", "connect-src 'self' ws://127.0.0.1:* ws://localhost:*", "script-src 'self'"],
1544
+ "contentSecurityPolicy": ["default-src 'none'", "connect-src 'self' https: wss: http://127.0.0.1:* http://localhost:* ws://127.0.0.1:* ws://localhost:*", "script-src 'self'"],
1545
1545
  "defaultPath": "/packages/renderer-worker/node_modules/@lvce-editor/terminal-worker/dist/terminalWorkerMain.js",
1546
1546
  "productionPath": "/packages/terminal-worker/dist/terminalWorkerMain.js",
1547
1547
  "settingName": "develop.terminalWorkerPath",
@@ -1572,7 +1572,7 @@
1572
1572
  "productionPath": "/packages/text-search-worker/dist/textSearchWorkerMain.js",
1573
1573
  "settingName": "develop.textSearchWorkerPath",
1574
1574
  "hotReloadCommand": "Search.hotReload",
1575
- "contentSecurityPolicy": ["default-src 'none'", "connect-src 'self' ws://127.0.0.1:* ws://localhost:*", "sandbox allow-same-origin"]
1575
+ "contentSecurityPolicy": ["default-src 'none'", "connect-src 'self' https: wss: http://127.0.0.1:* http://localhost:* ws://127.0.0.1:* ws://localhost:*", "sandbox allow-same-origin"]
1576
1576
  },
1577
1577
  {
1578
1578
  "id": "titleBar",