@lvce-editor/shared-process 0.125.24 → 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 +2 -2
- package/src/parts/BuiltinExtensionsPath/BuiltinExtensionsPath.js +1 -1
- package/src/parts/GetElectronFileResponseAbsolutePath/GetElectronFileResponseAbsolutePath.js +1 -5
- package/src/parts/GetElectronFileResponseContent/GetElectronFileResponseContent.js +4 -2
- package/src/parts/GetElectronFileResponseRelativePath/GetElectronFileResponseRelativePath.js +8 -7
- package/src/parts/HandleRequest/HandleRequest.js +1 -1
- package/src/parts/Platform/Platform.js +3 -3
- package/src/parts/PreloadUrl/PreloadUrl.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/shared-process",
|
|
3
|
-
"version": "0.
|
|
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.
|
|
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', '
|
|
6
|
+
const builtinExtensionsPath = join(staticServerPath, '..', '..', 'static', '79505d5', 'extensions')
|
|
7
7
|
return builtinExtensionsPath
|
|
8
8
|
}
|
package/src/parts/GetElectronFileResponseAbsolutePath/GetElectronFileResponseAbsolutePath.js
CHANGED
|
@@ -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
|
-
|
|
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
|
|
46
|
-
const
|
|
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', '')
|
package/src/parts/GetElectronFileResponseRelativePath/GetElectronFileResponseRelativePath.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
}
|
|
@@ -56,11 +56,11 @@ export const getSetupName = () => {
|
|
|
56
56
|
return 'Lvce-Setup'
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
export const version = '0.
|
|
59
|
+
export const version = '0.126.0'
|
|
60
60
|
|
|
61
|
-
export const commit = '
|
|
61
|
+
export const commit = '79505d5'
|
|
62
62
|
|
|
63
|
-
export const date = '2026-10-
|
|
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', '
|
|
5
|
+
return join(Root.root, 'static', '79505d5', 'packages', 'preload', 'dist', 'index.js')
|
|
6
6
|
}
|