Initial Renamr scaffold: Tauri (Rust core + React/TS UI), naming-expression engine ported+tested

This commit is contained in:
Renamr Scaffold
2026-08-29 01:43:12 +00:00
commit e01852f292
34 changed files with 7530 additions and 0 deletions
+18
View File
@@ -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"
+3
View File
@@ -0,0 +1,3 @@
fn main() {
tauri_build::build()
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

+22
View File
@@ -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");
}
+6
View File
@@ -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();
}
+37
View File
@@ -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"
]
}
}