@lvce-editor/pty-host 5.2.0 → 5.3.0

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.
@@ -1,5 +1,4 @@
1
1
  import debugModule from 'debug';
2
- import { spawn } from 'node-pty';
3
2
  import { Console } from 'node:console';
4
3
  import { createWriteStream, readFileSync } from 'node:fs';
5
4
  import { tmpdir } from 'node:os';
@@ -1363,9 +1362,9 @@ class Pty extends EventTarget {
1363
1362
  /**
1364
1363
  *
1365
1364
  * @param {*} param0
1366
- * @returns {any}
1365
+ * @returns {Promise<any>}
1367
1366
  */
1368
- const create$1 = ({
1367
+ const create$1 = async ({
1369
1368
  cwd,
1370
1369
  command,
1371
1370
  args
@@ -1374,6 +1373,9 @@ const create$1 = ({
1374
1373
  string(cwd);
1375
1374
  string(command);
1376
1375
  array(args);
1376
+ const {
1377
+ spawn
1378
+ } = await import('node-pty');
1377
1379
  const pty = spawn(command, args, {
1378
1380
  encoding: null,
1379
1381
  cwd
@@ -1401,7 +1403,7 @@ const remove = id => {
1401
1403
  };
1402
1404
 
1403
1405
  // TODO maybe merge pty and pty controller
1404
- const create = (ipc, id, cwd, command, args) => {
1406
+ const create = async (ipc, id, cwd, command, args) => {
1405
1407
  number(id);
1406
1408
  string(cwd);
1407
1409
  string(command);
@@ -1409,7 +1411,7 @@ const create = (ipc, id, cwd, command, args) => {
1409
1411
  object(ipc);
1410
1412
  debug(`create ${id} ${cwd}`);
1411
1413
  // @ts-ignore
1412
- const pty = create$1({
1414
+ const pty = await create$1({
1413
1415
  cwd,
1414
1416
  command,
1415
1417
  args
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/pty-host",
3
- "version": "5.2.0",
3
+ "version": "5.3.0",
4
4
  "keywords": [
5
5
  "lvce-editor",
6
6
  "pty-host"