@ionyx-apps/cli 0.4.8 → 0.4.9
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/src/templates/angular/src-ionyx/Cargo.toml +30 -0
- package/ionyx-cli/src/templates/angular/src-ionyx/build.rs +5 -0
- package/ionyx-cli/src/templates/angular/src-ionyx/main.rs +48 -0
- package/ionyx-cli/src/templates/angular/src-ionyx/src/lib.rs +267 -0
- package/ionyx-cli/src/templates/basic/ionyx.config.json +3 -0
- package/ionyx-cli/src/templates/basic/package.json +6 -1
- package/ionyx-cli/src/templates/basic/src-ionyx/Cargo.toml +14 -12
- package/ionyx-cli/src/templates/basic/src-ionyx/main.rs +46 -3
- package/ionyx-cli/src/templates/leptos/package.json +6 -1
- package/ionyx-cli/src/templates/leptos/src-ionyx/Cargo.toml +14 -8
- package/ionyx-cli/src/templates/leptos/src-ionyx/main.rs +46 -3
- package/ionyx-cli/src/templates/mod.rs +1 -5
- package/ionyx-cli/src/templates/react/ionyx.config.json +4 -1
- package/ionyx-cli/src/templates/react/package.json +6 -1
- package/ionyx-cli/src/templates/react/src-ionyx/Cargo.toml +14 -12
- package/ionyx-cli/src/templates/react/src-ionyx/main.rs +46 -3
- package/ionyx-cli/src/templates/src-ionyx/Cargo.toml +15 -5
- package/ionyx-cli/src/templates/src-ionyx/bridge.rs +380 -0
- package/ionyx-cli/src/templates/src-ionyx/fusion.rs +47 -0
- package/ionyx-cli/src/templates/src-ionyx/ionyx.js +100 -0
- package/ionyx-cli/src/templates/src-ionyx/ipc_bridge.rs +206 -0
- package/ionyx-cli/src/templates/src-ionyx/lib.rs +204 -114
- package/ionyx-cli/src/templates/src-ionyx/main.rs +268 -3
- package/ionyx-cli/src/templates/src-ionyx/protocol.rs +98 -0
- package/ionyx-cli/src/templates/src-ionyx/window.rs +13 -0
- package/ionyx-cli/src/templates/svelte/package.json +6 -1
- package/ionyx-cli/src/templates/svelte/src-ionyx/Cargo.toml +14 -12
- package/ionyx-cli/src/templates/svelte/src-ionyx/main.rs +46 -3
- package/ionyx-cli/src/templates/vanilla/ionyx.config.json +3 -0
- package/ionyx-cli/src/templates/vanilla/package.json +6 -1
- package/ionyx-cli/src/templates/vanilla/src-ionyx/Cargo.toml +14 -12
- package/ionyx-cli/src/templates/vanilla/src-ionyx/main.rs +46 -3
- package/ionyx-cli/src/templates/vue/ionyx.config.json +4 -1
- package/ionyx-cli/src/templates/vue/package.json +6 -1
- package/ionyx-cli/src/templates/vue/src-ionyx/Cargo.toml +14 -12
- package/ionyx-cli/src/templates/vue/src-ionyx/main.rs +46 -3
- package/package.json +1 -1
|
@@ -1,5 +1,48 @@
|
|
|
1
|
-
|
|
1
|
+
use ionyx::{config, security, protocol};
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
#[tokio::main]
|
|
4
|
+
async fn main() {
|
|
5
|
+
println!("🚀 Ionyx Application starting...");
|
|
6
|
+
|
|
7
|
+
// Load application configuration
|
|
8
|
+
let app_config = match config::Config::load().await {
|
|
9
|
+
Ok(config) => {
|
|
10
|
+
println!("✅ Configuration loaded successfully");
|
|
11
|
+
config
|
|
12
|
+
}
|
|
13
|
+
Err(e) => {
|
|
14
|
+
eprintln!("⚠️ Failed to load config, using defaults: {}", e);
|
|
15
|
+
config::Config::default()
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
// Initialize security manager for demonstration
|
|
20
|
+
let security_manager: crate::security::SecurityManager = security::SecurityManager::new(app_config.clone());
|
|
21
|
+
|
|
22
|
+
// Demonstrate comprehensive security manager functionality
|
|
23
|
+
let test_paths = ["./app-data", "/system", "../outside"];
|
|
24
|
+
for &test_path in &test_paths {
|
|
25
|
+
let is_secure = security_manager.is_path_allowed(test_path);
|
|
26
|
+
println!("🔒 Security check: '{}' -> {}",
|
|
27
|
+
test_path,
|
|
28
|
+
if is_secure { "ALLOWED" } else { "DENIED" });
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Demonstrate security validation
|
|
32
|
+
if let Ok(()) = security_manager.validate_path_operation("./app-data", "read") {
|
|
33
|
+
println!("🔒 Security validation: Path operation approved");
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Initialize protocol handler for demonstration
|
|
37
|
+
let _protocol_handler = protocol::CustomProtocolHandler::new();
|
|
38
|
+
println!("🌐 Protocol handler initialized");
|
|
39
|
+
|
|
40
|
+
// Create and run the Ionyx application with automatic Vite server startup
|
|
41
|
+
println!("🚀 Launching Ionyx application...");
|
|
42
|
+
let builder = ionyx::Builder::new().config(app_config);
|
|
43
|
+
|
|
44
|
+
if let Err(e) = builder.run() {
|
|
45
|
+
eprintln!("❌ Application failed to start: {}", e);
|
|
46
|
+
std::process::exit(1);
|
|
47
|
+
}
|
|
5
48
|
}
|