@lvce-editor/extension-host-helper-process 0.15.25 → 0.15.27

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/extension-host-helper-process",
3
- "version": "0.15.25",
3
+ "version": "0.15.27",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -16,13 +16,13 @@
16
16
  "node": ">=16"
17
17
  },
18
18
  "dependencies": {
19
- "@babel/code-frame": "^7.18.6",
19
+ "@babel/code-frame": "^7.21.4",
20
20
  "clean-stack": "^5.0.1",
21
- "execa": "^6.1.0",
22
- "got": "^12.5.3",
21
+ "execa": "^7.1.1",
22
+ "got": "^13.0.0",
23
23
  "lines-and-columns": "^2.0.3",
24
24
  "minimist": "^1.2.8",
25
25
  "verror": "^1.10.1",
26
- "ws": "^8.11.0"
26
+ "ws": "^8.13.0"
27
27
  }
28
28
  }
@@ -0,0 +1,5 @@
1
+ export const Error = 1
2
+
3
+ export const ExpectedError = 128
4
+
5
+ export const Success = 0
@@ -3,8 +3,10 @@ import * as CommandState from '../CommandState/CommandState.js'
3
3
  import * as HandleIpc from '../HandleIpc/HandleIpc.js'
4
4
  import * as IpcChild from '../IpcChild/IpcChild.js'
5
5
  import * as IpcChildType from '../IpcChildType/IpcChildType.js'
6
+ import * as ProcessListeners from '../ProcessListeners/ProcessListeners.js'
6
7
 
7
8
  export const main = async () => {
9
+ process.on('disconnect', ProcessListeners.handleDisconnect)
8
10
  CommandState.registerCommands(CommandMap.commandMap)
9
11
  const ipc = await IpcChild.listen({ method: IpcChildType.Auto() })
10
12
  HandleIpc.handleIpc(ipc)
@@ -0,0 +1,9 @@
1
+ import * as Process from './Process.js'
2
+
3
+ export const name = 'Process'
4
+
5
+ export const Commands = {
6
+ crash: Process.crash,
7
+ crashAsync: Process.crashAsync,
8
+ getPid: Process.getPid,
9
+ }
@@ -0,0 +1,7 @@
1
+ export const exit = (code) => {
2
+ process.exit(code)
3
+ }
4
+
5
+ export const setExitCode = (exitCode) => {
6
+ process.exitCode = exitCode
7
+ }
@@ -0,0 +1,12 @@
1
+ import * as ExitCode from '../ExitCode/ExitCode.js'
2
+ import * as Process from '../Process/Process.js'
3
+
4
+ export const handleDisconnect = () => {
5
+ console.info('[shared process] disconnected')
6
+ Process.exit(ExitCode.Success)
7
+ }
8
+
9
+ export const handleSigTerm = () => {
10
+ console.info('[shared-process] sigterm')
11
+ Process.exit(ExitCode.Success)
12
+ }