@lvce-editor/shared-process 0.95.8 → 0.95.9
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/ExportStatic/ExportStatic.js +0 -14
- package/src/parts/GetCustomPathsConfig/GetCustomPathsConfig.js +0 -3
- package/src/parts/ModuleId/ModuleId.js +0 -1
- package/src/parts/ModuleMap/ModuleMap.js +0 -45
- package/src/parts/Platform/Platform.js +3 -3
- package/src/parts/PreloadUrl/PreloadUrl.js +1 -1
- package/src/parts/RequiresSocket/RequiresSocket.js +0 -2
- package/src/parts/Workers/Workers.json +0 -9
- package/src/parts/ExtensionHostRpc/ExtensionHostRpc.js +0 -82
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/shared-process",
|
|
3
|
-
"version": "0.95.
|
|
3
|
+
"version": "0.95.9",
|
|
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.7.0",
|
|
21
|
-
"@lvce-editor/extension-host-helper-process": "0.95.
|
|
21
|
+
"@lvce-editor/extension-host-helper-process": "0.95.9",
|
|
22
22
|
"@lvce-editor/ipc": "16.6.0",
|
|
23
23
|
"@lvce-editor/json-rpc": "8.5.0",
|
|
24
24
|
"@lvce-editor/jsonc-parser": "1.5.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', '
|
|
6
|
+
const builtinExtensionsPath = join(staticServerPath, '..', '..', 'static', 'b0bd3ec', 'extensions')
|
|
7
7
|
return builtinExtensionsPath
|
|
8
8
|
}
|
|
@@ -150,7 +150,6 @@ const applyOverridesRendererProcess = async ({ commitHash, pathPrefix, root }
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
const applyOverrides = async ({ commitHash, pathPrefix, root, serverStaticPath } ) => {
|
|
153
|
-
const extensionHostWorkerDistPath = getWorkerDistPath(root, commitHash, 'extensionHostWorker')
|
|
154
153
|
await applyOverridesRendererProcess({ commitHash, pathPrefix, root })
|
|
155
154
|
await replace(
|
|
156
155
|
Path.join(root, 'dist', commitHash, 'packages', 'renderer-worker', 'dist', 'rendererWorkerMain.js'),
|
|
@@ -162,19 +161,6 @@ const applyOverrides = async ({ commitHash, pathPrefix, root, serverStaticPath }
|
|
|
162
161
|
`/${commitHash}`,
|
|
163
162
|
`${pathPrefix}/${commitHash}`,
|
|
164
163
|
)
|
|
165
|
-
await replace(
|
|
166
|
-
extensionHostWorkerDistPath,
|
|
167
|
-
`return \`\${assetDir}/extensions/builtin.theme-\${colorThemeId}/color-theme.json\``,
|
|
168
|
-
`return \`\${assetDir}/themes/\${colorThemeId}.json\``,
|
|
169
|
-
)
|
|
170
|
-
await replace(extensionHostWorkerDistPath, `/${commitHash}`, `${pathPrefix}/${commitHash}`)
|
|
171
|
-
await replace(extensionHostWorkerDistPath, `const platform = Remote`, `const platform = Web`)
|
|
172
|
-
// await replace(
|
|
173
|
-
// Path.join(root, 'dist', commitHash, 'packages', 'extension-host-worker', 'dist', 'extensionHostWorkerMain.js'),
|
|
174
|
-
// `return \`\${assetDir}/extensions/builtin.\${iconThemeId}/icon-theme.json\``,
|
|
175
|
-
// `return \`\${assetDir}/icon-themes/\${iconThemeId}.json\``,
|
|
176
|
-
// )
|
|
177
|
-
|
|
178
164
|
const extensionDirents = await FileSystem.readDir(Path.join(serverStaticPath, commitHash, 'extensions'))
|
|
179
165
|
|
|
180
166
|
const languageBasicsDirents = extensionDirents.filter(isLanguageBasics)
|
|
@@ -5,9 +5,6 @@ export const getCustomPathsConfig = (preferences) => {
|
|
|
5
5
|
if (preferences['develop.rendererProcessPath']) {
|
|
6
6
|
config.rendererProcessPath = GetRemoteUrl.getRemoteUrl(preferences['develop.rendererProcessPath'])
|
|
7
7
|
}
|
|
8
|
-
if (preferences['develop.extensionHostWorkerPath']) {
|
|
9
|
-
config.extensionHostWorkerUrl = GetRemoteUrl.getRemoteUrl(preferences['develop.extensionHostWorkerPath'])
|
|
10
|
-
}
|
|
11
8
|
if (preferences['develop.editorWorkerPath']) {
|
|
12
9
|
config.editorWorkerUrl = GetRemoteUrl.getRemoteUrl(preferences['develop.editorWorkerPath'])
|
|
13
10
|
}
|
|
@@ -103,51 +103,6 @@ export const getModuleId = (commandId) => {
|
|
|
103
103
|
return ModuleId.Exec
|
|
104
104
|
case 'Exit.exit':
|
|
105
105
|
return ModuleId.Exit
|
|
106
|
-
case 'ExtensionHost.dispose':
|
|
107
|
-
case 'ExtensionHost.enableExtension':
|
|
108
|
-
case 'ExtensionHost.executeCommand':
|
|
109
|
-
case 'ExtensionHost.executeTabCompletionProvider':
|
|
110
|
-
case 'ExtensionHost.format':
|
|
111
|
-
case 'ExtensionHost.getMemoryUsage':
|
|
112
|
-
case 'ExtensionHost.getSourceControlBadgeCount':
|
|
113
|
-
case 'ExtensionHost.getStatusBarItems':
|
|
114
|
-
case 'ExtensionHost.registerChangeListener':
|
|
115
|
-
case 'ExtensionHost.setWorkspacePath':
|
|
116
|
-
case 'ExtensionHost.sourceControlGetChangedFiles':
|
|
117
|
-
case 'ExtensionHost.start':
|
|
118
|
-
case 'ExtensionHostBraceCompletion.executeBraceCompletionProvider':
|
|
119
|
-
case 'ExtensionHostClosingTag.execute':
|
|
120
|
-
case 'ExtensionHostClosingTag.executeClosingTagProvider':
|
|
121
|
-
case 'ExtensionHostClosingTag.executeTypeDefinitionProvider':
|
|
122
|
-
case 'ExtensionHostCompletion.execute':
|
|
123
|
-
case 'ExtensionHostDefinition.executeDefinitionProvider':
|
|
124
|
-
case 'ExtensionHostDiagnostic.execute':
|
|
125
|
-
case 'ExtensionHostFileSystem.getPathSeparator':
|
|
126
|
-
case 'ExtensionHostFileSystem.readDirWithFileTypes':
|
|
127
|
-
case 'ExtensionHostFileSystem.readFile':
|
|
128
|
-
case 'ExtensionHostFileSystem.remove':
|
|
129
|
-
case 'ExtensionHostFileSystem.rename':
|
|
130
|
-
case 'ExtensionHostFileSystem.writeFile':
|
|
131
|
-
case 'ExtensionHostHover.execute':
|
|
132
|
-
case 'ExtensionHostImplementation.executeImplementationProvider':
|
|
133
|
-
case 'ExtensionHostKeyBindings.getKeyBindings':
|
|
134
|
-
case 'ExtensionHostLanguages.getLanguages':
|
|
135
|
-
case 'ExtensionHostManagement.activateAll':
|
|
136
|
-
case 'ExtensionHostManagement.enableExtensions':
|
|
137
|
-
case 'ExtensionHostOutput.getOutputChannels':
|
|
138
|
-
case 'ExtensionHostQuickPick.handleQuickPickResult':
|
|
139
|
-
case 'ExtensionHostReferences.executeReferenceProvider':
|
|
140
|
-
case 'EXtensionHostRename.executePrepareRename':
|
|
141
|
-
case 'ExtensionHostRename.executeRename':
|
|
142
|
-
case 'ExtensionHostSemanticTokens.executeSemanticTokenProvider':
|
|
143
|
-
case 'ExtensionHostSourceControl.acceptInput':
|
|
144
|
-
case 'ExtensionHostTextDocument':
|
|
145
|
-
case 'ExtensionHostTextDocument.setLanguageId':
|
|
146
|
-
case 'ExtensionHostTextDocument.syncFull':
|
|
147
|
-
case 'ExtensionHostTextDocument.syncIncremental':
|
|
148
|
-
case 'ExtensionHostTextDocument.syncInitial':
|
|
149
|
-
case 'ExtensionHostWorkspace.setWorkspacePath':
|
|
150
|
-
return ModuleId.ExtensionHost
|
|
151
106
|
case 'ExtensionHost.getColorThemeJson':
|
|
152
107
|
case 'ExtensionHost.getColorThemeNames':
|
|
153
108
|
case 'ExtensionHost.getColorThemes':
|
|
@@ -61,11 +61,11 @@ export const getSetupName = () => {
|
|
|
61
61
|
return 'Lvce-Setup'
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
export const version = '0.95.
|
|
64
|
+
export const version = '0.95.9'
|
|
65
65
|
|
|
66
|
-
export const commit = '
|
|
66
|
+
export const commit = 'b0bd3ec'
|
|
67
67
|
|
|
68
|
-
export const date = '2026-07-
|
|
68
|
+
export const date = '2026-07-31T19:31:41.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', '
|
|
5
|
+
return join(Root.root, 'static', 'b0bd3ec', 'packages', 'preload', 'dist', 'index.js')
|
|
6
6
|
}
|
|
@@ -251,15 +251,6 @@
|
|
|
251
251
|
"settingName": "develop.extensionHostSubWorkerPath",
|
|
252
252
|
"hotReloadCommand": ""
|
|
253
253
|
},
|
|
254
|
-
{
|
|
255
|
-
"id": "extensionHostWorker",
|
|
256
|
-
"fileName": "extensionHostWorkerMain.js",
|
|
257
|
-
"contentSecurityPolicy": ["default-src 'none'", "connect-src 'self'", "script-src 'self'", "font-src 'self'"],
|
|
258
|
-
"defaultPath": "/packages/renderer-worker/node_modules/@lvce-editor/extension-host-worker/dist/extensionHostWorkerMain.js",
|
|
259
|
-
"productionPath": "/packages/extension-host-worker/dist/extensionHostWorkerMain.js",
|
|
260
|
-
"settingName": "develop.extensionHostWorkerPath",
|
|
261
|
-
"hotReloadCommand": ""
|
|
262
|
-
},
|
|
263
254
|
{
|
|
264
255
|
"id": "extensionManagementWorker",
|
|
265
256
|
"fileName": "extensionManagementWorkerMain.js",
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import * as Assert from '../Assert/Assert.js'
|
|
2
|
-
import * as Logger from '../Logger/Logger.js'
|
|
3
|
-
import * as Timeout from '../Timeout/Timeout.js'
|
|
4
|
-
import { VError } from '../VError/VError.js'
|
|
5
|
-
// TODO maybe rename to extension host management for clarity
|
|
6
|
-
|
|
7
|
-
const CONNECTION_TIMEOUT = 3000
|
|
8
|
-
|
|
9
|
-
export const create = async (ipc, socket) => {
|
|
10
|
-
Assert.object(socket)
|
|
11
|
-
|
|
12
|
-
const handleChildProcessError = (error) => {
|
|
13
|
-
Logger.error(`[Extension Host] ${error}`)
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const handleChildProcessExit = (exitCode) => {
|
|
17
|
-
Logger.info(`[SharedProcess] Extension Host exited with code ${exitCode}`)
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const handleSocketClose = () => {
|
|
21
|
-
Logger.info('[shared process] disposing extension host')
|
|
22
|
-
ipc.dispose()
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
socket.on('close', handleSocketClose)
|
|
26
|
-
|
|
27
|
-
ipc.on('error', handleChildProcessError)
|
|
28
|
-
|
|
29
|
-
ipc.on('exit', handleChildProcessExit)
|
|
30
|
-
|
|
31
|
-
await new Promise((resolve, reject) => {
|
|
32
|
-
const handleFirstError = (error) => {
|
|
33
|
-
cleanup()
|
|
34
|
-
reject(error)
|
|
35
|
-
}
|
|
36
|
-
const handleFirstExit = (exitCode) => {
|
|
37
|
-
cleanup()
|
|
38
|
-
reject(new VError(`Extension Host exited with code ${exitCode}`))
|
|
39
|
-
}
|
|
40
|
-
const handleFirstMessage = (message) => {
|
|
41
|
-
cleanup()
|
|
42
|
-
if (message === 'ready') {
|
|
43
|
-
resolve(undefined)
|
|
44
|
-
} else {
|
|
45
|
-
reject(new VError('Unexpected first message from extension host'))
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
const handleSocketClose = () => {
|
|
49
|
-
cleanup()
|
|
50
|
-
ipc.off('error', handleChildProcessError)
|
|
51
|
-
ipc.off('exit', handleChildProcessExit)
|
|
52
|
-
resolve(undefined)
|
|
53
|
-
}
|
|
54
|
-
const cleanup = () => {
|
|
55
|
-
ipc.off('error', handleFirstError)
|
|
56
|
-
ipc.off('exit', handleFirstExit)
|
|
57
|
-
ipc.off('message', handleFirstMessage)
|
|
58
|
-
clearTimeout(timeout)
|
|
59
|
-
}
|
|
60
|
-
const handleTimeout = () => {
|
|
61
|
-
cleanup()
|
|
62
|
-
reject(new VError('Extension host did not connect'))
|
|
63
|
-
}
|
|
64
|
-
const timeout = Timeout.setTimeout(handleTimeout, CONNECTION_TIMEOUT)
|
|
65
|
-
ipc.on('error', handleFirstError)
|
|
66
|
-
ipc.on('exit', handleFirstExit)
|
|
67
|
-
ipc.on('message', handleFirstMessage)
|
|
68
|
-
socket.on('close', handleSocketClose)
|
|
69
|
-
})
|
|
70
|
-
|
|
71
|
-
return {
|
|
72
|
-
dispose() {
|
|
73
|
-
ipc.dispose()
|
|
74
|
-
},
|
|
75
|
-
on(event, listener) {
|
|
76
|
-
ipc.on(event, listener)
|
|
77
|
-
},
|
|
78
|
-
send(message) {
|
|
79
|
-
ipc.send(message)
|
|
80
|
-
},
|
|
81
|
-
}
|
|
82
|
-
}
|