@lvce-editor/embeds-worker 4.5.0 → 4.6.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.
@@ -182,8 +182,8 @@ const getModuleNotFoundError = stderr => {
182
182
  const messageIndex = lines.findIndex(isModuleNotFoundMessage);
183
183
  const message = lines[messageIndex];
184
184
  return {
185
- message,
186
- code: ERR_MODULE_NOT_FOUND
185
+ code: ERR_MODULE_NOT_FOUND,
186
+ message
187
187
  };
188
188
  };
189
189
  const isModuleNotFoundError = stderr => {
@@ -206,14 +206,14 @@ const isUnhelpfulNativeModuleError = stderr => {
206
206
  const getNativeModuleErrorMessage = stderr => {
207
207
  const message = getMessageCodeBlock(stderr);
208
208
  return {
209
- message: `Incompatible native node module: ${message}`,
210
- code: E_INCOMPATIBLE_NATIVE_MODULE
209
+ code: E_INCOMPATIBLE_NATIVE_MODULE,
210
+ message: `Incompatible native node module: ${message}`
211
211
  };
212
212
  };
213
213
  const getModuleSyntaxError = () => {
214
214
  return {
215
- message: `ES Modules are not supported in electron`,
216
- code: E_MODULES_NOT_SUPPORTED_IN_ELECTRON
215
+ code: E_MODULES_NOT_SUPPORTED_IN_ELECTRON,
216
+ message: `ES Modules are not supported in electron`
217
217
  };
218
218
  };
219
219
  const getHelpfulChildProcessError = (stdout, stderr) => {
@@ -232,8 +232,8 @@ const getHelpfulChildProcessError = (stdout, stderr) => {
232
232
  rest
233
233
  } = getDetails(lines);
234
234
  return {
235
- message: actualMessage,
236
235
  code: '',
236
+ message: actualMessage,
237
237
  stack: rest
238
238
  };
239
239
  };
@@ -243,8 +243,8 @@ class IpcError extends VError {
243
243
  if (stdout || stderr) {
244
244
  // @ts-ignore
245
245
  const {
246
- message,
247
246
  code,
247
+ message,
248
248
  stack
249
249
  } = getHelpfulChildProcessError(stdout, stderr);
250
250
  const cause = new Error(message);
@@ -305,8 +305,8 @@ const wrap$f = global => {
305
305
  };
306
306
  const waitForFirstMessage = async port => {
307
307
  const {
308
- resolve,
309
- promise
308
+ promise,
309
+ resolve
310
310
  } = Promise.withResolvers();
311
311
  port.addEventListener('message', resolve, {
312
312
  once: true
@@ -326,8 +326,8 @@ const listen$6 = async () => {
326
326
  const type = firstMessage.params[0];
327
327
  if (type === 'message-port') {
328
328
  parentIpc.send({
329
- jsonrpc: '2.0',
330
329
  id: firstMessage.id,
330
+ jsonrpc: '2.0',
331
331
  result: null
332
332
  });
333
333
  parentIpc.dispose();
@@ -384,8 +384,8 @@ const removeListener = (emitter, type, callback) => {
384
384
  };
385
385
  const getFirstEvent = (eventEmitter, eventMap) => {
386
386
  const {
387
- resolve,
388
- promise
387
+ promise,
388
+ resolve
389
389
  } = Promise.withResolvers();
390
390
  const listenerMap = Object.create(null);
391
391
  const cleanup = value => {
@@ -397,8 +397,8 @@ const getFirstEvent = (eventEmitter, eventMap) => {
397
397
  for (const [event, type] of Object.entries(eventMap)) {
398
398
  const listener = event => {
399
399
  cleanup({
400
- type,
401
- event
400
+ event,
401
+ type
402
402
  });
403
403
  };
404
404
  addListener(eventEmitter, event, listener);
@@ -408,8 +408,8 @@ const getFirstEvent = (eventEmitter, eventMap) => {
408
408
  };
409
409
  const Message$1 = 3;
410
410
  const create$5$1 = async ({
411
- messagePort,
412
- isMessagePortOpen
411
+ isMessagePortOpen,
412
+ messagePort
413
413
  }) => {
414
414
  if (!isMessagePort(messagePort)) {
415
415
  throw new IpcError('port must be of type MessagePort');
@@ -422,8 +422,8 @@ const create$5$1 = async ({
422
422
  });
423
423
  messagePort.start();
424
424
  const {
425
- type,
426
- event
425
+ event,
426
+ type
427
427
  } = await eventPromise;
428
428
  if (type !== Message$1) {
429
429
  throw new IpcError('Failed to wait for ipc message');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/embeds-worker",
3
- "version": "4.5.0",
3
+ "version": "4.6.0",
4
4
  "description": "Web Worker to manage electron webcontent views in Lvce Editor",
5
5
  "repository": {
6
6
  "type": "git",