@lvce-editor/ipc 10.2.0 → 11.0.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/browser.js CHANGED
@@ -365,6 +365,11 @@ const listen$3 = async () => {
365
365
  }
366
366
  const type = firstMessage.params[0];
367
367
  if (type === 'message-port') {
368
+ parentIpc.send({
369
+ jsonrpc: '2.0',
370
+ id: firstMessage.id,
371
+ result: null
372
+ });
368
373
  parentIpc.dispose();
369
374
  const port = firstMessage.params[1];
370
375
  return port;
package/dist/electron.js CHANGED
@@ -438,7 +438,7 @@ class IpcError extends VError {
438
438
  }
439
439
 
440
440
  // @ts-ignore
441
- const create$2 = async ({
441
+ const create$3 = async ({
442
442
  path,
443
443
  argv = [],
444
444
  execArgv = [],
@@ -507,7 +507,7 @@ const wrap$3 = process => {
507
507
 
508
508
  const IpcParentWithElectronUtilityProcess$1 = {
509
509
  __proto__: null,
510
- create: create$2,
510
+ create: create$3,
511
511
  wrap: wrap$3
512
512
  };
513
513
 
@@ -543,7 +543,7 @@ class ChildProcessError extends Error {
543
543
  const fixNodeParameters = value => {
544
544
  const transfer = getTransferrables(value);
545
545
  if (transfer.length === 0) {
546
- throw new Error('no transferrables found');
546
+ throw new IpcError('no transferrables found');
547
547
  }
548
548
  const newValue = removeValues(value, transfer);
549
549
  return {
@@ -626,7 +626,7 @@ const getFirstNodeChildProcessEvent = async childProcess => {
626
626
  };
627
627
 
628
628
  // @ts-ignore
629
- const create$1 = async ({
629
+ const create$2 = async ({
630
630
  path,
631
631
  argv = [],
632
632
  env,
@@ -699,7 +699,7 @@ const wrap$2 = childProcess => {
699
699
 
700
700
  const IpcParentWithNodeForkedProcess$1 = {
701
701
  __proto__: null,
702
- create: create$1,
702
+ create: create$2,
703
703
  wrap: wrap$2
704
704
  };
705
705
 
@@ -753,7 +753,7 @@ const getFirstNodeWorkerEvent = worker => {
753
753
  const readyMessage = 'ready';
754
754
 
755
755
  // @ts-ignore
756
- const create = async ({
756
+ const create$1 = async ({
757
757
  path,
758
758
  argv = [],
759
759
  env = process.env,
@@ -826,7 +826,7 @@ const wrap$1 = worker => {
826
826
 
827
827
  const IpcParentWithNodeWorker = {
828
828
  __proto__: null,
829
- create,
829
+ create: create$1,
830
830
  wrap: wrap$1
831
831
  };
832
832
 
@@ -844,7 +844,7 @@ const getActualDataElectron = event => {
844
844
  };
845
845
  };
846
846
 
847
- const listen = ({
847
+ const create = ({
848
848
  messagePort
849
849
  }) => {
850
850
  if (!isMessagePortMain(messagePort)) {
@@ -886,7 +886,7 @@ const wrap = messagePort => {
886
886
 
887
887
  const IpcParentWithElectronMessagePort$1 = {
888
888
  __proto__: null,
889
- listen,
889
+ create,
890
890
  signal,
891
891
  wrap
892
892
  };
package/dist/index.js CHANGED
@@ -279,7 +279,7 @@ class IpcError extends VError {
279
279
  }
280
280
  }
281
281
 
282
- const listen$9 = ({
282
+ const listen$8 = ({
283
283
  messagePort
284
284
  }) => {
285
285
  if (!isMessagePortMain(messagePort)) {
@@ -321,7 +321,7 @@ const wrap$c = messagePort => {
321
321
 
322
322
  const IpcChildWithElectronMessagePort$1 = {
323
323
  __proto__: null,
324
- listen: listen$9,
324
+ listen: listen$8,
325
325
  signal: signal$7,
326
326
  wrap: wrap$c
327
327
  };
@@ -343,7 +343,7 @@ const getUtilityProcessPortData = event => {
343
343
 
344
344
  const readyMessage = 'ready';
345
345
 
346
- const listen$8 = () => {
346
+ const listen$7 = () => {
347
347
  // @ts-ignore
348
348
  const {
349
349
  parentPort
@@ -386,7 +386,7 @@ const wrap$b = parentPort => {
386
386
 
387
387
  const IpcChildWithElectronUtilityProcess$1 = {
388
388
  __proto__: null,
389
- listen: listen$8,
389
+ listen: listen$7,
390
390
  signal: signal$6,
391
391
  wrap: wrap$b
392
392
  };
@@ -395,7 +395,7 @@ const getData$1 = event => {
395
395
  return event.data;
396
396
  };
397
397
 
398
- const listen$7 = () => {
398
+ const listen$6 = () => {
399
399
  // @ts-ignore
400
400
  if (typeof WorkerGlobalScope === 'undefined') {
401
401
  throw new TypeError('module is not in web worker scope');
@@ -434,7 +434,7 @@ const wrap$a = global => {
434
434
 
435
435
  const IpcChildWithModuleWorker$1 = {
436
436
  __proto__: null,
437
- listen: listen$7,
437
+ listen: listen$6,
438
438
  signal: signal$5,
439
439
  wrap: wrap$a
440
440
  };
@@ -463,8 +463,8 @@ const waitForFirstMessage = async port => {
463
463
  return event.data;
464
464
  };
465
465
 
466
- const listen$6 = async () => {
467
- const parentIpcRaw = listen$7();
466
+ const listen$5 = async () => {
467
+ const parentIpcRaw = listen$6();
468
468
  signal$5(parentIpcRaw);
469
469
  const parentIpc = wrap$a(parentIpcRaw);
470
470
  const firstMessage = await waitForFirstMessage(parentIpc);
@@ -473,6 +473,11 @@ const listen$6 = async () => {
473
473
  }
474
474
  const type = firstMessage.params[0];
475
475
  if (type === 'message-port') {
476
+ parentIpc.send({
477
+ jsonrpc: '2.0',
478
+ id: firstMessage.id,
479
+ result: null
480
+ });
476
481
  parentIpc.dispose();
477
482
  const port = firstMessage.params[1];
478
483
  return port;
@@ -512,7 +517,7 @@ const wrap$9 = port => {
512
517
 
513
518
  const IpcChildWithModuleWorkerAndMessagePort$1 = {
514
519
  __proto__: null,
515
- listen: listen$6,
520
+ listen: listen$5,
516
521
  wrap: wrap$9
517
522
  };
518
523
 
@@ -534,7 +539,7 @@ const getActualData = (message, handle) => {
534
539
  return message;
535
540
  };
536
541
 
537
- const listen$5 = async () => {
542
+ const listen$4 = async () => {
538
543
  if (!process.send) {
539
544
  throw new Error('process.send must be defined');
540
545
  }
@@ -573,12 +578,12 @@ const wrap$8 = process => {
573
578
 
574
579
  const IpcChildWithNodeForkedProcess$1 = {
575
580
  __proto__: null,
576
- listen: listen$5,
581
+ listen: listen$4,
577
582
  signal: signal$4,
578
583
  wrap: wrap$8
579
584
  };
580
585
 
581
- const listen$4 = async ({
586
+ const listen$3 = async ({
582
587
  messagePort
583
588
  }) => {
584
589
  if (!isMessagePort(messagePort)) {
@@ -619,12 +624,12 @@ const wrap$7 = port => {
619
624
 
620
625
  const IpcChildWithNodeMessagePort = {
621
626
  __proto__: null,
622
- listen: listen$4,
627
+ listen: listen$3,
623
628
  signal: signal$3,
624
629
  wrap: wrap$7
625
630
  };
626
631
 
627
- const listen$3 = async () => {
632
+ const listen$2 = async () => {
628
633
  const {
629
634
  parentPort
630
635
  } = await import('node:worker_threads');
@@ -663,13 +668,13 @@ const wrap$6 = parentPort => {
663
668
 
664
669
  const IpcChildWithNodeWorker = {
665
670
  __proto__: null,
666
- listen: listen$3,
671
+ listen: listen$2,
667
672
  signal: signal$2,
668
673
  wrap: wrap$6
669
674
  };
670
675
 
671
676
  const preloadChannelType = 'port';
672
- const listen$2 = ({
677
+ const listen$1 = ({
673
678
  webContents
674
679
  }) => {
675
680
  return webContents;
@@ -712,7 +717,7 @@ const wrap$5 = webContents => {
712
717
 
713
718
  const IpcChildWithRendererProcess2$1 = {
714
719
  __proto__: null,
715
- listen: listen$2,
720
+ listen: listen$1,
716
721
  wrap: wrap$5
717
722
  };
718
723
 
@@ -817,7 +822,7 @@ const handleUpgrade = async (...args) => {
817
822
  };
818
823
 
819
824
  // @ts-ignore
820
- const listen$1 = async ({
825
+ const listen = async ({
821
826
  request,
822
827
  handle
823
828
  }) => {
@@ -888,12 +893,12 @@ const wrap$4 = webSocket => {
888
893
 
889
894
  const IpcChildWithWebSocket = {
890
895
  __proto__: null,
891
- listen: listen$1,
896
+ listen,
892
897
  signal: signal$1,
893
898
  wrap: wrap$4
894
899
  };
895
900
 
896
- const listen = ({
901
+ const create$3 = ({
897
902
  messagePort
898
903
  }) => {
899
904
  if (!isMessagePortMain(messagePort)) {
@@ -935,7 +940,7 @@ const wrap$3 = messagePort => {
935
940
 
936
941
  const IpcParentWithElectronMessagePort$1 = {
937
942
  __proto__: null,
938
- listen,
943
+ create: create$3,
939
944
  signal,
940
945
  wrap: wrap$3
941
946
  };
@@ -1119,7 +1124,7 @@ class ChildProcessError extends Error {
1119
1124
  const fixNodeParameters = value => {
1120
1125
  const transfer = getTransferrables(value);
1121
1126
  if (transfer.length === 0) {
1122
- throw new Error('no transferrables found');
1127
+ throw new IpcError('no transferrables found');
1123
1128
  }
1124
1129
  const newValue = removeValues(value, transfer);
1125
1130
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/ipc",
3
- "version": "10.2.0",
3
+ "version": "11.0.0",
4
4
  "description": "Inter Process Communication for Lvce Editor",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",