@ionyx-apps/cli 0.2.0 → 0.2.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/bin/ionyx.exe CHANGED
Binary file
@@ -1,13 +1,31 @@
1
1
  use std::borrow::Cow;
2
2
  use wry::http::{Request, Response, StatusCode};
3
+ use std::path::Path;
3
4
 
4
5
  #[cfg(not(debug_assertions))]
5
6
  use include_dir::{include_dir, Dir};
6
7
 
8
+ // Configuration'dan frontendDist path'ini oku
9
+ fn get_frontend_dist_path() -> String {
10
+ // Önce Ionyx config dosyasını okumaya çalış
11
+ if let Ok(config_content) = std::fs::read_to_string("ionyx.config.toml") {
12
+ for line in config_content.lines() {
13
+ if line.trim().starts_with("frontendDist") {
14
+ if let Some(path) = line.split('=').nth(1) {
15
+ return path.trim().trim_matches('"').to_string();
16
+ }
17
+ }
18
+ }
19
+ }
20
+
21
+ // Varsayılan path
22
+ "../frontend/dist".to_string()
23
+ }
24
+
7
25
  // Release modunda frontend/dist içindeki dosyaları binary'ye gömer.
8
- // Path hatasını engellemek için senin yapılandırdığın "../dist" yolunu kullanıyoruz.
26
+ // Configuration'dan dinamik path okur.
9
27
  #[cfg(not(debug_assertions))]
10
- static EMBEDDED_ASSETS: Dir<'static> = include_dir!("$CARGO_MANIFEST_DIR/../dist");
28
+ static EMBEDDED_ASSETS: Dir<'static> = include_dir!("../frontend/dist");
11
29
 
12
30
  pub struct CustomProtocolHandler;
13
31
 
@@ -1,13 +1,31 @@
1
1
  use std::borrow::Cow;
2
2
  use wry::http::{Request, Response, StatusCode};
3
+ use std::path::Path;
3
4
 
4
5
  #[cfg(not(debug_assertions))]
5
6
  use include_dir::{include_dir, Dir};
6
7
 
8
+ // Configuration'dan frontendDist path'ini oku
9
+ fn get_frontend_dist_path() -> String {
10
+ // Önce Ionyx config dosyasını okumaya çalış
11
+ if let Ok(config_content) = std::fs::read_to_string("ionyx.config.toml") {
12
+ for line in config_content.lines() {
13
+ if line.trim().starts_with("frontendDist") {
14
+ if let Some(path) = line.split('=').nth(1) {
15
+ return path.trim().trim_matches('"').to_string();
16
+ }
17
+ }
18
+ }
19
+ }
20
+
21
+ // Varsayılan path
22
+ "../frontend/dist".to_string()
23
+ }
24
+
7
25
  // Release modunda frontend/dist içindeki dosyaları binary'ye gömer.
8
- // Path hatasını engellemek için senin yapılandırdığın "../dist" yolunu kullanıyoruz.
26
+ // Configuration'dan dinamik path okur.
9
27
  #[cfg(not(debug_assertions))]
10
- static EMBEDDED_ASSETS: Dir<'static> = include_dir!("$CARGO_MANIFEST_DIR/../dist");
28
+ static EMBEDDED_ASSETS: Dir<'static> = include_dir!("../frontend/dist");
11
29
 
12
30
  pub struct CustomProtocolHandler;
13
31
 
@@ -51,10 +51,10 @@ pub async fn copy_template(project_name: &str, dest_path: &str, template: &str)
51
51
  if Path::new(&backend_cargo_path).exists() {
52
52
  let mut content = fs::read_to_string(&backend_cargo_path)?;
53
53
  content = content.replace("my-ionyx-app", project_name);
54
- // Use local path dependency to avoid Git repository path issues
54
+ // Use Git dependency for generated projects
55
55
  content = content.replace(
56
56
  "ionyx = { path = \"../../../../../../src-ionyx\" }",
57
- "ionyx = { path = \"../../../src-ionyx\" }"
57
+ "ionyx = { git = \"https://github.com/ionyx-apps/ionyx\", branch = \"quantum\" }"
58
58
  );
59
59
  fs::write(&backend_cargo_path, content)?;
60
60
  }
@@ -1,13 +1,31 @@
1
1
  use std::borrow::Cow;
2
2
  use wry::http::{Request, Response, StatusCode};
3
+ use std::path::Path;
3
4
 
4
5
  #[cfg(not(debug_assertions))]
5
6
  use include_dir::{include_dir, Dir};
6
7
 
8
+ // Configuration'dan frontendDist path'ini oku
9
+ fn get_frontend_dist_path() -> String {
10
+ // Önce Ionyx config dosyasını okumaya çalış
11
+ if let Ok(config_content) = std::fs::read_to_string("ionyx.config.toml") {
12
+ for line in config_content.lines() {
13
+ if line.trim().starts_with("frontendDist") {
14
+ if let Some(path) = line.split('=').nth(1) {
15
+ return path.trim().trim_matches('"').to_string();
16
+ }
17
+ }
18
+ }
19
+ }
20
+
21
+ // Varsayılan path
22
+ "../frontend/dist".to_string()
23
+ }
24
+
7
25
  // Release modunda frontend/dist içindeki dosyaları binary'ye gömer.
