@lvce-editor/shared-process 0.121.19 → 0.121.21
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 +1 -1
- package/src/parts/AddCustomPathsToIndexHtml/AddCustomPathsToIndexHtml.js +1 -1
- package/src/parts/BuiltinExtensionsPath/BuiltinExtensionsPath.js +1 -1
- package/src/parts/GetElectronFileResponseContent/GetElectronFileResponseContent.js +11 -2
- package/src/parts/LanguageServerConnection/LanguageServerConnection.js +2 -0
- package/src/parts/Platform/Platform.js +3 -3
- package/src/parts/PreloadUrl/PreloadUrl.js +1 -1
- package/src/parts/ResolveRoot/ResolveRoot.js +3 -7
package/package.json
CHANGED
|
@@ -19,7 +19,7 @@ const serializeConfig = (config, indentation) => {
|
|
|
19
19
|
return `${contentIndentation}${json.replaceAll('\n', `\n${contentIndentation}`)}`
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
export const addCustomPathsToIndexHtml = async (content, runtimeConfig
|
|
22
|
+
export const addCustomPathsToIndexHtml = async (content, runtimeConfig = {}) => {
|
|
23
23
|
let preferences = {}
|
|
24
24
|
if (!Platform.isProduction) {
|
|
25
25
|
preferences = ApplyCustomWorkerPathCliOverride.applyCustomWorkerPathCliOverride(await Preferences.getUserPreferences())
|
|
@@ -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', '3ce1cf7', 'extensions')
|
|
7
7
|
return builtinExtensionsPath
|
|
8
8
|
}
|
|
@@ -7,6 +7,14 @@ import * as TranspileTypeScript from '../TranspileTypeScript/TranspileTypeScript
|
|
|
7
7
|
|
|
8
8
|
const useCache = false // TODO enable this
|
|
9
9
|
|
|
10
|
+
const getWorkspaceUri = (url) => {
|
|
11
|
+
const baseUrl = `${Platform.scheme}://-/`
|
|
12
|
+
if (!URL.canParse(url, baseUrl)) {
|
|
13
|
+
return undefined
|
|
14
|
+
}
|
|
15
|
+
return new URL(url, baseUrl).searchParams.get('workspace') || undefined
|
|
16
|
+
}
|
|
17
|
+
|
|
10
18
|
const readRange = async (absolutePath, range) => {
|
|
11
19
|
const length = range.end - range.start + 1
|
|
12
20
|
const buffer = Buffer.allocUnsafe(length)
|
|
@@ -35,13 +43,14 @@ export const getElectronFileResponseContent = async (request, absolutePath, url,
|
|
|
35
43
|
}
|
|
36
44
|
let content = await readFile(absolutePath)
|
|
37
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) }
|
|
38
47
|
if (!Platform.isProduction && isAppIndex) {
|
|
39
48
|
// @ts-ignore
|
|
40
49
|
content = content.toString().replace(' <link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />\n', '')
|
|
41
|
-
content = await AddCustomPathsToIndexHtml.addCustomPathsToIndexHtml(content,
|
|
50
|
+
content = await AddCustomPathsToIndexHtml.addCustomPathsToIndexHtml(content, runtimeConfig)
|
|
42
51
|
}
|
|
43
52
|
if (Platform.isProduction && isAppIndex) {
|
|
44
|
-
content = await AddCustomPathsToIndexHtml.addCustomPathsToIndexHtml(content,
|
|
53
|
+
content = await AddCustomPathsToIndexHtml.addCustomPathsToIndexHtml(content, runtimeConfig)
|
|
45
54
|
}
|
|
46
55
|
if (typeof content === 'string') {
|
|
47
56
|
content = Buffer.from(content)
|
|
@@ -423,6 +423,7 @@ export class LanguageServerConnection {
|
|
|
423
423
|
version: 1,
|
|
424
424
|
}
|
|
425
425
|
this.documents.set(textDocument.uri, next)
|
|
426
|
+
this.publishedDiagnostics.delete(textDocument.uri)
|
|
426
427
|
this.sendNotification('textDocument/didOpen', {
|
|
427
428
|
textDocument: {
|
|
428
429
|
languageId: next.languageId,
|
|
@@ -442,6 +443,7 @@ export class LanguageServerConnection {
|
|
|
442
443
|
version: previous.version + 1,
|
|
443
444
|
}
|
|
444
445
|
this.documents.set(textDocument.uri, next)
|
|
446
|
+
this.publishedDiagnostics.delete(textDocument.uri)
|
|
445
447
|
this.sendNotification('textDocument/didChange', {
|
|
446
448
|
contentChanges: [
|
|
447
449
|
{
|
|
@@ -56,11 +56,11 @@ export const getSetupName = () => {
|
|
|
56
56
|
return 'Lvce-Setup'
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
export const version = '0.121.
|
|
59
|
+
export const version = '0.121.21'
|
|
60
60
|
|
|
61
|
-
export const commit = '
|
|
61
|
+
export const commit = '3ce1cf7'
|
|
62
62
|
|
|
63
|
-
export const date = '2026-10-
|
|
63
|
+
export const date = '2026-10-10T01:48:39.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', '3ce1cf7', 'packages', 'preload', 'dist', 'index.js')
|
|
6
6
|
}
|
|
@@ -36,11 +36,7 @@ const toUri = (path) => {
|
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
|
|
39
|
-
const getWindowWorkspace = (
|
|
40
|
-
if (!href) {
|
|
41
|
-
return undefined
|
|
42
|
-
}
|
|
43
|
-
const workspaceUri = new URL(href).searchParams.get('workspace')
|
|
39
|
+
const getWindowWorkspace = (workspaceUri) => {
|
|
44
40
|
if (!workspaceUri) {
|
|
45
41
|
return undefined
|
|
46
42
|
}
|
|
@@ -57,9 +53,9 @@ const getWindowWorkspace = (href) => {
|
|
|
57
53
|
}
|
|
58
54
|
}
|
|
59
55
|
|
|
60
|
-
export const resolveRoot = async (href = '') => {
|
|
56
|
+
export const resolveRoot = async (href = '', workspaceUri = '') => {
|
|
61
57
|
if (IsElectron.isElectron) {
|
|
62
|
-
const windowWorkspace = getWindowWorkspace(
|
|
58
|
+
const windowWorkspace = getWindowWorkspace(workspaceUri)
|
|
63
59
|
if (windowWorkspace) {
|
|
64
60
|
return {
|
|
65
61
|
homeDir: PlatformPaths.getHomeDir(),
|