@lvce-editor/main-process 2.19.0 → 2.21.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,11 +1,11 @@
1
1
  import * as Electron from 'electron';
2
2
  import Electron__default, { dialog, app, clipboard, BrowserWindow, MessageChannelMain, Menu, shell, desktopCapturer, contentTracing, net, netLog, powerSaveBlocker, safeStorage, screen, webContents, WebContentsView } from 'electron';
3
3
  import process$1 from 'node:process';
4
+ import { fileURLToPath } from 'node:url';
4
5
  import { inspect } from 'node:util';
5
6
  import { spawn } from 'node:child_process';
6
7
  import { MessageChannel } from 'node:worker_threads';
7
8
  import { createWriteStream, readFileSync } from 'node:fs';
8
- import { fileURLToPath } from 'node:url';
9
9
  import * as NodePath from 'node:path';
10
10
  import { dirname } from 'node:path';
11
11
  import require$$1 from 'tty';
@@ -55,7 +55,18 @@ function cleanStack$1(stack, {
55
55
  line = line.replace(basePathRegex, '');
56
56
  }
57
57
  if (pretty) {
58
- line = line.replace(extractPathRegex, (m, p1) => m.replace(p1, p1.replace(homeDirectory, '~')));
58
+ line = line.replace(extractPathRegex, (m, p1) => {
59
+ let filePath = p1;
60
+
61
+ // Convert file:// URLs to regular paths first
62
+ if (filePath.startsWith('file://')) {
63
+ filePath = fileURLToPath(filePath);
64
+ }
65
+
66
+ // Then replace home directory with ~
67
+ filePath = filePath.replace(homeDirectory, '~');
68
+ return m.replace(p1, filePath);
69
+ });
59
70
  }
60
71
  return line;
61
72
  }).join('\n');
@@ -607,6 +618,21 @@ function isErrorLike(value) {
607
618
  return Boolean(value) && typeof value === 'object' && 'name' in value && 'message' in value && 'stack' in value;
608
619
  }
609
620
 
621
+ if (typeof Electron__default === 'string') {
622
+ throw new TypeError('Not running in an Electron environment!');
623
+ }
624
+ const {
625
+ env: env$1
626
+ } = process; // eslint-disable-line n/prefer-global/process
627
+ const isEnvSet = 'ELECTRON_IS_DEV' in env$1;
628
+ const getFromEnv = Number.parseInt(env$1.ELECTRON_IS_DEV, 10) === 1;
629
+ const isDev = isEnvSet ? getFromEnv : !Electron__default.app.isPackaged;
630
+
631
+ const index = {
632
+ __proto__: null,
633
+ default: isDev
634
+ };
635
+
610
636
  let appName;
611
637
  let invokeErrorHandler;
612
638
  const ERROR_HANDLER_CHANNEL = 'electron-unhandled.ERROR';
@@ -3304,15 +3330,15 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
3304
3330
  const root = process.env.LVCE_ROOT || join(__dirname, '../../../../..');
3305
3331
 
3306
3332
  const {
3307
- env: env$1,
3333
+ env,
3308
3334
  platform
3309
3335
  } = process;
3310
3336
  const isLinux = platform === 'linux';
3311
3337
  const isProduction = false;
3312
3338
  const homeDirectory = homedir();
3313
3339
  const applicationName = 'lvce-oss';
3314
- const xdgCache = env$1.XDG_CACHE_HOME || (homeDirectory ? join(homeDirectory, '.cache') : undefined);
3315
- const xdgData = env$1.XDG_DATA_HOME || (homeDirectory ? join(homeDirectory, '.local', 'share') : undefined);
3340
+ const xdgCache = env.XDG_CACHE_HOME || (homeDirectory ? join(homeDirectory, '.cache') : undefined);
3341
+ const xdgData = env.XDG_DATA_HOME || (homeDirectory ? join(homeDirectory, '.local', 'share') : undefined);
3316
3342
  join(xdgData || tmpdir(), applicationName);
3317
3343
  const chromeUserDataPath = xdgCache ? join(xdgCache, applicationName, 'userdata') : '';
3318
3344
  const scheme = 'lvce-oss';
@@ -7418,21 +7444,6 @@ const main = async () => {
7418
7444
 
7419
7445
  main();
7420
7446
 
7421
- if (typeof Electron__default === 'string') {
7422
- throw new TypeError('Not running in an Electron environment!');
7423
- }
7424
- const {
7425
- env
7426
- } = process; // eslint-disable-line n/prefer-global/process
7427
- const isEnvSet = 'ELECTRON_IS_DEV' in env;
7428
- const getFromEnv = Number.parseInt(env.ELECTRON_IS_DEV, 10) === 1;
7429
- const isDev = isEnvSet ? getFromEnv : !Electron__default.app.isPackaged;
7430
-
7431
- const index = {
7432
- __proto__: null,
7433
- default: isDev
7434
- };
7435
-
7436
7447
  const name$w = 'App';
7437
7448
  const Commands$w = {};
7438
7449
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/main-process",
3
- "version": "2.19.0",
3
+ "version": "2.21.0",
4
4
  "keywords": [
5
5
  "lvce-editor",
6
6
  "electron"
@@ -14,7 +14,7 @@
14
14
  "type": "module",
15
15
  "main": "dist/mainProcessMain.js",
16
16
  "dependencies": {
17
- "electron": "38.0.0"
17
+ "electron": "38.1.2"
18
18
  },
19
19
  "engines": {
20
20
  "node": ">=22"