Skip to main content

SideCar/
Library.rs

1#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
2#![allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
3
4//! # SideCar: Pre-Built Node.js Binary Manager
5//!
6//! Cocoon needs Node.js to run VS Code extensions. SideCar manages the
7//! embedded Node.js binary: downloading platform-specific builds, verifying
8//! integrity, and spawning Node.js as a Tauri sidecar process.
9//!
10//! No system Node.js installation required. Land ships its own.
11//!
12//! ## What SideCar Does
13//!
14//! 1. **Downloads** the correct Node.js binary for the current OS and arch
15//! 2. **Verifies** the download checksum before extracting
16//! 3. **Spawns** Node.js as a managed sidecar that Mountain can monitor
17//!
18//! ## Modules
19//!
20//! - [`Download`]: Platform-aware binary fetching and checksum verification
21//! - [`Spawn`]: Tauri sidecar process launch and lifecycle management
22
23/// Main executable function.
24/// DEPENDENCY: Move this function to main.rs in a future refactor
25#[allow(dead_code)]
26pub fn main() {
27	if let Err(Error) = Download::Fn() {
28		error!("The application encountered a fatal error: {}", Error);
29
30		std::process::exit(1);
31	}
32}
33
34pub mod Download;
35pub mod Spawn;
36
37use log::error;