@lvce-editor/main-process 2.15.0 → 2.17.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.
@@ -2636,13 +2636,12 @@ const getFirstNodeWorkerEvent = worker => {
2636
2636
  error: Error$2
2637
2637
  });
2638
2638
  };
2639
-
2640
- // @ts-ignore
2641
2639
  const create$1$2 = async ({
2642
2640
  path,
2643
2641
  argv = [],
2644
2642
  env = process.env,
2645
- execArgv = []
2643
+ execArgv = [],
2644
+ stdio
2646
2645
  }) => {
2647
2646
  string(path);
2648
2647
  const actualArgv = ['--ipc-type=node-worker', ...argv];
@@ -2650,13 +2649,16 @@ const create$1$2 = async ({
2650
2649
  ...env,
2651
2650
  ELECTRON_RUN_AS_NODE: '1'
2652
2651
  };
2652
+ const ignoreStdio = stdio === 'inherit' ? undefined : true;
2653
2653
  const {
2654
2654
  Worker
2655
2655
  } = await import('node:worker_threads');
2656
2656
  const worker = new Worker(path, {
2657
2657
  argv: actualArgv,
2658
2658
  env: actualEnv,
2659
- execArgv
2659
+ execArgv,
2660
+ stdout: ignoreStdio,
2661
+ stderr: ignoreStdio
2660
2662
  });
2661
2663
  const {
2662
2664
  type,
@@ -2814,7 +2816,8 @@ const splitLines = lines => {
2814
2816
  return lines.split(NewLine);
2815
2817
  };
2816
2818
  const getCurrentStack = () => {
2817
- const currentStack = joinLines(splitLines(new Error().stack || '').slice(2));
2819
+ const stackLinesToSkip = 3;
2820
+ const currentStack = joinLines(splitLines(new Error().stack || '').slice(stackLinesToSkip));
2818
2821
  return currentStack;
2819
2822
  };
2820
2823
  const getNewLineIndex = (string, startIndex = undefined) => {
@@ -3085,6 +3088,12 @@ const invokeAndTransfer$1 = (ipc, method, ...params) => {
3085
3088
  return invokeHelper(ipc, method, params, true);
3086
3089
  };
3087
3090
 
3091
+ let CommandNotFoundError$1 = class CommandNotFoundError extends Error {
3092
+ constructor(command) {
3093
+ super(`Command not found ${command}`);
3094
+ this.name = 'CommandNotFoundError';
3095
+ }
3096
+ };
3088
3097
  const commands = Object.create(null);
3089
3098
  const register$1 = commandMap => {
3090
3099
  Object.assign(commands, commandMap);
@@ -3095,7 +3104,7 @@ const getCommand = key => {
3095
3104
  const execute$1 = (command, ...args) => {
3096
3105
  const fn = getCommand(command);
3097
3106
  if (!fn) {
3098
- throw new Error(`command not found ${command}`);
3107
+ throw new CommandNotFoundError$1(command);
3099
3108
  }
3100
3109
  return fn(...args);
3101
3110
  };
@@ -3152,7 +3161,7 @@ const listen$1 = async (module, options) => {
3152
3161
  const ipc = module.wrap(rawIpc);
3153
3162
  return ipc;
3154
3163
  };
3155
- const create$g = async ({
3164
+ const create$k = async ({
3156
3165
  commandMap,
3157
3166
  messagePort,
3158
3167
  requiresSocket
@@ -3171,9 +3180,9 @@ const create$g = async ({
3171
3180
  };
3172
3181
  const ElectronMessagePortRpcClient = {
3173
3182
  __proto__: null,
3174
- create: create$g
3183
+ create: create$k
3175
3184
  };
3176
- const create$e = async ({
3185
+ const create$i = async ({
3177
3186
  commandMap,
3178
3187
  env,
3179
3188
  argv,
@@ -3202,9 +3211,9 @@ const create$e = async ({
3202
3211
  };
3203
3212
  const ElectronUtilityProcessRpcParent = {
3204
3213
  __proto__: null,
3205
- create: create$e
3214
+ create: create$i
3206
3215
  };
3207
- const create$d = async ({
3216
+ const create$h = async ({
3208
3217
  commandMap,
3209
3218
  webContents,
3210
3219
  requiresSocket
@@ -3222,7 +3231,7 @@ const create$d = async ({
3222
3231
  };
3223
3232
  const ElectronWebContentsRpcClient = {
3224
3233
  __proto__: null,
3225
- create: create$d
3234
+ create: create$h
3226
3235
  };
3227
3236
 
3228
3237
  const commandMapRef = Object.create(null);
package/package.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/main-process",
3
- "version": "2.15.0",
4
- "description": "",
3
+ "version": "2.17.0",
5
4
  "keywords": [
6
5
  "lvce-editor",
7
6
  "electron"
@@ -15,7 +14,7 @@
15
14
  "type": "module",
16
15
  "main": "dist/mainProcessMain.js",
17
16
  "dependencies": {
18
- "electron": "37.2.0"
17
+ "electron": "37.3.1"
19
18
  },
20
19
  "engines": {
21
20
  "node": ">=22"