From 025f01a3e0a80e484d5a07a66a7751cd6421ab17 Mon Sep 17 00:00:00 2001 From: Ilya Grigoriev Date: Tue, 20 Feb 2024 20:32:02 -0800 Subject: [PATCH] Rename diffedit3-web package to diffedit3 --- .github/workflows/release.yml | 2 +- Cargo.lock | 28 +++++++++---------- backend-local-server/Cargo.toml | 2 +- backend-local-server/src/bin/diffedit3-web.rs | 6 ++-- backend-tauri/Cargo.toml | 2 +- backend-tauri/src/main.rs | 14 +++++----- 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d7d3d93..8ce5e62 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -46,7 +46,7 @@ jobs: toolchain: stable target: ${{ matrix.target }} - name: Build release binary - run: cargo build --target ${{ matrix.target }} --verbose --release -p diffedit3-web + run: cargo build --target ${{ matrix.target }} --verbose --release -p diffedit3 - name: Build archive shell: bash run: | diff --git a/Cargo.lock b/Cargo.lock index d90303a..17eacf1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -666,20 +666,7 @@ dependencies = [ ] [[package]] -name = "diffedit3-gui" -version = "0.0.1" -dependencies = [ - "clap", - "diffedit3-web", - "indexmap 2.2.3", - "serde", - "serde_json", - "tauri", - "tauri-build", -] - -[[package]] -name = "diffedit3-web" +name = "diffedit3" version = "0.0.1" dependencies = [ "clap", @@ -696,6 +683,19 @@ dependencies = [ "walkdir", ] +[[package]] +name = "diffedit3-gui" +version = "0.0.1" +dependencies = [ + "clap", + "diffedit3", + "indexmap 2.2.3", + "serde", + "serde_json", + "tauri", + "tauri-build", +] + [[package]] name = "digest" version = "0.10.7" diff --git a/backend-local-server/Cargo.toml b/backend-local-server/Cargo.toml index d7df505..18ce9af 100644 --- a/backend-local-server/Cargo.toml +++ b/backend-local-server/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "diffedit3-web" +name = "diffedit3" version = { workspace = true } edition = { workspace = true } diff --git a/backend-local-server/src/bin/diffedit3-web.rs b/backend-local-server/src/bin/diffedit3-web.rs index 57f90d0..3457896 100644 --- a/backend-local-server/src/bin/diffedit3-web.rs +++ b/backend-local-server/src/bin/diffedit3-web.rs @@ -1,12 +1,12 @@ use clap::Parser; -use diffedit3_web::local_server::{run_server, MergeToolError}; +use diffedit3::local_server::{run_server, MergeToolError}; /// Compare three directories in a browser and allow editing one of them #[derive(Parser)] #[command(version, about)] pub struct LocalServerCli { #[command(flatten)] - lib_cli: diffedit3_web::fs::Cli, + lib_cli: diffedit3::fs::Cli, /// Port to use for `http://127.0.0.1` #[arg(long, short, default_value = "8080")] port: usize, @@ -37,7 +37,7 @@ fn exit_with_cli_error(s: String) -> ! { #[tokio::main] async fn main() -> Result<(), MergeToolError> { let cli = LocalServerCli::parse(); - let input: diffedit3_web::fs::ThreeDirInput = match cli.lib_cli.try_into() { + let input: diffedit3::fs::ThreeDirInput = match cli.lib_cli.try_into() { Ok(i) => i, Err(err) => { exit_with_cli_error(err.to_string()); diff --git a/backend-tauri/Cargo.toml b/backend-tauri/Cargo.toml index e09c531..e0811a4 100644 --- a/backend-tauri/Cargo.toml +++ b/backend-tauri/Cargo.toml @@ -12,7 +12,7 @@ serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" indexmap = { version = "2.2.3", features = ["serde"] } clap = { version = "4.5.0", features = ["derive"] } -diffedit3-web = { path = "../backend-local-server" } +diffedit3 = { path = "../backend-local-server" } [features] # this feature is used for production builds or when `devPath` points to the filesystem diff --git a/backend-tauri/src/main.rs b/backend-tauri/src/main.rs index 9b7affc..0baa5f3 100644 --- a/backend-tauri/src/main.rs +++ b/backend-tauri/src/main.rs @@ -4,7 +4,7 @@ // #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] use clap::Parser; -use diffedit3_web::DataInterface; +use diffedit3::DataInterface; use indexmap::IndexMap; use tauri::{CustomMenuItem, Menu, Submenu}; @@ -25,15 +25,15 @@ fn logoutput(result: IndexMap) { #[tauri::command] fn save( result: IndexMap, - state: tauri::State, -) -> Result<(), diffedit3_web::DataSaveError> { + state: tauri::State, +) -> Result<(), diffedit3::DataSaveError> { state.save(result) } #[tauri::command] fn get_merge_data( - state: tauri::State, -) -> Result { + state: tauri::State, +) -> Result { state.scan() } @@ -44,8 +44,8 @@ fn get_merge_data( // So far, the most promising approach is to change the `font-size` root // CSS property fn main() { - let cli = diffedit3_web::Cli::parse(); - let input: diffedit3_web::ThreeDirInput = cli.try_into().unwrap_or_else(|err| { + let cli = diffedit3::Cli::parse(); + let input: diffedit3::ThreeDirInput = cli.try_into().unwrap_or_else(|err| { eprintln!("Error: {err}"); std::process::exit(2) });