@lvce-editor/ipc 14.5.0 → 14.7.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.
- package/dist/index.js +114 -114
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -197,8 +197,8 @@ const getModuleNotFoundError = stderr => {
|
|
|
197
197
|
const messageIndex = lines.findIndex(isModuleNotFoundMessage);
|
|
198
198
|
const message = lines[messageIndex];
|
|
199
199
|
return {
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
code: ERR_MODULE_NOT_FOUND,
|
|
201
|
+
message
|
|
202
202
|
};
|
|
203
203
|
};
|
|
204
204
|
|
|
@@ -225,14 +225,14 @@ const isUnhelpfulNativeModuleError = stderr => {
|
|
|
225
225
|
const getNativeModuleErrorMessage = stderr => {
|
|
226
226
|
const message = getMessageCodeBlock(stderr);
|
|
227
227
|
return {
|
|
228
|
-
|
|
229
|
-
|
|
228
|
+
code: E_INCOMPATIBLE_NATIVE_MODULE,
|
|
229
|
+
message: `Incompatible native node module: ${message}`
|
|
230
230
|
};
|
|
231
231
|
};
|
|
232
232
|
const getModuleSyntaxError = () => {
|
|
233
233
|
return {
|
|
234
|
-
|
|
235
|
-
|
|
234
|
+
code: E_MODULES_NOT_SUPPORTED_IN_ELECTRON,
|
|
235
|
+
message: `ES Modules are not supported in electron`
|
|
236
236
|
};
|
|
237
237
|
};
|
|
238
238
|
const getHelpfulChildProcessError = (stdout, stderr) => {
|
|
@@ -251,8 +251,8 @@ const getHelpfulChildProcessError = (stdout, stderr) => {
|
|
|
251
251
|
rest
|
|
252
252
|
} = getDetails(lines);
|
|
253
253
|
return {
|
|
254
|
-
message: actualMessage,
|
|
255
254
|
code: '',
|
|
255
|
+
message: actualMessage,
|
|
256
256
|
stack: rest
|
|
257
257
|
};
|
|
258
258
|
};
|
|
@@ -263,8 +263,8 @@ class IpcError extends VError {
|
|
|
263
263
|
if (stdout || stderr) {
|
|
264
264
|
// @ts-ignore
|
|
265
265
|
const {
|
|
266
|
-
message,
|
|
267
266
|
code,
|
|
267
|
+
message,
|
|
268
268
|
stack
|
|
269
269
|
} = getHelpfulChildProcessError(stdout, stderr);
|
|
270
270
|
const cause = new Error(message);
|
|
@@ -398,7 +398,7 @@ const getData$2 = event => {
|
|
|
398
398
|
};
|
|
399
399
|
|
|
400
400
|
const listen$9 = () => {
|
|
401
|
-
return
|
|
401
|
+
return globalThis;
|
|
402
402
|
};
|
|
403
403
|
const signal$a = global => {
|
|
404
404
|
global.postMessage(readyMessage);
|
|
@@ -428,7 +428,7 @@ class IpcChildWithElectronWindow extends Ipc {
|
|
|
428
428
|
const {
|
|
429
429
|
ports
|
|
430
430
|
} = event;
|
|
431
|
-
if (ports.length) {
|
|
431
|
+
if (ports.length > 0) {
|
|
432
432
|
return;
|
|
433
433
|
}
|
|
434
434
|
callback(event);
|
|
@@ -535,8 +535,8 @@ const IpcChildWithModuleWorker$1 = {
|
|
|
535
535
|
|
|
536
536
|
const waitForFirstMessage = async port => {
|
|
537
537
|
const {
|
|
538
|
-
|
|
539
|
-
|
|
538
|
+
promise,
|
|
539
|
+
resolve
|
|
540
540
|
} = Promise.withResolvers();
|
|
541
541
|
port.addEventListener('message', resolve, {
|
|
542
542
|
once: true
|
|
@@ -557,8 +557,8 @@ const listen$6 = async () => {
|
|
|
557
557
|
const type = firstMessage.params[0];
|
|
558
558
|
if (type === 'message-port') {
|
|
559
559
|
parentIpc.send({
|
|
560
|
-
jsonrpc: '2.0',
|
|
561
560
|
id: firstMessage.id,
|
|
561
|
+
jsonrpc: '2.0',
|
|
562
562
|
result: null
|
|
563
563
|
});
|
|
564
564
|
parentIpc.dispose();
|
|
@@ -673,7 +673,12 @@ const signal$6 = messagePort => {
|
|
|
673
673
|
};
|
|
674
674
|
const wrap$c = port => {
|
|
675
675
|
return {
|
|
676
|
-
|
|
676
|
+
dispose() {
|
|
677
|
+
this.port.close();
|
|
678
|
+
},
|
|
679
|
+
off(event, listener) {
|
|
680
|
+
this.port.off(event, listener);
|
|
681
|
+
},
|
|
677
682
|
on(event, listener) {
|
|
678
683
|
const wrappedListener = message => {
|
|
679
684
|
const event = {
|
|
@@ -684,15 +689,10 @@ const wrap$c = port => {
|
|
|
684
689
|
};
|
|
685
690
|
this.port.on(event, wrappedListener);
|
|
686
691
|
},
|
|
687
|
-
|
|
688
|
-
this.port.off(event, listener);
|
|
689
|
-
},
|
|
692
|
+
port,
|
|
690
693
|
send(message) {
|
|
691
694
|
this.port.postMessage(message);
|
|
692
695
|
},
|
|
693
|
-
dispose() {
|
|
694
|
-
this.port.close();
|
|
695
|
-
},
|
|
696
696
|
start() {
|
|
697
697
|
throw new Error('start method is deprecated');
|
|
698
698
|
}
|
|
@@ -818,8 +818,8 @@ const removeListener = (emitter, type, callback) => {
|
|
|
818
818
|
};
|
|
819
819
|
const getFirstEvent = (eventEmitter, eventMap) => {
|
|
820
820
|
const {
|
|
821
|
-
|
|
822
|
-
|
|
821
|
+
promise,
|
|
822
|
+
resolve
|
|
823
823
|
} = Promise.withResolvers();
|
|
824
824
|
const listenerMap = Object.create(null);
|
|
825
825
|
const cleanup = value => {
|
|
@@ -831,8 +831,8 @@ const getFirstEvent = (eventEmitter, eventMap) => {
|
|
|
831
831
|
for (const [event, type] of Object.entries(eventMap)) {
|
|
832
832
|
const listener = event => {
|
|
833
833
|
cleanup({
|
|
834
|
-
|
|
835
|
-
|
|
834
|
+
event,
|
|
835
|
+
type
|
|
836
836
|
});
|
|
837
837
|
};
|
|
838
838
|
addListener(eventEmitter, event, listener);
|
|
@@ -848,28 +848,28 @@ const getFirstWebSocketEvent = async webSocket => {
|
|
|
848
848
|
WebSocket
|
|
849
849
|
} = await import('ws');
|
|
850
850
|
switch (webSocket.readyState) {
|
|
851
|
-
case WebSocket.
|
|
851
|
+
case WebSocket.CLOSED:
|
|
852
852
|
return {
|
|
853
|
-
|
|
854
|
-
|
|
853
|
+
event: undefined,
|
|
854
|
+
type: Close
|
|
855
855
|
};
|
|
856
|
-
case WebSocket.
|
|
856
|
+
case WebSocket.OPEN:
|
|
857
857
|
return {
|
|
858
|
-
|
|
859
|
-
|
|
858
|
+
event: undefined,
|
|
859
|
+
type: Open
|
|
860
860
|
};
|
|
861
861
|
}
|
|
862
862
|
// @ts-ignore
|
|
863
863
|
const {
|
|
864
|
-
|
|
865
|
-
|
|
864
|
+
event,
|
|
865
|
+
type
|
|
866
866
|
} = await getFirstEvent(webSocket, {
|
|
867
|
-
|
|
868
|
-
|
|
867
|
+
close: Close,
|
|
868
|
+
open: Open
|
|
869
869
|
});
|
|
870
870
|
return {
|
|
871
|
-
|
|
872
|
-
|
|
871
|
+
event,
|
|
872
|
+
type
|
|
873
873
|
};
|
|
874
874
|
};
|
|
875
875
|
|
|
@@ -900,8 +900,8 @@ const handleUpgrade = async (...args) => {
|
|
|
900
900
|
};
|
|
901
901
|
|
|
902
902
|
const listen$1 = async ({
|
|
903
|
-
|
|
904
|
-
|
|
903
|
+
handle,
|
|
904
|
+
request
|
|
905
905
|
}) => {
|
|
906
906
|
if (!request) {
|
|
907
907
|
throw new IpcError('request must be defined');
|
|
@@ -921,14 +921,19 @@ const signal$4 = webSocket => {
|
|
|
921
921
|
};
|
|
922
922
|
const wrap$9 = webSocket => {
|
|
923
923
|
return {
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
924
|
+
dispose() {
|
|
925
|
+
this.webSocket.close();
|
|
926
|
+
},
|
|
927
|
+
// @ts-ignore
|
|
928
|
+
off(event, listener) {
|
|
929
|
+
this.webSocket.off(event, listener);
|
|
930
|
+
},
|
|
929
931
|
// @ts-ignore
|
|
930
932
|
on(event, listener) {
|
|
931
933
|
switch (event) {
|
|
934
|
+
case 'close':
|
|
935
|
+
webSocket.on('close', listener);
|
|
936
|
+
break;
|
|
932
937
|
case 'message':
|
|
933
938
|
// @ts-ignore
|
|
934
939
|
const wrappedListener = message => {
|
|
@@ -941,28 +946,23 @@ const wrap$9 = webSocket => {
|
|
|
941
946
|
};
|
|
942
947
|
webSocket.on('message', wrappedListener);
|
|
943
948
|
break;
|
|
944
|
-
case 'close':
|
|
945
|
-
webSocket.on('close', listener);
|
|
946
|
-
break;
|
|
947
949
|
default:
|
|
948
950
|
throw new Error('unknown event listener type');
|
|
949
951
|
}
|
|
950
952
|
},
|
|
951
953
|
// @ts-ignore
|
|
952
|
-
off(event, listener) {
|
|
953
|
-
this.webSocket.off(event, listener);
|
|
954
|
-
},
|
|
955
|
-
// @ts-ignore
|
|
956
954
|
send(message) {
|
|
957
955
|
const stringifiedMessage = serialize(message);
|
|
958
956
|
this.webSocket.send(stringifiedMessage);
|
|
959
957
|
},
|
|
960
|
-
dispose() {
|
|
961
|
-
this.webSocket.close();
|
|
962
|
-
},
|
|
963
958
|
start() {
|
|
964
959
|
throw new Error('start method is deprecated');
|
|
965
|
-
}
|
|
960
|
+
},
|
|
961
|
+
webSocket,
|
|
962
|
+
/**
|
|
963
|
+
* @type {any}
|
|
964
|
+
*/
|
|
965
|
+
wrappedListener: undefined
|
|
966
966
|
};
|
|
967
967
|
};
|
|
968
968
|
|
|
@@ -974,7 +974,7 @@ const IpcChildWithWebSocket = {
|
|
|
974
974
|
};
|
|
975
975
|
|
|
976
976
|
const listen = () => {
|
|
977
|
-
return
|
|
977
|
+
return globalThis;
|
|
978
978
|
};
|
|
979
979
|
const signal$3 = global => {
|
|
980
980
|
global.postMessage(readyMessage);
|
|
@@ -1001,7 +1001,7 @@ class IpcChildWithWindow extends Ipc {
|
|
|
1001
1001
|
const {
|
|
1002
1002
|
ports
|
|
1003
1003
|
} = event;
|
|
1004
|
-
if (ports.length) {
|
|
1004
|
+
if (ports.length > 0) {
|
|
1005
1005
|
return;
|
|
1006
1006
|
}
|
|
1007
1007
|
callback(event);
|
|
@@ -1071,8 +1071,8 @@ const Message$1 = 3;
|
|
|
1071
1071
|
|
|
1072
1072
|
const getFirstUtilityProcessEvent = async utilityProcess => {
|
|
1073
1073
|
const {
|
|
1074
|
-
|
|
1075
|
-
|
|
1074
|
+
promise,
|
|
1075
|
+
resolve
|
|
1076
1076
|
} = Promise.withResolvers();
|
|
1077
1077
|
let stdout = '';
|
|
1078
1078
|
let stderr = '';
|
|
@@ -1093,18 +1093,18 @@ const getFirstUtilityProcessEvent = async utilityProcess => {
|
|
|
1093
1093
|
};
|
|
1094
1094
|
const handleMessage = event => {
|
|
1095
1095
|
cleanup({
|
|
1096
|
-
type: Message$1,
|
|
1097
1096
|
event,
|
|
1097
|
+
stderr,
|
|
1098
1098
|
stdout,
|
|
1099
|
-
|
|
1099
|
+
type: Message$1
|
|
1100
1100
|
});
|
|
1101
1101
|
};
|
|
1102
1102
|
const handleExit = event => {
|
|
1103
1103
|
cleanup({
|
|
1104
|
-
type: Exit,
|
|
1105
1104
|
event,
|
|
1105
|
+
stderr,
|
|
1106
1106
|
stdout,
|
|
1107
|
-
|
|
1107
|
+
type: Exit
|
|
1108
1108
|
});
|
|
1109
1109
|
};
|
|
1110
1110
|
// @ts-ignore
|
|
@@ -1114,23 +1114,23 @@ const getFirstUtilityProcessEvent = async utilityProcess => {
|
|
|
1114
1114
|
utilityProcess.on('message', handleMessage);
|
|
1115
1115
|
utilityProcess.on('exit', handleExit);
|
|
1116
1116
|
const {
|
|
1117
|
-
|
|
1118
|
-
|
|
1117
|
+
event,
|
|
1118
|
+
type
|
|
1119
1119
|
} = await promise;
|
|
1120
1120
|
return {
|
|
1121
|
-
type,
|
|
1122
1121
|
event,
|
|
1122
|
+
stderr,
|
|
1123
1123
|
stdout,
|
|
1124
|
-
|
|
1124
|
+
type
|
|
1125
1125
|
};
|
|
1126
1126
|
};
|
|
1127
1127
|
|
|
1128
1128
|
const create$6 = async ({
|
|
1129
|
-
path,
|
|
1130
1129
|
argv = [],
|
|
1130
|
+
env = process.env,
|
|
1131
1131
|
execArgv = [],
|
|
1132
1132
|
name,
|
|
1133
|
-
|
|
1133
|
+
path
|
|
1134
1134
|
}) => {
|
|
1135
1135
|
string(path);
|
|
1136
1136
|
const actualArgv = ['--ipc-type=electron-utility-process', ...argv];
|
|
@@ -1138,10 +1138,10 @@ const create$6 = async ({
|
|
|
1138
1138
|
utilityProcess
|
|
1139
1139
|
} = await import('electron');
|
|
1140
1140
|
const childProcess = utilityProcess.fork(path, actualArgv, {
|
|
1141
|
+
env,
|
|
1141
1142
|
execArgv,
|
|
1142
|
-
stdio: 'pipe',
|
|
1143
1143
|
serviceName: name,
|
|
1144
|
-
|
|
1144
|
+
stdio: 'pipe'
|
|
1145
1145
|
});
|
|
1146
1146
|
const handleExit = () => {
|
|
1147
1147
|
// @ts-ignore
|
|
@@ -1153,9 +1153,9 @@ const create$6 = async ({
|
|
|
1153
1153
|
// @ts-ignore
|
|
1154
1154
|
childProcess.stdout.pipe(process.stdout);
|
|
1155
1155
|
const {
|
|
1156
|
-
|
|
1156
|
+
stderr,
|
|
1157
1157
|
stdout,
|
|
1158
|
-
|
|
1158
|
+
type
|
|
1159
1159
|
} = await getFirstUtilityProcessEvent(childProcess);
|
|
1160
1160
|
if (type === Exit) {
|
|
1161
1161
|
throw new IpcError(`Utility process exited before ipc connection was established`, stdout, stderr);
|
|
@@ -1199,8 +1199,8 @@ const IpcParentWithElectronUtilityProcess$1 = {
|
|
|
1199
1199
|
};
|
|
1200
1200
|
|
|
1201
1201
|
const create$5 = async ({
|
|
1202
|
-
|
|
1203
|
-
|
|
1202
|
+
isMessagePortOpen,
|
|
1203
|
+
messagePort
|
|
1204
1204
|
}) => {
|
|
1205
1205
|
if (!isMessagePort(messagePort)) {
|
|
1206
1206
|
throw new IpcError('port must be of type MessagePort');
|
|
@@ -1213,8 +1213,8 @@ const create$5 = async ({
|
|
|
1213
1213
|
});
|
|
1214
1214
|
messagePort.start();
|
|
1215
1215
|
const {
|
|
1216
|
-
|
|
1217
|
-
|
|
1216
|
+
event,
|
|
1217
|
+
type
|
|
1218
1218
|
} = await eventPromise;
|
|
1219
1219
|
if (type !== Message$1) {
|
|
1220
1220
|
throw new IpcError('Failed to wait for ipc message');
|
|
@@ -1260,8 +1260,8 @@ const Error$1 = 'error';
|
|
|
1260
1260
|
|
|
1261
1261
|
const getFirstWorkerEvent = worker => {
|
|
1262
1262
|
return getFirstEvent(worker, {
|
|
1263
|
-
|
|
1264
|
-
|
|
1263
|
+
error: Error$1,
|
|
1264
|
+
message: Message
|
|
1265
1265
|
});
|
|
1266
1266
|
};
|
|
1267
1267
|
|
|
@@ -1301,16 +1301,16 @@ ${relevant}`;
|
|
|
1301
1301
|
const Module = 'module';
|
|
1302
1302
|
|
|
1303
1303
|
const create$4 = async ({
|
|
1304
|
-
|
|
1305
|
-
|
|
1304
|
+
name,
|
|
1305
|
+
url
|
|
1306
1306
|
}) => {
|
|
1307
1307
|
const worker = new Worker(url, {
|
|
1308
|
-
|
|
1309
|
-
|
|
1308
|
+
name,
|
|
1309
|
+
type: Module
|
|
1310
1310
|
});
|
|
1311
1311
|
const {
|
|
1312
|
-
|
|
1313
|
-
|
|
1312
|
+
event,
|
|
1313
|
+
type
|
|
1314
1314
|
} = await getFirstWorkerEvent(worker);
|
|
1315
1315
|
switch (type) {
|
|
1316
1316
|
case Message:
|
|
@@ -1379,17 +1379,17 @@ const getPortTuple = () => {
|
|
|
1379
1379
|
};
|
|
1380
1380
|
|
|
1381
1381
|
const create$3 = async ({
|
|
1382
|
+
name,
|
|
1382
1383
|
sendPort,
|
|
1383
|
-
url
|
|
1384
|
-
name
|
|
1384
|
+
url
|
|
1385
1385
|
}) => {
|
|
1386
1386
|
const {
|
|
1387
1387
|
port1,
|
|
1388
1388
|
port2
|
|
1389
1389
|
} = getPortTuple();
|
|
1390
1390
|
await sendPort({
|
|
1391
|
-
port: port1,
|
|
1392
1391
|
name,
|
|
1392
|
+
port: port1,
|
|
1393
1393
|
url
|
|
1394
1394
|
});
|
|
1395
1395
|
return port2;
|
|
@@ -1433,8 +1433,8 @@ class ChildProcessError extends Error {
|
|
|
1433
1433
|
constructor(stderr) {
|
|
1434
1434
|
// @ts-ignore
|
|
1435
1435
|
const {
|
|
1436
|
-
message,
|
|
1437
1436
|
code,
|
|
1437
|
+
message,
|
|
1438
1438
|
stack
|
|
1439
1439
|
} = getHelpfulChildProcessError('', stderr);
|
|
1440
1440
|
super(message || 'child process error');
|
|
@@ -1471,10 +1471,10 @@ const fixNodeChildProcessParameters = value => {
|
|
|
1471
1471
|
|
|
1472
1472
|
const getFirstNodeChildProcessEvent = async childProcess => {
|
|
1473
1473
|
const {
|
|
1474
|
-
type,
|
|
1475
1474
|
event,
|
|
1475
|
+
stderr,
|
|
1476
1476
|
stdout,
|
|
1477
|
-
|
|
1477
|
+
type
|
|
1478
1478
|
} = await new Promise((resolve, reject) => {
|
|
1479
1479
|
let stderr = '';
|
|
1480
1480
|
let stdout = '';
|
|
@@ -1496,26 +1496,26 @@ const getFirstNodeChildProcessEvent = async childProcess => {
|
|
|
1496
1496
|
};
|
|
1497
1497
|
const handleMessage = event => {
|
|
1498
1498
|
cleanup({
|
|
1499
|
-
type: Message$1,
|
|
1500
1499
|
event,
|
|
1500
|
+
stderr,
|
|
1501
1501
|
stdout,
|
|
1502
|
-
|
|
1502
|
+
type: Message$1
|
|
1503
1503
|
});
|
|
1504
1504
|
};
|
|
1505
1505
|
const handleExit = event => {
|
|
1506
1506
|
cleanup({
|
|
1507
|
-
type: Exit,
|
|
1508
1507
|
event,
|
|
1508
|
+
stderr,
|
|
1509
1509
|
stdout,
|
|
1510
|
-
|
|
1510
|
+
type: Exit
|
|
1511
1511
|
});
|
|
1512
1512
|
};
|
|
1513
1513
|
const handleError = event => {
|
|
1514
1514
|
cleanup({
|
|
1515
|
-
type: Error$2,
|
|
1516
1515
|
event,
|
|
1516
|
+
stderr,
|
|
1517
1517
|
stdout,
|
|
1518
|
-
|
|
1518
|
+
type: Error$2
|
|
1519
1519
|
});
|
|
1520
1520
|
};
|
|
1521
1521
|
if (childProcess.stdout && childProcess.stderr) {
|
|
@@ -1527,21 +1527,21 @@ const getFirstNodeChildProcessEvent = async childProcess => {
|
|
|
1527
1527
|
childProcess.on('error', handleError);
|
|
1528
1528
|
});
|
|
1529
1529
|
return {
|
|
1530
|
-
type,
|
|
1531
1530
|
event,
|
|
1531
|
+
stderr,
|
|
1532
1532
|
stdout,
|
|
1533
|
-
|
|
1533
|
+
type
|
|
1534
1534
|
};
|
|
1535
1535
|
};
|
|
1536
1536
|
|
|
1537
1537
|
// @ts-ignore
|
|
1538
1538
|
const create$2 = async ({
|
|
1539
|
-
path,
|
|
1540
1539
|
argv = [],
|
|
1541
1540
|
env,
|
|
1542
1541
|
execArgv = [],
|
|
1543
|
-
|
|
1544
|
-
|
|
1542
|
+
name = 'child process',
|
|
1543
|
+
path,
|
|
1544
|
+
stdio = 'inherit'
|
|
1545
1545
|
}) => {
|
|
1546
1546
|
try {
|
|
1547
1547
|
string(path);
|
|
@@ -1555,9 +1555,9 @@ const create$2 = async ({
|
|
|
1555
1555
|
stdio: 'pipe'
|
|
1556
1556
|
});
|
|
1557
1557
|
const {
|
|
1558
|
-
type,
|
|
1559
1558
|
event,
|
|
1560
|
-
stderr
|
|
1559
|
+
stderr,
|
|
1560
|
+
type
|
|
1561
1561
|
} = await getFirstNodeChildProcessEvent(childProcess);
|
|
1562
1562
|
if (type === Exit) {
|
|
1563
1563
|
throw new ChildProcessError(stderr);
|
|
@@ -1625,19 +1625,19 @@ const fixNodeWorkerParameters = value => {
|
|
|
1625
1625
|
|
|
1626
1626
|
const getFirstNodeWorkerEvent = worker => {
|
|
1627
1627
|
return getFirstEvent(worker, {
|
|
1628
|
-
|
|
1628
|
+
error: Error$2,
|
|
1629
1629
|
exit: Exit,
|
|
1630
|
-
|
|
1630
|
+
message: Message$1
|
|
1631
1631
|
});
|
|
1632
1632
|
};
|
|
1633
1633
|
|
|
1634
1634
|
const create$1 = async ({
|
|
1635
|
-
path,
|
|
1636
1635
|
argv = [],
|
|
1637
1636
|
env = process.env,
|
|
1638
1637
|
execArgv = [],
|
|
1639
|
-
|
|
1640
|
-
|
|
1638
|
+
name,
|
|
1639
|
+
path,
|
|
1640
|
+
stdio
|
|
1641
1641
|
}) => {
|
|
1642
1642
|
string(path);
|
|
1643
1643
|
const actualArgv = ['--ipc-type=node-worker', ...argv];
|
|
@@ -1653,13 +1653,13 @@ const create$1 = async ({
|
|
|
1653
1653
|
argv: actualArgv,
|
|
1654
1654
|
env: actualEnv,
|
|
1655
1655
|
execArgv,
|
|
1656
|
-
|
|
1656
|
+
name,
|
|
1657
1657
|
stderr: ignoreStdio,
|
|
1658
|
-
|
|
1658
|
+
stdout: ignoreStdio
|
|
1659
1659
|
});
|
|
1660
1660
|
const {
|
|
1661
|
-
|
|
1662
|
-
|
|
1661
|
+
event,
|
|
1662
|
+
type
|
|
1663
1663
|
} = await getFirstNodeWorkerEvent(worker);
|
|
1664
1664
|
if (type === Exit) {
|
|
1665
1665
|
throw new IpcError(`Worker exited before ipc connection was established`);
|
|
@@ -1722,9 +1722,9 @@ const parse = content => {
|
|
|
1722
1722
|
|
|
1723
1723
|
const waitForWebSocketToBeOpen = webSocket => {
|
|
1724
1724
|
return getFirstEvent(webSocket, {
|
|
1725
|
-
open: Open,
|
|
1726
1725
|
close: Close,
|
|
1727
|
-
error: Error$3
|
|
1726
|
+
error: Error$3,
|
|
1727
|
+
open: Open
|
|
1728
1728
|
});
|
|
1729
1729
|
};
|
|
1730
1730
|
|
package/package.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/ipc",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.7.0",
|
|
4
4
|
"description": "Inter Process Communication for Lvce Editor",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"sideEffects": false,
|
|
8
5
|
"keywords": [
|
|
9
6
|
"ipc"
|
|
10
7
|
],
|
|
11
|
-
"author": "Lvce Editor",
|
|
12
|
-
"license": "MIT",
|
|
13
8
|
"repository": {
|
|
14
9
|
"type": "git",
|
|
15
10
|
"url": "https://github.com/lvce-editor/ipc.git"
|
|
16
11
|
},
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"author": "Lvce Editor",
|
|
14
|
+
"sideEffects": false,
|
|
15
|
+
"type": "module",
|
|
16
|
+
"main": "dist/index.js",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@lvce-editor/assert": "^1.
|
|
18
|
+
"@lvce-editor/assert": "^1.5.1",
|
|
19
19
|
"@lvce-editor/verror": "^1.7.0",
|
|
20
20
|
"@lvce-editor/web-socket-server": "^2.1.0"
|
|
21
21
|
},
|