mod commands;
mod types;

use commands::{analyze_project, apply_actions, get_app_info, preview_actions, undo_last};

#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
  tauri::Builder::default()
    .plugin(tauri_plugin_dialog::init())
    .plugin(tauri_plugin_updater::Builder::new().build())
    .plugin(tauri_plugin_process::init())
    .setup(|app| {
      if cfg!(debug_assertions) {
        app.handle().plugin(
          tauri_plugin_log::Builder::default()
            .level(log::LevelFilter::Info)
            .build(),
        )?;
      }
      Ok(())
    })
    .invoke_handler(tauri::generate_handler![
      analyze_project,
      preview_actions,
      apply_actions,
      undo_last,
      get_app_info,
    ])
    .run(tauri::generate_context!())
    .expect("error while running tauri application");
}
