@ionyx-apps/cli 0.3.0 → 0.3.2
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/bin/ionyx.exe +0 -0
- package/ionyx-cli/Cargo.toml +40 -40
- package/ionyx-cli/src/templates/basic/src-ionyx/Cargo.toml +27 -26
- package/ionyx-cli/src/templates/basic/src-ionyx/src/protocol.rs +11 -15
- package/ionyx-cli/src/templates/leptos/Cargo.toml +14 -13
- package/ionyx-cli/src/templates/leptos/src-ionyx/Cargo.toml +23 -20
- package/ionyx-cli/src/templates/leptos/src-ionyx/src/protocol.rs +10 -15
- package/ionyx-cli/src/templates/react/src-ionyx/Cargo.toml +27 -26
- package/ionyx-cli/src/templates/react/src-ionyx/src/protocol.rs +11 -15
- package/ionyx-cli/src/templates/src-ionyx/Cargo.toml +19 -18
- package/ionyx-cli/src/templates/svelte/src-ionyx/Cargo.toml +27 -26
- package/ionyx-cli/src/templates/svelte/src-ionyx/src/protocol.rs +11 -15
- package/ionyx-cli/src/templates/vanilla/src-ionyx/Cargo.toml +27 -26
- package/ionyx-cli/src/templates/vanilla/src-ionyx/src/protocol.rs +11 -15
- package/ionyx-cli/src/templates/vue/src-ionyx/Cargo.toml +27 -26
- package/ionyx-cli/src/templates/vue/src-ionyx/src/protocol.rs +9 -14
- package/package.json +3 -2
package/bin/ionyx.exe
CHANGED
|
Binary file
|
package/ionyx-cli/Cargo.toml
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
[package]
|
|
2
|
-
name = "ionyx-cli"
|
|
3
|
-
version = "0.
|
|
4
|
-
edition = "2021"
|
|
5
|
-
description = "Ionyx Framework CLI Tool"
|
|
6
|
-
authors = ["Ionyx Team"]
|
|
7
|
-
license = "MIT"
|
|
8
|
-
repository = "https://github.com/ionyx-framework/ionyx-cli"
|
|
9
|
-
|
|
10
|
-
[[bin]]
|
|
11
|
-
name = "ionyx"
|
|
12
|
-
path = "src/main.rs"
|
|
13
|
-
|
|
14
|
-
[dependencies]
|
|
15
|
-
clap = { version = "4.4", features = ["derive"] }
|
|
16
|
-
serde = { version = "1.0", features = ["derive"] }
|
|
17
|
-
serde_json = "1.0"
|
|
18
|
-
tokio = { version = "1.0", features = ["full"] }
|
|
19
|
-
anyhow = "1.0"
|
|
20
|
-
colored = "2.0"
|
|
21
|
-
dirs = "5.0"
|
|
22
|
-
handlebars = "4.5"
|
|
23
|
-
zip = "0.6"
|
|
24
|
-
reqwest = { version = "0.11", features = ["json"] }
|
|
25
|
-
futures = "0.3"
|
|
26
|
-
include_dir = "0.7"
|
|
27
|
-
dialoguer = "0.11"
|
|
28
|
-
os_info = "3.8"
|
|
29
|
-
toml = "0.8"
|
|
30
|
-
[workspace]
|
|
31
|
-
exclude = [
|
|
32
|
-
"src/templates/basic/src-ionyx",
|
|
33
|
-
"src/templates/leptos",
|
|
34
|
-
"src/templates/leptos/src-ionyx",
|
|
35
|
-
"src/templates/react/src-ionyx",
|
|
36
|
-
"src/templates/src-ionyx",
|
|
37
|
-
"src/templates/svelte/src-ionyx",
|
|
38
|
-
"src/templates/vanilla/src-ionyx",
|
|
39
|
-
"src/templates/vue/src-ionyx"
|
|
40
|
-
]
|
|
1
|
+
[package]
|
|
2
|
+
name = "ionyx-cli"
|
|
3
|
+
version = "0.3.2"
|
|
4
|
+
edition = "2021"
|
|
5
|
+
description = "Ionyx Framework CLI Tool"
|
|
6
|
+
authors = ["Ionyx Team"]
|
|
7
|
+
license = "MIT"
|
|
8
|
+
repository = "https://github.com/ionyx-framework/ionyx-cli"
|
|
9
|
+
|
|
10
|
+
[[bin]]
|
|
11
|
+
name = "ionyx"
|
|
12
|
+
path = "src/main.rs"
|
|
13
|
+
|
|
14
|
+
[dependencies]
|
|
15
|
+
clap = { version = "4.4", features = ["derive"] }
|
|
16
|
+
serde = { version = "1.0", features = ["derive"] }
|
|
17
|
+
serde_json = "1.0"
|
|
18
|
+
tokio = { version = "1.0", features = ["full"] }
|
|
19
|
+
anyhow = "1.0"
|
|
20
|
+
colored = "2.0"
|
|
21
|
+
dirs = "5.0"
|
|
22
|
+
handlebars = "4.5"
|
|
23
|
+
zip = "0.6"
|
|
24
|
+
reqwest = { version = "0.11", features = ["json"] }
|
|
25
|
+
futures = "0.3"
|
|
26
|
+
include_dir = "0.7"
|
|
27
|
+
dialoguer = "0.11"
|
|
28
|
+
os_info = "3.8"
|
|
29
|
+
toml = "0.8"
|
|
30
|
+
[workspace]
|
|
31
|
+
exclude = [
|
|
32
|
+
"src/templates/basic/src-ionyx",
|
|
33
|
+
"src/templates/leptos",
|
|
34
|
+
"src/templates/leptos/src-ionyx",
|
|
35
|
+
"src/templates/react/src-ionyx",
|
|
36
|
+
"src/templates/src-ionyx",
|
|
37
|
+
"src/templates/svelte/src-ionyx",
|
|
38
|
+
"src/templates/vanilla/src-ionyx",
|
|
39
|
+
"src/templates/vue/src-ionyx"
|
|
40
|
+
]
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
[package]
|
|
2
|
-
name = "my-ionyx-app"
|
|
3
|
-
version = "0.
|
|
4
|
-
edition = "2021"
|
|
5
|
-
|
|
6
|
-
[workspace]
|
|
7
|
-
|
|
8
|
-
[lib]
|
|
9
|
-
name = "my_ionyx_app"
|
|
10
|
-
path = "src/lib.rs"
|
|
11
|
-
|
|
12
|
-
[[bin]]
|
|
13
|
-
name = "my-ionyx-app"
|
|
14
|
-
path = "main.rs"
|
|
15
|
-
|
|
16
|
-
[dependencies]
|
|
17
|
-
ionyx = { path = "../../../../../../src-ionyx" }
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
[package]
|
|
2
|
+
name = "my-ionyx-app"
|
|
3
|
+
version = "0.3.2"
|
|
4
|
+
edition = "2021"
|
|
5
|
+
|
|
6
|
+
[workspace]
|
|
7
|
+
|
|
8
|
+
[lib]
|
|
9
|
+
name = "my_ionyx_app"
|
|
10
|
+
path = "src/lib.rs"
|
|
11
|
+
|
|
12
|
+
[[bin]]
|
|
13
|
+
name = "my-ionyx-app"
|
|
14
|
+
path = "main.rs"
|
|
15
|
+
|
|
16
|
+
[dependencies]
|
|
17
|
+
ionyx = { path = "../../../../../../src-ionyx" }
|
|
18
|
+
include_dir = { version = "0.7", features = ["glob"] }
|
|
19
|
+
anyhow = "1.0"
|
|
20
|
+
wry = "0.54"
|
|
21
|
+
tao = "0.34"
|
|
22
|
+
|
|
23
|
+
[profile.release]
|
|
24
|
+
opt-level = 3
|
|
25
|
+
lto = true
|
|
26
|
+
codegen-units = 1
|
|
27
|
+
panic = "abort"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
use std::borrow::Cow;
|
|
2
2
|
use wry::http::{Request, Response, StatusCode};
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
|
|
5
5
|
#[cfg(not(debug_assertions))]
|
|
6
6
|
use include_dir::{include_dir, Dir};
|
|
@@ -35,12 +35,11 @@ impl CustomProtocolHandler {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
pub fn handle_request(&self, request: Request<Vec<u8>>) -> Response<Cow<'static, [u8]>> {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
if cfg!(debug_assertions) {
|
|
38
|
+
#[cfg(debug_assertions)]
|
|
39
|
+
{
|
|
40
|
+
let _uri_path = request.uri().path();
|
|
41
|
+
let _dist_path = get_frontend_dist_path();
|
|
42
|
+
let _unused_ct = Self::get_content_type("index.html");
|
|
44
43
|
return Response::builder()
|
|
45
44
|
.status(StatusCode::NOT_FOUND)
|
|
46
45
|
.header("Content-Type", "text/plain")
|
|
@@ -48,10 +47,10 @@ impl CustomProtocolHandler {
|
|
|
48
47
|
.unwrap();
|
|
49
48
|
}
|
|
50
49
|
|
|
51
|
-
// Release modunda gömülü dosyaları işle
|
|
52
50
|
#[cfg(not(debug_assertions))]
|
|
53
51
|
{
|
|
54
|
-
let
|
|
52
|
+
let uri_path = request.uri().path();
|
|
53
|
+
let clean_path = uri_path.trim_start_matches('/');
|
|
55
54
|
let file_path = if clean_path.is_empty() { "index.html" } else { clean_path };
|
|
56
55
|
|
|
57
56
|
match EMBEDDED_ASSETS.get_file(file_path) {
|
|
@@ -60,7 +59,7 @@ impl CustomProtocolHandler {
|
|
|
60
59
|
Response::builder()
|
|
61
60
|
.status(StatusCode::OK)
|
|
62
61
|
.header("Content-Type", content_type)
|
|
63
|
-
.body(Cow::Borrowed(file.contents()))
|
|
62
|
+
.body(Cow::Borrowed::<'static, [u8]>(file.contents()))
|
|
64
63
|
.unwrap()
|
|
65
64
|
}
|
|
66
65
|
None => {
|
|
@@ -69,7 +68,7 @@ impl CustomProtocolHandler {
|
|
|
69
68
|
Response::builder()
|
|
70
69
|
.status(StatusCode::OK)
|
|
71
70
|
.header("Content-Type", "text/html")
|
|
72
|
-
.body(Cow::Borrowed(index_file.contents()))
|
|
71
|
+
.body(Cow::Borrowed::<'static, [u8]>(index_file.contents()))
|
|
73
72
|
.unwrap()
|
|
74
73
|
} else {
|
|
75
74
|
Response::builder()
|
|
@@ -80,10 +79,6 @@ impl CustomProtocolHandler {
|
|
|
80
79
|
}
|
|
81
80
|
}
|
|
82
81
|
}
|
|
83
|
-
|
|
84
|
-
// Burası teknik olarak unreachable ancak derleyiciyi tatmin etmek için
|
|
85
|
-
#[cfg(debug_assertions)]
|
|
86
|
-
Response::builder().status(StatusCode::NOT_FOUND).body(Cow::Borrowed(&b"Not Found"[..])).unwrap()
|
|
87
82
|
}
|
|
88
83
|
|
|
89
84
|
fn get_content_type(file_path: &str) -> &'static str {
|
|
@@ -103,3 +98,4 @@ impl CustomProtocolHandler {
|
|
|
103
98
|
}
|
|
104
99
|
}
|
|
105
100
|
}
|
|
101
|
+
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
[package]
|
|
2
|
-
name = "my-ionyx-app"
|
|
3
|
-
version = "0.
|
|
4
|
-
edition = "2021"
|
|
5
|
-
|
|
6
|
-
[lib]
|
|
7
|
-
crate-type = ["cdylib"]
|
|
8
|
-
|
|
9
|
-
[dependencies]
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
[package]
|
|
2
|
+
name = "my-ionyx-app"
|
|
3
|
+
version = "0.3.2"
|
|
4
|
+
edition = "2021"
|
|
5
|
+
|
|
6
|
+
[lib]
|
|
7
|
+
crate-type = ["cdylib"]
|
|
8
|
+
|
|
9
|
+
[dependencies]
|
|
10
|
+
include_dir = { version = "0.7", features = ["glob"] }
|
|
11
|
+
leptos = { version = "0.6", features = ["csr"] }
|
|
12
|
+
wasm-bindgen = "0.2"
|
|
13
|
+
console_log = "1.0"
|
|
14
|
+
log = "0.4"
|
|
14
15
|
console_error_panic_hook = "0.1"
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
[package]
|
|
2
|
-
name = "my-ionyx-app"
|
|
3
|
-
version = "0.
|
|
4
|
-
edition = "2021"
|
|
5
|
-
|
|
6
|
-
[workspace]
|
|
7
|
-
|
|
8
|
-
[[bin]]
|
|
9
|
-
name = "my-ionyx-app"
|
|
10
|
-
path = "main.rs"
|
|
11
|
-
|
|
12
|
-
[dependencies]
|
|
13
|
-
ionyx = { path = "../../../../../../src-ionyx" }
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
[package]
|
|
2
|
+
name = "my-ionyx-app"
|
|
3
|
+
version = "0.3.2"
|
|
4
|
+
edition = "2021"
|
|
5
|
+
|
|
6
|
+
[workspace]
|
|
7
|
+
|
|
8
|
+
[[bin]]
|
|
9
|
+
name = "my-ionyx-app"
|
|
10
|
+
path = "main.rs"
|
|
11
|
+
|
|
12
|
+
[dependencies]
|
|
13
|
+
ionyx = { path = "../../../../../../src-ionyx" }
|
|
14
|
+
include_dir = { version = "0.7", features = ["glob"] }
|
|
15
|
+
anyhow = "1.0"
|
|
16
|
+
wry = "0.54"
|
|
17
|
+
tao = "0.34"
|
|
18
|
+
|
|
19
|
+
[profile.release]
|
|
20
|
+
opt-level = 3
|
|
21
|
+
lto = true
|
|
22
|
+
codegen-units = 1
|
|
23
|
+
panic = "abort"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
use std::borrow::Cow;
|
|
2
2
|
use wry::http::{Request, Response, StatusCode};
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
|
|
5
5
|
#[cfg(not(debug_assertions))]
|
|
6
6
|
use include_dir::{include_dir, Dir};
|
|
@@ -35,12 +35,10 @@ impl CustomProtocolHandler {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
pub fn handle_request(&self, request: Request<Vec<u8>>) -> Response<Cow<'static, [u8]>> {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
// 404 yerine temiz bir hata dönüyoruz.
|
|
43
|
-
if cfg!(debug_assertions) {
|
|
38
|
+
#[cfg(debug_assertions)]
|
|
39
|
+
{
|
|
40
|
+
let _uri_path = request.uri().path();
|
|
41
|
+
let _unused_ct = Self::get_content_type("index.html");
|
|
44
42
|
return Response::builder()
|
|
45
43
|
.status(StatusCode::NOT_FOUND)
|
|
46
44
|
.header("Content-Type", "text/plain")
|
|
@@ -48,10 +46,10 @@ impl CustomProtocolHandler {
|
|
|
48
46
|
.unwrap();
|
|
49
47
|
}
|
|
50
48
|
|
|
51
|
-
// Release modunda gömülü dosyaları işle
|
|
52
49
|
#[cfg(not(debug_assertions))]
|
|
53
50
|
{
|
|
54
|
-
let
|
|
51
|
+
let uri_path = request.uri().path();
|
|
52
|
+
let clean_path = uri_path.trim_start_matches('/');
|
|
55
53
|
let file_path = if clean_path.is_empty() { "index.html" } else { clean_path };
|
|
56
54
|
|
|
57
55
|
match EMBEDDED_ASSETS.get_file(file_path) {
|
|
@@ -60,7 +58,7 @@ impl CustomProtocolHandler {
|
|
|
60
58
|
Response::builder()
|
|
61
59
|
.status(StatusCode::OK)
|
|
62
60
|
.header("Content-Type", content_type)
|
|
63
|
-
.body(Cow::Borrowed(file.contents()))
|
|
61
|
+
.body(Cow::Borrowed::<'static, [u8]>(file.contents()))
|
|
64
62
|
.unwrap()
|
|
65
63
|
}
|
|
66
64
|
None => {
|
|
@@ -69,7 +67,7 @@ impl CustomProtocolHandler {
|
|
|
69
67
|
Response::builder()
|
|
70
68
|
.status(StatusCode::OK)
|
|
71
69
|
.header("Content-Type", "text/html")
|
|
72
|
-
.body(Cow::Borrowed(index_file.contents()))
|
|
70
|
+
.body(Cow::Borrowed::<'static, [u8]>(index_file.contents()))
|
|
73
71
|
.unwrap()
|
|
74
72
|
} else {
|
|
75
73
|
Response::builder()
|
|
@@ -80,10 +78,6 @@ impl CustomProtocolHandler {
|
|
|
80
78
|
}
|
|
81
79
|
}
|
|
82
80
|
}
|
|
83
|
-
|
|
84
|
-
// Burası teknik olarak unreachable ancak derleyiciyi tatmin etmek için
|
|
85
|
-
#[cfg(debug_assertions)]
|
|
86
|
-
Response::builder().status(StatusCode::NOT_FOUND).body(Cow::Borrowed(&b"Not Found"[..])).unwrap()
|
|
87
81
|
}
|
|
88
82
|
|
|
89
83
|
fn get_content_type(file_path: &str) -> &'static str {
|
|
@@ -103,3 +97,4 @@ impl CustomProtocolHandler {
|
|
|
103
97
|
}
|
|
104
98
|
}
|
|
105
99
|
}
|
|
100
|
+
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
[package]
|
|
2
|
-
name = "my-ionyx-app"
|
|
3
|
-
version = "0.
|
|
4
|
-
edition = "2021"
|
|
5
|
-
|
|
6
|
-
[workspace]
|
|
7
|
-
|
|
8
|
-
[lib]
|
|
9
|
-
name = "my_ionyx_app"
|
|
10
|
-
path = "src/lib.rs"
|
|
11
|
-
|
|
12
|
-
[[bin]]
|
|
13
|
-
name = "my-ionyx-app"
|
|
14
|
-
path = "main.rs"
|
|
15
|
-
|
|
16
|
-
[dependencies]
|
|
17
|
-
ionyx = { path = "../../../../../../src-ionyx" }
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
[package]
|
|
2
|
+
name = "my-ionyx-app"
|
|
3
|
+
version = "0.3.2"
|
|
4
|
+
edition = "2021"
|
|
5
|
+
|
|
6
|
+
[workspace]
|
|
7
|
+
|
|
8
|
+
[lib]
|
|
9
|
+
name = "my_ionyx_app"
|
|
10
|
+
path = "src/lib.rs"
|
|
11
|
+
|
|
12
|
+
[[bin]]
|
|
13
|
+
name = "my-ionyx-app"
|
|
14
|
+
path = "main.rs"
|
|
15
|
+
|
|
16
|
+
[dependencies]
|
|
17
|
+
ionyx = { path = "../../../../../../src-ionyx" }
|
|
18
|
+
include_dir = { version = "0.7", features = ["glob"] }
|
|
19
|
+
anyhow = "1.0"
|
|
20
|
+
wry = "0.54"
|
|
21
|
+
tao = "0.34"
|
|
22
|
+
|
|
23
|
+
[profile.release]
|
|
24
|
+
opt-level = 3
|
|
25
|
+
lto = true
|
|
26
|
+
codegen-units = 1
|
|
27
|
+
panic = "abort"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
use std::borrow::Cow;
|
|
2
2
|
use wry::http::{Request, Response, StatusCode};
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
|
|
5
5
|
#[cfg(not(debug_assertions))]
|
|
6
6
|
use include_dir::{include_dir, Dir};
|
|
@@ -35,12 +35,11 @@ impl CustomProtocolHandler {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
pub fn handle_request(&self, request: Request<Vec<u8>>) -> Response<Cow<'static, [u8]>> {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
if cfg!(debug_assertions) {
|
|
38
|
+
#[cfg(debug_assertions)]
|
|
39
|
+
{
|
|
40
|
+
let _uri_path = request.uri().path();
|
|
41
|
+
let _dist_path = get_frontend_dist_path();
|
|
42
|
+
let _unused_ct = Self::get_content_type("index.html");
|
|
44
43
|
return Response::builder()
|
|
45
44
|
.status(StatusCode::NOT_FOUND)
|
|
46
45
|
.header("Content-Type", "text/plain")
|
|
@@ -48,10 +47,10 @@ impl CustomProtocolHandler {
|
|
|
48
47
|
.unwrap();
|
|
49
48
|
}
|
|
50
49
|
|
|
51
|
-
// Release modunda gömülü dosyaları işle
|
|
52
50
|
#[cfg(not(debug_assertions))]
|
|
53
51
|
{
|
|
54
|
-
let
|
|
52
|
+
let uri_path = request.uri().path();
|
|
53
|
+
let clean_path = uri_path.trim_start_matches('/');
|
|
55
54
|
let file_path = if clean_path.is_empty() { "index.html" } else { clean_path };
|
|
56
55
|
|
|
57
56
|
match EMBEDDED_ASSETS.get_file(file_path) {
|
|
@@ -60,7 +59,7 @@ impl CustomProtocolHandler {
|
|
|
60
59
|
Response::builder()
|
|
61
60
|
.status(StatusCode::OK)
|
|
62
61
|
.header("Content-Type", content_type)
|
|
63
|
-
.body(Cow::Borrowed(file.contents()))
|
|
62
|
+
.body(Cow::Borrowed::<'static, [u8]>(file.contents()))
|
|
64
63
|
.unwrap()
|
|
65
64
|
}
|
|
66
65
|
None => {
|
|
@@ -69,7 +68,7 @@ impl CustomProtocolHandler {
|
|
|
69
68
|
Response::builder()
|
|
70
69
|
.status(StatusCode::OK)
|
|
71
70
|
.header("Content-Type", "text/html")
|
|
72
|
-
.body(Cow::Borrowed(index_file.contents()))
|
|
71
|
+
.body(Cow::Borrowed::<'static, [u8]>(index_file.contents()))
|
|
73
72
|
.unwrap()
|
|
74
73
|
} else {
|
|
75
74
|
Response::builder()
|
|
@@ -80,10 +79,6 @@ impl CustomProtocolHandler {
|
|
|
80
79
|
}
|
|
81
80
|
}
|
|
82
81
|
}
|
|
83
|
-
|
|
84
|
-
// Burası teknik olarak unreachable ancak derleyiciyi tatmin etmek için
|
|
85
|
-
#[cfg(debug_assertions)]
|
|
86
|
-
Response::builder().status(StatusCode::NOT_FOUND).body(Cow::Borrowed(&b"Not Found"[..])).unwrap()
|
|
87
82
|
}
|
|
88
83
|
|
|
89
84
|
fn get_content_type(file_path: &str) -> &'static str {
|
|
@@ -103,3 +98,4 @@ impl CustomProtocolHandler {
|
|
|
103
98
|
}
|
|
104
99
|
}
|
|
105
100
|
}
|
|
101
|
+
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
[package]
|
|
2
|
-
name = "my-ionyx-app"
|
|
3
|
-
version = "0.
|
|
4
|
-
edition = "2021"
|
|
5
|
-
|
|
6
|
-
[[bin]]
|
|
7
|
-
name = "my-ionyx-app"
|
|
8
|
-
path = "main.rs"
|
|
9
|
-
|
|
10
|
-
[dependencies]
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
[package]
|
|
2
|
+
name = "my-ionyx-app"
|
|
3
|
+
version = "0.3.2"
|
|
4
|
+
edition = "2021"
|
|
5
|
+
|
|
6
|
+
[[bin]]
|
|
7
|
+
name = "my-ionyx-app"
|
|
8
|
+
path = "main.rs"
|
|
9
|
+
|
|
10
|
+
[dependencies]
|
|
11
|
+
include_dir = { version = "0.7", features = ["glob"] }
|
|
12
|
+
ionyx = "1.0.0"
|
|
13
|
+
anyhow = "1.0"
|
|
14
|
+
|
|
15
|
+
[profile.release]
|
|
16
|
+
opt-level = 3
|
|
17
|
+
lto = true
|
|
18
|
+
codegen-units = 1
|
|
19
|
+
panic = "abort"
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
[package]
|
|
2
|
-
name = "my-ionyx-app"
|
|
3
|
-
version = "0.
|
|
4
|
-
edition = "2021"
|
|
5
|
-
|
|
6
|
-
[workspace]
|
|
7
|
-
|
|
8
|
-
[lib]
|
|
9
|
-
name = "my_ionyx_app"
|
|
10
|
-
path = "src/lib.rs"
|
|
11
|
-
|
|
12
|
-
[[bin]]
|
|
13
|
-
name = "my-ionyx-app"
|
|
14
|
-
path = "main.rs"
|
|
15
|
-
|
|
16
|
-
[dependencies]
|
|
17
|
-
ionyx = { path = "../../../../../../src-ionyx" }
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
[package]
|
|
2
|
+
name = "my-ionyx-app"
|
|
3
|
+
version = "0.3.2"
|
|
4
|
+
edition = "2021"
|
|
5
|
+
|
|
6
|
+
[workspace]
|
|
7
|
+
|
|
8
|
+
[lib]
|
|
9
|
+
name = "my_ionyx_app"
|
|
10
|
+
path = "src/lib.rs"
|
|
11
|
+
|
|
12
|
+
[[bin]]
|
|
13
|
+
name = "my-ionyx-app"
|
|
14
|
+
path = "main.rs"
|
|
15
|
+
|
|
16
|
+
[dependencies]
|
|
17
|
+
ionyx = { path = "../../../../../../src-ionyx" }
|
|
18
|
+
include_dir = { version = "0.7", features = ["glob"] }
|
|
19
|
+
anyhow = "1.0"
|
|
20
|
+
wry = "0.54"
|
|
21
|
+
tao = "0.34"
|
|
22
|
+
|
|
23
|
+
[profile.release]
|
|
24
|
+
opt-level = 3
|
|
25
|
+
lto = true
|
|
26
|
+
codegen-units = 1
|
|
27
|
+
panic = "abort"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
use std::borrow::Cow;
|
|
2
2
|
use wry::http::{Request, Response, StatusCode};
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
|
|
5
5
|
#[cfg(not(debug_assertions))]
|
|
6
6
|
use include_dir::{include_dir, Dir};
|
|
@@ -35,12 +35,11 @@ impl CustomProtocolHandler {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
pub fn handle_request(&self, request: Request<Vec<u8>>) -> Response<Cow<'static, [u8]>> {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
if cfg!(debug_assertions) {
|
|
38
|
+
#[cfg(debug_assertions)]
|
|
39
|
+
{
|
|
40
|
+
let _uri_path = request.uri().path();
|
|
41
|
+
let _dist_path = get_frontend_dist_path();
|
|
42
|
+
let _unused_ct = Self::get_content_type("index.html");
|
|
44
43
|
return Response::builder()
|
|
45
44
|
.status(StatusCode::NOT_FOUND)
|
|
46
45
|
.header("Content-Type", "text/plain")
|
|
@@ -48,10 +47,10 @@ impl CustomProtocolHandler {
|
|
|
48
47
|
.unwrap();
|
|
49
48
|
}
|
|
50
49
|
|
|
51
|
-
// Release modunda gömülü dosyaları işle
|
|
52
50
|
#[cfg(not(debug_assertions))]
|
|
53
51
|
{
|
|
54
|
-
let
|
|
52
|
+
let uri_path = request.uri().path();
|
|
53
|
+
let clean_path = uri_path.trim_start_matches('/');
|
|
55
54
|
let file_path = if clean_path.is_empty() { "index.html" } else { clean_path };
|
|
56
55
|
|
|
57
56
|
match EMBEDDED_ASSETS.get_file(file_path) {
|
|
@@ -60,7 +59,7 @@ impl CustomProtocolHandler {
|
|
|
60
59
|
Response::builder()
|
|
61
60
|
.status(StatusCode::OK)
|
|
62
61
|
.header("Content-Type", content_type)
|
|
63
|
-
.body(Cow::Borrowed(file.contents()))
|
|
62
|
+
.body(Cow::Borrowed::<'static, [u8]>(file.contents()))
|
|
64
63
|
.unwrap()
|
|
65
64
|
}
|
|
66
65
|
None => {
|
|
@@ -69,7 +68,7 @@ impl CustomProtocolHandler {
|
|
|
69
68
|
Response::builder()
|
|
70
69
|
.status(StatusCode::OK)
|
|
71
70
|
.header("Content-Type", "text/html")
|
|
72
|
-
.body(Cow::Borrowed(index_file.contents()))
|
|
71
|
+
.body(Cow::Borrowed::<'static, [u8]>(index_file.contents()))
|
|
73
72
|
.unwrap()
|
|
74
73
|
} else {
|
|
75
74
|
Response::builder()
|
|
@@ -80,10 +79,6 @@ impl CustomProtocolHandler {
|
|
|
80
79
|
}
|
|
81
80
|
}
|
|
82
81
|
}
|
|
83
|
-
|
|
84
|
-
// Burası teknik olarak unreachable ancak derleyiciyi tatmin etmek için
|
|
85
|
-
#[cfg(debug_assertions)]
|
|
86
|
-
Response::builder().status(StatusCode::NOT_FOUND).body(Cow::Borrowed(&b"Not Found"[..])).unwrap()
|
|
87
82
|
}
|
|
88
83
|
|
|
89
84
|
fn get_content_type(file_path: &str) -> &'static str {
|
|
@@ -103,3 +98,4 @@ impl CustomProtocolHandler {
|
|
|
103
98
|
}
|
|
104
99
|
}
|
|
105
100
|
}
|
|
101
|
+
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
[package]
|
|
2
|
-
name = "my-ionyx-app"
|
|
3
|
-
version = "0.
|
|
4
|
-
edition = "2021"
|
|
5
|
-
|
|
6
|
-
[workspace]
|
|
7
|
-
|
|
8
|
-
[lib]
|
|
9
|
-
name = "my_ionyx_app"
|
|
10
|
-
path = "src/lib.rs"
|
|
11
|
-
|
|
12
|
-
[[bin]]
|
|
13
|
-
name = "my-ionyx-app"
|
|
14
|
-
path = "main.rs"
|
|
15
|
-
|
|
16
|
-
[dependencies]
|
|
17
|
-
ionyx = { path = "../../../../../../src-ionyx" }
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
[package]
|
|
2
|
+
name = "my-ionyx-app"
|
|
3
|
+
version = "0.3.2"
|
|
4
|
+
edition = "2021"
|
|
5
|
+
|
|
6
|
+
[workspace]
|
|
7
|
+
|
|
8
|
+
[lib]
|
|
9
|
+
name = "my_ionyx_app"
|
|
10
|
+
path = "src/lib.rs"
|
|
11
|
+
|
|
12
|
+
[[bin]]
|
|
13
|
+
name = "my-ionyx-app"
|
|
14
|
+
path = "main.rs"
|
|
15
|
+
|
|
16
|
+
[dependencies]
|
|
17
|
+
ionyx = { path = "../../../../../../src-ionyx" }
|
|
18
|
+
include_dir = { version = "0.7", features = ["glob"] }
|
|
19
|
+
anyhow = "1.0"
|
|
20
|
+
wry = "0.54"
|
|
21
|
+
tao = "0.34"
|
|
22
|
+
|
|
23
|
+
[profile.release]
|
|
24
|
+
opt-level = 3
|
|
25
|
+
lto = true
|
|
26
|
+
codegen-units = 1
|
|
27
|
+
panic = "abort"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
use std::borrow::Cow;
|
|
2
2
|
use wry::http::{Request, Response, StatusCode};
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
|
|
5
5
|
#[cfg(not(debug_assertions))]
|
|
6
6
|
use include_dir::{include_dir, Dir};
|
|
@@ -35,12 +35,11 @@ impl CustomProtocolHandler {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
pub fn handle_request(&self, request: Request<Vec<u8>>) -> Response<Cow<'static, [u8]>> {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
if cfg!(debug_assertions) {
|
|
38
|
+
#[cfg(debug_assertions)]
|
|
39
|
+
{
|
|
40
|
+
let _uri_path = request.uri().path();
|
|
41
|
+
let _dist_path = get_frontend_dist_path();
|
|
42
|
+
let _unused_ct = Self::get_content_type("index.html");
|
|
44
43
|
return Response::builder()
|
|
45
44
|
.status(StatusCode::NOT_FOUND)
|
|
46
45
|
.header("Content-Type", "text/plain")
|
|
@@ -48,10 +47,10 @@ impl CustomProtocolHandler {
|
|
|
48
47
|
.unwrap();
|
|
49
48
|
}
|
|
50
49
|
|
|
51
|
-
// Release modunda gömülü dosyaları işle
|
|
52
50
|
#[cfg(not(debug_assertions))]
|
|
53
51
|
{
|
|
54
|
-
let
|
|
52
|
+
let uri_path = request.uri().path();
|
|
53
|
+
let clean_path = uri_path.trim_start_matches('/');
|
|
55
54
|
let file_path = if clean_path.is_empty() { "index.html" } else { clean_path };
|
|
56
55
|
|
|
57
56
|
match EMBEDDED_ASSETS.get_file(file_path) {
|
|
@@ -60,7 +59,7 @@ impl CustomProtocolHandler {
|
|
|
60
59
|
Response::builder()
|
|
61
60
|
.status(StatusCode::OK)
|
|
62
61
|
.header("Content-Type", content_type)
|
|
63
|
-
.body(Cow::Borrowed(file.contents()))
|
|
62
|
+
.body(Cow::Borrowed::<'static, [u8]>(file.contents()))
|
|
64
63
|
.unwrap()
|
|
65
64
|
}
|
|
66
65
|
None => {
|
|
@@ -69,7 +68,7 @@ impl CustomProtocolHandler {
|
|
|
69
68
|
Response::builder()
|
|
70
69
|
.status(StatusCode::OK)
|
|
71
70
|
.header("Content-Type", "text/html")
|
|
72
|
-
.body(Cow::Borrowed(index_file.contents()))
|
|
71
|
+
.body(Cow::Borrowed::<'static, [u8]>(index_file.contents()))
|
|
73
72
|
.unwrap()
|
|
74
73
|
} else {
|
|
75
74
|
Response::builder()
|
|
@@ -80,10 +79,6 @@ impl CustomProtocolHandler {
|
|
|
80
79
|
}
|
|
81
80
|
}
|
|
82
81
|
}
|
|
83
|
-
|
|
84
|
-
// Burası teknik olarak unreachable ancak derleyiciyi tatmin etmek için
|
|
85
|
-
#[cfg(debug_assertions)]
|
|
86
|
-
Response::builder().status(StatusCode::NOT_FOUND).body(Cow::Borrowed(&b"Not Found"[..])).unwrap()
|
|
87
82
|
}
|
|
88
83
|
|
|
89
84
|
fn get_content_type(file_path: &str) -> &'static str {
|
|
@@ -103,3 +98,4 @@ impl CustomProtocolHandler {
|
|
|
103
98
|
}
|
|
104
99
|
}
|
|
105
100
|
}
|
|
101
|
+
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
[package]
|
|
2
|
-
name = "my-ionyx-app"
|
|
3
|
-
version = "0.
|
|
4
|
-
edition = "2021"
|
|
5
|
-
|
|
6
|
-
[workspace]
|
|
7
|
-
|
|
8
|
-
[lib]
|
|
9
|
-
name = "my_ionyx_app"
|
|
10
|
-
path = "src/lib.rs"
|
|
11
|
-
|
|
12
|
-
[[bin]]
|
|
13
|
-
name = "my-ionyx-app"
|
|
14
|
-
path = "main.rs"
|
|
15
|
-
|
|
16
|
-
[dependencies]
|
|
17
|
-
ionyx = { path = "../../../../../../src-ionyx" }
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
[package]
|
|
2
|
+
name = "my-ionyx-app"
|
|
3
|
+
version = "0.3.2"
|
|
4
|
+
edition = "2021"
|
|
5
|
+
|
|
6
|
+
[workspace]
|
|
7
|
+
|
|
8
|
+
[lib]
|
|
9
|
+
name = "my_ionyx_app"
|
|
10
|
+
path = "src/lib.rs"
|
|
11
|
+
|
|
12
|
+
[[bin]]
|
|
13
|
+
name = "my-ionyx-app"
|
|
14
|
+
path = "main.rs"
|
|
15
|
+
|
|
16
|
+
[dependencies]
|
|
17
|
+
ionyx = { path = "../../../../../../src-ionyx" }
|
|
18
|
+
include_dir = { version = "0.7", features = ["glob"] }
|
|
19
|
+
anyhow = "1.0"
|
|
20
|
+
wry = "0.54"
|
|
21
|
+
tao = "0.34"
|
|
22
|
+
|
|
23
|
+
[profile.release]
|
|
24
|
+
opt-level = 3
|
|
25
|
+
lto = true
|
|
26
|
+
codegen-units = 1
|
|
27
|
+
panic = "abort"
|
|
@@ -17,12 +17,10 @@ impl CustomProtocolHandler {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
pub fn handle_request(&self, request: Request<Vec<u8>>) -> Response<Cow<'static, [u8]>> {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
// 404 yerine temiz bir hata dönüyoruz.
|
|
25
|
-
if cfg!(debug_assertions) {
|
|
20
|
+
#[cfg(debug_assertions)]
|
|
21
|
+
{
|
|
22
|
+
let _uri_path = request.uri().path();
|
|
23
|
+
let _unused_ct = Self::get_content_type("index.html");
|
|
26
24
|
return Response::builder()
|
|
27
25
|
.status(StatusCode::NOT_FOUND)
|
|
28
26
|
.header("Content-Type", "text/plain")
|
|
@@ -30,10 +28,10 @@ impl CustomProtocolHandler {
|
|
|
30
28
|
.unwrap();
|
|
31
29
|
}
|
|
32
30
|
|
|
33
|
-
// Release modunda gömülü dosyaları işle
|
|
34
31
|
#[cfg(not(debug_assertions))]
|
|
35
32
|
{
|
|
36
|
-
let
|
|
33
|
+
let uri_path = request.uri().path();
|
|
34
|
+
let clean_path = uri_path.trim_start_matches('/');
|
|
37
35
|
let file_path = if clean_path.is_empty() { "index.html" } else { clean_path };
|
|
38
36
|
|
|
39
37
|
match EMBEDDED_ASSETS.get_file(file_path) {
|
|
@@ -42,7 +40,7 @@ impl CustomProtocolHandler {
|
|
|
42
40
|
Response::builder()
|
|
43
41
|
.status(StatusCode::OK)
|
|
44
42
|
.header("Content-Type", content_type)
|
|
45
|
-
.body(Cow::Borrowed(file.contents()))
|
|
43
|
+
.body(Cow::Borrowed::<'static, [u8]>(file.contents()))
|
|
46
44
|
.unwrap()
|
|
47
45
|
}
|
|
48
46
|
None => {
|
|
@@ -51,7 +49,7 @@ impl CustomProtocolHandler {
|
|
|
51
49
|
Response::builder()
|
|
52
50
|
.status(StatusCode::OK)
|
|
53
51
|
.header("Content-Type", "text/html")
|
|
54
|
-
.body(Cow::Borrowed(index_file.contents()))
|
|
52
|
+
.body(Cow::Borrowed::<'static, [u8]>(index_file.contents()))
|
|
55
53
|
.unwrap()
|
|
56
54
|
} else {
|
|
57
55
|
Response::builder()
|
|
@@ -62,10 +60,6 @@ impl CustomProtocolHandler {
|
|
|
62
60
|
}
|
|
63
61
|
}
|
|
64
62
|
}
|
|
65
|
-
|
|
66
|
-
// Burası teknik olarak unreachable ancak derleyiciyi tatmin etmek için
|
|
67
|
-
#[cfg(debug_assertions)]
|
|
68
|
-
Response::builder().status(StatusCode::NOT_FOUND).body(Cow::Borrowed(&b"Not Found"[..])).unwrap()
|
|
69
63
|
}
|
|
70
64
|
|
|
71
65
|
fn get_content_type(file_path: &str) -> &'static str {
|
|
@@ -85,3 +79,4 @@ impl CustomProtocolHandler {
|
|
|
85
79
|
}
|
|
86
80
|
}
|
|
87
81
|
}
|
|
82
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ionyx-apps/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Ionyx Framework CLI - High-performance desktop apps with Rust and WebGPU",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"ionyx": "node bin/ionyx.js",
|
|
12
12
|
"dev": "cd ionyx-cli && cargo run --bin ionyx",
|
|
13
13
|
"build": "cd ionyx-cli && cargo build --release",
|
|
14
|
-
"
|
|
14
|
+
"clean:templates": "node clean-templates.js",
|
|
15
|
+
"prepack": "npm run clean:templates && npm run build && (copy ionyx-cli\\target\\release\\ionyx.exe bin\\ionyx.exe || cp ionyx-cli/target/release/ionyx bin/ionyx) && (upx --best --lzma bin\\ionyx.exe || echo 'UPX not available, skipping compression')",
|
|
15
16
|
"test": "node test-framework.js"
|
|
16
17
|
},
|
|
17
18
|
"files": [
|