Skip to main content

SideCar/
Library.rs

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