8
- // Path hatasını engellemek için senin yapılandırdığın "../dist" yolunu kullanıyoruz.
26
+ // Configuration'dan dinamik path okur.
9
27
  #[cfg(not(debug_assertions))]
10
- static EMBEDDED_ASSETS: Dir<'static> = include_dir!("$CARGO_MANIFEST_DIR/../dist");
28
+ static EMBEDDED_ASSETS: Dir<'static> = include_dir!("../frontend/dist");
11
29
 
12
30
  pub struct CustomProtocolHandler;
13
31
 
@@ -1,13 +1,31 @@
1
1
  use std::borrow::Cow;
2
2
  use wry::http::{Request, Response, StatusCode};
3
+ use std::path::Path;
3
4
 
4
5
  #[cfg(not(debug_assertions))]
5
6
  use include_dir::{include_dir, Dir};
6
7
 
8
+ // Configuration'dan frontendDist path'ini oku
9
+ fn get_frontend_dist_path() -> String {
10
+ // Önce Ionyx config dosyasını okumaya çalış
11
+ if let Ok(config_content) = std::fs::read_to_string("ionyx.config.toml") {
12
+ for line in config_content.lines() {
13
+ if line.trim().starts_with("frontendDist") {
14
+ if let Some(path) = line.split('=').nth(1) {
15
+ return path.trim().trim_matches('"').to_string();
16
+ }
17
+ }
18
+ }
19
+ }
20
+
21
+ // Varsayılan path
22
+ "../frontend/dist".to_string()
23
+ }
24
+
7
25
  // Release modunda frontend/dist içindeki dosyaları binary'ye gömer.
8
- // Path hatasını engellemek için senin yapılandırdığın "../dist" yolunu kullanıyoruz.
26
+ // Configuration'dan dinamik path okur.
9
27
  #[cfg(not(debug_assertions))]
10
- static EMBEDDED_ASSETS: Dir<'static> = include_dir!("$CARGO_MANIFEST_DIR/../dist");
28
+ static EMBEDDED_ASSETS: Dir<'static> = include_dir!("../frontend/dist");
11
29
 
12
30
  pub struct CustomProtocolHandler;
13
31
 
@@ -1,13 +1,31 @@
1
1
  use std::borrow::Cow;
2
2
  use wry::http::{Request, Response, StatusCode};
3
+ use std::path::Path;
3
4
 
4
5
  #[cfg(not(debug_assertions))]
5
6
  use include_dir::{include_dir, Dir};
6
7
 
8
+ // Configuration'dan frontendDist path'ini oku
9
+ fn get_frontend_dist_path() -> String {
10
+ // Önce Ionyx config dosyasını okumaya çalış
11
+ if let Ok(config_content) = std::fs::read_to_string("ionyx.config.toml") {
12
+ for line in config_content.lines() {
13
+ if line.trim().starts_with("frontendDist") {
14
+ if let Some(path) = line.split('=').nth(1) {
15
+ return path.trim().trim_matches('"').to_string();
16
+ }
17
+ }
18
+ }
19
+ }
20
+
21
+ // Varsayılan path
22
+ "../frontend/dist".to_string()
23
+ }
24
+
7
25
  // Release modunda frontend/dist içindeki dosyaları binary'ye gömer.
8
- // Path hatasını engellemek için senin yapılandırdığın "../dist" yolunu kullanıyoruz.
26
+ // Configuration'dan dinamik path okur.
9
27
  #[cfg(not(debug_assertions))]
10
- static EMBEDDED_ASSETS: Dir<'static> = include_dir!("$CARGO_MANIFEST_DIR/../dist");
28
+ static EMBEDDED_ASSETS: Dir<'static> = include_dir!("../frontend/dist");
11
29
 
12
30
  pub struct CustomProtocolHandler;
13
31
 
@@ -5,9 +5,9 @@ use wry::http::{Request, Response, StatusCode};
5
5
  use include_dir::{include_dir, Dir};
6
6
 
7
7
  // Release modunda frontend/dist içindeki dosyaları binary'ye gömer.
8
- // Path hatasını engellemek için senin yapılandırdığın "../dist" yolunu kullanıyoruz.
8
+ // Path hatasını engellemek için doğru path kullanıyoruz.
9
9
  #[cfg(not(debug_assertions))]
10
- static EMBEDDED_ASSETS: Dir<'static> = include_dir!("$CARGO_MANIFEST_DIR/../dist");
10
+ static EMBEDDED_ASSETS: Dir<'static> = include_dir!("../frontend/dist");
11
11
 
12
12
  pub struct CustomProtocolHandler;
13
13
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ionyx-apps/cli",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Ionyx Framework CLI - High-performance desktop apps with Rust and WebGPU",
5
5
  "main": "index.js",
6
6
  "type": "commonjs",