@lvce-editor/shared-process 0.24.0 → 0.24.2
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 +5 -5
- package/src/parts/CliHelp/CliHelp.js +10 -0
- package/src/parts/CliModule/CliModule.js +6 -0
- package/src/parts/CliVersion/CliVersion.js +9 -0
- package/src/parts/ElectronBrowserViewIpcState/ElectronBrowserViewIpcState.js +1 -1
- package/src/parts/ElectronWebContents/ElectronWebContents.js +5 -1
- package/src/parts/ElectronWebContentsView/ElectronWebContentsView.js +6 -1
- package/src/parts/GetHelpString/GetHelpString.js +9 -0
- package/src/parts/GetVersionString/GetVersionString.js +6 -0
- package/src/parts/Platform/Platform.js +3 -3
- package/src/parts/RequiresSocket/RequiresSocket.js +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/shared-process",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.2",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@lvce-editor/assert": "^1.2.0",
|
|
21
|
-
"@lvce-editor/extension-host-helper-process": "0.24.
|
|
21
|
+
"@lvce-editor/extension-host-helper-process": "0.24.2",
|
|
22
22
|
"@lvce-editor/ipc": "^2.1.0",
|
|
23
23
|
"@lvce-editor/json-rpc": "^1.0.0",
|
|
24
|
-
"@lvce-editor/jsonc-parser": "^1.1.
|
|
24
|
+
"@lvce-editor/jsonc-parser": "^1.1.1",
|
|
25
25
|
"@lvce-editor/pretty-error": "^1.5.0",
|
|
26
|
-
"@lvce-editor/pty-host": "0.24.
|
|
26
|
+
"@lvce-editor/pty-host": "0.24.2",
|
|
27
27
|
"@lvce-editor/verror": "^1.1.2",
|
|
28
28
|
"@lvce-editor/web-socket-server": "^1.1.0",
|
|
29
29
|
"debug": "^4.3.4",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"optionalDependencies": {
|
|
39
39
|
"@lvce-editor/ripgrep": "^1.0.2",
|
|
40
40
|
"extract-zip": "^2.0.1",
|
|
41
|
-
"open": "^10.0.
|
|
41
|
+
"open": "^10.0.4",
|
|
42
42
|
"tail": "^2.2.6",
|
|
43
43
|
"tmp-promise": "^3.0.3",
|
|
44
44
|
"trash": "^8.1.1"
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as Exit from '../Exit/Exit.js'
|
|
2
|
+
import * as GetHelpString from '../GetHelpString/GetHelpString.js'
|
|
3
|
+
import * as Logger from '../Logger/Logger.js'
|
|
4
|
+
|
|
5
|
+
export const handleCliArgs = (parsedArgs) => {
|
|
6
|
+
const helpString = GetHelpString.getHelpString()
|
|
7
|
+
Logger.info(helpString)
|
|
8
|
+
Exit.exit()
|
|
9
|
+
return true
|
|
10
|
+
}
|
|
@@ -6,6 +6,12 @@ export const getModule = (parsedArgs) => {
|
|
|
6
6
|
if (parsedArgs[CliCommandType.Status]) {
|
|
7
7
|
return import('../CliStatus/CliStatus.js')
|
|
8
8
|
}
|
|
9
|
+
if (parsedArgs[CliCommandType.Version]) {
|
|
10
|
+
return import('../CliVersion/CliVersion.js')
|
|
11
|
+
}
|
|
12
|
+
if (parsedArgs[CliCommandType.Help]) {
|
|
13
|
+
return import('../CliHelp/CliHelp.js')
|
|
14
|
+
}
|
|
9
15
|
const argv0 = parsedArgs._[0]
|
|
10
16
|
switch (argv0) {
|
|
11
17
|
case CliCommandType.Install:
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as Exit from '../Exit/Exit.js'
|
|
2
|
+
import * as GetVersionString from '../GetVersionString/GetVersionString.js'
|
|
3
|
+
import * as Logger from '../Logger/Logger.js'
|
|
4
|
+
|
|
5
|
+
export const handleCliArgs = async (argv) => {
|
|
6
|
+
const versionString = GetVersionString.getVersionString()
|
|
7
|
+
Logger.info(versionString)
|
|
8
|
+
await Exit.exit()
|
|
9
|
+
}
|
|
@@ -41,7 +41,7 @@ export const handleWindowOpen = (webContentsId, url) => {
|
|
|
41
41
|
const forwardEvent = (method, webContentsId, ...params) => {
|
|
42
42
|
const ipc = ElectronBrowserViewIpcState.get(webContentsId)
|
|
43
43
|
if (!ipc) {
|
|
44
|
-
console.log(
|
|
44
|
+
console.log(`[shared-process] no ipc for webcontents ${webContentsId}`)
|
|
45
45
|
return
|
|
46
46
|
}
|
|
47
47
|
ipc.send({
|
|
@@ -67,6 +67,10 @@ export const handleTitleUpdated = (...args) => {
|
|
|
67
67
|
return forwardEvent('handleTitleUpdated', ...args)
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
export const handleKeyBinding = (...args) => {
|
|
71
|
+
forwardEvent('handleKeyBinding', ...args)
|
|
72
|
+
}
|
|
73
|
+
|
|
70
74
|
export const handleBrowserViewDestroyed = (id) => {
|
|
71
75
|
ElectronBrowserViewState.remove(id)
|
|
72
76
|
ElectronBrowserViewIpcState.remove(id)
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
+
import * as ElectronBrowserViewIpcState from '../ElectronBrowserViewIpcState/ElectronBrowserViewIpcState.js'
|
|
1
2
|
import * as ElectronWebContents from '../ElectronWebContents/ElectronWebContents.js'
|
|
2
3
|
import * as ParentIpc from '../ParentIpc/ParentIpc.js'
|
|
4
|
+
import * as Assert from '../Assert/Assert.js'
|
|
3
5
|
|
|
4
6
|
export const createWebContentsView = async (ipc, restoreId, fallthroughKeyBindings) => {
|
|
7
|
+
Assert.object(ipc)
|
|
8
|
+
Assert.number(restoreId)
|
|
5
9
|
const webContentsId = await ParentIpc.invoke('ElectronWebContentsView.createWebContentsView', restoreId)
|
|
10
|
+
ElectronBrowserViewIpcState.add(webContentsId, ipc)
|
|
6
11
|
// TODO get window id from renderer worker
|
|
7
12
|
await ParentIpc.invoke('ElectronWebContentsView.attachEventListeners', webContentsId)
|
|
8
|
-
|
|
13
|
+
await ParentIpc.invoke('ElectronWebContentsViewFunctions.setBackgroundColor', webContentsId, 'white')
|
|
9
14
|
return webContentsId
|
|
10
15
|
}
|
|
11
16
|
|
|
@@ -61,11 +61,11 @@ export const getSetupName = () => {
|
|
|
61
61
|
return 'Lvce-Setup'
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
export const version = '0.24.
|
|
64
|
+
export const version = '0.24.2'
|
|
65
65
|
|
|
66
|
-
export const commit = '
|
|
66
|
+
export const commit = '2e025bb'
|
|
67
67
|
|
|
68
|
-
export const date = '2024-02-
|
|
68
|
+
export const date = '2024-02-27T21:45:27.000Z'
|
|
69
69
|
|
|
70
70
|
export const getVersion = () => {
|
|
71
71
|
return version
|
|
@@ -12,6 +12,7 @@ const METHODS_THAT_REQUIRE_SOCKET = new Set([
|
|
|
12
12
|
'GetWindowId.getWindowId',
|
|
13
13
|
'HandleMessagePortForExtensionHostHelperProcess.handleMessagePortForExtensionHostHelperProcess',
|
|
14
14
|
'ElectronBrowserView.createBrowserView',
|
|
15
|
+
'ElectronWebContentsView.createWebContentsView',
|
|
15
16
|
])
|
|
16
17
|
|
|
17
18
|
export const requiresSocket = (method) => {
|