diff --git a/src-tauri/src/app/app.rs b/src-tauri/src/app.rs similarity index 99% rename from src-tauri/src/app/app.rs rename to src-tauri/src/app.rs index 9261dc8d2..c9d96ec38 100644 --- a/src-tauri/src/app/app.rs +++ b/src-tauri/src/app.rs @@ -3,9 +3,7 @@ use std::{collections::HashMap, sync, ops}; use anyhow::{Context, Result}; use crossbeam_channel::{bounded, Sender}; -use crate::{events, projects, search, storage, users, database}; - -use super::{gb_repository, watcher, sessions, deltas, pty, project_repository::{self, activity}, files, bookmarks}; +use crate::{events, projects, search, storage, users, database, watcher, sessions, deltas, pty, project_repository::{self, activity}, files, bookmarks, gb_repository}; #[derive(Clone)] pub struct App { diff --git a/src-tauri/src/app/mod.rs b/src-tauri/src/app/mod.rs deleted file mode 100644 index 328e30e36..000000000 --- a/src-tauri/src/app/mod.rs +++ /dev/null @@ -1,15 +0,0 @@ -mod app; -pub mod bookmarks; -pub mod deltas; -pub mod files; -pub mod gb_repository; -pub mod project_repository; -pub mod projects; -pub mod pty; -pub mod search; -pub mod sessions; -pub mod users; -pub mod watcher; - -pub use app::{AddProjectError, App}; -pub use project_repository::FileStatus; diff --git a/src-tauri/src/app/bookmarks/database.rs b/src-tauri/src/bookmarks/database.rs similarity index 100% rename from src-tauri/src/app/bookmarks/database.rs rename to src-tauri/src/bookmarks/database.rs diff --git a/src-tauri/src/app/bookmarks/mod.rs b/src-tauri/src/bookmarks/mod.rs similarity index 100% rename from src-tauri/src/app/bookmarks/mod.rs rename to src-tauri/src/bookmarks/mod.rs diff --git a/src-tauri/src/app/bookmarks/reader.rs b/src-tauri/src/bookmarks/reader.rs similarity index 98% rename from src-tauri/src/app/bookmarks/reader.rs rename to src-tauri/src/bookmarks/reader.rs index 006062caa..378a33890 100644 --- a/src-tauri/src/app/bookmarks/reader.rs +++ b/src-tauri/src/bookmarks/reader.rs @@ -2,8 +2,8 @@ use anyhow::{Context, Result}; use serde_jsonlines::JsonLinesReader; use crate::{ - app::sessions, reader::{self, Reader}, + sessions, }; use super::Bookmark; diff --git a/src-tauri/src/app/deltas/database.rs b/src-tauri/src/deltas/database.rs similarity index 100% rename from src-tauri/src/app/deltas/database.rs rename to src-tauri/src/deltas/database.rs diff --git a/src-tauri/src/app/deltas/delta.rs b/src-tauri/src/deltas/delta.rs similarity index 100% rename from src-tauri/src/app/deltas/delta.rs rename to src-tauri/src/deltas/delta.rs diff --git a/src-tauri/src/app/deltas/document/document.rs b/src-tauri/src/deltas/document/document.rs similarity index 100% rename from src-tauri/src/app/deltas/document/document.rs rename to src-tauri/src/deltas/document/document.rs diff --git a/src-tauri/src/app/deltas/document/mod.rs b/src-tauri/src/deltas/document/mod.rs similarity index 100% rename from src-tauri/src/app/deltas/document/mod.rs rename to src-tauri/src/deltas/document/mod.rs diff --git a/src-tauri/src/app/deltas/document/tests.rs b/src-tauri/src/deltas/document/tests.rs similarity index 100% rename from src-tauri/src/app/deltas/document/tests.rs rename to src-tauri/src/deltas/document/tests.rs diff --git a/src-tauri/src/app/deltas/mod.rs b/src-tauri/src/deltas/mod.rs similarity index 100% rename from src-tauri/src/app/deltas/mod.rs rename to src-tauri/src/deltas/mod.rs diff --git a/src-tauri/src/app/deltas/operations/mod.rs b/src-tauri/src/deltas/operations/mod.rs similarity index 100% rename from src-tauri/src/app/deltas/operations/mod.rs rename to src-tauri/src/deltas/operations/mod.rs diff --git a/src-tauri/src/app/deltas/operations/operations.rs b/src-tauri/src/deltas/operations/operations.rs similarity index 100% rename from src-tauri/src/app/deltas/operations/operations.rs rename to src-tauri/src/deltas/operations/operations.rs diff --git a/src-tauri/src/app/deltas/operations/tests.rs b/src-tauri/src/deltas/operations/tests.rs similarity index 100% rename from src-tauri/src/app/deltas/operations/tests.rs rename to src-tauri/src/deltas/operations/tests.rs diff --git a/src-tauri/src/app/deltas/reader.rs b/src-tauri/src/deltas/reader.rs similarity index 98% rename from src-tauri/src/app/deltas/reader.rs rename to src-tauri/src/deltas/reader.rs index 4afdc3c34..900aeb07e 100644 --- a/src-tauri/src/app/deltas/reader.rs +++ b/src-tauri/src/deltas/reader.rs @@ -3,8 +3,8 @@ use std::{collections::HashMap, path}; use anyhow::Result; use crate::{ - app::sessions, reader::{self, Reader}, + sessions, }; use super::Delta; diff --git a/src-tauri/src/events.rs b/src-tauri/src/events.rs index c6f0f310e..9e42bdb81 100644 --- a/src-tauri/src/events.rs +++ b/src-tauri/src/events.rs @@ -1,7 +1,7 @@ use anyhow::{Context, Result}; use tauri::Manager; -use crate::app::{deltas, sessions}; +use crate::{deltas, sessions}; #[derive(Clone)] pub struct Sender { diff --git a/src-tauri/src/app/files/database.rs b/src-tauri/src/files/database.rs similarity index 100% rename from src-tauri/src/app/files/database.rs rename to src-tauri/src/files/database.rs diff --git a/src-tauri/src/app/files/mod.rs b/src-tauri/src/files/mod.rs similarity index 100% rename from src-tauri/src/app/files/mod.rs rename to src-tauri/src/files/mod.rs diff --git a/src-tauri/src/app/gb_repository/mod.rs b/src-tauri/src/gb_repository/mod.rs similarity index 100% rename from src-tauri/src/app/gb_repository/mod.rs rename to src-tauri/src/gb_repository/mod.rs diff --git a/src-tauri/src/app/gb_repository/repository.rs b/src-tauri/src/gb_repository/repository.rs similarity index 99% rename from src-tauri/src/app/gb_repository/repository.rs rename to src-tauri/src/gb_repository/repository.rs index d77c22df9..d77b09507 100644 --- a/src-tauri/src/app/gb_repository/repository.rs +++ b/src-tauri/src/gb_repository/repository.rs @@ -14,8 +14,9 @@ use uuid::Uuid; use crate::{fs, projects, users}; use crate::{ - app::{project_repository, sessions}, + project_repository, reader::{self, Reader}, + sessions, }; pub struct Repository { diff --git a/src-tauri/src/app/gb_repository/repository_tests.rs b/src-tauri/src/gb_repository/repository_tests.rs similarity index 99% rename from src-tauri/src/app/gb_repository/repository_tests.rs rename to src-tauri/src/gb_repository/repository_tests.rs index ed93925ca..da385e264 100644 --- a/src-tauri/src/app/gb_repository/repository_tests.rs +++ b/src-tauri/src/gb_repository/repository_tests.rs @@ -3,10 +3,7 @@ use std::{thread, time}; use anyhow::Result; use tempfile::tempdir; -use crate::{ - app::{deltas, gb_repository, sessions}, - projects, storage, users, -}; +use crate::{deltas, gb_repository, projects, sessions, storage, users}; fn remote_repository() -> Result { let path = tempdir()?.path().to_str().unwrap().to_string(); diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 2a92b1c82..ec9b54b74 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -2,7 +2,18 @@ extern crate scopeguard; mod app; +mod bookmarks; mod database; +mod deltas; +mod sessions; +mod files; +mod gb_repository; +mod project_repository; +mod projects; +mod pty; +mod search; +mod users; +mod watcher; mod reader; mod writer; mod zip; @@ -14,7 +25,6 @@ mod storage; extern crate log; use anyhow::{Context, Result}; -use app::bookmarks; use serde::{ser::SerializeMap, Serialize}; use std::{collections::HashMap, ops}; use tauri::{generate_context, Manager}; @@ -25,7 +35,7 @@ use tauri_plugin_log::{ use thiserror::Error; use timed::timed; -use crate::app::{project_repository::activity, search, projects, deltas, sessions, users}; +use crate::project_repository::activity; #[derive(Debug, Error)] pub enum Error { @@ -349,7 +359,7 @@ async fn git_activity( async fn git_status( handle: tauri::AppHandle, project_id: &str, -) -> Result, Error> { +) -> Result, Error> { let app = handle.state::(); let status = app .git_status(project_id) diff --git a/src-tauri/src/app/project_repository/activity.rs b/src-tauri/src/project_repository/activity.rs similarity index 100% rename from src-tauri/src/app/project_repository/activity.rs rename to src-tauri/src/project_repository/activity.rs diff --git a/src-tauri/src/app/project_repository/activity_tests.rs b/src-tauri/src/project_repository/activity_tests.rs similarity index 100% rename from src-tauri/src/app/project_repository/activity_tests.rs rename to src-tauri/src/project_repository/activity_tests.rs diff --git a/src-tauri/src/app/project_repository/mod.rs b/src-tauri/src/project_repository/mod.rs similarity index 100% rename from src-tauri/src/app/project_repository/mod.rs rename to src-tauri/src/project_repository/mod.rs diff --git a/src-tauri/src/app/project_repository/repository.rs b/src-tauri/src/project_repository/repository.rs similarity index 99% rename from src-tauri/src/app/project_repository/repository.rs rename to src-tauri/src/project_repository/repository.rs index 4d2da2d28..0fcbe0874 100644 --- a/src-tauri/src/app/project_repository/repository.rs +++ b/src-tauri/src/project_repository/repository.rs @@ -4,7 +4,7 @@ use anyhow::{Context, Result}; use serde::Serialize; use walkdir::WalkDir; -use crate::{app::project_repository::activity, projects, reader}; +use crate::{project_repository::activity, projects, reader}; pub struct Repository<'repository> { pub(crate) git_repository: git2::Repository, diff --git a/src-tauri/src/app/projects/mod.rs b/src-tauri/src/projects/mod.rs similarity index 100% rename from src-tauri/src/app/projects/mod.rs rename to src-tauri/src/projects/mod.rs diff --git a/src-tauri/src/app/projects/project.rs b/src-tauri/src/projects/project.rs similarity index 100% rename from src-tauri/src/app/projects/project.rs rename to src-tauri/src/projects/project.rs diff --git a/src-tauri/src/app/projects/storage.rs b/src-tauri/src/projects/storage.rs similarity index 100% rename from src-tauri/src/app/projects/storage.rs rename to src-tauri/src/projects/storage.rs diff --git a/src-tauri/src/app/pty/connection.rs b/src-tauri/src/pty/connection.rs similarity index 100% rename from src-tauri/src/app/pty/connection.rs rename to src-tauri/src/pty/connection.rs diff --git a/src-tauri/src/app/pty/mod.rs b/src-tauri/src/pty/mod.rs similarity index 100% rename from src-tauri/src/app/pty/mod.rs rename to src-tauri/src/pty/mod.rs diff --git a/src-tauri/src/app/pty/recorder.rs b/src-tauri/src/pty/recorder.rs similarity index 100% rename from src-tauri/src/app/pty/recorder.rs rename to src-tauri/src/pty/recorder.rs diff --git a/src-tauri/src/app/pty/server.rs b/src-tauri/src/pty/server.rs similarity index 100% rename from src-tauri/src/app/pty/server.rs rename to src-tauri/src/pty/server.rs diff --git a/src-tauri/src/app/search/deltas.rs b/src-tauri/src/search/deltas.rs similarity index 98% rename from src-tauri/src/app/search/deltas.rs rename to src-tauri/src/search/deltas.rs index 53c4bd546..4e6b2c4c4 100644 --- a/src-tauri/src/app/search/deltas.rs +++ b/src-tauri/src/search/deltas.rs @@ -11,10 +11,7 @@ use serde::Serialize; use similar::{ChangeTag, TextDiff}; use tantivy::{collector, directory::MmapDirectory, schema, IndexWriter}; -use crate::{ - app::{self, deltas, sessions}, - storage, -}; +use crate::{deltas, gb_repository, sessions, storage}; const CURRENT_VERSION: u64 = 4; // should not decrease @@ -123,7 +120,7 @@ impl Deltas { pub fn index_session( &self, - repository: &app::gb_repository::Repository, + repository: &gb_repository::Repository, session: &sessions::Session, ) -> Result<()> { // TODO: maybe we should index current sessions? @@ -196,7 +193,7 @@ fn index_session( index: &tantivy::Index, writer: &mut IndexWriter, session: &sessions::Session, - repository: &app::gb_repository::Repository, + repository: &gb_repository::Repository, ) -> Result<()> { let session_reader = sessions::Reader::open(&repository, &session) .with_context(|| "could not get session reader")?; diff --git a/src-tauri/src/app/search/deltas_test.rs b/src-tauri/src/search/deltas_test.rs similarity index 97% rename from src-tauri/src/app/search/deltas_test.rs rename to src-tauri/src/search/deltas_test.rs index a6608aded..080adf825 100644 --- a/src-tauri/src/app/search/deltas_test.rs +++ b/src-tauri/src/search/deltas_test.rs @@ -4,10 +4,7 @@ use std::path::Path; use anyhow::Result; use tempfile::tempdir; -use crate::{ - app::{self, deltas, sessions}, - projects, storage, users, -}; +use crate::{deltas, gb_repository, projects, sessions, storage, users}; fn test_repository() -> Result { let path = tempdir()?.path().to_str().unwrap().to_string(); @@ -48,7 +45,7 @@ fn test_filter_by_timestamp() -> Result<()> { let project_store = projects::Storage::new(storage.clone()); project_store.add_project(&project)?; let user_store = users::Storage::new(storage); - let gb_repo = app::gb_repository::Repository::open( + let gb_repo = gb_repository::Repository::open( gb_repo_path, project.id.clone(), project_store.clone(), @@ -124,7 +121,7 @@ fn test_sorted_by_timestamp() -> Result<()> { let project_store = projects::Storage::new(storage.clone()); project_store.add_project(&project)?; let user_store = users::Storage::new(storage); - let gb_repo = app::gb_repository::Repository::open( + let gb_repo = gb_repository::Repository::open( gb_repo_path, project.id.clone(), project_store.clone(), @@ -180,7 +177,7 @@ fn test_simple() -> Result<()> { let project_store = projects::Storage::new(storage.clone()); project_store.add_project(&project)?; let user_store = users::Storage::new(storage); - let gb_repo = app::gb_repository::Repository::open( + let gb_repo = gb_repository::Repository::open( gb_repo_path, project.id.clone(), project_store.clone(), @@ -299,7 +296,7 @@ fn test_delete_all() -> Result<()> { let project_store = projects::Storage::new(storage.clone()); project_store.add_project(&project)?; let user_store = users::Storage::new(storage); - let gb_repo = app::gb_repository::Repository::open( + let gb_repo = gb_repository::Repository::open( gb_repo_path, project.id.clone(), project_store.clone(), diff --git a/src-tauri/src/app/search/mod.rs b/src-tauri/src/search/mod.rs similarity index 100% rename from src-tauri/src/app/search/mod.rs rename to src-tauri/src/search/mod.rs diff --git a/src-tauri/src/app/sessions/database.rs b/src-tauri/src/sessions/database.rs similarity index 100% rename from src-tauri/src/app/sessions/database.rs rename to src-tauri/src/sessions/database.rs diff --git a/src-tauri/src/app/sessions/iterator.rs b/src-tauri/src/sessions/iterator.rs similarity index 100% rename from src-tauri/src/app/sessions/iterator.rs rename to src-tauri/src/sessions/iterator.rs diff --git a/src-tauri/src/app/sessions/mod.rs b/src-tauri/src/sessions/mod.rs similarity index 100% rename from src-tauri/src/app/sessions/mod.rs rename to src-tauri/src/sessions/mod.rs diff --git a/src-tauri/src/app/sessions/reader.rs b/src-tauri/src/sessions/reader.rs similarity index 99% rename from src-tauri/src/app/sessions/reader.rs rename to src-tauri/src/sessions/reader.rs index 88bef23eb..58b44b11a 100644 --- a/src-tauri/src/app/sessions/reader.rs +++ b/src-tauri/src/sessions/reader.rs @@ -3,7 +3,7 @@ use std::collections::HashMap; use anyhow::{anyhow, Context, Result}; use crate::{ - app::gb_repository, + gb_repository, reader::{self, CommitReader, Reader}, }; diff --git a/src-tauri/src/app/sessions/session.rs b/src-tauri/src/sessions/session.rs similarity index 100% rename from src-tauri/src/app/sessions/session.rs rename to src-tauri/src/sessions/session.rs diff --git a/src-tauri/src/app/sessions/tests.rs b/src-tauri/src/sessions/tests.rs similarity index 98% rename from src-tauri/src/app/sessions/tests.rs rename to src-tauri/src/sessions/tests.rs index cc448e1a7..f1fbd7ede 100644 --- a/src-tauri/src/app/sessions/tests.rs +++ b/src-tauri/src/sessions/tests.rs @@ -1,10 +1,7 @@ use anyhow::Result; use tempfile::tempdir; -use crate::{ - app::{gb_repository, sessions}, - projects, storage, users, -}; +use crate::{gb_repository, projects, sessions, storage, users}; use super::Writer; diff --git a/src-tauri/src/app/sessions/writer.rs b/src-tauri/src/sessions/writer.rs similarity index 99% rename from src-tauri/src/app/sessions/writer.rs rename to src-tauri/src/sessions/writer.rs index d63356a21..b6807a408 100644 --- a/src-tauri/src/app/sessions/writer.rs +++ b/src-tauri/src/sessions/writer.rs @@ -3,7 +3,7 @@ use std::time; use anyhow::{anyhow, Context, Result}; use crate::{ - app::{bookmarks, deltas, gb_repository, pty}, + bookmarks, deltas, gb_repository, pty, reader::{self, Reader}, writer::{self, Writer}, }; diff --git a/src-tauri/src/app/users/mod.rs b/src-tauri/src/users/mod.rs similarity index 100% rename from src-tauri/src/app/users/mod.rs rename to src-tauri/src/users/mod.rs diff --git a/src-tauri/src/app/users/storage.rs b/src-tauri/src/users/storage.rs similarity index 100% rename from src-tauri/src/app/users/storage.rs rename to src-tauri/src/users/storage.rs diff --git a/src-tauri/src/app/users/user.rs b/src-tauri/src/users/user.rs similarity index 100% rename from src-tauri/src/app/users/user.rs rename to src-tauri/src/users/user.rs diff --git a/src-tauri/src/app/watcher/dispatchers/database.rs b/src-tauri/src/watcher/dispatchers/database.rs similarity index 97% rename from src-tauri/src/app/watcher/dispatchers/database.rs rename to src-tauri/src/watcher/dispatchers/database.rs index ce42a04ae..97a03caaf 100644 --- a/src-tauri/src/app/watcher/dispatchers/database.rs +++ b/src-tauri/src/watcher/dispatchers/database.rs @@ -1,7 +1,7 @@ use anyhow::{Context, Result}; use crossbeam_channel::{bounded, Receiver, Sender}; -use crate::app::{deltas, files, sessions, watcher::events}; +use crate::{deltas, files, sessions, watcher::events}; #[derive(Clone)] pub struct Dispatcher { diff --git a/src-tauri/src/app/watcher/dispatchers/file_change.rs b/src-tauri/src/watcher/dispatchers/file_change.rs similarity index 100% rename from src-tauri/src/app/watcher/dispatchers/file_change.rs rename to src-tauri/src/watcher/dispatchers/file_change.rs diff --git a/src-tauri/src/app/watcher/dispatchers/mod.rs b/src-tauri/src/watcher/dispatchers/mod.rs similarity index 99% rename from src-tauri/src/app/watcher/dispatchers/mod.rs rename to src-tauri/src/watcher/dispatchers/mod.rs index ff7b0dc87..01dc59462 100644 --- a/src-tauri/src/app/watcher/dispatchers/mod.rs +++ b/src-tauri/src/watcher/dispatchers/mod.rs @@ -7,7 +7,7 @@ use std::{path, time}; use anyhow::Result; use crossbeam_channel::{bounded, select, unbounded, Sender}; -use crate::app::{deltas, files, sessions}; +use crate::{deltas, files, sessions}; use super::events; diff --git a/src-tauri/src/app/watcher/dispatchers/tick.rs b/src-tauri/src/watcher/dispatchers/tick.rs similarity index 100% rename from src-tauri/src/app/watcher/dispatchers/tick.rs rename to src-tauri/src/watcher/dispatchers/tick.rs diff --git a/src-tauri/src/app/watcher/events.rs b/src-tauri/src/watcher/events.rs similarity index 92% rename from src-tauri/src/app/watcher/events.rs rename to src-tauri/src/watcher/events.rs index 1e39af6e9..c2f6bd6d4 100644 --- a/src-tauri/src/app/watcher/events.rs +++ b/src-tauri/src/watcher/events.rs @@ -1,6 +1,6 @@ use std::{path, time}; -use crate::app::{deltas, sessions}; +use crate::{deltas, sessions}; pub enum Event { Tick(time::SystemTime), diff --git a/src-tauri/src/app/watcher/handlers/check_current_session.rs b/src-tauri/src/watcher/handlers/check_current_session.rs similarity index 97% rename from src-tauri/src/app/watcher/handlers/check_current_session.rs rename to src-tauri/src/watcher/handlers/check_current_session.rs index e0828275f..1da472b51 100644 --- a/src-tauri/src/app/watcher/handlers/check_current_session.rs +++ b/src-tauri/src/watcher/handlers/check_current_session.rs @@ -2,7 +2,7 @@ use std::{sync, time}; use anyhow::{Context, Result}; -use crate::app::{gb_repository, sessions}; +use crate::{gb_repository, sessions}; use super::events; diff --git a/src-tauri/src/app/watcher/handlers/check_current_session_tests.rs b/src-tauri/src/watcher/handlers/check_current_session_tests.rs similarity index 97% rename from src-tauri/src/app/watcher/handlers/check_current_session_tests.rs rename to src-tauri/src/watcher/handlers/check_current_session_tests.rs index ad63997db..ca3b22a13 100644 --- a/src-tauri/src/app/watcher/handlers/check_current_session_tests.rs +++ b/src-tauri/src/watcher/handlers/check_current_session_tests.rs @@ -2,7 +2,7 @@ use std::time; use anyhow::Result; -use crate::app::sessions; +use crate::sessions; use super::check_current_session::should_flush; diff --git a/src-tauri/src/app/watcher/handlers/check_fetch_project.rs b/src-tauri/src/watcher/handlers/check_fetch_project.rs similarity index 97% rename from src-tauri/src/app/watcher/handlers/check_fetch_project.rs rename to src-tauri/src/watcher/handlers/check_fetch_project.rs index 078d51a3d..39bef5a1d 100644 --- a/src-tauri/src/app/watcher/handlers/check_fetch_project.rs +++ b/src-tauri/src/watcher/handlers/check_fetch_project.rs @@ -2,7 +2,7 @@ use std::time; use anyhow::{Context, Result}; -use crate::app::projects; +use crate::projects; use super::events; diff --git a/src-tauri/src/app/watcher/handlers/fetch_project.rs b/src-tauri/src/watcher/handlers/fetch_project.rs similarity index 97% rename from src-tauri/src/app/watcher/handlers/fetch_project.rs rename to src-tauri/src/watcher/handlers/fetch_project.rs index ef34b4509..0192c7797 100644 --- a/src-tauri/src/app/watcher/handlers/fetch_project.rs +++ b/src-tauri/src/watcher/handlers/fetch_project.rs @@ -2,7 +2,7 @@ use std::time; use anyhow::{Context, Result}; -use crate::{app::gb_repository, projects}; +use crate::{gb_repository, projects}; use super::events; diff --git a/src-tauri/src/app/watcher/handlers/file_change.rs b/src-tauri/src/watcher/handlers/file_change.rs similarity index 94% rename from src-tauri/src/app/watcher/handlers/file_change.rs rename to src-tauri/src/watcher/handlers/file_change.rs index 2b0f1c157..f9109bf5b 100644 --- a/src-tauri/src/app/watcher/handlers/file_change.rs +++ b/src-tauri/src/watcher/handlers/file_change.rs @@ -1,6 +1,6 @@ use anyhow::Result; -use crate::app::watcher::events; +use crate::watcher::events; pub struct Handler {} diff --git a/src-tauri/src/app/watcher/handlers/flush_session.rs b/src-tauri/src/watcher/handlers/flush_session.rs similarity index 93% rename from src-tauri/src/app/watcher/handlers/flush_session.rs rename to src-tauri/src/watcher/handlers/flush_session.rs index 455df8164..57cd0955a 100644 --- a/src-tauri/src/app/watcher/handlers/flush_session.rs +++ b/src-tauri/src/watcher/handlers/flush_session.rs @@ -1,9 +1,6 @@ use anyhow::{anyhow, Context, Result}; -use crate::{ - app::{gb_repository, project_repository, sessions}, - projects, -}; +use crate::{gb_repository, project_repository, projects, sessions}; use super::events; diff --git a/src-tauri/src/app/watcher/handlers/git_file_change.rs b/src-tauri/src/watcher/handlers/git_file_change.rs similarity index 97% rename from src-tauri/src/app/watcher/handlers/git_file_change.rs rename to src-tauri/src/watcher/handlers/git_file_change.rs index fda6d7b88..2b5c41fdd 100644 --- a/src-tauri/src/app/watcher/handlers/git_file_change.rs +++ b/src-tauri/src/watcher/handlers/git_file_change.rs @@ -1,6 +1,6 @@ use anyhow::{Context, Result}; -use crate::{app::project_repository, projects}; +use crate::{project_repository, projects}; use super::events; diff --git a/src-tauri/src/app/watcher/handlers/index_handler.rs b/src-tauri/src/watcher/handlers/index_handler.rs similarity index 97% rename from src-tauri/src/app/watcher/handlers/index_handler.rs rename to src-tauri/src/watcher/handlers/index_handler.rs index 81318fc2c..6f43153ac 100644 --- a/src-tauri/src/app/watcher/handlers/index_handler.rs +++ b/src-tauri/src/watcher/handlers/index_handler.rs @@ -1,6 +1,6 @@ use anyhow::{Context, Result}; -use crate::app::{bookmarks, deltas, files, gb_repository, search, sessions}; +use crate::{bookmarks, deltas, files, gb_repository, search, sessions}; use super::events; diff --git a/src-tauri/src/app/watcher/handlers/mod.rs b/src-tauri/src/watcher/handlers/mod.rs similarity index 98% rename from src-tauri/src/app/watcher/handlers/mod.rs rename to src-tauri/src/watcher/handlers/mod.rs index 7d1ddcc0e..cea39350d 100644 --- a/src-tauri/src/app/watcher/handlers/mod.rs +++ b/src-tauri/src/watcher/handlers/mod.rs @@ -15,8 +15,7 @@ mod project_file_change_tests; use anyhow::{Context, Result}; use crate::{ - app::{deltas, files, gb_repository, sessions, bookmarks}, - events as app_events, projects, search, + bookmarks, deltas, events as app_events, files, gb_repository, projects, search, sessions, }; use super::events; diff --git a/src-tauri/src/app/watcher/handlers/project_file_change.rs b/src-tauri/src/watcher/handlers/project_file_change.rs similarity index 99% rename from src-tauri/src/app/watcher/handlers/project_file_change.rs rename to src-tauri/src/watcher/handlers/project_file_change.rs index 9c64fa6c3..bd6cee46b 100644 --- a/src-tauri/src/app/watcher/handlers/project_file_change.rs +++ b/src-tauri/src/watcher/handlers/project_file_change.rs @@ -3,9 +3,9 @@ use std::vec; use anyhow::{Context, Result}; use crate::{ - app::{deltas, gb_repository, project_repository, sessions}, - projects, + deltas, gb_repository, project_repository, projects, reader::{self, Reader}, + sessions, }; use super::events; diff --git a/src-tauri/src/app/watcher/handlers/project_file_change_tests.rs b/src-tauri/src/watcher/handlers/project_file_change_tests.rs similarity index 99% rename from src-tauri/src/app/watcher/handlers/project_file_change_tests.rs rename to src-tauri/src/watcher/handlers/project_file_change_tests.rs index a87d5ec47..b4fff3458 100644 --- a/src-tauri/src/app/watcher/handlers/project_file_change_tests.rs +++ b/src-tauri/src/watcher/handlers/project_file_change_tests.rs @@ -1,10 +1,7 @@ use anyhow::Result; use tempfile::tempdir; -use crate::{ - app::{deltas, gb_repository, project_repository, sessions}, - projects, storage, users, -}; +use crate::{deltas, gb_repository, project_repository, projects, sessions, storage, users}; use super::project_file_change::Handler; diff --git a/src-tauri/src/app/watcher/mod.rs b/src-tauri/src/watcher/mod.rs similarity index 100% rename from src-tauri/src/app/watcher/mod.rs rename to src-tauri/src/watcher/mod.rs diff --git a/src-tauri/src/app/watcher/watcher.rs b/src-tauri/src/watcher/watcher.rs similarity index 96% rename from src-tauri/src/app/watcher/watcher.rs rename to src-tauri/src/watcher/watcher.rs index d473c0ad9..6518ba637 100644 --- a/src-tauri/src/app/watcher/watcher.rs +++ b/src-tauri/src/watcher/watcher.rs @@ -1,10 +1,7 @@ use anyhow::Result; use crossbeam_channel::{select, unbounded}; -use crate::{ - app::{deltas, files, gb_repository, sessions, bookmarks}, - events, projects, search, -}; +use crate::{bookmarks, deltas, events, files, gb_repository, projects, search, sessions}; use super::{dispatchers, handlers};