electron-version-deployer-cli 0.0.1
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/cli.cjs +496 -0
- package/dist/const.d.ts +2 -0
- package/dist/helpers/fetchRemotePkgJSON.d.ts +2 -0
- package/dist/index.cjs.js +10 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.es.js +10 -0
- package/dist/main.cjs.js +306 -0
- package/dist/main.d.ts +18 -0
- package/dist/main.es.js +306 -0
- package/dist/templates/evd.config.ts +19 -0
- package/dist/templates/newVersionDialog.html +163 -0
- package/dist/types/EVDConfigType.d.ts +20 -0
- package/dist/utils/compareObjectsIsEqual.d.ts +1 -0
- package/dist/utils/versionToNum.d.ts +1 -0
- package/package.json +55 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="zh">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta
|
|
6
|
+
name="viewport"
|
|
7
|
+
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
|
|
8
|
+
/>
|
|
9
|
+
<link
|
|
10
|
+
rel="icon"
|
|
11
|
+
type="image/png"
|
|
12
|
+
sizes="32x32"
|
|
13
|
+
href="https://chat.openai.com/favicon-32x32.png"
|
|
14
|
+
/>
|
|
15
|
+
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
|
|
16
|
+
<title>有可用的更新 (4.3.5)</title>
|
|
17
|
+
<style>
|
|
18
|
+
* {
|
|
19
|
+
margin: 0;
|
|
20
|
+
padding: 0;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
body {
|
|
24
|
+
font-family: -apple-system, Helvetica, Arial, sans-serif,
|
|
25
|
+
"Microsoft YaHei", "ST Heiti";
|
|
26
|
+
color: #333;
|
|
27
|
+
padding: 20px;
|
|
28
|
+
background-color: #f5f5f5;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.title {
|
|
32
|
+
font-size: 18px;
|
|
33
|
+
font-weight: bold;
|
|
34
|
+
margin-bottom: 10px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.content {
|
|
38
|
+
margin-top: 8px;
|
|
39
|
+
margin-bottom: 12px;
|
|
40
|
+
margin-left: -20px;
|
|
41
|
+
margin-right: -20px;
|
|
42
|
+
height: 200px;
|
|
43
|
+
overflow: auto;
|
|
44
|
+
padding: 0 20px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.content ul {
|
|
48
|
+
padding-left: 20px;
|
|
49
|
+
margin-top: 5px;
|
|
50
|
+
margin-bottom: 10px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.content ul li {
|
|
54
|
+
margin-bottom: 4px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.buttons-box {
|
|
58
|
+
display: flex;
|
|
59
|
+
justify-content: flex-end;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.buttons-box button {
|
|
63
|
+
padding: 10px 20px;
|
|
64
|
+
font-size: 14px;
|
|
65
|
+
font-weight: bold;
|
|
66
|
+
border-radius: 5px;
|
|
67
|
+
border: none;
|
|
68
|
+
cursor: pointer;
|
|
69
|
+
margin-left: 12px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.buttons-box button:first-child {
|
|
73
|
+
background-color: #007bff;
|
|
74
|
+
color: #fff;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.buttons-box button:last-child {
|
|
78
|
+
background-color: #ccc;
|
|
79
|
+
color: #333;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.buttons-box button:first-child:hover {
|
|
83
|
+
background-color: #0056b3;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.buttons-box button:last-child:hover {
|
|
87
|
+
background-color: #b3b3b3;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.title-bar {
|
|
91
|
+
display: flex;
|
|
92
|
+
flex-direction: row;
|
|
93
|
+
justify-content: flex-start;
|
|
94
|
+
align-items: center;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.title-bar img {
|
|
98
|
+
margin-right: 8px;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.loading-box {
|
|
102
|
+
position: fixed;
|
|
103
|
+
left: 0;
|
|
104
|
+
top: 0;
|
|
105
|
+
bottom: 0;
|
|
106
|
+
right: 0;
|
|
107
|
+
background: rgba(255, 255, 255, 0.9);
|
|
108
|
+
font-size: 18px;
|
|
109
|
+
flex-direction: row;
|
|
110
|
+
align-items: center;
|
|
111
|
+
justify-content: center;
|
|
112
|
+
display: none;
|
|
113
|
+
font-weight: bold;
|
|
114
|
+
}
|
|
115
|
+
</style>
|
|
116
|
+
</head>
|
|
117
|
+
<body>
|
|
118
|
+
<div class="loading-box">软件更新中……</div>
|
|
119
|
+
<div class="title-bar">
|
|
120
|
+
<img src="https://chat.openai.com/favicon-32x32.png" width="28" alt="" />
|
|
121
|
+
<span>有可用的新版本:</span>
|
|
122
|
+
</div>
|
|
123
|
+
<div class="content">具体更新内容请查看 Changelogs</div>
|
|
124
|
+
<div class="buttons-box">
|
|
125
|
+
<button id="updateBtn">现在更新</button>
|
|
126
|
+
<button id="skipBtn">稍后再提醒我</button>
|
|
127
|
+
</div>
|
|
128
|
+
|
|
129
|
+
<script>
|
|
130
|
+
const { ipcRenderer } = require("electron");
|
|
131
|
+
|
|
132
|
+
document.querySelector("#updateBtn").addEventListener("click", () => {
|
|
133
|
+
ipcRenderer.send("evd-update-now");
|
|
134
|
+
document.querySelector(".loading-box").style.display = "flex";
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
document.querySelector("#skipBtn").addEventListener("click", () => {
|
|
138
|
+
ipcRenderer.send("evd-skip");
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
ipcRenderer.invoke("evd-get-change-logs").then((data) => {
|
|
142
|
+
// 如果没有数据就不渲染
|
|
143
|
+
if (!data) return;
|
|
144
|
+
|
|
145
|
+
const contentRef = document.querySelector(".content");
|
|
146
|
+
|
|
147
|
+
contentRef.innerHTML = `
|
|
148
|
+
<p class="title">${data.title}</p>
|
|
149
|
+
${data.changes}
|
|
150
|
+
`;
|
|
151
|
+
|
|
152
|
+
// 监听所有 A 链接点击
|
|
153
|
+
Array.from(document.querySelectorAll("a")).map((a) => {
|
|
154
|
+
a.addEventListener("click", (ev) => {
|
|
155
|
+
ev.preventDefault();
|
|
156
|
+
|
|
157
|
+
ipcRenderer.send("evd-open-link", ev.target.href);
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
</script>
|
|
162
|
+
</body>
|
|
163
|
+
</html>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type PrebuiltConfigType = Record<string, {
|
|
2
|
+
files: string[];
|
|
3
|
+
outputPath: string[];
|
|
4
|
+
}>;
|
|
5
|
+
export type EVDConfigType = {
|
|
6
|
+
compileCommand: string;
|
|
7
|
+
changelogsPath: string;
|
|
8
|
+
sources: {
|
|
9
|
+
folder: string;
|
|
10
|
+
nodeModules: string;
|
|
11
|
+
codes: string;
|
|
12
|
+
packageJSON: string;
|
|
13
|
+
};
|
|
14
|
+
netlify: {
|
|
15
|
+
url: string;
|
|
16
|
+
token: string;
|
|
17
|
+
siteID: string;
|
|
18
|
+
};
|
|
19
|
+
prebuiltConfig: PrebuiltConfigType;
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function compareObjectsIsEqual(obj1: any, obj2: any): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function versionToNum(a: string): string;
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "electron-version-deployer-cli",
|
|
3
|
+
"private": false,
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"types": "./dist/index.d.ts",
|
|
6
|
+
"main": "./dist/index.cjs.js",
|
|
7
|
+
"module": "./dist/index.es.js",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"serve": "esno ./watch.ts",
|
|
10
|
+
"build": "MODE=production esno ./watch.ts && tsc -p ./tsconfig.dist.json -emitDeclarationOnly && tsc-alias -p ./tsconfig.dist.json"
|
|
11
|
+
},
|
|
12
|
+
"bin": {
|
|
13
|
+
"evd": "./dist/cli.cjs"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@types/archiver": "^5.3.2",
|
|
20
|
+
"@types/node": "^20.2.5",
|
|
21
|
+
"electron": "^25.0.1",
|
|
22
|
+
"prettier": "^2.8.8",
|
|
23
|
+
"tsc-alias": "^1.8.6",
|
|
24
|
+
"typescript": "^5.0.2",
|
|
25
|
+
"vite": "^4.3.9",
|
|
26
|
+
"@inquirer/prompts": "^1.2.3",
|
|
27
|
+
"changelog-parser": "^3.0.1",
|
|
28
|
+
"commander": "^10.0.1",
|
|
29
|
+
"dompurify": "^3.0.3",
|
|
30
|
+
"download": "^8.0.0",
|
|
31
|
+
"esno": "^0.16.3",
|
|
32
|
+
"jsdom": "^22.1.0",
|
|
33
|
+
"log-symbols": "=4.1.0",
|
|
34
|
+
"marked": "^5.0.4",
|
|
35
|
+
"netlify-cli": "^15.2.0"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"archiver": "^5.3.1",
|
|
39
|
+
"extract-zip": "^2.0.1",
|
|
40
|
+
"pkg-up": "3.1.0"
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"electron": ">=10.0.0",
|
|
44
|
+
"@inquirer/prompts": "^1.2.3",
|
|
45
|
+
"changelog-parser": "^3.0.1",
|
|
46
|
+
"commander": "^10.0.1",
|
|
47
|
+
"dompurify": "^3.0.3",
|
|
48
|
+
"download": "^8.0.0",
|
|
49
|
+
"esno": "^0.16.3",
|
|
50
|
+
"jsdom": "^22.1.0",
|
|
51
|
+
"log-symbols": "=4.1.0",
|
|
52
|
+
"marked": "^5.0.4",
|
|
53
|
+
"netlify-cli": "^15.2.0"
|
|
54
|
+
}
|
|
55
|
+
}
|