@lvce-editor/shared-process 0.125.23 → 0.126.0

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.125.23",
3
+ "version": "0.126.0",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -23,7 +23,7 @@
23
23
  "@lvce-editor/json-rpc": "8.9.2",
24
24
  "@lvce-editor/jsonc-parser": "1.5.2",
25
25
  "@lvce-editor/pretty-error": "2.1.1",
26
- "@lvce-editor/process-explorer": "3.36.3",
26
+ "@lvce-editor/process-explorer": "3.37.0",
27
27
  "@lvce-editor/rpc-registry": "9.66.2",
28
28
  "@lvce-editor/verror": "1.7.0",
29
29
  "is-object": "^1.0.2",
@@ -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', '453fa6a', 'extensions')
6
+ const builtinExtensionsPath = join(staticServerPath, '..', '..', 'static', '79505d5', 'extensions')
7
7
  return builtinExtensionsPath
8
8
  }
@@ -3,7 +3,6 @@ import { tmpdir } from 'node:os'
3
3
  import { join } from 'node:path'
4
4
  import { fileURLToPath } from 'node:url'
5
5
  import * as Path from '../Path/Path.js'
6
- import * as Platform from '../Platform/Platform.js'
7
6
  import * as Root from '../Root/Root.js'
8
7
  import * as StaticPath from '../StaticPath/StaticPath.js'
9
8
 
@@ -47,10 +46,7 @@ export const getElectronFileResponseAbsolutePath = (pathName) => {
47
46
  // TODO maybe have a separate protocol for remote, e.g. vscode has vscode-remote
48
47
  if (pathName.startsWith(`/remote`)) {
49
48
  const uri = pathName.slice('/remote'.length)
50
- if (Platform.isWindows) {
51
- return fileURLToPath(`file://` + uri)
52
- }
53
- return uri
49
+ return fileURLToPath(`file://` + uri)
54
50
  }
55
51
  if (pathName.startsWith('/process-explorer/process-explorer-theme.css')) {
56
52
  const processExplorerThemeCss = join(tmpdir(), 'process-explorer-theme.css')
@@ -42,8 +42,10 @@ export const getElectronFileResponseContent = async (request, absolutePath, url,
42
42
  return newContentBuffer
43
43
  }
44
44
  let content = await readFile(absolutePath)
45
- const isAppIndex = typeof url === 'string' && (url === '/' || (url.startsWith(`${Platform.scheme}://-/`) && new URL(url).pathname === '/'))
46
- const runtimeConfig = { platform: 'electron', workspaceUri: getWorkspaceUri(request?.url || url) }
45
+ const baseUrl = `${Platform.scheme}://-/`
46
+ const indexUrl = typeof url === 'string' && URL.canParse(url, baseUrl) ? new URL(url, baseUrl) : undefined
47
+ const isAppIndex = indexUrl && (indexUrl.pathname === '/' || indexUrl.pathname === '/index.html')
48
+ const runtimeConfig = { platform: request?.platform === 'remote' ? 'remote' : 'electron', workspaceUri: getWorkspaceUri(request?.url || url) }
47
49
  if (!Platform.isProduction && isAppIndex) {
48
50
  // @ts-ignore
49
51
  content = content.toString().replace(' <link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />\n', '')
@@ -9,26 +9,27 @@ const prefixLength = prefix.length
9
9
  const webViewPrefix = `${Scheme.WebView}://-`
10
10
  const webViewPrefixLength = webViewPrefix.length
11
11
 
12
+ const decodePathName = (pathName) => {
13
+ // Remote paths remain file-URL encoded until fileURLToPath decodes them once.
14
+ return pathName.startsWith('/remote/') ? pathName : decodeURI(pathName)
15
+ }
16
+
12
17
  export const getElectronFileResponseRelativePath = (requestUrl) => {
13
18
  if (requestUrl.startsWith(prefix)) {
14
19
  // TODO only support reading from app root and extensions
15
20
  // maybe add a separate protocol for extensions (e.g. lvce-remote)
16
- const decoded = decodeURI(requestUrl)
17
- const pathName = decoded.slice(prefixLength)
18
- return pathName
21
+ return decodePathName(requestUrl.slice(prefixLength))
19
22
  }
20
23
  if (requestUrl.startsWith(webViewPrefix)) {
21
24
  // TODO group this by extension so that
22
25
  // extension-a can only access resources in extension-a folder and
23
26
  // extension-b can only access resources in extension-b folder
24
- const decoded = decodeURI(requestUrl)
25
- const pathName = decoded.slice(webViewPrefixLength)
26
- return pathName
27
+ return decodePathName(requestUrl.slice(webViewPrefixLength))
27
28
  }
28
29
  if (requestUrl.startsWith('/')) {
29
30
  // TODO this should not be supported anymore and could probably be removed
30
31
  const pathName = removeQueryParameters(requestUrl)
31
- return decodeURI(pathName)
32
+ return decodePathName(pathName)
32
33
  }
33
34
  console.log({ requestUrl })
34
35
  return ''
@@ -23,6 +23,6 @@ export const handleRequest = async (request) => {
23
23
  const response = await GetTestRequestResponse.getTestRequestResponse(request, indexHtmlPath)
24
24
  return toHttpResponse(request, response)
25
25
  }
26
- const response = await GetElectronFileResponse.getElectronFileResponse(request.url, request)
26
+ const response = await GetElectronFileResponse.getElectronFileResponse(request.url, { ...request, platform: 'remote' })
27
27
  return toHttpResponse(request, response)
28
28
  }
@@ -7,6 +7,10 @@ import * as Platform from '../Platform/Platform.js'
7
7
  import * as Preferences from '../Preferences/Preferences.js'
8
8
 
9
9
  const getConfiguredUrl = async (settingName, defaultPath) => {
10
+ const cliPath = Preferences.getOverrides()[settingName]
11
+ if (cliPath && existsSync(cliPath)) {
12
+ return cliPath
13
+ }
10
14
  if (Platform.isProduction) {
11
15
  return defaultPath
12
16
  }
@@ -56,11 +56,11 @@ export const getSetupName = () => {
56
56
  return 'Lvce-Setup'
57
57
  }
58
58
 
59
- export const version = '0.125.23'
59
+ export const version = '0.126.0'
60
60
 
61
- export const commit = '453fa6a'
61
+ export const commit = '79505d5'
62
62
 
63
- export const date = '2026-10-26T11:19:53.000Z'
63
+ export const date = '2026-10-26T13:26:22.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', '453fa6a', 'packages', 'preload', 'dist', 'index.js')
5
+ return join(Root.root, 'static', '79505d5', 'packages', 'preload', 'dist', 'index.js')
6
6
  }