Initial Renamr scaffold: Tauri (Rust core + React/TS UI), naming-expression engine ported+tested
@@ -0,0 +1,18 @@
|
||||
[package]
|
||||
name = "renamr"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
|
||||
[lib]
|
||||
name = "renamr_lib"
|
||||
crate-type = ["staticlib", "cdylib", "rlib"]
|
||||
|
||||
[build-dependencies]
|
||||
tauri-build = { version = "2", features = [] }
|
||||
|
||||
[dependencies]
|
||||
renamr-core = { path = "../crates/renamr-core" }
|
||||
tauri = { version = "2", features = [] }
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
@@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
tauri_build::build()
|
||||
}
|
||||
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 9.0 KiB |
|
After Width: | Height: | Size: 9.0 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 20 KiB |
@@ -0,0 +1,22 @@
|
||||
use renamr_core::format::ExpressionFormat;
|
||||
use renamr_core::string_bindings;
|
||||
use std::collections::HashMap;
|
||||
|
||||
/// Renders a naming-scheme expression against a set of binding values.
|
||||
/// This is the Tauri-facing entry point into the core format engine, used by the
|
||||
/// rename-preview panel in the UI so users see live results as they edit a pattern.
|
||||
#[tauri::command]
|
||||
fn render_expression(expression: String, bindings: HashMap<String, String>) -> Result<String, String> {
|
||||
let compiled = ExpressionFormat::compile(&expression).map_err(|e| e.to_string())?;
|
||||
compiled
|
||||
.format(&string_bindings(bindings))
|
||||
.map_err(|e| e.to_string())
|
||||
}
|
||||
|
||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||
pub fn run() {
|
||||
tauri::Builder::default()
|
||||
.invoke_handler(tauri::generate_handler![render_expression])
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running Renamr");
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// Prevents an additional console window on Windows in release builds.
|
||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||
|
||||
fn main() {
|
||||
renamr_lib::run();
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "Renamr",
|
||||
"version": "0.1.0",
|
||||
"identifier": "com.renamr.app",
|
||||
"build": {
|
||||
"beforeDevCommand": "npm run dev",
|
||||
"beforeBuildCommand": "npm run build",
|
||||
"devUrl": "http://localhost:5173",
|
||||
"frontendDist": "../dist"
|
||||
},
|
||||
"app": {
|
||||
"windows": [
|
||||
{
|
||||
"title": "Renamr",
|
||||
"width": 1100,
|
||||
"height": 720,
|
||||
"minWidth": 720,
|
||||
"minHeight": 480
|
||||
}
|
||||
],
|
||||
"security": {
|
||||
"csp": null
|
||||
}
|
||||
},
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"targets": "all",
|
||||
"icon": [
|
||||
"icons/32x32.png",
|
||||
"icons/128x128.png",
|
||||
"icons/[email protected]",
|
||||
"icons/icon.icns",
|
||||
"icons/icon.ico"
|
||||
]
|
||||
}
|
||||
}
|
||||