pake-cli 3.2.15 → 3.2.17
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 +340 -323
- package/dist/cli.js +282 -74
- package/package.json +11 -9
- package/src-tauri/.cargo/config.toml +0 -11
- package/src-tauri/.pake/pake.json +5 -4
- package/src-tauri/.pake/tauri.conf.json +9 -7
- package/src-tauri/.pake/tauri.macos.conf.json +3 -4
- package/src-tauri/capabilities/default.json +2 -1
- package/src-tauri/gen/schemas/capabilities.json +1 -1
- package/src-tauri/src/app/config.rs +1 -0
- package/src-tauri/src/app/invoke.rs +27 -7
- package/src-tauri/src/app/window.rs +7 -0
- package/src-tauri/src/inject/event.js +524 -20
- package/src-tauri/src/util.rs +35 -18
- package/src-tauri/tauri.conf.json +3 -0
- package/src-tauri/tauri.macos.conf.json +0 -1
- package/src-tauri/gen/schemas/windows-schema.json +0 -2326
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
{
|
|
2
|
-
"productName": "
|
|
3
|
-
"identifier": "com.pake.
|
|
2
|
+
"productName": "GitHubMultiArch",
|
|
3
|
+
"identifier": "com.pake.3097fc",
|
|
4
4
|
"version": "1.0.0",
|
|
5
5
|
"app": {
|
|
6
|
-
"withGlobalTauri": true
|
|
6
|
+
"withGlobalTauri": true,
|
|
7
|
+
"security": {
|
|
8
|
+
"headers": {}
|
|
9
|
+
}
|
|
7
10
|
},
|
|
8
11
|
"build": {
|
|
9
12
|
"frontendDist": "../dist"
|
|
10
13
|
},
|
|
11
14
|
"bundle": {
|
|
12
15
|
"icon": [
|
|
13
|
-
"/private/var/folders/v3/4mpcxc0564j9qhpf8jpf6r_r0000gp/T/tmp-
|
|
16
|
+
"/private/var/folders/v3/4mpcxc0564j9qhpf8jpf6r_r0000gp/T/tmp-5358-aQ26u2gjnt3X/converted-icons/githubmultiarch.icns"
|
|
14
17
|
],
|
|
15
18
|
"active": true,
|
|
16
|
-
"macOS": {},
|
|
17
19
|
"targets": [
|
|
18
|
-
"
|
|
20
|
+
"app"
|
|
19
21
|
],
|
|
20
22
|
"resources": [
|
|
21
|
-
"icons/
|
|
23
|
+
"icons/githubmultiarch.icns"
|
|
22
24
|
]
|
|
23
25
|
}
|
|
24
26
|
}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"bundle": {
|
|
3
3
|
"icon": [
|
|
4
|
-
"/private/var/folders/v3/4mpcxc0564j9qhpf8jpf6r_r0000gp/T/tmp-
|
|
4
|
+
"/private/var/folders/v3/4mpcxc0564j9qhpf8jpf6r_r0000gp/T/tmp-5358-aQ26u2gjnt3X/converted-icons/githubmultiarch.icns"
|
|
5
5
|
],
|
|
6
6
|
"active": true,
|
|
7
|
-
"macOS": {},
|
|
8
7
|
"targets": [
|
|
9
|
-
"
|
|
8
|
+
"app"
|
|
10
9
|
],
|
|
11
10
|
"resources": [
|
|
12
|
-
"icons/
|
|
11
|
+
"icons/githubmultiarch.icns"
|
|
13
12
|
]
|
|
14
13
|
}
|
|
15
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"pake-capability":{"identifier":"pake-capability","description":"Capability for the pake app.","remote":{"urls":["https://*.*"]},"local":true,"webviews":["pake"],"permissions":["shell:allow-open","core:window:allow-theme","core:window:allow-start-dragging","core:window:allow-toggle-maximize","core:window:allow-is-fullscreen","core:window:allow-set-fullscreen","core:webview:allow-internal-toggle-devtools","notification:allow-is-permission-granted","notification:allow-notify","notification:allow-get-active","notification:allow-register-listener","notification:allow-register-action-types","notification:default"]}}
|
|
1
|
+
{"pake-capability":{"identifier":"pake-capability","description":"Capability for the pake app.","remote":{"urls":["https://*.*"]},"local":true,"webviews":["pake"],"permissions":["shell:allow-open","core:window:allow-theme","core:window:allow-start-dragging","core:window:allow-toggle-maximize","core:window:allow-is-fullscreen","core:window:allow-set-fullscreen","core:webview:allow-internal-toggle-devtools","notification:allow-is-permission-granted","notification:allow-notify","notification:allow-get-active","notification:allow-register-listener","notification:allow-register-action-types","notification:default","core:path:default"]}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
use crate::util::{check_file_or_append,
|
|
1
|
+
use crate::util::{check_file_or_append, get_download_message_with_lang, show_toast, MessageType};
|
|
2
2
|
use std::fs::{self, File};
|
|
3
3
|
use std::io::Write;
|
|
4
4
|
use std::str::FromStr;
|
|
@@ -10,12 +10,14 @@ use tauri_plugin_http::reqwest::{ClientBuilder, Request};
|
|
|
10
10
|
pub struct DownloadFileParams {
|
|
11
11
|
url: String,
|
|
12
12
|
filename: String,
|
|
13
|
+
language: Option<String>,
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
#[derive(serde::Deserialize)]
|
|
16
17
|
pub struct BinaryDownloadParams {
|
|
17
18
|
filename: String,
|
|
18
19
|
binary: Vec<u8>,
|
|
20
|
+
language: Option<String>,
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
#[derive(serde::Deserialize)]
|
|
@@ -28,7 +30,10 @@ pub struct NotificationParams {
|
|
|
28
30
|
#[command]
|
|
29
31
|
pub async fn download_file(app: AppHandle, params: DownloadFileParams) -> Result<(), String> {
|
|
30
32
|
let window: WebviewWindow = app.get_webview_window("pake").unwrap();
|
|
31
|
-
show_toast(
|
|
33
|
+
show_toast(
|
|
34
|
+
&window,
|
|
35
|
+
&get_download_message_with_lang(MessageType::Start, params.language.clone()),
|
|
36
|
+
);
|
|
32
37
|
|
|
33
38
|
let output_path = app.path().download_dir().unwrap().join(params.filename);
|
|
34
39
|
let file_path = check_file_or_append(output_path.to_str().unwrap());
|
|
@@ -47,11 +52,17 @@ pub async fn download_file(app: AppHandle, params: DownloadFileParams) -> Result
|
|
|
47
52
|
|
|
48
53
|
let mut file = File::create(file_path).unwrap();
|
|
49
54
|
file.write_all(&bytes).unwrap();
|
|
50
|
-
show_toast(
|
|
55
|
+
show_toast(
|
|
56
|
+
&window,
|
|
57
|
+
&get_download_message_with_lang(MessageType::Success, params.language.clone()),
|
|
58
|
+
);
|
|
51
59
|
Ok(())
|
|
52
60
|
}
|
|
53
61
|
Err(e) => {
|
|
54
|
-
show_toast(
|
|
62
|
+
show_toast(
|
|
63
|
+
&window,
|
|
64
|
+
&get_download_message_with_lang(MessageType::Failure, params.language),
|
|
65
|
+
);
|
|
55
66
|
Err(e.to_string())
|
|
56
67
|
}
|
|
57
68
|
}
|
|
@@ -63,17 +74,26 @@ pub async fn download_file_by_binary(
|
|
|
63
74
|
params: BinaryDownloadParams,
|
|
64
75
|
) -> Result<(), String> {
|
|
65
76
|
let window: WebviewWindow = app.get_webview_window("pake").unwrap();
|
|
66
|
-
show_toast(
|
|
77
|
+
show_toast(
|
|
78
|
+
&window,
|
|
79
|
+
&get_download_message_with_lang(MessageType::Start, params.language.clone()),
|
|
80
|
+
);
|
|
67
81
|
let output_path = app.path().download_dir().unwrap().join(params.filename);
|
|
68
82
|
let file_path = check_file_or_append(output_path.to_str().unwrap());
|
|
69
83
|
let download_file_result = fs::write(file_path, ¶ms.binary);
|
|
70
84
|
match download_file_result {
|
|
71
85
|
Ok(_) => {
|
|
72
|
-
show_toast(
|
|
86
|
+
show_toast(
|
|
87
|
+
&window,
|
|
88
|
+
&get_download_message_with_lang(MessageType::Success, params.language.clone()),
|
|
89
|
+
);
|
|
73
90
|
Ok(())
|
|
74
91
|
}
|
|
75
92
|
Err(e) => {
|
|
76
|
-
show_toast(
|
|
93
|
+
show_toast(
|
|
94
|
+
&window,
|
|
95
|
+
&get_download_message_with_lang(MessageType::Failure, params.language),
|
|
96
|
+
);
|
|
77
97
|
Err(e.to_string())
|
|
78
98
|
}
|
|
79
99
|
}
|
|
@@ -46,6 +46,13 @@ pub fn set_window(app: &mut App, config: &PakeConfig, tauri_config: &Config) ->
|
|
|
46
46
|
.initialization_script(include_str!("../inject/style.js"))
|
|
47
47
|
.initialization_script(include_str!("../inject/custom.js"));
|
|
48
48
|
|
|
49
|
+
// Configure WASM support with required headers for SharedArrayBuffer
|
|
50
|
+
if window_config.enable_wasm {
|
|
51
|
+
window_builder = window_builder
|
|
52
|
+
.additional_browser_args("--enable-features=SharedArrayBuffer")
|
|
53
|
+
.additional_browser_args("--enable-unsafe-webgpu");
|
|
54
|
+
}
|
|
55
|
+
|
|
49
56
|
// Configure proxy if specified
|
|
50
57
|
if !config.proxy_url.is_empty() {
|
|
51
58
|
if let Ok(proxy_url) = Url::from_str(&config.proxy_url) {
|