pake-cli 3.0.0-beta → 3.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/README.md +1 -1
- package/dist/cli.js +14 -52
- package/dist/dev.js +10 -48
- package/dist/dev.js.map +1 -1
- package/package.json +4 -4
- package/src-tauri/Cargo.lock +1 -1
- package/src-tauri/Cargo.toml +1 -1
- package/src-tauri/assets/main.wxs +71 -31
- package/src-tauri/src/app/window.rs +4 -4
- package/src-tauri/src/inject/event.js +3 -3
- package/src-tauri/src/lib.rs +4 -4
- package/src-tauri/tauri.conf.json +4 -10
- package/src-tauri/tauri.linux.conf.json +1 -7
- package/src-tauri/tauri.macos.conf.json +1 -13
- package/src-tauri/tauri.windows.conf.json +0 -7
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<h4 align="right"><strong>English</strong> | <a href="https://github.com/tw93/Pake/blob/
|
|
1
|
+
<h4 align="right"><strong>English</strong> | <a href="https://github.com/tw93/Pake/blob/main/README_CN.md">简体中文</a> | <a href="https://github.com/tw93/Pake/blob/main/README_JP.md">日本語</a></h4>
|
|
2
2
|
<p align="center">
|
|
3
3
|
<img src=https://gw.alipayobjects.com/zos/k/fa/logo-modified.png width=138/>
|
|
4
4
|
</p>
|
package/dist/cli.js
CHANGED
|
@@ -20,7 +20,7 @@ import * as psl from 'psl';
|
|
|
20
20
|
import isUrl from 'is-url';
|
|
21
21
|
|
|
22
22
|
var name = "pake-cli";
|
|
23
|
-
var version$1 = "3.0.
|
|
23
|
+
var version$1 = "3.0.1";
|
|
24
24
|
var description = "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 利用 Rust 轻松构建轻量级多端桌面应用。";
|
|
25
25
|
var engines = {
|
|
26
26
|
node: ">=16.0.0"
|
|
@@ -69,7 +69,7 @@ var license = "MIT";
|
|
|
69
69
|
var dependencies = {
|
|
70
70
|
"@tauri-apps/api": "^1.6.0",
|
|
71
71
|
"@tauri-apps/cli": "^2.1.0",
|
|
72
|
-
axios: "^1.7.
|
|
72
|
+
axios: "^1.7.9",
|
|
73
73
|
chalk: "^5.3.0",
|
|
74
74
|
commander: "^11.1.0",
|
|
75
75
|
"file-type": "^18.7.0",
|
|
@@ -91,7 +91,7 @@ var devDependencies = {
|
|
|
91
91
|
"@rollup/plugin-terser": "^0.4.4",
|
|
92
92
|
"@types/fs-extra": "^11.0.4",
|
|
93
93
|
"@types/is-url": "^1.2.32",
|
|
94
|
-
"@types/node": "^20.17.
|
|
94
|
+
"@types/node": "^20.17.10",
|
|
95
95
|
"@types/page-icon": "^0.3.6",
|
|
96
96
|
"@types/prompts": "^2.4.9",
|
|
97
97
|
"@types/psl": "^1.1.3",
|
|
@@ -100,7 +100,7 @@ var devDependencies = {
|
|
|
100
100
|
"@types/update-notifier": "^6.0.8",
|
|
101
101
|
"app-root-path": "^3.1.0",
|
|
102
102
|
"cross-env": "^7.0.3",
|
|
103
|
-
rollup: "^4.28.
|
|
103
|
+
rollup: "^4.28.1",
|
|
104
104
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
105
105
|
tslib: "^2.8.1",
|
|
106
106
|
typescript: "^5.7.2"
|
|
@@ -163,30 +163,22 @@ var pakeConf = {
|
|
|
163
163
|
|
|
164
164
|
var productName$1 = "WeRead";
|
|
165
165
|
var identifier = "com.pake.weread";
|
|
166
|
-
var version = "
|
|
167
|
-
var plugins = {
|
|
168
|
-
};
|
|
166
|
+
var version = "1.0.0";
|
|
169
167
|
var app = {
|
|
170
|
-
|
|
171
|
-
csp: null
|
|
172
|
-
},
|
|
168
|
+
withGlobalTauri: true,
|
|
173
169
|
trayIcon: {
|
|
174
170
|
iconPath: "png/weread_512.png",
|
|
175
171
|
iconAsTemplate: false,
|
|
176
172
|
id: "pake-tray"
|
|
177
|
-
}
|
|
178
|
-
withGlobalTauri: true
|
|
173
|
+
}
|
|
179
174
|
};
|
|
180
175
|
var build = {
|
|
181
|
-
|
|
182
|
-
frontendDist: "../dist",
|
|
183
|
-
beforeDevCommand: ""
|
|
176
|
+
frontendDist: "../dist"
|
|
184
177
|
};
|
|
185
178
|
var CommonConf = {
|
|
186
179
|
productName: productName$1,
|
|
187
180
|
identifier: identifier,
|
|
188
181
|
version: version,
|
|
189
|
-
plugins: plugins,
|
|
190
182
|
app: app,
|
|
191
183
|
build: build
|
|
192
184
|
};
|
|
@@ -197,22 +189,14 @@ var bundle$2 = {
|
|
|
197
189
|
"png/weread_32.ico"
|
|
198
190
|
],
|
|
199
191
|
active: true,
|
|
200
|
-
category: "DeveloperTool",
|
|
201
|
-
copyright: "",
|
|
202
|
-
externalBin: [
|
|
203
|
-
],
|
|
204
|
-
longDescription: "",
|
|
205
192
|
resources: [
|
|
206
193
|
"png/weread_32.ico"
|
|
207
194
|
],
|
|
208
|
-
shortDescription: "",
|
|
209
195
|
targets: [
|
|
210
196
|
"msi"
|
|
211
197
|
],
|
|
212
198
|
windows: {
|
|
213
|
-
certificateThumbprint: null,
|
|
214
199
|
digestAlgorithm: "sha256",
|
|
215
|
-
timestampUrl: "",
|
|
216
200
|
wix: {
|
|
217
201
|
language: [
|
|
218
202
|
"en-US"
|
|
@@ -230,22 +214,8 @@ var bundle$1 = {
|
|
|
230
214
|
"icons/weread.icns"
|
|
231
215
|
],
|
|
232
216
|
active: true,
|
|
233
|
-
category: "DeveloperTool",
|
|
234
|
-
copyright: "",
|
|
235
|
-
externalBin: [
|
|
236
|
-
],
|
|
237
|
-
longDescription: "",
|
|
238
217
|
macOS: {
|
|
239
|
-
entitlements: null,
|
|
240
|
-
exceptionDomain: null,
|
|
241
|
-
frameworks: [
|
|
242
|
-
],
|
|
243
|
-
providerShortName: null,
|
|
244
|
-
signingIdentity: null
|
|
245
218
|
},
|
|
246
|
-
resources: [
|
|
247
|
-
],
|
|
248
|
-
shortDescription: "",
|
|
249
219
|
targets: [
|
|
250
220
|
"dmg"
|
|
251
221
|
]
|
|
@@ -254,14 +224,12 @@ var MacConf = {
|
|
|
254
224
|
bundle: bundle$1
|
|
255
225
|
};
|
|
256
226
|
|
|
257
|
-
var productName = "
|
|
227
|
+
var productName = "we-read";
|
|
258
228
|
var bundle = {
|
|
259
229
|
icon: [
|
|
260
230
|
"png/weread_512.png"
|
|
261
231
|
],
|
|
262
232
|
active: true,
|
|
263
|
-
category: "DeveloperTool",
|
|
264
|
-
copyright: "",
|
|
265
233
|
linux: {
|
|
266
234
|
deb: {
|
|
267
235
|
depends: [
|
|
@@ -273,12 +241,6 @@ var bundle = {
|
|
|
273
241
|
}
|
|
274
242
|
}
|
|
275
243
|
},
|
|
276
|
-
externalBin: [
|
|
277
|
-
],
|
|
278
|
-
longDescription: "",
|
|
279
|
-
resources: [
|
|
280
|
-
],
|
|
281
|
-
shortDescription: "",
|
|
282
244
|
targets: [
|
|
283
245
|
"deb",
|
|
284
246
|
"appimage"
|
|
@@ -481,7 +443,7 @@ async function mergeConfig(url, options, tauriConf) {
|
|
|
481
443
|
Object.assign(tauriConf.pake.windows[0], { url, ...tauriConfWindowOptions });
|
|
482
444
|
tauriConf.productName = name;
|
|
483
445
|
tauriConf.identifier = identifier;
|
|
484
|
-
if (platform ==
|
|
446
|
+
if (platform == 'win32') {
|
|
485
447
|
tauriConf.bundle.windows.wix.language[0] = installerLanguage;
|
|
486
448
|
}
|
|
487
449
|
//Judge the type of URL, whether it is a file or a website.
|
|
@@ -619,7 +581,7 @@ async function mergeConfig(url, options, tauriConf) {
|
|
|
619
581
|
tauriConf.pake.inject = [];
|
|
620
582
|
await fsExtra.writeFile(injectFilePath, '');
|
|
621
583
|
}
|
|
622
|
-
tauriConf.pake.proxy_url = proxyUrl ||
|
|
584
|
+
tauriConf.pake.proxy_url = proxyUrl || '';
|
|
623
585
|
// Save config file.
|
|
624
586
|
const platformConfigPaths = {
|
|
625
587
|
win32: 'tauri.windows.conf.json',
|
|
@@ -1006,10 +968,10 @@ program
|
|
|
1006
968
|
.option('--fullscreen', 'Start in full screen', DEFAULT_PAKE_OPTIONS.fullscreen)
|
|
1007
969
|
.option('--hide-title-bar', 'Only for Mac, hide title bar', DEFAULT_PAKE_OPTIONS.hideTitleBar)
|
|
1008
970
|
.option('--activation-shortcut <string>', 'Shortcut key to active App', DEFAULT_PAKE_OPTIONS.activationShortcut)
|
|
1009
|
-
.option('--
|
|
1010
|
-
.option('--
|
|
971
|
+
.option('--inject <url>', 'Injection of .js or .css files', DEFAULT_PAKE_OPTIONS.inject)
|
|
972
|
+
.option('--proxy-url <url>', "Proxy URL for all network requests", DEFAULT_PAKE_OPTIONS.proxyUrl)
|
|
1011
973
|
.option('--debug', 'Debug build and more output', DEFAULT_PAKE_OPTIONS.debug)
|
|
1012
|
-
.option('--
|
|
974
|
+
.option('--multi-arch', 'Only for Mac, supports both Intel and M1', DEFAULT_PAKE_OPTIONS.multiArch)
|
|
1013
975
|
.addOption(new Option('--user-agent <string>', 'Custom user agent').default(DEFAULT_PAKE_OPTIONS.userAgent).hideHelp())
|
|
1014
976
|
.addOption(new Option('--targets <string>', 'Only for Linux, option "deb" or "appimage"').default(DEFAULT_PAKE_OPTIONS.targets).hideHelp())
|
|
1015
977
|
.addOption(new Option('--always-on-top', 'Always on the top level').default(DEFAULT_PAKE_OPTIONS.alwaysOnTop).hideHelp())
|
package/dist/dev.js
CHANGED
|
@@ -263,30 +263,22 @@ var pakeConf = {
|
|
|
263
263
|
|
|
264
264
|
var productName$1 = "WeRead";
|
|
265
265
|
var identifier = "com.pake.weread";
|
|
266
|
-
var version = "
|
|
267
|
-
var plugins = {
|
|
268
|
-
};
|
|
266
|
+
var version = "1.0.0";
|
|
269
267
|
var app = {
|
|
270
|
-
|
|
271
|
-
csp: null
|
|
272
|
-
},
|
|
268
|
+
withGlobalTauri: true,
|
|
273
269
|
trayIcon: {
|
|
274
270
|
iconPath: "png/weread_512.png",
|
|
275
271
|
iconAsTemplate: false,
|
|
276
272
|
id: "pake-tray"
|
|
277
|
-
}
|
|
278
|
-
withGlobalTauri: true
|
|
273
|
+
}
|
|
279
274
|
};
|
|
280
275
|
var build = {
|
|
281
|
-
|
|
282
|
-
frontendDist: "../dist",
|
|
283
|
-
beforeDevCommand: ""
|
|
276
|
+
frontendDist: "../dist"
|
|
284
277
|
};
|
|
285
278
|
var CommonConf = {
|
|
286
279
|
productName: productName$1,
|
|
287
280
|
identifier: identifier,
|
|
288
281
|
version: version,
|
|
289
|
-
plugins: plugins,
|
|
290
282
|
app: app,
|
|
291
283
|
build: build
|
|
292
284
|
};
|
|
@@ -297,22 +289,14 @@ var bundle$2 = {
|
|
|
297
289
|
"png/weread_32.ico"
|
|
298
290
|
],
|
|
299
291
|
active: true,
|
|
300
|
-
category: "DeveloperTool",
|
|
301
|
-
copyright: "",
|
|
302
|
-
externalBin: [
|
|
303
|
-
],
|
|
304
|
-
longDescription: "",
|
|
305
292
|
resources: [
|
|
306
293
|
"png/weread_32.ico"
|
|
307
294
|
],
|
|
308
|
-
shortDescription: "",
|
|
309
295
|
targets: [
|
|
310
296
|
"msi"
|
|
311
297
|
],
|
|
312
298
|
windows: {
|
|
313
|
-
certificateThumbprint: null,
|
|
314
299
|
digestAlgorithm: "sha256",
|
|
315
|
-
timestampUrl: "",
|
|
316
300
|
wix: {
|
|
317
301
|
language: [
|
|
318
302
|
"en-US"
|
|
@@ -330,22 +314,8 @@ var bundle$1 = {
|
|
|
330
314
|
"icons/weread.icns"
|
|
331
315
|
],
|
|
332
316
|
active: true,
|
|
333
|
-
category: "DeveloperTool",
|
|
334
|
-
copyright: "",
|
|
335
|
-
externalBin: [
|
|
336
|
-
],
|
|
337
|
-
longDescription: "",
|
|
338
317
|
macOS: {
|
|
339
|
-
entitlements: null,
|
|
340
|
-
exceptionDomain: null,
|
|
341
|
-
frameworks: [
|
|
342
|
-
],
|
|
343
|
-
providerShortName: null,
|
|
344
|
-
signingIdentity: null
|
|
345
318
|
},
|
|
346
|
-
resources: [
|
|
347
|
-
],
|
|
348
|
-
shortDescription: "",
|
|
349
319
|
targets: [
|
|
350
320
|
"dmg"
|
|
351
321
|
]
|
|
@@ -354,14 +324,12 @@ var MacConf = {
|
|
|
354
324
|
bundle: bundle$1
|
|
355
325
|
};
|
|
356
326
|
|
|
357
|
-
var productName = "
|
|
327
|
+
var productName = "we-read";
|
|
358
328
|
var bundle = {
|
|
359
329
|
icon: [
|
|
360
330
|
"png/weread_512.png"
|
|
361
331
|
],
|
|
362
332
|
active: true,
|
|
363
|
-
category: "DeveloperTool",
|
|
364
|
-
copyright: "",
|
|
365
333
|
linux: {
|
|
366
334
|
deb: {
|
|
367
335
|
depends: [
|
|
@@ -373,12 +341,6 @@ var bundle = {
|
|
|
373
341
|
}
|
|
374
342
|
}
|
|
375
343
|
},
|
|
376
|
-
externalBin: [
|
|
377
|
-
],
|
|
378
|
-
longDescription: "",
|
|
379
|
-
resources: [
|
|
380
|
-
],
|
|
381
|
-
shortDescription: "",
|
|
382
344
|
targets: [
|
|
383
345
|
"deb",
|
|
384
346
|
"appimage"
|
|
@@ -521,10 +483,10 @@ async function mergeConfig(url, options, tauriConf) {
|
|
|
521
483
|
disabled_web_shortcuts: disabledWebShortcuts,
|
|
522
484
|
};
|
|
523
485
|
Object.assign(tauriConf.pake.windows[0], { url, ...tauriConfWindowOptions });
|
|
524
|
-
tauriConf.
|
|
525
|
-
tauriConf.
|
|
526
|
-
if (platform ==
|
|
527
|
-
tauriConf.
|
|
486
|
+
tauriConf.productName = name;
|
|
487
|
+
tauriConf.identifier = identifier;
|
|
488
|
+
if (platform == 'win32') {
|
|
489
|
+
tauriConf.bundle.windows.wix.language[0] = installerLanguage;
|
|
528
490
|
}
|
|
529
491
|
//Judge the type of URL, whether it is a file or a website.
|
|
530
492
|
const pathExists = await fsExtra.pathExists(url);
|
|
@@ -661,7 +623,7 @@ async function mergeConfig(url, options, tauriConf) {
|
|
|
661
623
|
tauriConf.pake.inject = [];
|
|
662
624
|
await fsExtra.writeFile(injectFilePath, '');
|
|
663
625
|
}
|
|
664
|
-
tauriConf.pake.proxy_url = proxyUrl ||
|
|
626
|
+
tauriConf.pake.proxy_url = proxyUrl || '';
|
|
665
627
|
// Save config file.
|
|
666
628
|
const platformConfigPaths = {
|
|
667
629
|
win32: 'tauri.windows.conf.json',
|
package/dist/dev.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.js","sources":["../bin/defaults.ts","../bin/options/logger.ts","../bin/utils/dir.ts","../bin/utils/platform.ts","../bin/utils/info.ts","../bin/options/icon.ts","../bin/utils/url.ts","../bin/options/index.ts","../bin/helpers/tauriConfig.ts","../bin/utils/shell.ts","../bin/utils/ip.ts","../bin/helpers/rust.ts","../bin/utils/combine.ts","../bin/helpers/merge.ts","../bin/builders/BaseBuilder.ts","../bin/builders/MacBuilder.ts","../bin/builders/WinBuilder.ts","../bin/builders/LinuxBuilder.ts","../bin/builders/BuilderProvider.ts","../bin/dev.ts"],"sourcesContent":["import { PakeCliOptions } from './types.js';\n\nexport const DEFAULT_PAKE_OPTIONS: PakeCliOptions = {\n icon: '',\n height: 780,\n width: 1200,\n fullscreen: false,\n resizable: true,\n hideTitleBar: false,\n alwaysOnTop: false,\n darkMode: false,\n disabledWebShortcuts: false,\n activationShortcut: '',\n userAgent: '',\n showSystemTray: false,\n multiArch: false,\n targets: 'deb',\n useLocalFile: false,\n systemTrayIcon: '',\n proxyUrl: \"\",\n debug: false,\n inject: [],\n installerLanguage: 'en-US',\n};\n\n// Just for cli development\nexport const DEFAULT_DEV_PAKE_OPTIONS: PakeCliOptions & { url: string } = {\n ...DEFAULT_PAKE_OPTIONS,\n url: 'https://weread.qq.com',\n name: 'WeRead',\n hideTitleBar: true,\n};\n","import chalk from 'chalk';\nimport log from 'loglevel';\n\nconst logger = {\n info(...msg: any[]) {\n log.info(...msg.map(m => chalk.white(m)));\n },\n debug(...msg: any[]) {\n log.debug(...msg);\n },\n error(...msg: any[]) {\n log.error(...msg.map(m => chalk.red(m)));\n },\n warn(...msg: any[]) {\n log.info(...msg.map(m => chalk.yellow(m)));\n },\n success(...msg: any[]) {\n log.info(...msg.map(m => chalk.green(m)));\n },\n};\n\nexport default logger;\n","import path from 'path';\nimport { fileURLToPath } from 'url';\n\n// Convert the current module URL to a file path\nconst currentModulePath = fileURLToPath(import.meta.url);\n\n// Resolve the parent directory of the current module\nexport const npmDirectory = path.join(path.dirname(currentModulePath), '..');\n\nexport const tauriConfigDirectory =\n process.env.NODE_ENV === 'development'\n ? path.join(npmDirectory, 'src-tauri', '.pake')\n : path.join(npmDirectory, 'src-tauri');\n","const { platform } = process;\n\nexport const IS_MAC = platform === 'darwin';\nexport const IS_WIN = platform === 'win32';\nexport const IS_LINUX = platform === 'linux';\n","import crypto from 'crypto';\nimport prompts from 'prompts';\nimport ora from 'ora';\nimport chalk from 'chalk';\n\n// Generates an identifier based on the given URL.\nexport function getIdentifier(url: string) {\n const postFixHash = crypto.createHash('md5').update(url).digest('hex').substring(0, 6);\n return `com.pake.${postFixHash}`;\n}\n\nexport async function promptText(message: string, initial?: string): Promise<string> {\n const response = await prompts({\n type: 'text',\n name: 'content',\n message,\n initial,\n });\n return response.content;\n}\n\nexport function capitalizeFirstLetter(string: string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}\n\nexport function getSpinner(text: string) {\n const loadingType = {\n interval: 80,\n frames: ['✦', '✶', '✺', '✵', '✸', '✹', '✺'],\n };\n return ora({\n text: `${chalk.cyan(text)}\\n`,\n spinner: loadingType,\n color: 'cyan',\n }).start();\n}\n","import path from 'path';\nimport axios from 'axios';\nimport fsExtra from 'fs-extra';\nimport chalk from 'chalk';\nimport { dir } from 'tmp-promise';\n\nimport logger from './logger';\nimport { npmDirectory } from '@/utils/dir';\nimport { IS_LINUX, IS_WIN } from '@/utils/platform';\nimport { getSpinner } from '@/utils/info';\nimport { fileTypeFromBuffer } from 'file-type';\nimport { PakeAppOptions } from '@/types';\n\nexport async function handleIcon(options: PakeAppOptions) {\n if (options.icon) {\n if (options.icon.startsWith('http')) {\n return downloadIcon(options.icon);\n } else {\n return path.resolve(options.icon);\n }\n } else {\n logger.warn('✼ No icon given, default in use. For a custom icon, use --icon option.');\n const iconPath = IS_WIN\n ? 'src-tauri/png/icon_256.ico'\n : IS_LINUX\n ? 'src-tauri/png/icon_512.png'\n : 'src-tauri/icons/icon.icns';\n return path.join(npmDirectory, iconPath);\n }\n}\n\nexport async function downloadIcon(iconUrl: string) {\n const spinner = getSpinner('Downloading icon...');\n try {\n const iconResponse = await axios.get(iconUrl, { responseType: 'arraybuffer' });\n const iconData = await iconResponse.data;\n\n if (!iconData) {\n return null;\n }\n\n const fileDetails = await fileTypeFromBuffer(iconData);\n if (!fileDetails) {\n return null;\n }\n\n const { path: tempPath } = await dir();\n let iconPath = `${tempPath}/icon.${fileDetails.ext}`;\n // Fix this for linux\n if (IS_LINUX) {\n iconPath = 'png/linux_temp.png';\n await fsExtra.outputFile(`${npmDirectory}/src-tauri/${iconPath}`, iconData);\n } else {\n await fsExtra.outputFile(iconPath, iconData);\n }\n await fsExtra.outputFile(iconPath, iconData);\n spinner.succeed(chalk.green('Icon downloaded successfully!'));\n return iconPath;\n } catch (error) {\n spinner.fail(chalk.red('Icon download failed!'));\n if (error.response && error.response.status === 404) {\n return null;\n }\n throw error;\n }\n}\n","import * as psl from 'psl';\nimport isUrl from 'is-url';\n\n// Extracts the domain from a given URL.\nexport function getDomain(inputUrl: string): string | null {\n try {\n const url = new URL(inputUrl);\n // Use PSL to parse domain names.\n const parsed = psl.parse(url.hostname);\n\n // If domain is available, split it and return the SLD.\n if ('domain' in parsed && parsed.domain) {\n return parsed.domain.split('.')[0];\n } else {\n return null;\n }\n } catch (error) {\n return null;\n }\n}\n\n// Appends 'https://' protocol to the URL if not present.\nexport function appendProtocol(inputUrl: string): string {\n try {\n new URL(inputUrl);\n return inputUrl;\n } catch {\n return `https://${inputUrl}`;\n }\n}\n\n// Normalizes the URL by ensuring it has a protocol and is valid.\nexport function normalizeUrl(urlToNormalize: string): string {\n const urlWithProtocol = appendProtocol(urlToNormalize);\n\n if (isUrl(urlWithProtocol)) {\n return urlWithProtocol;\n } else {\n throw new Error(`Your url \"${urlWithProtocol}\" is invalid`);\n }\n}\n","import fsExtra from 'fs-extra';\nimport logger from '@/options/logger';\n\nimport { handleIcon } from './icon';\nimport { getDomain } from '@/utils/url';\nimport { getIdentifier, promptText, capitalizeFirstLetter } from '@/utils/info';\nimport { PakeAppOptions, PakeCliOptions, PlatformMap } from '@/types';\n\nfunction resolveAppName(name: string, platform: NodeJS.Platform): string {\n const domain = getDomain(name) || 'pake';\n return platform !== 'linux' ? capitalizeFirstLetter(domain) : domain;\n}\n\nfunction isValidName(name: string, platform: NodeJS.Platform): boolean {\n const platformRegexMapping: PlatformMap = {\n linux: /^[a-z0-9]+(-[a-z0-9]+)*$/,\n default: /^[a-zA-Z0-9]+([-a-zA-Z0-9])*$/,\n };\n const reg = platformRegexMapping[platform] || platformRegexMapping.default;\n return !!name && reg.test(name);\n}\n\nexport default async function handleOptions(options: PakeCliOptions, url: string): Promise<PakeAppOptions> {\n const { platform } = process;\n const isActions = process.env.GITHUB_ACTIONS;\n let name = options.name;\n\n const pathExists = await fsExtra.pathExists(url);\n if (!options.name) {\n const defaultName = pathExists ? '' : resolveAppName(url, platform);\n const promptMessage = 'Enter your application name';\n const namePrompt = await promptText(promptMessage, defaultName);\n name = namePrompt || defaultName;\n }\n\n if (!isValidName(name, platform)) {\n const LINUX_NAME_ERROR = `✕ name should only include lowercase letters, numbers, and dashes, and must contain at least one lowercase letter. Examples: com-123-xxx, 123pan, pan123, weread, we-read.`;\n const DEFAULT_NAME_ERROR = `✕ Name should only include letters and numbers, and dashes (dashes must not at the beginning), and must contain at least one letter. Examples: 123pan, 123Pan, Pan123, weread, WeRead, WERead, we-read.`;\n const errorMsg = platform === 'linux' ? LINUX_NAME_ERROR : DEFAULT_NAME_ERROR;\n logger.error(errorMsg);\n if (isActions) {\n name = resolveAppName(url, platform);\n logger.warn(`✼ Inside github actions, use the default name: ${name}`);\n } else {\n process.exit(1);\n }\n }\n\n const appOptions: PakeAppOptions = {\n ...options,\n name,\n identifier: getIdentifier(url),\n };\n\n appOptions.icon = await handleIcon(appOptions);\n\n return appOptions;\n}\n","import pakeConf from '../../src-tauri/pake.json';\nimport CommonConf from '../../src-tauri/tauri.conf.json';\nimport WinConf from '../../src-tauri/tauri.windows.conf.json';\nimport MacConf from '../../src-tauri/tauri.macos.conf.json';\nimport LinuxConf from '../../src-tauri/tauri.linux.conf.json';\n\nconst platformConfigs = {\n win32: WinConf,\n darwin: MacConf,\n linux: LinuxConf,\n};\n\nconst { platform } = process;\n// @ts-ignore\nconst platformConfig = platformConfigs[platform];\n\nlet tauriConfig = {\n ...CommonConf,\n bundle: platformConfig.bundle,\n app: {\n ...CommonConf.app,\n trayIcon: {\n ...CommonConf.app.trayIcon,\n ...(platformConfig?.app?.trayIcon ?? {}),\n },\n },\n build: CommonConf.build,\n pake: pakeConf,\n};\n\nexport default tauriConfig;\n","import shelljs from 'shelljs';\nimport { npmDirectory } from './dir';\n\nexport function shellExec(command: string) {\n return new Promise<number>((resolve, reject) => {\n shelljs.exec(command, { async: true, silent: false, cwd: npmDirectory }, code => {\n if (code === 0) {\n resolve(0);\n } else {\n reject(new Error(`${code}`));\n }\n });\n });\n}\n","import dns from 'dns';\nimport http from 'http';\nimport { promisify } from 'util';\n\nimport logger from '@/options/logger';\n\nconst resolve = promisify(dns.resolve);\n\nconst ping = async (host: string) => {\n const lookup = promisify(dns.lookup);\n const ip = await lookup(host);\n const start = new Date();\n\n // Prevent timeouts from affecting user experience.\n const requestPromise = new Promise<number>((resolve, reject) => {\n const req = http.get(`http://${ip.address}`, res => {\n const delay = new Date().getTime() - start.getTime();\n res.resume();\n resolve(delay);\n });\n\n req.on('error', err => {\n reject(err);\n });\n });\n\n const timeoutPromise = new Promise<number>((_, reject) => {\n setTimeout(() => {\n reject(new Error('Request timed out after 3 seconds'));\n }, 1000);\n });\n\n return Promise.race([requestPromise, timeoutPromise]);\n};\n\nasync function isChinaDomain(domain: string): Promise<boolean> {\n try {\n const [ip] = await resolve(domain);\n return await isChinaIP(ip, domain);\n } catch (error) {\n logger.debug(`${domain} can't be parse!`);\n return true;\n }\n}\n\nasync function isChinaIP(ip: string, domain: string): Promise<boolean> {\n try {\n const delay = await ping(ip);\n logger.debug(`${domain} latency is ${delay} ms`);\n return delay > 500;\n } catch (error) {\n logger.debug(`ping ${domain} failed!`);\n return true;\n }\n}\n\nexport { isChinaDomain, isChinaIP };\n","import chalk from 'chalk';\nimport shelljs from 'shelljs';\n\nimport { getSpinner } from '@/utils/info';\nimport { IS_WIN } from '@/utils/platform';\nimport { shellExec } from '@/utils/shell';\nimport { isChinaDomain } from '@/utils/ip';\n\nexport async function installRust() {\n const isActions = process.env.GITHUB_ACTIONS;\n const isInChina = await isChinaDomain('sh.rustup.rs');\n const rustInstallScriptForMac =\n isInChina && !isActions\n ? 'export RUSTUP_DIST_SERVER=\"https://rsproxy.cn\" && export RUSTUP_UPDATE_ROOT=\"https://rsproxy.cn/rustup\" && curl --proto \"=https\" --tlsv1.2 -sSf https://rsproxy.cn/rustup-init.sh | sh'\n : \"curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y\";\n const rustInstallScriptForWindows = 'winget install --id Rustlang.Rustup';\n\n const spinner = getSpinner('Downloading Rust...');\n\n try {\n await shellExec(IS_WIN ? rustInstallScriptForWindows : rustInstallScriptForMac);\n spinner.succeed(chalk.green('Rust installed successfully!'));\n } catch (error) {\n console.error('Error installing Rust:', error.message);\n spinner.fail(chalk.red('Rust installation failed!'));\n process.exit(1);\n }\n}\n\nexport function checkRustInstalled() {\n return shelljs.exec('rustc --version', { silent: true }).code === 0;\n}\n","import fs from 'fs';\n\nexport default async function combineFiles(files: string[], output: string) {\n const contents = files.map(file => {\n const fileContent = fs.readFileSync(file);\n if (file.endsWith('.css')) {\n return (\n \"window.addEventListener('DOMContentLoaded', (_event) => { const css = `\" +\n fileContent +\n \"`; const style = document.createElement('style'); style.innerHTML = css; document.head.appendChild(style); });\"\n );\n }\n\n return \"window.addEventListener('DOMContentLoaded', (_event) => { \" + fileContent + ' });';\n });\n fs.writeFileSync(output, contents.join('\\n'));\n return files;\n}\n","import path from 'path';\nimport fsExtra from 'fs-extra';\n\nimport { npmDirectory } from '@/utils/dir';\nimport combineFiles from '@/utils/combine';\nimport logger from '@/options/logger';\nimport { PakeAppOptions, PlatformMap } from '@/types';\nimport { tauriConfigDirectory } from '@/utils/dir';\n\nexport async function mergeConfig(url: string, options: PakeAppOptions, tauriConf: any) {\n const {\n width,\n height,\n fullscreen,\n hideTitleBar,\n alwaysOnTop,\n darkMode,\n disabledWebShortcuts,\n activationShortcut,\n userAgent,\n showSystemTray,\n systemTrayIcon,\n useLocalFile,\n identifier,\n name,\n resizable = true,\n inject,\n proxyUrl,\n installerLanguage,\n } = options;\n\n const { platform } = process;\n\n // Set Windows parameters.\n const tauriConfWindowOptions = {\n width,\n height,\n fullscreen,\n resizable,\n hide_title_bar: hideTitleBar,\n activation_shortcut: activationShortcut,\n always_on_top: alwaysOnTop,\n dark_mode: darkMode,\n disabled_web_shortcuts: disabledWebShortcuts,\n };\n Object.assign(tauriConf.pake.windows[0], { url, ...tauriConfWindowOptions });\n\n tauriConf.package.productName = name;\n tauriConf.tauri.bundle.identifier = identifier;\n if (platform == \"win32\") {\n tauriConf.tauri.bundle.windows.wix.language[0] = installerLanguage;\n }\n\n //Judge the type of URL, whether it is a file or a website.\n const pathExists = await fsExtra.pathExists(url);\n if (pathExists) {\n logger.warn('✼ Your input might be a local file.');\n tauriConf.pake.windows[0].url_type = 'local';\n\n const fileName = path.basename(url);\n const dirName = path.dirname(url);\n\n const distDir = path.join(npmDirectory, 'dist');\n const distBakDir = path.join(npmDirectory, 'dist_bak');\n\n if (!useLocalFile) {\n const urlPath = path.join(distDir, fileName);\n await fsExtra.copy(url, urlPath);\n } else {\n fsExtra.moveSync(distDir, distBakDir, { overwrite: true });\n fsExtra.copySync(dirName, distDir, { overwrite: true });\n\n // ignore it, because about_pake.html have be erased.\n // const filesToCopyBack = ['cli.js', 'about_pake.html'];\n const filesToCopyBack = ['cli.js'];\n await Promise.all(\n filesToCopyBack.map(file => fsExtra.copy(path.join(distBakDir, file), path.join(distDir, file))),\n );\n }\n\n tauriConf.pake.windows[0].url = fileName;\n tauriConf.pake.windows[0].url_type = 'local';\n } else {\n tauriConf.pake.windows[0].url_type = 'web';\n }\n\n const platformMap: PlatformMap = {\n win32: 'windows',\n linux: 'linux',\n darwin: 'macos',\n };\n const currentPlatform = platformMap[platform];\n\n if (userAgent.length > 0) {\n tauriConf.pake.user_agent[currentPlatform] = userAgent;\n }\n\n tauriConf.pake.system_tray[currentPlatform] = showSystemTray;\n\n // Processing targets are currently only open to Linux.\n if (platform === 'linux') {\n delete tauriConf.bundle.linux.deb.files;\n const validTargets = ['all', 'deb', 'appimage', 'rpm'];\n if (validTargets.includes(options.targets)) {\n tauriConf.bundle.targets = options.targets === 'all' ? ['deb', 'appimage', 'rpm'] : [options.targets];\n } else {\n logger.warn(`✼ The target must be one of ${validTargets.join(', ')}, the default 'deb' will be used.`);\n }\n }\n\n // Set icon.\n const platformIconMap: PlatformMap = {\n win32: {\n fileExt: '.ico',\n path: `png/${name.toLowerCase()}_256.ico`,\n defaultIcon: 'png/icon_256.ico',\n message: 'Windows icon must be .ico and 256x256px.',\n },\n linux: {\n fileExt: '.png',\n path: `png/${name.toLowerCase()}_512.png`,\n defaultIcon: 'png/icon_512.png',\n message: 'Linux icon must be .png and 512x512px.',\n },\n darwin: {\n fileExt: '.icns',\n path: `icons/${name.toLowerCase()}.icns`,\n defaultIcon: 'icons/icon.icns',\n message: 'macOS icon must be .icns type.',\n },\n };\n const iconInfo = platformIconMap[platform];\n const exists = await fsExtra.pathExists(options.icon);\n if (exists) {\n let updateIconPath = true;\n let customIconExt = path.extname(options.icon).toLowerCase();\n\n if (customIconExt !== iconInfo.fileExt) {\n updateIconPath = false;\n logger.warn(`✼ ${iconInfo.message}, but you give ${customIconExt}`);\n tauriConf.bundle.icon = [iconInfo.defaultIcon];\n } else {\n const iconPath = path.join(npmDirectory, 'src-tauri/', iconInfo.path);\n tauriConf.bundle.resources = [iconInfo.path];\n await fsExtra.copy(options.icon, iconPath);\n }\n\n if (updateIconPath) {\n tauriConf.bundle.icon = [options.icon];\n } else {\n logger.warn(`✼ Icon will remain as default.`);\n }\n } else {\n logger.warn('✼ Custom icon path may be invalid, default icon will be used instead.');\n tauriConf.bundle.icon = [iconInfo.defaultIcon];\n }\n\n // Set tray icon path.\n let trayIconPath = platform === 'darwin' ? 'png/icon_512.png' : tauriConf.bundle.icon[0];\n if (systemTrayIcon.length > 0) {\n try {\n await fsExtra.pathExists(systemTrayIcon);\n // 需要判断图标格式,默认只支持ico和png两种\n let iconExt = path.extname(systemTrayIcon).toLowerCase();\n if (iconExt == '.png' || iconExt == '.ico') {\n const trayIcoPath = path.join(npmDirectory, `src-tauri/png/${name.toLowerCase()}${iconExt}`);\n trayIconPath = `png/${name.toLowerCase()}${iconExt}`;\n await fsExtra.copy(systemTrayIcon, trayIcoPath);\n } else {\n logger.warn(`✼ System tray icon must be .ico or .png, but you provided ${iconExt}.`);\n logger.warn(`✼ Default system tray icon will be used.`);\n }\n } catch {\n logger.warn(`✼ ${systemTrayIcon} not exists!`);\n logger.warn(`✼ Default system tray icon will remain unchanged.`);\n }\n }\n\n tauriConf.app.trayIcon.iconPath = trayIconPath;\n tauriConf.pake.system_tray_path = trayIconPath;\n\n delete tauriConf.app.trayIcon;\n\n const injectFilePath = path.join(npmDirectory, `src-tauri/src/inject/custom.js`);\n // inject js or css files\n if (inject?.length > 0) {\n if (!inject.every(item => item.endsWith('.css') || item.endsWith('.js'))) {\n logger.error('The injected file must be in either CSS or JS format.');\n return;\n }\n const files = inject.map(filepath => (path.isAbsolute(filepath) ? filepath : path.join(process.cwd(), filepath)));\n tauriConf.pake.inject = files;\n await combineFiles(files, injectFilePath);\n } else {\n tauriConf.pake.inject = [];\n await fsExtra.writeFile(injectFilePath, '');\n }\n tauriConf.pake.proxy_url = proxyUrl || \"\";\n // Save config file.\n const platformConfigPaths: PlatformMap = {\n win32: 'tauri.windows.conf.json',\n darwin: 'tauri.macos.conf.json',\n linux: 'tauri.linux.conf.json',\n };\n const configPath = path.join(tauriConfigDirectory, platformConfigPaths[platform]);\n\n const bundleConf = { bundle: tauriConf.bundle };\n console.log('pakeConfig', tauriConf.pake);\n await fsExtra.outputJSON(configPath, bundleConf, { spaces: 4 });\n const pakeConfigPath = path.join(tauriConfigDirectory, 'pake.json');\n await fsExtra.outputJSON(pakeConfigPath, tauriConf.pake, { spaces: 4 });\n\n let tauriConf2 = JSON.parse(JSON.stringify(tauriConf));\n delete tauriConf2.pake;\n // delete tauriConf2.bundle;\n if (process.env.NODE_ENV === 'development') {\n tauriConf2.bundle = bundleConf.bundle;\n }\n const configJsonPath = path.join(tauriConfigDirectory, 'tauri.conf.json');\n await fsExtra.outputJSON(configJsonPath, tauriConf2, { spaces: 4 });\n}\n","import path from 'path';\nimport fsExtra from 'fs-extra';\nimport chalk from 'chalk';\nimport prompts from 'prompts';\n\nimport { PakeAppOptions } from '@/types';\nimport { checkRustInstalled, installRust } from '@/helpers/rust';\nimport { mergeConfig } from '@/helpers/merge';\nimport tauriConfig from '@/helpers/tauriConfig';\nimport { npmDirectory } from '@/utils/dir';\nimport { getSpinner } from '@/utils/info';\nimport { shellExec } from '@/utils/shell';\nimport { isChinaDomain } from '@/utils/ip';\nimport { IS_MAC } from '@/utils/platform';\nimport logger from '@/options/logger';\n\nexport default abstract class BaseBuilder {\n protected options: PakeAppOptions;\n\n protected constructor(options: PakeAppOptions) {\n this.options = options;\n }\n\n async prepare() {\n const tauriSrcPath = path.join(npmDirectory, 'src-tauri');\n const tauriTargetPath = path.join(tauriSrcPath, 'target');\n const tauriTargetPathExists = await fsExtra.pathExists(tauriTargetPath);\n\n if (!IS_MAC && !tauriTargetPathExists) {\n logger.warn('✼ The first use requires installing system dependencies.');\n logger.warn('✼ See more in https://tauri.app/guides/getting-started/prerequisites.');\n }\n\n if (!checkRustInstalled()) {\n const res = await prompts({\n type: 'confirm',\n message: 'Rust not detected. Install now?',\n name: 'value',\n });\n\n if (res.value) {\n await installRust();\n } else {\n logger.error('✕ Rust required to package your webapp.');\n process.exit(0);\n }\n }\n\n const isChina = await isChinaDomain('www.npmjs.com');\n const spinner = getSpinner('Installing package...');\n const rustProjectDir = path.join(tauriSrcPath, '.cargo');\n const projectConf = path.join(rustProjectDir, 'config.toml');\n await fsExtra.ensureDir(rustProjectDir);\n\n if (isChina) {\n logger.info('✺ Located in China, using npm/rsProxy CN mirror.');\n const projectCnConf = path.join(tauriSrcPath, 'rust_proxy.toml');\n await fsExtra.copy(projectCnConf, projectConf);\n await shellExec(`cd \"${npmDirectory}\" && npm install --registry=https://registry.npmmirror.com`);\n } else {\n await shellExec(`cd \"${npmDirectory}\" && npm install`);\n }\n spinner.succeed(chalk.green('Package installed!'));\n if (!tauriTargetPathExists) {\n logger.warn('✼ The first packaging may be slow, please be patient and wait, it will be faster afterwards.');\n }\n }\n\n async build(url: string) {\n await this.buildAndCopy(url, this.options.targets);\n }\n\n async start(url: string) {\n await mergeConfig(url, this.options, tauriConfig);\n }\n\n async buildAndCopy(url: string, target: string) {\n const { name } = this.options;\n await mergeConfig(url, this.options, tauriConfig);\n\n // Build app\n const spinner = getSpinner('Building app...');\n setTimeout(() => spinner.stop(), 3000);\n await shellExec(`cd \"${npmDirectory}\" && ${this.getBuildCommand()}`);\n\n // Copy app\n const fileName = this.getFileName();\n const fileType = this.getFileType(target);\n const appPath = this.getBuildAppPath(npmDirectory, fileName, fileType);\n const distPath = path.resolve(`${name}.${fileType}`);\n await fsExtra.copy(appPath, distPath);\n await fsExtra.remove(appPath);\n logger.success('✔ Build success!');\n logger.success('✔ App installer located in', distPath);\n }\n\n protected getFileType(target: string): string {\n return target;\n }\n\n abstract getFileName(): string;\n\n protected getBuildCommand(): string {\n // the debug option should support `--debug` and `--release`\n return this.options.debug ? 'npm run build:debug' : 'npm run build';\n }\n\n protected getBasePath(): string {\n const basePath = this.options.debug ? 'debug' : 'release';\n return `src-tauri/target/${basePath}/bundle/`;\n }\n\n protected getBuildAppPath(npmDirectory: string, fileName: string, fileType: string): string {\n return path.join(npmDirectory, this.getBasePath(), fileType.toLowerCase(), `${fileName}.${fileType}`);\n }\n}\n","import tauriConfig from '@/helpers/tauriConfig';\nimport { PakeAppOptions } from '@/types';\nimport BaseBuilder from './BaseBuilder';\n\nexport default class MacBuilder extends BaseBuilder {\n constructor(options: PakeAppOptions) {\n super(options);\n this.options.targets = 'dmg';\n }\n\n getFileName(): string {\n const { name } = this.options;\n let arch: string;\n if (this.options.multiArch) {\n arch = 'universal';\n } else {\n arch = process.arch === 'arm64' ? 'aarch64' : process.arch;\n }\n return `${name}_${tauriConfig.version}_${arch}`;\n }\n\n protected getBuildCommand(): string {\n return this.options.multiArch ? 'npm run build:mac' : super.getBuildCommand();\n }\n\n protected getBasePath(): string {\n return this.options.multiArch\n ? 'src-tauri/target/universal-apple-darwin/release/bundle'\n : super.getBasePath();\n }\n}\n","import BaseBuilder from './BaseBuilder';\nimport { PakeAppOptions } from '@/types';\nimport tauriConfig from '@/helpers/tauriConfig';\n\nexport default class WinBuilder extends BaseBuilder {\n constructor(options: PakeAppOptions) {\n super(options);\n this.options.targets = 'msi';\n }\n\n getFileName(): string {\n const { name } = this.options;\n const { arch } = process;\n const language = tauriConfig.bundle.windows.wix.language[0];\n return `${name}_${tauriConfig.version}_${arch}_${language}`;\n }\n}\n","import BaseBuilder from './BaseBuilder';\nimport { PakeAppOptions } from '@/types';\nimport tauriConfig from '@/helpers/tauriConfig';\n\nexport default class LinuxBuilder extends BaseBuilder {\n constructor(options: PakeAppOptions) {\n super(options);\n }\n\n getFileName(): string {\n const { name } = this.options;\n const arch = process.arch === 'x64' ? 'amd64' : process.arch;\n return `${name}_${tauriConfig.version}_${arch}`;\n }\n\n // Customize it, considering that there are all targets.\n async build(url: string) {\n const targetTypes = ['deb', 'appimage'];\n for (const target of targetTypes) {\n if (this.options.targets === target || this.options.targets === 'all') {\n await this.buildAndCopy(url, target);\n }\n }\n }\n\n protected getFileType(target: string): string {\n if (target === 'appimage') {\n return 'AppImage';\n }\n return super.getFileType(target);\n }\n}\n","import BaseBuilder from './BaseBuilder';\nimport MacBuilder from './MacBuilder';\nimport WinBuilder from './WinBuilder';\nimport LinuxBuilder from './LinuxBuilder';\nimport { PakeAppOptions } from '@/types';\n\nconst { platform } = process;\n\nconst buildersMap: Record<string, new (options: PakeAppOptions) => BaseBuilder> = {\n darwin: MacBuilder,\n win32: WinBuilder,\n linux: LinuxBuilder,\n};\n\nexport default class BuilderProvider {\n static create(options: PakeAppOptions): BaseBuilder {\n const Builder = buildersMap[platform];\n if (!Builder) {\n throw new Error('The current system is not supported!');\n }\n return new Builder(options);\n }\n}\n","import log from 'loglevel';\nimport { DEFAULT_DEV_PAKE_OPTIONS } from './defaults';\nimport handleInputOptions from './options/index';\nimport BuilderProvider from './builders/BuilderProvider';\n\nasync function startBuild() {\n log.setDefaultLevel('debug');\n\n const appOptions = await handleInputOptions(DEFAULT_DEV_PAKE_OPTIONS, DEFAULT_DEV_PAKE_OPTIONS.url);\n log.debug('PakeAppOptions', appOptions);\n\n const builder = BuilderProvider.create(appOptions);\n await builder.prepare();\n await builder.start(DEFAULT_DEV_PAKE_OPTIONS.url);\n}\n\nstartBuild();\n"],"names":["platform","handleInputOptions"],"mappings":";;;;;;;;;;;;;;;;;;;AAEO,MAAM,oBAAoB,GAAmB;AAClD,IAAA,IAAI,EAAE,EAAE;AACR,IAAA,MAAM,EAAE,GAAG;AACX,IAAA,KAAK,EAAE,IAAI;AACX,IAAA,UAAU,EAAE,KAAK;AACjB,IAAA,SAAS,EAAE,IAAI;AACf,IAAA,YAAY,EAAE,KAAK;AACnB,IAAA,WAAW,EAAE,KAAK;AAClB,IAAA,QAAQ,EAAE,KAAK;AACf,IAAA,oBAAoB,EAAE,KAAK;AAC3B,IAAA,kBAAkB,EAAE,EAA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AY,CAAC,GAAG,EAAE,MAAM,CAAC;;;;AAKhC,IAAA,WAAW,CAAC,MAAc,EAAA;AAClC,QAAA,IAAI,MAAM,KAAK,UAAU,EAAE;AACzB,YAAA,OAAO,UAAU;;AAEnB,QAAA,OAAO,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC;;AAEnC;;ACzBD,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO;AAE5B,MAAM,WAAW,GAAiE;AAChF,IAAA,MAAM,EAAE,UAAU;AAClB,IAAA,KAAK,EAAE,UAAU;AACjB,IAAA,KAAK,EAAE,YAAY;CACpB;AAEa,MAAO,eAAe,CAAA;IAClC,OAAO,MAAM,CAAC,OAAuB,EAAA;AACnC,QAAA,MAAM,OAAO,GAAG,WAAW,CAAC,QAAQ,CAAC;QACrC,IAAI,CAAC,OAAO,EAAE;AACZ,YAAA,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC;;AAEzD,QAAA,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;;AAE9B;;ACjBD,eAAe,UAAU,GAAA;AACvB,IAAA,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC;IAE5B,MAAM,UAAU,GAAG,MAAMC,aAAkB,CAAC,wBAAwB,EAAE,wBAAwB,CAAC,GAAG,CAAC;AACnG,IAAA,GAAG,CAAC,KAAK,CAAC,gBAAgB,EAAE,UAAU,CAAC;IAEvC,MAAM,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC,UAAU,CAAC;AAClD,IAAA,MAAM,OAAO,CAAC,OAAO,EAAE;IACvB,MAAM,OAAO,CAAC,KAAK,CAAC,wBAAwB,CAAC,GAAG,CAAC;AACnD;AAEA,UAAU,EAAE"}
|
|
1
|
+
{"version":3,"file":"dev.js","sources":["../bin/defaults.ts","../bin/options/logger.ts","../bin/utils/dir.ts","../bin/utils/platform.ts","../bin/utils/info.ts","../bin/options/icon.ts","../bin/utils/url.ts","../bin/options/index.ts","../bin/helpers/tauriConfig.ts","../bin/utils/shell.ts","../bin/utils/ip.ts","../bin/helpers/rust.ts","../bin/utils/combine.ts","../bin/helpers/merge.ts","../bin/builders/BaseBuilder.ts","../bin/builders/MacBuilder.ts","../bin/builders/WinBuilder.ts","../bin/builders/LinuxBuilder.ts","../bin/builders/BuilderProvider.ts","../bin/dev.ts"],"sourcesContent":["import { PakeCliOptions } from './types.js';\n\nexport const DEFAULT_PAKE_OPTIONS: PakeCliOptions = {\n icon: '',\n height: 780,\n width: 1200,\n fullscreen: false,\n resizable: true,\n hideTitleBar: false,\n alwaysOnTop: false,\n darkMode: false,\n disabledWebShortcuts: false,\n activationShortcut: '',\n userAgent: '',\n showSystemTray: false,\n multiArch: false,\n targets: 'deb',\n useLocalFile: false,\n systemTrayIcon: '',\n proxyUrl: \"\",\n debug: false,\n inject: [],\n installerLanguage: 'en-US',\n};\n\n// Just for cli development\nexport const DEFAULT_DEV_PAKE_OPTIONS: PakeCliOptions & { url: string } = {\n ...DEFAULT_PAKE_OPTIONS,\n url: 'https://weread.qq.com',\n name: 'WeRead',\n hideTitleBar: true,\n};\n","import chalk from 'chalk';\nimport log from 'loglevel';\n\nconst logger = {\n info(...msg: any[]) {\n log.info(...msg.map(m => chalk.white(m)));\n },\n debug(...msg: any[]) {\n log.debug(...msg);\n },\n error(...msg: any[]) {\n log.error(...msg.map(m => chalk.red(m)));\n },\n warn(...msg: any[]) {\n log.info(...msg.map(m => chalk.yellow(m)));\n },\n success(...msg: any[]) {\n log.info(...msg.map(m => chalk.green(m)));\n },\n};\n\nexport default logger;\n","import path from 'path';\nimport { fileURLToPath } from 'url';\n\n// Convert the current module URL to a file path\nconst currentModulePath = fileURLToPath(import.meta.url);\n\n// Resolve the parent directory of the current module\nexport const npmDirectory = path.join(path.dirname(currentModulePath), '..');\n\nexport const tauriConfigDirectory =\n process.env.NODE_ENV === 'development'\n ? path.join(npmDirectory, 'src-tauri', '.pake')\n : path.join(npmDirectory, 'src-tauri');\n","const { platform } = process;\n\nexport const IS_MAC = platform === 'darwin';\nexport const IS_WIN = platform === 'win32';\nexport const IS_LINUX = platform === 'linux';\n","import crypto from 'crypto';\nimport prompts from 'prompts';\nimport ora from 'ora';\nimport chalk from 'chalk';\n\n// Generates an identifier based on the given URL.\nexport function getIdentifier(url: string) {\n const postFixHash = crypto.createHash('md5').update(url).digest('hex').substring(0, 6);\n return `com.pake.${postFixHash}`;\n}\n\nexport async function promptText(message: string, initial?: string): Promise<string> {\n const response = await prompts({\n type: 'text',\n name: 'content',\n message,\n initial,\n });\n return response.content;\n}\n\nexport function capitalizeFirstLetter(string: string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}\n\nexport function getSpinner(text: string) {\n const loadingType = {\n interval: 80,\n frames: ['✦', '✶', '✺', '✵', '✸', '✹', '✺'],\n };\n return ora({\n text: `${chalk.cyan(text)}\\n`,\n spinner: loadingType,\n color: 'cyan',\n }).start();\n}\n","import path from 'path';\nimport axios from 'axios';\nimport fsExtra from 'fs-extra';\nimport chalk from 'chalk';\nimport { dir } from 'tmp-promise';\n\nimport logger from './logger';\nimport { npmDirectory } from '@/utils/dir';\nimport { IS_LINUX, IS_WIN } from '@/utils/platform';\nimport { getSpinner } from '@/utils/info';\nimport { fileTypeFromBuffer } from 'file-type';\nimport { PakeAppOptions } from '@/types';\n\nexport async function handleIcon(options: PakeAppOptions) {\n if (options.icon) {\n if (options.icon.startsWith('http')) {\n return downloadIcon(options.icon);\n } else {\n return path.resolve(options.icon);\n }\n } else {\n logger.warn('✼ No icon given, default in use. For a custom icon, use --icon option.');\n const iconPath = IS_WIN\n ? 'src-tauri/png/icon_256.ico'\n : IS_LINUX\n ? 'src-tauri/png/icon_512.png'\n : 'src-tauri/icons/icon.icns';\n return path.join(npmDirectory, iconPath);\n }\n}\n\nexport async function downloadIcon(iconUrl: string) {\n const spinner = getSpinner('Downloading icon...');\n try {\n const iconResponse = await axios.get(iconUrl, { responseType: 'arraybuffer' });\n const iconData = await iconResponse.data;\n\n if (!iconData) {\n return null;\n }\n\n const fileDetails = await fileTypeFromBuffer(iconData);\n if (!fileDetails) {\n return null;\n }\n\n const { path: tempPath } = await dir();\n let iconPath = `${tempPath}/icon.${fileDetails.ext}`;\n // Fix this for linux\n if (IS_LINUX) {\n iconPath = 'png/linux_temp.png';\n await fsExtra.outputFile(`${npmDirectory}/src-tauri/${iconPath}`, iconData);\n } else {\n await fsExtra.outputFile(iconPath, iconData);\n }\n await fsExtra.outputFile(iconPath, iconData);\n spinner.succeed(chalk.green('Icon downloaded successfully!'));\n return iconPath;\n } catch (error) {\n spinner.fail(chalk.red('Icon download failed!'));\n if (error.response && error.response.status === 404) {\n return null;\n }\n throw error;\n }\n}\n","import * as psl from 'psl';\nimport isUrl from 'is-url';\n\n// Extracts the domain from a given URL.\nexport function getDomain(inputUrl: string): string | null {\n try {\n const url = new URL(inputUrl);\n // Use PSL to parse domain names.\n const parsed = psl.parse(url.hostname);\n\n // If domain is available, split it and return the SLD.\n if ('domain' in parsed && parsed.domain) {\n return parsed.domain.split('.')[0];\n } else {\n return null;\n }\n } catch (error) {\n return null;\n }\n}\n\n// Appends 'https://' protocol to the URL if not present.\nexport function appendProtocol(inputUrl: string): string {\n try {\n new URL(inputUrl);\n return inputUrl;\n } catch {\n return `https://${inputUrl}`;\n }\n}\n\n// Normalizes the URL by ensuring it has a protocol and is valid.\nexport function normalizeUrl(urlToNormalize: string): string {\n const urlWithProtocol = appendProtocol(urlToNormalize);\n\n if (isUrl(urlWithProtocol)) {\n return urlWithProtocol;\n } else {\n throw new Error(`Your url \"${urlWithProtocol}\" is invalid`);\n }\n}\n","import fsExtra from 'fs-extra';\nimport logger from '@/options/logger';\n\nimport { handleIcon } from './icon';\nimport { getDomain } from '@/utils/url';\nimport { getIdentifier, promptText, capitalizeFirstLetter } from '@/utils/info';\nimport { PakeAppOptions, PakeCliOptions, PlatformMap } from '@/types';\n\nfunction resolveAppName(name: string, platform: NodeJS.Platform): string {\n const domain = getDomain(name) || 'pake';\n return platform !== 'linux' ? capitalizeFirstLetter(domain) : domain;\n}\n\nfunction isValidName(name: string, platform: NodeJS.Platform): boolean {\n const platformRegexMapping: PlatformMap = {\n linux: /^[a-z0-9]+(-[a-z0-9]+)*$/,\n default: /^[a-zA-Z0-9]+([-a-zA-Z0-9])*$/,\n };\n const reg = platformRegexMapping[platform] || platformRegexMapping.default;\n return !!name && reg.test(name);\n}\n\nexport default async function handleOptions(options: PakeCliOptions, url: string): Promise<PakeAppOptions> {\n const { platform } = process;\n const isActions = process.env.GITHUB_ACTIONS;\n let name = options.name;\n\n const pathExists = await fsExtra.pathExists(url);\n if (!options.name) {\n const defaultName = pathExists ? '' : resolveAppName(url, platform);\n const promptMessage = 'Enter your application name';\n const namePrompt = await promptText(promptMessage, defaultName);\n name = namePrompt || defaultName;\n }\n\n if (!isValidName(name, platform)) {\n const LINUX_NAME_ERROR = `✕ name should only include lowercase letters, numbers, and dashes, and must contain at least one lowercase letter. Examples: com-123-xxx, 123pan, pan123, weread, we-read.`;\n const DEFAULT_NAME_ERROR = `✕ Name should only include letters and numbers, and dashes (dashes must not at the beginning), and must contain at least one letter. Examples: 123pan, 123Pan, Pan123, weread, WeRead, WERead, we-read.`;\n const errorMsg = platform === 'linux' ? LINUX_NAME_ERROR : DEFAULT_NAME_ERROR;\n logger.error(errorMsg);\n if (isActions) {\n name = resolveAppName(url, platform);\n logger.warn(`✼ Inside github actions, use the default name: ${name}`);\n } else {\n process.exit(1);\n }\n }\n\n const appOptions: PakeAppOptions = {\n ...options,\n name,\n identifier: getIdentifier(url),\n };\n\n appOptions.icon = await handleIcon(appOptions);\n\n return appOptions;\n}\n","import pakeConf from '../../src-tauri/pake.json';\nimport CommonConf from '../../src-tauri/tauri.conf.json';\nimport WinConf from '../../src-tauri/tauri.windows.conf.json';\nimport MacConf from '../../src-tauri/tauri.macos.conf.json';\nimport LinuxConf from '../../src-tauri/tauri.linux.conf.json';\n\nconst platformConfigs = {\n win32: WinConf,\n darwin: MacConf,\n linux: LinuxConf,\n};\n\nconst { platform } = process;\n// @ts-ignore\nconst platformConfig = platformConfigs[platform];\n\nlet tauriConfig = {\n ...CommonConf,\n bundle: platformConfig.bundle,\n app: {\n ...CommonConf.app,\n trayIcon: {\n ...CommonConf.app.trayIcon,\n ...(platformConfig?.app?.trayIcon ?? {}),\n },\n },\n build: CommonConf.build,\n pake: pakeConf,\n};\n\nexport default tauriConfig;\n","import shelljs from 'shelljs';\nimport { npmDirectory } from './dir';\n\nexport function shellExec(command: string) {\n return new Promise<number>((resolve, reject) => {\n shelljs.exec(command, { async: true, silent: false, cwd: npmDirectory }, code => {\n if (code === 0) {\n resolve(0);\n } else {\n reject(new Error(`${code}`));\n }\n });\n });\n}\n","import dns from 'dns';\nimport http from 'http';\nimport { promisify } from 'util';\n\nimport logger from '@/options/logger';\n\nconst resolve = promisify(dns.resolve);\n\nconst ping = async (host: string) => {\n const lookup = promisify(dns.lookup);\n const ip = await lookup(host);\n const start = new Date();\n\n // Prevent timeouts from affecting user experience.\n const requestPromise = new Promise<number>((resolve, reject) => {\n const req = http.get(`http://${ip.address}`, res => {\n const delay = new Date().getTime() - start.getTime();\n res.resume();\n resolve(delay);\n });\n\n req.on('error', err => {\n reject(err);\n });\n });\n\n const timeoutPromise = new Promise<number>((_, reject) => {\n setTimeout(() => {\n reject(new Error('Request timed out after 3 seconds'));\n }, 1000);\n });\n\n return Promise.race([requestPromise, timeoutPromise]);\n};\n\nasync function isChinaDomain(domain: string): Promise<boolean> {\n try {\n const [ip] = await resolve(domain);\n return await isChinaIP(ip, domain);\n } catch (error) {\n logger.debug(`${domain} can't be parse!`);\n return true;\n }\n}\n\nasync function isChinaIP(ip: string, domain: string): Promise<boolean> {\n try {\n const delay = await ping(ip);\n logger.debug(`${domain} latency is ${delay} ms`);\n return delay > 500;\n } catch (error) {\n logger.debug(`ping ${domain} failed!`);\n return true;\n }\n}\n\nexport { isChinaDomain, isChinaIP };\n","import chalk from 'chalk';\nimport shelljs from 'shelljs';\n\nimport { getSpinner } from '@/utils/info';\nimport { IS_WIN } from '@/utils/platform';\nimport { shellExec } from '@/utils/shell';\nimport { isChinaDomain } from '@/utils/ip';\n\nexport async function installRust() {\n const isActions = process.env.GITHUB_ACTIONS;\n const isInChina = await isChinaDomain('sh.rustup.rs');\n const rustInstallScriptForMac =\n isInChina && !isActions\n ? 'export RUSTUP_DIST_SERVER=\"https://rsproxy.cn\" && export RUSTUP_UPDATE_ROOT=\"https://rsproxy.cn/rustup\" && curl --proto \"=https\" --tlsv1.2 -sSf https://rsproxy.cn/rustup-init.sh | sh'\n : \"curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y\";\n const rustInstallScriptForWindows = 'winget install --id Rustlang.Rustup';\n\n const spinner = getSpinner('Downloading Rust...');\n\n try {\n await shellExec(IS_WIN ? rustInstallScriptForWindows : rustInstallScriptForMac);\n spinner.succeed(chalk.green('Rust installed successfully!'));\n } catch (error) {\n console.error('Error installing Rust:', error.message);\n spinner.fail(chalk.red('Rust installation failed!'));\n process.exit(1);\n }\n}\n\nexport function checkRustInstalled() {\n return shelljs.exec('rustc --version', { silent: true }).code === 0;\n}\n","import fs from 'fs';\n\nexport default async function combineFiles(files: string[], output: string) {\n const contents = files.map(file => {\n const fileContent = fs.readFileSync(file);\n if (file.endsWith('.css')) {\n return (\n \"window.addEventListener('DOMContentLoaded', (_event) => { const css = `\" +\n fileContent +\n \"`; const style = document.createElement('style'); style.innerHTML = css; document.head.appendChild(style); });\"\n );\n }\n\n return \"window.addEventListener('DOMContentLoaded', (_event) => { \" + fileContent + ' });';\n });\n fs.writeFileSync(output, contents.join('\\n'));\n return files;\n}\n","import path from 'path';\nimport fsExtra from 'fs-extra';\n\nimport { npmDirectory } from '@/utils/dir';\nimport combineFiles from '@/utils/combine';\nimport logger from '@/options/logger';\nimport { PakeAppOptions, PlatformMap } from '@/types';\nimport { tauriConfigDirectory } from '@/utils/dir';\n\nexport async function mergeConfig(url: string, options: PakeAppOptions, tauriConf: any) {\n const {\n width,\n height,\n fullscreen,\n hideTitleBar,\n alwaysOnTop,\n darkMode,\n disabledWebShortcuts,\n activationShortcut,\n userAgent,\n showSystemTray,\n systemTrayIcon,\n useLocalFile,\n identifier,\n name,\n resizable = true,\n inject,\n proxyUrl,\n installerLanguage,\n } = options;\n\n const { platform } = process;\n\n // Set Windows parameters.\n const tauriConfWindowOptions = {\n width,\n height,\n fullscreen,\n resizable,\n hide_title_bar: hideTitleBar,\n activation_shortcut: activationShortcut,\n always_on_top: alwaysOnTop,\n dark_mode: darkMode,\n disabled_web_shortcuts: disabledWebShortcuts,\n };\n Object.assign(tauriConf.pake.windows[0], { url, ...tauriConfWindowOptions });\n\n tauriConf.productName = name;\n tauriConf.identifier = identifier;\n\n if (platform == 'win32') {\n tauriConf.bundle.windows.wix.language[0] = installerLanguage;\n }\n\n //Judge the type of URL, whether it is a file or a website.\n const pathExists = await fsExtra.pathExists(url);\n if (pathExists) {\n logger.warn('✼ Your input might be a local file.');\n tauriConf.pake.windows[0].url_type = 'local';\n\n const fileName = path.basename(url);\n const dirName = path.dirname(url);\n\n const distDir = path.join(npmDirectory, 'dist');\n const distBakDir = path.join(npmDirectory, 'dist_bak');\n\n if (!useLocalFile) {\n const urlPath = path.join(distDir, fileName);\n await fsExtra.copy(url, urlPath);\n } else {\n fsExtra.moveSync(distDir, distBakDir, { overwrite: true });\n fsExtra.copySync(dirName, distDir, { overwrite: true });\n\n // ignore it, because about_pake.html have be erased.\n // const filesToCopyBack = ['cli.js', 'about_pake.html'];\n const filesToCopyBack = ['cli.js'];\n await Promise.all(filesToCopyBack.map(file => fsExtra.copy(path.join(distBakDir, file), path.join(distDir, file))));\n }\n\n tauriConf.pake.windows[0].url = fileName;\n tauriConf.pake.windows[0].url_type = 'local';\n } else {\n tauriConf.pake.windows[0].url_type = 'web';\n }\n\n const platformMap: PlatformMap = {\n win32: 'windows',\n linux: 'linux',\n darwin: 'macos',\n };\n const currentPlatform = platformMap[platform];\n\n if (userAgent.length > 0) {\n tauriConf.pake.user_agent[currentPlatform] = userAgent;\n }\n\n tauriConf.pake.system_tray[currentPlatform] = showSystemTray;\n\n // Processing targets are currently only open to Linux.\n if (platform === 'linux') {\n delete tauriConf.bundle.linux.deb.files;\n const validTargets = ['all', 'deb', 'appimage', 'rpm'];\n if (validTargets.includes(options.targets)) {\n tauriConf.bundle.targets = options.targets === 'all' ? ['deb', 'appimage', 'rpm'] : [options.targets];\n } else {\n logger.warn(`✼ The target must be one of ${validTargets.join(', ')}, the default 'deb' will be used.`);\n }\n }\n\n // Set icon.\n const platformIconMap: PlatformMap = {\n win32: {\n fileExt: '.ico',\n path: `png/${name.toLowerCase()}_256.ico`,\n defaultIcon: 'png/icon_256.ico',\n message: 'Windows icon must be .ico and 256x256px.',\n },\n linux: {\n fileExt: '.png',\n path: `png/${name.toLowerCase()}_512.png`,\n defaultIcon: 'png/icon_512.png',\n message: 'Linux icon must be .png and 512x512px.',\n },\n darwin: {\n fileExt: '.icns',\n path: `icons/${name.toLowerCase()}.icns`,\n defaultIcon: 'icons/icon.icns',\n message: 'macOS icon must be .icns type.',\n },\n };\n const iconInfo = platformIconMap[platform];\n const exists = await fsExtra.pathExists(options.icon);\n if (exists) {\n let updateIconPath = true;\n let customIconExt = path.extname(options.icon).toLowerCase();\n\n if (customIconExt !== iconInfo.fileExt) {\n updateIconPath = false;\n logger.warn(`✼ ${iconInfo.message}, but you give ${customIconExt}`);\n tauriConf.bundle.icon = [iconInfo.defaultIcon];\n } else {\n const iconPath = path.join(npmDirectory, 'src-tauri/', iconInfo.path);\n tauriConf.bundle.resources = [iconInfo.path];\n await fsExtra.copy(options.icon, iconPath);\n }\n\n if (updateIconPath) {\n tauriConf.bundle.icon = [options.icon];\n } else {\n logger.warn(`✼ Icon will remain as default.`);\n }\n } else {\n logger.warn('✼ Custom icon path may be invalid, default icon will be used instead.');\n tauriConf.bundle.icon = [iconInfo.defaultIcon];\n }\n\n // Set tray icon path.\n let trayIconPath = platform === 'darwin' ? 'png/icon_512.png' : tauriConf.bundle.icon[0];\n if (systemTrayIcon.length > 0) {\n try {\n await fsExtra.pathExists(systemTrayIcon);\n // 需要判断图标格式,默认只支持ico和png两种\n let iconExt = path.extname(systemTrayIcon).toLowerCase();\n if (iconExt == '.png' || iconExt == '.ico') {\n const trayIcoPath = path.join(npmDirectory, `src-tauri/png/${name.toLowerCase()}${iconExt}`);\n trayIconPath = `png/${name.toLowerCase()}${iconExt}`;\n await fsExtra.copy(systemTrayIcon, trayIcoPath);\n } else {\n logger.warn(`✼ System tray icon must be .ico or .png, but you provided ${iconExt}.`);\n logger.warn(`✼ Default system tray icon will be used.`);\n }\n } catch {\n logger.warn(`✼ ${systemTrayIcon} not exists!`);\n logger.warn(`✼ Default system tray icon will remain unchanged.`);\n }\n }\n\n tauriConf.app.trayIcon.iconPath = trayIconPath;\n tauriConf.pake.system_tray_path = trayIconPath;\n\n delete tauriConf.app.trayIcon;\n\n const injectFilePath = path.join(npmDirectory, `src-tauri/src/inject/custom.js`);\n\n // inject js or css files\n if (inject?.length > 0) {\n if (!inject.every(item => item.endsWith('.css') || item.endsWith('.js'))) {\n logger.error('The injected file must be in either CSS or JS format.');\n return;\n }\n const files = inject.map(filepath => (path.isAbsolute(filepath) ? filepath : path.join(process.cwd(), filepath)));\n tauriConf.pake.inject = files;\n await combineFiles(files, injectFilePath);\n } else {\n tauriConf.pake.inject = [];\n await fsExtra.writeFile(injectFilePath, '');\n }\n tauriConf.pake.proxy_url = proxyUrl || '';\n\n // Save config file.\n const platformConfigPaths: PlatformMap = {\n win32: 'tauri.windows.conf.json',\n darwin: 'tauri.macos.conf.json',\n linux: 'tauri.linux.conf.json',\n };\n\n const configPath = path.join(tauriConfigDirectory, platformConfigPaths[platform]);\n\n const bundleConf = { bundle: tauriConf.bundle };\n console.log('pakeConfig', tauriConf.pake);\n await fsExtra.outputJSON(configPath, bundleConf, { spaces: 4 });\n const pakeConfigPath = path.join(tauriConfigDirectory, 'pake.json');\n await fsExtra.outputJSON(pakeConfigPath, tauriConf.pake, { spaces: 4 });\n\n let tauriConf2 = JSON.parse(JSON.stringify(tauriConf));\n delete tauriConf2.pake;\n\n // delete tauriConf2.bundle;\n if (process.env.NODE_ENV === 'development') {\n tauriConf2.bundle = bundleConf.bundle;\n }\n const configJsonPath = path.join(tauriConfigDirectory, 'tauri.conf.json');\n await fsExtra.outputJSON(configJsonPath, tauriConf2, { spaces: 4 });\n}\n","import path from 'path';\nimport fsExtra from 'fs-extra';\nimport chalk from 'chalk';\nimport prompts from 'prompts';\n\nimport { PakeAppOptions } from '@/types';\nimport { checkRustInstalled, installRust } from '@/helpers/rust';\nimport { mergeConfig } from '@/helpers/merge';\nimport tauriConfig from '@/helpers/tauriConfig';\nimport { npmDirectory } from '@/utils/dir';\nimport { getSpinner } from '@/utils/info';\nimport { shellExec } from '@/utils/shell';\nimport { isChinaDomain } from '@/utils/ip';\nimport { IS_MAC } from '@/utils/platform';\nimport logger from '@/options/logger';\n\nexport default abstract class BaseBuilder {\n protected options: PakeAppOptions;\n\n protected constructor(options: PakeAppOptions) {\n this.options = options;\n }\n\n async prepare() {\n const tauriSrcPath = path.join(npmDirectory, 'src-tauri');\n const tauriTargetPath = path.join(tauriSrcPath, 'target');\n const tauriTargetPathExists = await fsExtra.pathExists(tauriTargetPath);\n\n if (!IS_MAC && !tauriTargetPathExists) {\n logger.warn('✼ The first use requires installing system dependencies.');\n logger.warn('✼ See more in https://tauri.app/guides/getting-started/prerequisites.');\n }\n\n if (!checkRustInstalled()) {\n const res = await prompts({\n type: 'confirm',\n message: 'Rust not detected. Install now?',\n name: 'value',\n });\n\n if (res.value) {\n await installRust();\n } else {\n logger.error('✕ Rust required to package your webapp.');\n process.exit(0);\n }\n }\n\n const isChina = await isChinaDomain('www.npmjs.com');\n const spinner = getSpinner('Installing package...');\n const rustProjectDir = path.join(tauriSrcPath, '.cargo');\n const projectConf = path.join(rustProjectDir, 'config.toml');\n await fsExtra.ensureDir(rustProjectDir);\n\n if (isChina) {\n logger.info('✺ Located in China, using npm/rsProxy CN mirror.');\n const projectCnConf = path.join(tauriSrcPath, 'rust_proxy.toml');\n await fsExtra.copy(projectCnConf, projectConf);\n await shellExec(`cd \"${npmDirectory}\" && npm install --registry=https://registry.npmmirror.com`);\n } else {\n await shellExec(`cd \"${npmDirectory}\" && npm install`);\n }\n spinner.succeed(chalk.green('Package installed!'));\n if (!tauriTargetPathExists) {\n logger.warn('✼ The first packaging may be slow, please be patient and wait, it will be faster afterwards.');\n }\n }\n\n async build(url: string) {\n await this.buildAndCopy(url, this.options.targets);\n }\n\n async start(url: string) {\n await mergeConfig(url, this.options, tauriConfig);\n }\n\n async buildAndCopy(url: string, target: string) {\n const { name } = this.options;\n await mergeConfig(url, this.options, tauriConfig);\n\n // Build app\n const spinner = getSpinner('Building app...');\n setTimeout(() => spinner.stop(), 3000);\n await shellExec(`cd \"${npmDirectory}\" && ${this.getBuildCommand()}`);\n\n // Copy app\n const fileName = this.getFileName();\n const fileType = this.getFileType(target);\n const appPath = this.getBuildAppPath(npmDirectory, fileName, fileType);\n const distPath = path.resolve(`${name}.${fileType}`);\n await fsExtra.copy(appPath, distPath);\n await fsExtra.remove(appPath);\n logger.success('✔ Build success!');\n logger.success('✔ App installer located in', distPath);\n }\n\n protected getFileType(target: string): string {\n return target;\n }\n\n abstract getFileName(): string;\n\n protected getBuildCommand(): string {\n // the debug option should support `--debug` and `--release`\n return this.options.debug ? 'npm run build:debug' : 'npm run build';\n }\n\n protected getBasePath(): string {\n const basePath = this.options.debug ? 'debug' : 'release';\n return `src-tauri/target/${basePath}/bundle/`;\n }\n\n protected getBuildAppPath(npmDirectory: string, fileName: string, fileType: string): string {\n return path.join(npmDirectory, this.getBasePath(), fileType.toLowerCase(), `${fileName}.${fileType}`);\n }\n}\n","import tauriConfig from '@/helpers/tauriConfig';\nimport { PakeAppOptions } from '@/types';\nimport BaseBuilder from './BaseBuilder';\n\nexport default class MacBuilder extends BaseBuilder {\n constructor(options: PakeAppOptions) {\n super(options);\n this.options.targets = 'dmg';\n }\n\n getFileName(): string {\n const { name } = this.options;\n let arch: string;\n if (this.options.multiArch) {\n arch = 'universal';\n } else {\n arch = process.arch === 'arm64' ? 'aarch64' : process.arch;\n }\n return `${name}_${tauriConfig.version}_${arch}`;\n }\n\n protected getBuildCommand(): string {\n return this.options.multiArch ? 'npm run build:mac' : super.getBuildCommand();\n }\n\n protected getBasePath(): string {\n return this.options.multiArch\n ? 'src-tauri/target/universal-apple-darwin/release/bundle'\n : super.getBasePath();\n }\n}\n","import BaseBuilder from './BaseBuilder';\nimport { PakeAppOptions } from '@/types';\nimport tauriConfig from '@/helpers/tauriConfig';\n\nexport default class WinBuilder extends BaseBuilder {\n constructor(options: PakeAppOptions) {\n super(options);\n this.options.targets = 'msi';\n }\n\n getFileName(): string {\n const { name } = this.options;\n const { arch } = process;\n const language = tauriConfig.bundle.windows.wix.language[0];\n return `${name}_${tauriConfig.version}_${arch}_${language}`;\n }\n}\n","import BaseBuilder from './BaseBuilder';\nimport { PakeAppOptions } from '@/types';\nimport tauriConfig from '@/helpers/tauriConfig';\n\nexport default class LinuxBuilder extends BaseBuilder {\n constructor(options: PakeAppOptions) {\n super(options);\n }\n\n getFileName(): string {\n const { name } = this.options;\n const arch = process.arch === 'x64' ? 'amd64' : process.arch;\n return `${name}_${tauriConfig.version}_${arch}`;\n }\n\n // Customize it, considering that there are all targets.\n async build(url: string) {\n const targetTypes = ['deb', 'appimage'];\n for (const target of targetTypes) {\n if (this.options.targets === target || this.options.targets === 'all') {\n await this.buildAndCopy(url, target);\n }\n }\n }\n\n protected getFileType(target: string): string {\n if (target === 'appimage') {\n return 'AppImage';\n }\n return super.getFileType(target);\n }\n}\n","import BaseBuilder from './BaseBuilder';\nimport MacBuilder from './MacBuilder';\nimport WinBuilder from './WinBuilder';\nimport LinuxBuilder from './LinuxBuilder';\nimport { PakeAppOptions } from '@/types';\n\nconst { platform } = process;\n\nconst buildersMap: Record<string, new (options: PakeAppOptions) => BaseBuilder> = {\n darwin: MacBuilder,\n win32: WinBuilder,\n linux: LinuxBuilder,\n};\n\nexport default class BuilderProvider {\n static create(options: PakeAppOptions): BaseBuilder {\n const Builder = buildersMap[platform];\n if (!Builder) {\n throw new Error('The current system is not supported!');\n }\n return new Builder(options);\n }\n}\n","import log from 'loglevel';\nimport { DEFAULT_DEV_PAKE_OPTIONS } from './defaults';\nimport handleInputOptions from './options/index';\nimport BuilderProvider from './builders/BuilderProvider';\n\nasync function startBuild() {\n log.setDefaultLevel('debug');\n\n const appOptions = await handleInputOptions(DEFAULT_DEV_PAKE_OPTIONS, DEFAULT_DEV_PAKE_OPTIONS.url);\n log.debug('PakeAppOptions', appOptions);\n\n const builder = BuilderProvider.create(appOptions);\n await builder.prepare();\n await builder.start(DEFAULT_DEV_PAKE_OPTIONS.url);\n}\n\nstartBuild();\n"],"names":["platform","handleInputOptions"],"mappings":";;;;;;;;;;;;;;;;;;;AAEO,MAAM,oBAAoB,GAAmB;AAClD,IAAA,IAAI,EAAE,EAAE;AACR,IAAA,MAAM,EAAE,GAAG;AACX,IAAA,KAAK,EAAE,IAAI;AACX,IAAA,UAAU,EAAE,KAAK;AACjB,IAAA,SAAS,EAAE,IAAI;AACf,IAAA,YAAY,EAAE,KAAK;AACnB,IAAA,WAAW,EAAE,KAAK;AAClB,IAAA,QAAQ,EAAE,KAAK;AACf,IAAA,oBAAoB,EAAE,KAAK;AAC3B,IAAA,kBAAkB,EAAE,EAAE;AACtB,IAAA,SAAS,EAAE,EAAE;AACb,IAAA,cAAc,EAAE,KAAK;AACrB,IAAA,SAAS,EAAE,KAAK;AAChB,IAAA,OAAO,EAAE,KAAK;AACd,IAAA,YAAY,EAAE,KAAK;AACnB,IAAA,cAAc,EAAE,EAAE;AAClB,IAAA,QAAQ,EAAE,EAAE;AACZ,IAAA,KAAK,EAAE,KAAK;AACZ,IAAA,MAAM,EAAE,EAAE;AACV,IAAA,iBAAiB,EAAE,OAAO;CAC3B;AAED;AACO,MAAM,wBAAwB,GAAqC;AACxE,IAAA,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nC,QAAA,MAAM,OAAO,GAAG,WAAW,CAAC,QAAQ,CAAC;QACrC,IAAI,CAAC,OAAO,EAAE;AACZ,YAAA,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC;;AAEzD,QAAA,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;;AAE9B;;ACjBD,eAAe,UAAU,GAAA;AACvB,IAAA,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC;IAE5B,MAAM,UAAU,GAAG,MAAMC,aAAkB,CAAC,wBAAwB,EAAE,wBAAwB,CAAC,GAAG,CAAC;AACnG,IAAA,GAAG,CAAC,KAAK,CAAC,gBAAgB,EAAE,UAAU,CAAC;IAEvC,MAAM,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC,UAAU,CAAC;AAClD,IAAA,MAAM,OAAO,CAAC,OAAO,EAAE;IACvB,MAAM,OAAO,CAAC,KAAK,CAAC,wBAAwB,CAAC,GAAG,CAAC;AACnD;AAEA,UAAU,EAAE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pake-cli",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 利用 Rust 轻松构建轻量级多端桌面应用。",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=16.0.0"
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@tauri-apps/api": "^1.6.0",
|
|
51
51
|
"@tauri-apps/cli": "^2.1.0",
|
|
52
|
-
"axios": "^1.7.
|
|
52
|
+
"axios": "^1.7.9",
|
|
53
53
|
"chalk": "^5.3.0",
|
|
54
54
|
"commander": "^11.1.0",
|
|
55
55
|
"file-type": "^18.7.0",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"@rollup/plugin-terser": "^0.4.4",
|
|
72
72
|
"@types/fs-extra": "^11.0.4",
|
|
73
73
|
"@types/is-url": "^1.2.32",
|
|
74
|
-
"@types/node": "^20.17.
|
|
74
|
+
"@types/node": "^20.17.10",
|
|
75
75
|
"@types/page-icon": "^0.3.6",
|
|
76
76
|
"@types/prompts": "^2.4.9",
|
|
77
77
|
"@types/psl": "^1.1.3",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"@types/update-notifier": "^6.0.8",
|
|
81
81
|
"app-root-path": "^3.1.0",
|
|
82
82
|
"cross-env": "^7.0.3",
|
|
83
|
-
"rollup": "^4.28.
|
|
83
|
+
"rollup": "^4.28.1",
|
|
84
84
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
85
85
|
"tslib": "^2.8.1",
|
|
86
86
|
"typescript": "^5.7.2"
|
package/src-tauri/Cargo.lock
CHANGED
package/src-tauri/Cargo.toml
CHANGED
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
<?elseif $(sys.BUILDARCH)="x64"?>
|
|
5
5
|
<?define Win64 = "yes" ?>
|
|
6
6
|
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
|
|
7
|
+
<?elseif $(sys.BUILDARCH)="arm64"?>
|
|
8
|
+
<?define Win64 = "yes" ?>
|
|
9
|
+
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
|
|
7
10
|
<?else?>
|
|
8
11
|
<?error Unsupported value of sys.BUILDARCH=$(sys.BUILDARCH)?>
|
|
9
12
|
<?endif?>
|
|
@@ -11,11 +14,11 @@
|
|
|
11
14
|
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
|
12
15
|
<Product
|
|
13
16
|
Id="*"
|
|
14
|
-
Name="{{
|
|
15
|
-
UpgradeCode="{{
|
|
17
|
+
Name="{{product_name}}"
|
|
18
|
+
UpgradeCode="{{upgrade_code}}"
|
|
16
19
|
Language="!(loc.TauriLanguage)"
|
|
17
|
-
Manufacturer="{{
|
|
18
|
-
Version="{{
|
|
20
|
+
Manufacturer="{{manufacturer}}"
|
|
21
|
+
Version="{{version}}">
|
|
19
22
|
|
|
20
23
|
<Package Id="*"
|
|
21
24
|
Keywords="Installer"
|
|
@@ -29,6 +32,11 @@
|
|
|
29
32
|
<!-- reinstall all files; rewrite all registry entries; reinstall all shortcuts -->
|
|
30
33
|
<Property Id="REINSTALLMODE" Value="amus" />
|
|
31
34
|
|
|
35
|
+
<!-- Auto launch app after installation, useful for passive mode which usually used in updates -->
|
|
36
|
+
<Property Id="AUTOLAUNCHAPP" Secure="yes" />
|
|
37
|
+
<!-- Property to forward cli args to the launched app to not lose those of the pre-update instance -->
|
|
38
|
+
<Property Id="LAUNCHAPPARGS" Secure="yes" />
|
|
39
|
+
|
|
32
40
|
{{#if allow_downgrades}}
|
|
33
41
|
<MajorUpgrade Schedule="afterInstallInitialize" AllowDowngrades="yes" />
|
|
34
42
|
{{else}}
|
|
@@ -42,29 +50,35 @@
|
|
|
42
50
|
<Media Id="1" Cabinet="app.cab" EmbedCab="yes" />
|
|
43
51
|
|
|
44
52
|
{{#if banner_path}}
|
|
45
|
-
<WixVariable Id="WixUIBannerBmp" Value="{{
|
|
53
|
+
<WixVariable Id="WixUIBannerBmp" Value="{{banner_path}}" />
|
|
46
54
|
{{/if}}
|
|
47
55
|
{{#if dialog_image_path}}
|
|
48
|
-
<WixVariable Id="WixUIDialogBmp" Value="{{
|
|
56
|
+
<WixVariable Id="WixUIDialogBmp" Value="{{dialog_image_path}}" />
|
|
49
57
|
{{/if}}
|
|
50
58
|
{{#if license}}
|
|
51
|
-
<WixVariable Id="WixUILicenseRtf" Value="{{
|
|
59
|
+
<WixVariable Id="WixUILicenseRtf" Value="{{license}}" />
|
|
52
60
|
{{/if}}
|
|
53
61
|
|
|
54
|
-
<Icon Id="ProductIcon" SourceFile="{{
|
|
62
|
+
<Icon Id="ProductIcon" SourceFile="{{icon_path}}"/>
|
|
55
63
|
<Property Id="ARPPRODUCTICON" Value="ProductIcon" />
|
|
56
64
|
<Property Id="ARPNOREPAIR" Value="yes" Secure="yes" /> <!-- Remove repair -->
|
|
57
65
|
<SetProperty Id="ARPNOMODIFY" Value="1" After="InstallValidate" Sequence="execute"/>
|
|
58
66
|
|
|
67
|
+
{{#if homepage}}
|
|
68
|
+
<Property Id="ARPURLINFOABOUT" Value="{{homepage}}"/>
|
|
69
|
+
<Property Id="ARPHELPLINK" Value="{{homepage}}"/>
|
|
70
|
+
<Property Id="ARPURLUPDATEINFO" Value="{{homepage}}"/>
|
|
71
|
+
{{/if}}
|
|
72
|
+
|
|
59
73
|
<!-- initialize with previous InstallDir -->
|
|
60
74
|
<Property Id="INSTALLDIR">
|
|
61
|
-
<RegistrySearch Id="PrevInstallDirReg" Root="HKCU" Key="Software\\{{
|
|
75
|
+
<RegistrySearch Id="PrevInstallDirReg" Root="HKCU" Key="Software\\{{manufacturer}}\\{{product_name}}" Name="InstallDir" Type="raw"/>
|
|
62
76
|
</Property>
|
|
63
77
|
|
|
64
78
|
<!-- launch app checkbox -->
|
|
65
79
|
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="!(loc.LaunchApp)" />
|
|
66
|
-
<Property Id="
|
|
67
|
-
<CustomAction Id="LaunchApplication"
|
|
80
|
+
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1"/>
|
|
81
|
+
<CustomAction Id="LaunchApplication" Impersonate="yes" FileKey="Path" ExeCommand="[LAUNCHAPPARGS]" Return="asyncNoWait" />
|
|
68
82
|
|
|
69
83
|
<UI>
|
|
70
84
|
<!-- launch app checkbox -->
|
|
@@ -92,27 +106,49 @@
|
|
|
92
106
|
<Directory Id="TARGETDIR" Name="SourceDir">
|
|
93
107
|
<Directory Id="DesktopFolder" Name="Desktop">
|
|
94
108
|
<Component Id="ApplicationShortcutDesktop" Guid="*">
|
|
95
|
-
<Shortcut Id="ApplicationDesktopShortcut" Name="{{
|
|
109
|
+
<Shortcut Id="ApplicationDesktopShortcut" Name="{{product_name}}" Description="Runs {{product_name}}" Target="[!Path]" WorkingDirectory="INSTALLDIR" />
|
|
96
110
|
<RemoveFolder Id="DesktopFolder" On="uninstall" />
|
|
97
|
-
<RegistryValue Root="HKCU" Key="Software\\{{
|
|
111
|
+
<RegistryValue Root="HKCU" Key="Software\\{{manufacturer}}\\{{product_name}}" Name="Desktop Shortcut" Type="integer" Value="1" KeyPath="yes" />
|
|
98
112
|
</Component>
|
|
99
113
|
</Directory>
|
|
100
114
|
<Directory Id="$(var.PlatformProgramFilesFolder)" Name="PFiles">
|
|
101
|
-
<Directory Id="INSTALLDIR" Name="{{
|
|
115
|
+
<Directory Id="INSTALLDIR" Name="{{product_name}}"/>
|
|
102
116
|
</Directory>
|
|
103
117
|
<Directory Id="ProgramMenuFolder">
|
|
104
|
-
<Directory Id="ApplicationProgramsFolder" Name="{{
|
|
118
|
+
<Directory Id="ApplicationProgramsFolder" Name="{{product_name}}"/>
|
|
105
119
|
</Directory>
|
|
106
120
|
</Directory>
|
|
107
121
|
|
|
108
122
|
<DirectoryRef Id="INSTALLDIR">
|
|
109
123
|
<Component Id="RegistryEntries" Guid="*">
|
|
110
|
-
<RegistryKey Root="HKCU" Key="Software\\{{
|
|
124
|
+
<RegistryKey Root="HKCU" Key="Software\\{{manufacturer}}\\{{product_name}}">
|
|
111
125
|
<RegistryValue Name="InstallDir" Type="string" Value="[INSTALLDIR]" KeyPath="yes" />
|
|
112
126
|
</RegistryKey>
|
|
127
|
+
<!-- Change the Root to HKCU for perUser installations -->
|
|
128
|
+
{{#each deep_link_protocols as |protocol| ~}}
|
|
129
|
+
<RegistryKey Root="HKLM" Key="Software\Classes\\{{protocol}}">
|
|
130
|
+
<RegistryValue Type="string" Name="URL Protocol" Value=""/>
|
|
131
|
+
<RegistryValue Type="string" Value="URL:{{bundle_id}} protocol"/>
|
|
132
|
+
<RegistryKey Key="DefaultIcon">
|
|
133
|
+
<RegistryValue Type="string" Value=""[!Path]",0" />
|
|
134
|
+
</RegistryKey>
|
|
135
|
+
<RegistryKey Key="shell\open\command">
|
|
136
|
+
<RegistryValue Type="string" Value=""[!Path]" "%1"" />
|
|
137
|
+
</RegistryKey>
|
|
138
|
+
</RegistryKey>
|
|
139
|
+
{{/each~}}
|
|
113
140
|
</Component>
|
|
114
|
-
<Component Id="Path" Guid="{{
|
|
115
|
-
<File Id="Path" Source="{{
|
|
141
|
+
<Component Id="Path" Guid="{{path_component_guid}}" Win64="$(var.Win64)">
|
|
142
|
+
<File Id="Path" Source="{{main_binary_path}}" KeyPath="yes" Checksum="yes"/>
|
|
143
|
+
{{#each file_associations as |association| ~}}
|
|
144
|
+
{{#each association.ext as |ext| ~}}
|
|
145
|
+
<ProgId Id="{{../../product_name}}.{{ext}}" Advertise="yes" Description="{{association.description}}">
|
|
146
|
+
<Extension Id="{{ext}}" Advertise="yes">
|
|
147
|
+
<Verb Id="open" Command="Open with {{../../product_name}}" Argument=""%1"" />
|
|
148
|
+
</Extension>
|
|
149
|
+
</ProgId>
|
|
150
|
+
{{/each~}}
|
|
151
|
+
{{/each~}}
|
|
116
152
|
</Component>
|
|
117
153
|
{{#each binaries as |bin| ~}}
|
|
118
154
|
<Component Id="{{ bin.id }}" Guid="{{bin.guid}}" Win64="$(var.Win64)">
|
|
@@ -130,12 +166,12 @@
|
|
|
130
166
|
<File Id="UpdateTaskUninstaller" Source="uninstall-task.ps1" KeyPath="yes" Checksum="yes"/>
|
|
131
167
|
</Component>
|
|
132
168
|
{{/if}}
|
|
133
|
-
{{
|
|
169
|
+
{{resources}}
|
|
134
170
|
<Component Id="CMP_UninstallShortcut" Guid="*">
|
|
135
171
|
|
|
136
172
|
<Shortcut Id="UninstallShortcut"
|
|
137
|
-
Name="Uninstall {{
|
|
138
|
-
Description="Uninstalls {{
|
|
173
|
+
Name="Uninstall {{product_name}}"
|
|
174
|
+
Description="Uninstalls {{product_name}}"
|
|
139
175
|
Target="[System64Folder]msiexec.exe"
|
|
140
176
|
Arguments="/x [ProductCode]" />
|
|
141
177
|
|
|
@@ -143,7 +179,7 @@
|
|
|
143
179
|
On="uninstall" />
|
|
144
180
|
|
|
145
181
|
<RegistryValue Root="HKCU"
|
|
146
|
-
Key="Software\\{{
|
|
182
|
+
Key="Software\\{{manufacturer}}\\{{product_name}}"
|
|
147
183
|
Name="Uninstaller Shortcut"
|
|
148
184
|
Type="integer"
|
|
149
185
|
Value="1"
|
|
@@ -154,15 +190,15 @@
|
|
|
154
190
|
<DirectoryRef Id="ApplicationProgramsFolder">
|
|
155
191
|
<Component Id="ApplicationShortcut" Guid="*">
|
|
156
192
|
<Shortcut Id="ApplicationStartMenuShortcut"
|
|
157
|
-
Name="{{
|
|
158
|
-
Description="Runs {{
|
|
193
|
+
Name="{{product_name}}"
|
|
194
|
+
Description="Runs {{product_name}}"
|
|
159
195
|
Target="[!Path]"
|
|
160
196
|
Icon="ProductIcon"
|
|
161
197
|
WorkingDirectory="INSTALLDIR">
|
|
162
|
-
<ShortcutProperty Key="System.AppUserModel.ID" Value="{{
|
|
198
|
+
<ShortcutProperty Key="System.AppUserModel.ID" Value="{{bundle_id}}"/>
|
|
163
199
|
</Shortcut>
|
|
164
200
|
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
|
|
165
|
-
<RegistryValue Root="HKCU" Key="Software\\{{
|
|
201
|
+
<RegistryValue Root="HKCU" Key="Software\\{{manufacturer}}\\{{product_name}}" Name="Start Menu Shortcut" Type="integer" Value="1" KeyPath="yes"/>
|
|
166
202
|
</Component>
|
|
167
203
|
</DirectoryRef>
|
|
168
204
|
|
|
@@ -246,7 +282,7 @@
|
|
|
246
282
|
</Property>
|
|
247
283
|
|
|
248
284
|
{{#if download_bootstrapper}}
|
|
249
|
-
<CustomAction Id='DownloadAndInvokeBootstrapper' Directory="INSTALLDIR" Execute="deferred" ExeCommand='powershell.exe -NoProfile -windowstyle hidden try [\{] [\[]Net.ServicePointManager[\]]::SecurityProtocol = [\[]Net.SecurityProtocolType[\]]::Tls12 [\}] catch [\{][\}]; Invoke-WebRequest -Uri "https://go.microsoft.com/fwlink/p/?LinkId=2124703" -OutFile "$env:TEMP\MicrosoftEdgeWebview2Setup.exe" ; Start-Process -FilePath "$env:TEMP\MicrosoftEdgeWebview2Setup.exe" -ArgumentList ({{
|
|
285
|
+
<CustomAction Id='DownloadAndInvokeBootstrapper' Directory="INSTALLDIR" Execute="deferred" ExeCommand='powershell.exe -NoProfile -windowstyle hidden try [\{] [\[]Net.ServicePointManager[\]]::SecurityProtocol = [\[]Net.SecurityProtocolType[\]]::Tls12 [\}] catch [\{][\}]; Invoke-WebRequest -Uri "https://go.microsoft.com/fwlink/p/?LinkId=2124703" -OutFile "$env:TEMP\MicrosoftEdgeWebview2Setup.exe" ; Start-Process -FilePath "$env:TEMP\MicrosoftEdgeWebview2Setup.exe" -ArgumentList ({{webview_installer_args}} '/install') -Wait' Return='check'/>
|
|
250
286
|
<InstallExecuteSequence>
|
|
251
287
|
<Custom Action='DownloadAndInvokeBootstrapper' Before='InstallFinalize'>
|
|
252
288
|
<![CDATA[NOT(REMOVE OR WVRTINSTALLED)]]>
|
|
@@ -256,8 +292,8 @@
|
|
|
256
292
|
|
|
257
293
|
<!-- Embedded webview bootstrapper mode -->
|
|
258
294
|
{{#if webview2_bootstrapper_path}}
|
|
259
|
-
<Binary Id="MicrosoftEdgeWebview2Setup.exe" SourceFile="{{
|
|
260
|
-
<CustomAction Id='InvokeBootstrapper' BinaryKey='MicrosoftEdgeWebview2Setup.exe' Execute="deferred" ExeCommand='{{
|
|
295
|
+
<Binary Id="MicrosoftEdgeWebview2Setup.exe" SourceFile="{{webview2_bootstrapper_path}}"/>
|
|
296
|
+
<CustomAction Id='InvokeBootstrapper' BinaryKey='MicrosoftEdgeWebview2Setup.exe' Execute="deferred" ExeCommand='{{webview_installer_args}} /install' Return='check' />
|
|
261
297
|
<InstallExecuteSequence>
|
|
262
298
|
<Custom Action='InvokeBootstrapper' Before='InstallFinalize'>
|
|
263
299
|
<![CDATA[NOT(REMOVE OR WVRTINSTALLED)]]>
|
|
@@ -267,8 +303,8 @@
|
|
|
267
303
|
|
|
268
304
|
<!-- Embedded offline installer -->
|
|
269
305
|
{{#if webview2_installer_path}}
|
|
270
|
-
<Binary Id="MicrosoftEdgeWebView2RuntimeInstaller.exe" SourceFile="{{
|
|
271
|
-
<CustomAction Id='InvokeStandalone' BinaryKey='MicrosoftEdgeWebView2RuntimeInstaller.exe' Execute="deferred" ExeCommand='{{
|
|
306
|
+
<Binary Id="MicrosoftEdgeWebView2RuntimeInstaller.exe" SourceFile="{{webview2_installer_path}}"/>
|
|
307
|
+
<CustomAction Id='InvokeStandalone' BinaryKey='MicrosoftEdgeWebView2RuntimeInstaller.exe' Execute="deferred" ExeCommand='{{webview_installer_args}} /install' Return='check' />
|
|
272
308
|
<InstallExecuteSequence>
|
|
273
309
|
<Custom Action='InvokeStandalone' Before='InstallFinalize'>
|
|
274
310
|
<![CDATA[NOT(REMOVE OR WVRTINSTALLED)]]>
|
|
@@ -305,6 +341,10 @@
|
|
|
305
341
|
</InstallExecuteSequence>
|
|
306
342
|
{{/if}}
|
|
307
343
|
|
|
344
|
+
<InstallExecuteSequence>
|
|
345
|
+
<Custom Action="LaunchApplication" After="InstallFinalize">AUTOLAUNCHAPP AND NOT Installed</Custom>
|
|
346
|
+
</InstallExecuteSequence>
|
|
347
|
+
|
|
308
348
|
<SetProperty Id="ARPINSTALLLOCATION" Value="[INSTALLDIR]" After="CostFinalize"/>
|
|
309
349
|
</Product>
|
|
310
350
|
</Wix>
|
|
@@ -26,22 +26,22 @@ pub fn get_window(app: &mut App, config: &PakeConfig, _data_dir: PathBuf) -> Web
|
|
|
26
26
|
|
|
27
27
|
let mut window_builder = WebviewWindowBuilder::new(app, "pake", url)
|
|
28
28
|
.title("")
|
|
29
|
+
.visible(false)
|
|
29
30
|
.user_agent(user_agent)
|
|
30
|
-
.visible(false) // Prevent initial shaking
|
|
31
31
|
.resizable(window_config.resizable)
|
|
32
32
|
.fullscreen(window_config.fullscreen)
|
|
33
33
|
.inner_size(window_config.width, window_config.height)
|
|
34
34
|
.always_on_top(window_config.always_on_top)
|
|
35
|
+
.disable_drag_drop_handler()
|
|
35
36
|
.initialization_script(&config_script)
|
|
36
37
|
.initialization_script(include_str!("../inject/component.js"))
|
|
37
38
|
.initialization_script(include_str!("../inject/event.js"))
|
|
38
39
|
.initialization_script(include_str!("../inject/style.js"))
|
|
39
|
-
//This is necessary to allow for file injection by external developers for customization purposes.
|
|
40
40
|
.initialization_script(include_str!("../inject/custom.js"));
|
|
41
41
|
|
|
42
|
-
if config.proxy_url
|
|
42
|
+
if !config.proxy_url.is_empty() {
|
|
43
43
|
window_builder =
|
|
44
|
-
window_builder.proxy_url(Url::from_str(
|
|
44
|
+
window_builder.proxy_url(Url::from_str(config.proxy_url.as_str()).unwrap());
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
#[cfg(target_os = "macos")]
|
|
@@ -175,19 +175,19 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
175
175
|
};
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
-
const isExternalLink = link => window.location.host !== link.host;
|
|
179
178
|
// process special download protocol['data:','blob:']
|
|
180
179
|
const isSpecialDownload = url => ['blob', 'data'].some(protocol => url.startsWith(protocol));
|
|
181
180
|
|
|
182
181
|
const isDownloadRequired = (url, anchorElement, e) => anchorElement.download || e.metaKey || e.ctrlKey || isDownloadLink(url);
|
|
183
182
|
|
|
184
|
-
const handleExternalLink =
|
|
183
|
+
const handleExternalLink = url => {
|
|
185
184
|
invoke('plugin:shell|open', {
|
|
186
185
|
path: url,
|
|
187
186
|
});
|
|
188
187
|
};
|
|
189
188
|
|
|
190
189
|
const detectAnchorElementClick = e => {
|
|
190
|
+
|
|
191
191
|
const anchorElement = e.target.closest('a');
|
|
192
192
|
|
|
193
193
|
if (anchorElement && anchorElement.href) {
|
|
@@ -224,7 +224,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
224
224
|
|
|
225
225
|
// Rewrite the window.open function.
|
|
226
226
|
const originalWindowOpen = window.open;
|
|
227
|
-
window.open = function(url, name, specs) {
|
|
227
|
+
window.open = function (url, name, specs) {
|
|
228
228
|
// Apple login and google login
|
|
229
229
|
if (name === 'AppleAuthentication') {
|
|
230
230
|
//do nothing
|
package/src-tauri/src/lib.rs
CHANGED
|
@@ -23,7 +23,7 @@ pub fn run_app() {
|
|
|
23
23
|
|
|
24
24
|
// Save the value of toggle_app_shortcut before pake_config is moved
|
|
25
25
|
let activation_shortcut = pake_config.windows[0].activation_shortcut.clone();
|
|
26
|
-
let init_fullscreen = pake_config.windows[0].fullscreen
|
|
26
|
+
let init_fullscreen = pake_config.windows[0].fullscreen;
|
|
27
27
|
|
|
28
28
|
let window_state_plugin = if init_fullscreen {
|
|
29
29
|
windowStatePlugin::default()
|
|
@@ -43,7 +43,7 @@ pub fn run_app() {
|
|
|
43
43
|
download_file_by_binary
|
|
44
44
|
])
|
|
45
45
|
.setup(move |app| {
|
|
46
|
-
let data_dir = get_data_dir(
|
|
46
|
+
let data_dir = get_data_dir(app.app_handle(), tauri_config.clone());
|
|
47
47
|
|
|
48
48
|
let _window = get_window(app, &pake_config, data_dir);
|
|
49
49
|
|
|
@@ -51,14 +51,14 @@ pub fn run_app() {
|
|
|
51
51
|
_window.show().unwrap();
|
|
52
52
|
|
|
53
53
|
if show_system_tray {
|
|
54
|
-
let _ = set_system_tray(
|
|
54
|
+
let _ = set_system_tray(app.app_handle());
|
|
55
55
|
} else {
|
|
56
56
|
app.app_handle().remove_tray_by_id("pake-tray");
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
if !activation_shortcut.is_empty() {
|
|
60
60
|
let app_handle = app.app_handle().clone();
|
|
61
|
-
let shortcut_hotkey = Shortcut::from_str(
|
|
61
|
+
let shortcut_hotkey = Shortcut::from_str(activation_shortcut.as_str()).unwrap();
|
|
62
62
|
let last_triggered = Arc::new(Mutex::new(Instant::now()));
|
|
63
63
|
|
|
64
64
|
app_handle
|
|
@@ -1,22 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"productName": "WeRead",
|
|
3
3
|
"identifier": "com.pake.weread",
|
|
4
|
-
"version": "
|
|
5
|
-
"plugins": {},
|
|
4
|
+
"version": "1.0.0",
|
|
6
5
|
"app": {
|
|
7
|
-
"
|
|
8
|
-
"csp": null
|
|
9
|
-
},
|
|
6
|
+
"withGlobalTauri": true,
|
|
10
7
|
"trayIcon": {
|
|
11
8
|
"iconPath": "png/weread_512.png",
|
|
12
9
|
"iconAsTemplate": false,
|
|
13
10
|
"id": "pake-tray"
|
|
14
|
-
}
|
|
15
|
-
"withGlobalTauri": true
|
|
11
|
+
}
|
|
16
12
|
},
|
|
17
13
|
"build": {
|
|
18
|
-
"
|
|
19
|
-
"frontendDist": "../dist",
|
|
20
|
-
"beforeDevCommand": ""
|
|
14
|
+
"frontendDist": "../dist"
|
|
21
15
|
}
|
|
22
16
|
}
|
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
-
"productName": "
|
|
2
|
+
"productName": "we-read",
|
|
3
3
|
"bundle": {
|
|
4
4
|
"icon": ["png/weread_512.png"],
|
|
5
5
|
"active": true,
|
|
6
|
-
"category": "DeveloperTool",
|
|
7
|
-
"copyright": "",
|
|
8
6
|
"linux": {
|
|
9
7
|
"deb": {
|
|
10
8
|
"depends": ["curl", "wget"],
|
|
11
9
|
"files": { "/usr/share/applications/com-pake-weread.desktop": "assets/com-pake-weread.desktop" }
|
|
12
10
|
}
|
|
13
11
|
},
|
|
14
|
-
"externalBin": [],
|
|
15
|
-
"longDescription": "",
|
|
16
|
-
"resources": [],
|
|
17
|
-
"shortDescription": "",
|
|
18
12
|
"targets": ["deb", "appimage"]
|
|
19
13
|
}
|
|
20
14
|
}
|
|
@@ -2,19 +2,7 @@
|
|
|
2
2
|
"bundle": {
|
|
3
3
|
"icon": ["icons/weread.icns"],
|
|
4
4
|
"active": true,
|
|
5
|
-
"
|
|
6
|
-
"copyright": "",
|
|
7
|
-
"externalBin": [],
|
|
8
|
-
"longDescription": "",
|
|
9
|
-
"macOS": {
|
|
10
|
-
"entitlements": null,
|
|
11
|
-
"exceptionDomain": null,
|
|
12
|
-
"frameworks": [],
|
|
13
|
-
"providerShortName": null,
|
|
14
|
-
"signingIdentity": null
|
|
15
|
-
},
|
|
16
|
-
"resources": [],
|
|
17
|
-
"shortDescription": "",
|
|
5
|
+
"macOS": {},
|
|
18
6
|
"targets": ["dmg"]
|
|
19
7
|
}
|
|
20
8
|
}
|
|
@@ -2,17 +2,10 @@
|
|
|
2
2
|
"bundle": {
|
|
3
3
|
"icon": ["png/weread_256.ico", "png/weread_32.ico"],
|
|
4
4
|
"active": true,
|
|
5
|
-
"category": "DeveloperTool",
|
|
6
|
-
"copyright": "",
|
|
7
|
-
"externalBin": [],
|
|
8
|
-
"longDescription": "",
|
|
9
5
|
"resources": ["png/weread_32.ico"],
|
|
10
|
-
"shortDescription": "",
|
|
11
6
|
"targets": ["msi"],
|
|
12
7
|
"windows": {
|
|
13
|
-
"certificateThumbprint": null,
|
|
14
8
|
"digestAlgorithm": "sha256",
|
|
15
|
-
"timestampUrl": "",
|
|
16
9
|
"wix": {
|
|
17
10
|
"language": ["en-US"],
|
|
18
11
|
"template": "assets/main.wxs"
|