lighty-core

Core utilities and foundational components for the LightyLauncher ecosystem.

Overview

Version: 0.8.6 Part of: LightyLauncherarrow-up-right

lighty-core provides essential building blocks used across all LightyLauncher crates:

  • Application State - Global app configuration and directory management

  • Download System - Async file downloads with SHA1 verification

  • Archive Extraction - ZIP, TAR, and TAR.GZ support with security

  • System Detection - Cross-platform OS and architecture detection

  • Hash Utilities - SHA1 verification for files and data

  • Logging Macros - Unified tracing interface

  • File Macros - Directory creation utilities

Quick Start

[dependencies]
lighty-core = "0.8.6"
use lighty_core::{AppState, system::{OS, ARCHITECTURE}};

const QUALIFIER: &str = "com";
const ORGANIZATION: &str = "MyLauncher";
const APPLICATION: &str = "";

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    // Initialize application state
    let _app = AppState::new(
        QUALIFIER.to_string(),
        ORGANIZATION.to_string(),
        APPLICATION.to_string(),
    )?;

    let launcher_dir = AppState::get_project_dirs();

    println!("Data directory: {}", launcher_dir.data_dir().display());
    println!("Cache directory: {}", launcher_dir.cache_dir().display());
    println!("Running on: {:?} {:?}", OS, ARCHITECTURE);

    Ok(())
}

Features

  • Thread-safe state - Global AppState with OnceCell

  • Secure extraction - Path traversal protection, file size limits

  • Smart downloads - Progress tracking and hash verification

  • Cross-platform - Windows, macOS, Linux support

  • Zero dependencies - Minimal external dependencies for core operations

Documentation

📚 Complete Documentationarrow-up-right

Guide
Description

Practical usage guide with examples

Architecture and design philosophy

Complete export reference

CoreEvent types

Application state management

File download system

Archive extraction

SHA1 verification utilities

Platform detection

Logging and file macros

License

MIT

Last updated