@lvce-editor/pty-host 0.15.29 → 0.15.30

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/pty-host",
3
- "version": "0.15.29",
3
+ "version": "0.15.30",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -23,6 +23,6 @@
23
23
  "ws": "^8.13.0"
24
24
  },
25
25
  "optionalDependencies": {
26
- "node-pty": "^0.11.0-beta27"
26
+ "node-pty": "^1.0.0"
27
27
  }
28
28
  }
@@ -1,8 +1,9 @@
1
1
  import { parentPort } from 'node:worker_threads'
2
+ import { IpcError } from '../IpcError/IpcError.js'
2
3
 
3
4
  export const listen = async () => {
4
5
  if (!parentPort) {
5
- throw new Error('parentPort is required')
6
+ throw new IpcError('parentPort is required')
6
7
  }
7
8
  parentPort.postMessage('ready')
8
9
  return parentPort
@@ -0,0 +1,9 @@
1
+ import * as JsonRpcVersion from '../JsonRpcVersion/JsonRpcVersion.js'
2
+
3
+ export const create = (method, params) => {
4
+ return {
5
+ jsonrpc: JsonRpcVersion.Two,
6
+ method,
7
+ params: params,
8
+ }
9
+ }
@@ -0,0 +1,16 @@
1
+ import * as Callback from '../Callback/Callback.js'
2
+ import * as JsonRpcVersion from '../JsonRpcVersion/JsonRpcVersion.js'
3
+
4
+ export const create = (method, params) => {
5
+ const { id, promise } = Callback.registerPromise()
6
+ const message = {
7
+ jsonrpc: JsonRpcVersion.Two,
8
+ method,
9
+ params,
10
+ id,
11
+ }
12
+ return {
13
+ message,
14
+ promise,
15
+ }
16
+ }
@@ -1,7 +1,3 @@
1
1
  import * as Main from './parts/Main/Main.js'
2
2
 
3
- const main = async () => {
4
- await Main.main()
5
- }
6
-
7
- main()
3
+ Main.main()