electron-incremental-update 2.2.1 → 2.2.3

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,62 +0,0 @@
1
- interface Version {
2
- /**
3
- * `4` of `4.3.2-beta.1`
4
- */
5
- major: number;
6
- /**
7
- * `3` of `4.3.2-beta.1`
8
- */
9
- minor: number;
10
- /**
11
- * `2` of `4.3.2-beta.1`
12
- */
13
- patch: number;
14
- /**
15
- * `beta` of `4.3.2-beta.1`
16
- */
17
- stage: string;
18
- /**
19
- * `1` of `4.3.2-beta.1`
20
- */
21
- stageVersion: number;
22
- }
23
- /**
24
- * Parse version string to {@link Version}, like `0.2.0-beta.1`
25
- * @param version version string
26
- */
27
- declare function parseVersion(version: string): Version;
28
- /**
29
- * Default function to check the old version is less than new version
30
- * @param oldVer old version string
31
- * @param newVer new version string
32
- */
33
- declare function defaultIsLowerVersion(oldVer: string, newVer: string): boolean;
34
- /**
35
- * Update info json
36
- */
37
- type UpdateInfo = {
38
- signature: string;
39
- minimumVersion: string;
40
- version: string;
41
- };
42
- /**
43
- * {@link UpdateInfo} with beta
44
- */
45
- type UpdateJSON = UpdateInfo & {
46
- beta: UpdateInfo;
47
- };
48
- /**
49
- * Check is `UpdateJSON`
50
- * @param json any variable
51
- */
52
- declare function isUpdateJSON(json: any): json is UpdateJSON;
53
- /**
54
- * Default function to generate `UpdateJSON`
55
- * @param existingJson exising update json
56
- * @param signature sigature
57
- * @param version target version
58
- * @param minimumVersion minimum version
59
- */
60
- declare function defaultVersionJsonGenerator(existingJson: UpdateJSON, signature: string, version: string, minimumVersion: string): UpdateJSON;
61
-
62
- export { type UpdateInfo as U, type Version as V, type UpdateJSON as a, defaultVersionJsonGenerator as b, defaultIsLowerVersion as d, isUpdateJSON as i, parseVersion as p };
@@ -1,10 +1,10 @@
1
1
  import { bytecodeLog } from './chunk-5NKEXGI3.js';
2
- import path from 'node:path';
3
- import fs from 'node:fs';
4
2
  import cp from 'node:child_process';
3
+ import fs from 'node:fs';
4
+ import path from 'node:path';
5
5
  import * as babel from '@babel/core';
6
- import MagicString from 'magic-string';
7
6
  import { getPackageInfoSync } from 'local-pkg';
7
+ import MagicString from 'magic-string';
8
8
 
9
9
  // src/vite/bytecode/code.ts
10
10
  var bytecodeGeneratorScript = "const vm = require('vm')\nconst v8 = require('v8')\nconst wrap = require('module').wrap\nv8.setFlagsFromString('--no-lazy')\nv8.setFlagsFromString('--no-flush-bytecode')\nlet code = ''\nprocess.stdin.setEncoding('utf-8')\nprocess.stdin.on('readable', () => {\n const data = process.stdin.read()\n if (data !== null) {\n code += data\n }\n})\nprocess.stdin.on('end', () => {\n try {\n if (typeof code !== 'string') {\n throw new Error('javascript code must be string.')\n }\n const script = new vm.Script(wrap(code), { produceCachedData: true })\n const bytecodeBuffer = script.createCachedData()\n process.stdout.write(bytecodeBuffer)\n } catch (error) {\n console.error(error)\n }\n})\n";