electron-incremental-update 2.0.0-beta.1 → 2.0.0-beta.2

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/vite.js CHANGED
@@ -57,7 +57,7 @@ async function zipFile(filePath, targetFilePath = `${filePath}.gz`) {
57
57
  reject(err);
58
58
  }
59
59
  writeFileSync(targetFilePath, buffer2);
60
- resolve2(null);
60
+ resolve2();
61
61
  });
62
62
  });
63
63
  }
@@ -235,7 +235,7 @@ async function buildVersion({
235
235
  } else {
236
236
  log.warn("old version json is invalid, ignore it");
237
237
  }
238
- } catch (error) {
238
+ } catch {
239
239
  }
240
240
  }
241
241
  const buffer = readFileSync2(gzipPath);
@@ -357,7 +357,9 @@ function parseKeys({
357
357
  days
358
358
  }) {
359
359
  const keysDir = dirname(privateKeyPath);
360
- !existsSync3(keysDir) && mkdirSync(keysDir);
360
+ if (!existsSync3(keysDir)) {
361
+ mkdirSync(keysDir);
362
+ }
361
363
  if (!existsSync3(privateKeyPath) || !existsSync3(certPath)) {
362
364
  log.warn("no key pair found, generate new key pair");
363
365
  generateKeyPair(keyLength, parseSubjects(subject), days, privateKeyPath, certPath);
@@ -596,7 +598,11 @@ ${bytecodeLoaderBlock}`) : _code;
596
598
 
597
599
  // src/vite.ts
598
600
  function debugStartup(args) {
599
- process.env.VSCODE_DEBUG ? console.log("[startup] Electron App") : args.startup();
601
+ if (process.env.VSCODE_DEBUG) {
602
+ console.log("[startup] Electron App");
603
+ } else {
604
+ args.startup();
605
+ }
600
606
  }
601
607
  function getMainFilePath(options) {
602
608
  let mainFilePath;
@@ -635,11 +641,11 @@ async function electronWithUpdater(options) {
635
641
  } = options;
636
642
  if (!pkg) {
637
643
  log.error(`package.json not found`, { timestamp: true });
638
- return null;
644
+ return void 0;
639
645
  }
640
646
  if (!pkg.version || !pkg.name || !pkg.main) {
641
647
  log.error(`package.json not valid`, { timestamp: true });
642
- return null;
648
+ return void 0;
643
649
  }
644
650
  const _options = parseOptions(pkg, sourcemap, minify, updater);
645
651
  const bytecodeOptions = typeof bytecode === "object" ? bytecode : bytecode === true ? { protectedStrings: [] } : void 0;
@@ -649,7 +655,7 @@ async function electronWithUpdater(options) {
649
655
  try {
650
656
  rmSync(_options.buildAsarOption.electronDistPath, { recursive: true, force: true });
651
657
  rmSync(_options.buildEntryOption.entryOutputDirPath, { recursive: true, force: true });
652
- } catch (ignore) {
658
+ } catch {
653
659
  }
654
660
  log.info(`remove old files`, { timestamp: true });
655
661
  const { buildAsarOption, buildEntryOption, buildVersionOption, postBuild, cert } = _options;
@@ -707,7 +713,11 @@ async function electronWithUpdater(options) {
707
713
  await _buildEntry();
708
714
  await _postBuild();
709
715
  }
710
- _main.onstart ? _main.onstart(args) : args.startup();
716
+ if (_main.onstart) {
717
+ _main.onstart(args);
718
+ } else {
719
+ args.startup();
720
+ }
711
721
  },
712
722
  vite: mergeConfig2(
713
723
  {
@@ -761,17 +771,19 @@ async function electronWithUpdater(options) {
761
771
  )
762
772
  }
763
773
  };
764
- logParsedOptions && log.info(
765
- JSON.stringify(
766
- {
767
- ...electronPluginOptions,
768
- updater: { buildAsarOption, buildEntryOption, buildVersionOption }
769
- },
770
- (key, value) => (key === "privateKey" || key === "cert") && !(typeof logParsedOptions === "object" && logParsedOptions.showKeys === true) ? "***" : value,
771
- 2
772
- ),
773
- { timestamp: true }
774
- );
774
+ if (logParsedOptions) {
775
+ log.info(
776
+ JSON.stringify(
777
+ {
778
+ ...electronPluginOptions,
779
+ updater: { buildAsarOption, buildEntryOption, buildVersionOption }
780
+ },
781
+ (key, value) => (key === "privateKey" || key === "cert") && !(typeof logParsedOptions === "object" && logParsedOptions.showKeys === true) ? "***" : value,
782
+ 2
783
+ ),
784
+ { timestamp: true }
785
+ );
786
+ }
775
787
  let extraHmrPlugin;
776
788
  if (nativeModuleEntryMap) {
777
789
  const files = [...Object.values(nativeModuleEntryMap), appEntryPath].map((file) => resolve(normalizePath2(file)));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "electron-incremental-update",
3
3
  "type": "module",
4
- "version": "2.0.0-beta.1",
4
+ "version": "2.0.0-beta.2",
5
5
  "description": "electron incremental update tools, powered by vite",
6
6
  "author": "subframe7536",
7
7
  "license": "MIT",
@@ -65,17 +65,17 @@
65
65
  "selfsigned": "^2.4.1"
66
66
  },
67
67
  "devDependencies": {
68
- "@subframe7536/eslint-config": "^0.6.6",
68
+ "@subframe7536/eslint-config": "^0.7.2",
69
69
  "@types/babel__core": "^7.20.5",
70
- "@types/node": "^20.14.10",
70
+ "@types/node": "^20.14.11",
71
71
  "bumpp": "^9.4.1",
72
72
  "electron": "28.2.10",
73
73
  "eslint": "^9.7.0",
74
74
  "esno": "^4.7.0",
75
75
  "tsup": "^8.1.0",
76
76
  "typescript": "^5.5.3",
77
- "vite": "^5.3.3",
77
+ "vite": "^5.3.4",
78
78
  "vite-plugin-electron": "^0.28.7",
79
- "vitest": "^2.0.2"
79
+ "vitest": "^2.0.3"
80
80
  }
81
81
  }