electron-incremental-update 0.7.8 → 0.7.9
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 +9 -10
- package/dist/chunk-2JVXVTC5.mjs +9 -0
- package/dist/{chunk-SWXNCK6H.mjs → chunk-4TION32M.mjs} +19 -12
- package/dist/{chunk-2XHZMWRR.mjs → chunk-Q2K52LOG.mjs} +1 -8
- package/dist/chunk-ZFXKCRJC.mjs +11 -0
- package/dist/index.d.mts +69 -43
- package/dist/index.d.ts +69 -43
- package/dist/index.js +181 -162
- package/dist/index.mjs +149 -139
- package/dist/{updateJson-7e45d9e1.d.ts → updateJson.d.mts} +2 -1
- package/dist/updateJson.d.ts +12 -0
- package/dist/updateJson.js +33 -0
- package/dist/updateJson.mjs +7 -0
- package/dist/utils.d.mts +17 -7
- package/dist/utils.d.ts +17 -7
- package/dist/utils.js +16 -4
- package/dist/utils.mjs +2 -1
- package/dist/vite.d.mts +22 -19
- package/dist/vite.d.ts +22 -19
- package/dist/vite.js +14 -2
- package/dist/vite.mjs +6 -3
- package/package.json +2 -2
package/dist/vite.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Plugin } from 'vite';
|
|
2
2
|
import { Buffer } from 'node:buffer';
|
|
3
|
-
import {
|
|
3
|
+
import { UpdateJSON } from './updateJson.js';
|
|
4
4
|
|
|
5
5
|
type DistinguishedName = {
|
|
6
6
|
countryName?: string;
|
|
@@ -15,8 +15,26 @@ type DistinguishedName = {
|
|
|
15
15
|
businessCategory?: string;
|
|
16
16
|
emailAddress?: string;
|
|
17
17
|
};
|
|
18
|
-
type
|
|
19
|
-
|
|
18
|
+
type GeneratorOverrideFunctions = {
|
|
19
|
+
/**
|
|
20
|
+
* custom signature generate function
|
|
21
|
+
* @param buffer file buffer
|
|
22
|
+
* @param privateKey private key
|
|
23
|
+
* @param cert certificate string, **EOL must be '\n'**
|
|
24
|
+
* @param version current version
|
|
25
|
+
*/
|
|
26
|
+
generateSignature?: (buffer: Buffer, privateKey: string, cert: string, version: string) => string | Promise<string>;
|
|
27
|
+
/**
|
|
28
|
+
* custom generate version json function
|
|
29
|
+
* @param existingJson The existing JSON object.
|
|
30
|
+
* @param buffer file buffer
|
|
31
|
+
* @param signature generated signature
|
|
32
|
+
* @param version current version
|
|
33
|
+
* @param minVersion The minimum version
|
|
34
|
+
* @returns The updated version json
|
|
35
|
+
*/
|
|
36
|
+
generateVersionJson?: (existingJson: UpdateJSON, buffer: Buffer, signature: string, version: string, minVersion: string) => UpdateJSON | Promise<UpdateJSON>;
|
|
37
|
+
};
|
|
20
38
|
type Options = {
|
|
21
39
|
/**
|
|
22
40
|
* whether is in build mode
|
|
@@ -123,22 +141,7 @@ type Options = {
|
|
|
123
141
|
*/
|
|
124
142
|
days?: number;
|
|
125
143
|
};
|
|
126
|
-
overrideFunctions?:
|
|
127
|
-
/**
|
|
128
|
-
* custom signature generate function {@link FunctionGenerateSignature}
|
|
129
|
-
* @param buffer file buffer
|
|
130
|
-
* @param privateKey private key
|
|
131
|
-
* @param cert certificate
|
|
132
|
-
*/
|
|
133
|
-
generateSignature?: FunctionGenerateSignature;
|
|
134
|
-
/**
|
|
135
|
-
* custom signature generate function {@link FunctionGenerateVersionJson}
|
|
136
|
-
* @param signature generated signature
|
|
137
|
-
* @param version currentVersion
|
|
138
|
-
* @param cert certificate
|
|
139
|
-
*/
|
|
140
|
-
generateVersionJson?: FunctionGenerateVersionJson;
|
|
141
|
-
};
|
|
144
|
+
overrideFunctions?: GeneratorOverrideFunctions;
|
|
142
145
|
};
|
|
143
146
|
};
|
|
144
147
|
|
package/dist/vite.js
CHANGED
|
@@ -76,10 +76,22 @@ function parseVersion(version) {
|
|
|
76
76
|
throw new TypeError(`invalid version: ${version}`);
|
|
77
77
|
}
|
|
78
78
|
const [major, minor, patch] = match.slice(1, 4).map(Number);
|
|
79
|
-
|
|
79
|
+
const ret = {
|
|
80
|
+
major,
|
|
81
|
+
minor,
|
|
82
|
+
patch,
|
|
83
|
+
stage: "",
|
|
84
|
+
stageVersion: -1
|
|
85
|
+
};
|
|
86
|
+
if (match[4]) {
|
|
87
|
+
let [stage, _v] = match[4].split(".");
|
|
88
|
+
ret.stage = stage;
|
|
89
|
+
ret.stageVersion = Number(_v) || -1;
|
|
90
|
+
}
|
|
91
|
+
if (isNaN(major) || isNaN(minor) || isNaN(patch) || isNaN(ret.stageVersion)) {
|
|
80
92
|
throw new TypeError(`invalid version: ${version}`);
|
|
81
93
|
}
|
|
82
|
-
return
|
|
94
|
+
return ret;
|
|
83
95
|
}
|
|
84
96
|
|
|
85
97
|
// src/updateJson.ts
|
package/dist/vite.mjs
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
|
-
isUpdateJSON,
|
|
3
2
|
signature
|
|
4
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q2K52LOG.mjs";
|
|
5
4
|
import {
|
|
6
5
|
parseVersion,
|
|
7
6
|
zipFile
|
|
8
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-4TION32M.mjs";
|
|
8
|
+
import {
|
|
9
|
+
isUpdateJSON
|
|
10
|
+
} from "./chunk-2JVXVTC5.mjs";
|
|
11
|
+
import "./chunk-ZFXKCRJC.mjs";
|
|
9
12
|
|
|
10
13
|
// src/vite.ts
|
|
11
14
|
import { createLogger } from "vite";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "electron-incremental-update",
|
|
3
3
|
"author": "subframe7536",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.9",
|
|
5
5
|
"description": "electron incremental update tools, powered by vite",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "tsup && node fix-module.js",
|
|
@@ -58,4 +58,4 @@
|
|
|
58
58
|
"ci-info": "^3.8.0",
|
|
59
59
|
"selfsigned": "^2.1.1"
|
|
60
60
|
}
|
|
61
|
-
}
|
|
61
|
+
}
|