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.
- package/README.md +62 -7
- package/dist/{bytecode-7V24FFYI.js → bytecode-R2B4KTMV.js} +3 -3
- package/dist/chunk-D7NXTCQW.js +135 -0
- package/dist/{chunk-JI27JWJN.js → chunk-YZGE4RFY.js} +12 -1
- package/dist/{esm-UJAQJA65.js → esm-4S4XCVEW.js} +1 -1
- package/dist/index.cjs +17 -17
- package/dist/index.d.cts +15 -7
- package/dist/index.d.ts +15 -7
- package/dist/index.js +13 -9
- package/dist/provider.cjs +48 -51
- package/dist/provider.d.cts +14 -43
- package/dist/provider.d.ts +14 -43
- package/dist/provider.js +4 -98
- package/dist/{types-nE_pIMPo.d.ts → types-C5M2xRjF.d.cts} +77 -5
- package/dist/{types-C6lSLZWB.d.cts → types-C5M2xRjF.d.ts} +77 -5
- package/dist/utils.cjs +216 -106
- package/dist/utils.d.cts +6 -3
- package/dist/utils.d.ts +6 -3
- package/dist/utils.js +2 -2
- package/dist/vite.d.ts +50 -28
- package/dist/vite.js +36 -27
- package/dist/zip-BQS8qbGA.d.cts +70 -0
- package/dist/zip-DbfskMQi.d.ts +70 -0
- package/package.json +86 -87
- package/dist/chunk-PUVBFHOK.js +0 -43
- package/dist/crypto-Zynscwmj.d.cts +0 -33
- package/dist/crypto-Zynscwmj.d.ts +0 -33
- package/dist/version-BYVQ367i.d.cts +0 -62
- package/dist/version-BYVQ367i.d.ts +0 -62
- package/dist/{chunk-7JCGLFGU.js → chunk-LR7LR5WG.js} +3 -3
|
@@ -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";
|