@lvce-editor/shared-process 0.105.12 → 0.105.13

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.105.12",
3
+ "version": "0.105.13",
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.12",
21
+ "@lvce-editor/extension-host-helper-process": "0.105.13",
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",
@@ -1,3 +1,30 @@
1
+ import * as ApplyCustomWorkerPathCliOverride from '../ApplyCustomWorkerPathCliOverride/ApplyCustomWorkerPathCliOverride.js'
2
+ import * as GetCustomPathsConfig from '../GetCustomPathsConfig/GetCustomPathsConfig.js'
3
+ import * as LinkedWorkerPreferences from '../LinkedWorkerPreferences/LinkedWorkerPreferences.js'
4
+ import * as Platform from '../Platform/Platform.js'
5
+ import * as Preferences from '../Preferences/Preferences.js'
6
+
1
7
  export const addCustomPathsToIndexHtml = async (content) => {
8
+ let preferences = {}
9
+ if (!Platform.isProduction) {
10
+ preferences = ApplyCustomWorkerPathCliOverride.applyCustomWorkerPathCliOverride(await Preferences.getUserPreferences())
11
+ }
12
+ const linkedWorkerPreferences = await LinkedWorkerPreferences.getLinkedWorkerPreferences()
13
+ const config = GetCustomPathsConfig.getCustomPathsConfig({ ...preferences, ...linkedWorkerPreferences })
14
+ if (Object.keys(config).length === 0) {
2
15
  return content
16
+ }
17
+ let newContent = content
18
+ if (config.rendererProcessPath) {
19
+ newContent = newContent
20
+ .toString()
21
+ .replace('/packages/renderer-worker/node_modules/@lvce-editor/renderer-process/dist/rendererProcessMain.js', config.rendererProcessPath)
22
+ }
23
+ const stringifiedConfig = JSON.stringify(config, null, 2)
24
+ newContent = newContent.toString().replace(
25
+ '</title>',
26
+ `</title>
27
+ <script type="application/json" id="Config">${stringifiedConfig}</script>`,
28
+ )
29
+ return newContent
3
30
  }
@@ -4,7 +4,7 @@ const disableCustomWorkerPathsFlag = '--disable-custom-worker-paths'
4
4
 
5
5
  const workerPathSettingsWithoutWorkerInName = new Set(['develop.languageModelsViewPath', 'develop.runningExtensionsViewPath'])
6
6
 
7
- const isCustomWorkerPathSetting = (key) => {
7
+ export const isCustomWorkerPathSetting = (key) => {
8
8
  const isDevelopmentSetting = key.startsWith('develop.') || key.startsWith('developer.')
9
9
  return isDevelopmentSetting && (key.endsWith('WorkerPath') || workerPathSettingsWithoutWorkerInName.has(key))
10
10
  }
@@ -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', 'fc75bc0', 'extensions')
6
+ const builtinExtensionsPath = join(staticServerPath, '..', '..', 'static', '883ca15', 'extensions')
7
7
  return builtinExtensionsPath
8
8
  }
@@ -1,5 +1,10 @@
1
+ import * as ApplyCustomWorkerPathCliOverride from '../ApplyCustomWorkerPathCliOverride/ApplyCustomWorkerPathCliOverride.js'
1
2
  import * as GetRemoteUrl from '../GetRemoteUrl/GetRemoteUrl.js'
2
3
 
4
+ const isWorkerPath = ([key, value] ) => {
5
+ return typeof value === 'string' && ApplyCustomWorkerPathCliOverride.isCustomWorkerPathSetting(key)
6
+ }
7
+
3
8
  export const getCustomPathsConfig = (preferences) => {
4
9
  const config = Object.create(null)
5
10
  if (preferences['develop.rendererProcessPath']) {
@@ -8,5 +13,13 @@ export const getCustomPathsConfig = (preferences) => {
8
13
  if (preferences['develop.editorWorkerPath']) {
9
14
  config.editorWorkerUrl = GetRemoteUrl.getRemoteUrl(preferences['develop.editorWorkerPath'])
10
15
  }
16
+ const workerUrls = Object.fromEntries(
17
+ Object.entries(preferences)
18
+ .filter(isWorkerPath)
19
+ .map(([key, value]) => [key, GetRemoteUrl.getRemoteUrl(value)]),
20
+ )
21
+ if (Object.keys(workerUrls).length > 0) {
22
+ config.workerUrls = workerUrls
23
+ }
11
24
  return config
12
25
  }
@@ -61,11 +61,11 @@ export const getSetupName = () => {
61
61
  return 'Lvce-Setup'
62
62
  }
63
63
 
64
- export const version = '0.105.12'
64
+ export const version = '0.105.13'
65
65
 
66
- export const commit = 'fc75bc0'
66
+ export const commit = '883ca15'
67
67
 
68
- export const date = '2026-08-20T23:06:42.000Z'
68
+ export const date = '2026-08-20T23:18:01.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', 'fc75bc0', 'packages', 'preload', 'dist', 'index.js')
5
+ return join(Root.root, 'static', '883ca15', 'packages', 'preload', 'dist', 'index.js')
6
6
  }