Skip to content

Commit 9db229c

Browse files
unhappychoiceclaude
andcommitted
refactor: complete Clean Architecture reorganization
Reorganize remaining src root files and tests according to Clean Architecture: **Domain Layer:** - Move src/error.rs → src/domain/error.rs (domain errors) - Move tests/unit/error_tests.rs → tests/unit/domain/error_tests.rs **Infrastructure Layer:** - Move src/logging.rs → src/infrastructure/logging.rs (file logging) - Move src/repository_manager.rs → src/infrastructure/repository_manager.rs (git operations) **Presentation Layer:** - Move src/signal_handler.rs → src/presentation/signal_handler.rs (UI signal handling) - Move src/sharing.rs → src/presentation/sharing.rs (social media sharing) - Move tests/unit/sharing_tests.rs → tests/unit/presentation/sharing_tests.rs - Move tests/unit/extractor_unit_tests.rs → tests/unit/domain/services/extractor_unit_tests.rs - Move tests/unit/game_unit_tests.rs → tests/unit/presentation/game/game_unit_tests.rs **Other Changes:** - Update all import paths to reflect new module locations - Update module declarations in lib.rs and test modules - Clean up tests/unit/mod.rs to match src structure - Update external imports from gittype::* paths - No implementation changes, pure refactoring - All 589 tests passing The codebase now follows Clean Architecture with clear separation of concerns: - Domain: Business logic and domain models - Infrastructure: External system integrations - Presentation: UI and external interfaces 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent cb31b81 commit 9db229c

37 files changed

+52
-52
lines changed
File renamed without changes.

src/domain/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
pub mod error;
12
pub mod models;
23
pub mod repositories;
34
pub mod services;

src/domain/repositories/session_repository.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::infrastructure::storage::{
55
use crate::domain::models::storage::{SaveStageParams, SessionResultData, SessionStageResult, StoredRepository, StoredSession};
66
use crate::domain::models::{Challenge, GitRepository, SessionResult};
77
use crate::domain::services::scoring::{StageResult, StageTracker};
8-
use crate::{error::GitTypeError, Result};
8+
use crate::{domain::error::GitTypeError, Result};
99
use std::sync::{Arc, Mutex};
1010

1111
type StageResultTuple = (String, StageResult, usize, Option<Challenge>);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::{error::GitTypeError, Result};
1+
use crate::{domain::error::GitTypeError, Result};
22
use chrono;
33
use log4rs::{
44
append::{console::ConsoleAppender, file::FileAppender},

src/infrastructure/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
pub mod cache;
22
pub mod config;
33
pub mod external;
4+
pub mod logging;
5+
pub mod repository_manager;
46
pub mod storage;
57
pub mod version;

src/infrastructure/storage/daos/challenge_dao.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use super::super::database::Database;
22
use crate::domain::models::Challenge;
3-
use crate::{error::GitTypeError, Result};
3+
use crate::{domain::error::GitTypeError, Result};
44
use rusqlite::{params, Transaction};
55
use serde_json;
66

src/infrastructure/storage/daos/repository_dao.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use super::super::database::Database;
22
use crate::domain::models::GitRepository;
33
use crate::domain::models::storage::{StoredRepository, StoredRepositoryWithLanguages};
4-
use crate::{error::GitTypeError, Result};
4+
use crate::{domain::error::GitTypeError, Result};
55
use rusqlite::{params, Transaction};
66

77
pub struct RepositoryDao<'a> {

src/infrastructure/storage/daos/session_dao.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use super::super::database::Database;
22
use crate::domain::models::{GitRepository, SessionResult};
33
use crate::domain::models::storage::{SaveStageParams, SessionResultData, SessionStageResult, StoredSession};
4-
use crate::{error::GitTypeError, Result};
4+
use crate::{domain::error::GitTypeError, Result};
55
use chrono::{DateTime, Utc};
66
use rusqlite::{params, OptionalExtension, Transaction};
77
use std::time::{SystemTime, UNIX_EPOCH};

src/infrastructure/storage/daos/stage_dao.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use super::super::database::Database;
22
use crate::domain::models::storage::{DifficultyStats, LanguageStats, StageStatistics, StoredStageResult};
3-
use crate::{error::GitTypeError, Result};
3+
use crate::{domain::error::GitTypeError, Result};
44
use chrono::{DateTime, Utc};
55
use rusqlite::params;
66

0 commit comments

Comments
 (0)