Skip to content

Commit 777273d

Browse files
ndbroadbentclaude
andcommitted
Add CLI tool and test infrastructure with real SQLite fixtures
- Create ctm-cli binary for debugging (JTAG-style access to internals) - list-chats: List all iMessage chats with contact resolution - contacts: Show contacts index statistics - check-access: Verify Full Disk Access permission - Add FactoryBot-style test data builders (test_fixtures module) - TestIMessageDb: Creates in-memory iMessage database with real schema - TestAddressBookDb: Creates in-memory AddressBook database with real schema - Builders: HandleBuilder, ChatBuilder, MessageBuilder, ContactBuilder - Set up fixtures/schemas/ with versioned database schemas - imessage_26.0.1.sql: Real iMessage database schema - addressbook_26.0.1.sql: Real AddressBook database schema - scripts/update-schemas.sh: Schema dump/diff/version script - Fix deduped_id vs handle_id bug in resolve_chat_display_name - Handle::dedupe creates NEW sequential IDs, not identity mapping - Added deduped_handles parameter to translate before lookup - Refactor: Extract shared code into lib.rs, simplify main.rs 28 tests passing (14 unit + 8 integration + 6 fixture tests) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent a6a8290 commit 777273d

File tree

16 files changed

+2018
-251
lines changed

16 files changed

+2018
-251
lines changed

src-tauri/Cargo.lock

Lines changed: 115 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,35 @@ rust-version = "1.70"
1212
tauri-build = { version = "2", features = [] }
1313

1414
[dependencies]
15-
tauri = { version = "2", features = [] }
16-
tauri-plugin-shell = "2"
15+
tauri = { version = "2", features = [], optional = true }
16+
tauri-plugin-shell = { version = "2", optional = true }
1717
serde = { version = "1", features = ["derive"] }
1818
serde_json = "1"
1919
tokio = { version = "1", features = ["full"] }
2020
anyhow = "1"
2121
thiserror = "2"
22+
clap = { version = "4", features = ["derive"] }
2223

2324
# iMessage database access - the core functionality
2425
imessage-database = "3"
2526
rusqlite = "0.37"
2627

28+
[lib]
29+
name = "chat_to_map_desktop"
30+
path = "src/lib.rs"
31+
32+
[[bin]]
33+
name = "chat-to-map-desktop"
34+
path = "src/main.rs"
35+
required-features = ["desktop"]
36+
37+
[[bin]]
38+
name = "ctm-cli"
39+
path = "src/cli.rs"
40+
2741
[features]
28-
default = ["custom-protocol"]
29-
custom-protocol = ["tauri/custom-protocol"]
42+
default = ["desktop"]
43+
desktop = ["tauri", "tauri-plugin-shell", "tauri/custom-protocol"]
3044

3145
[profile.release]
3246
panic = "abort"

src-tauri/build.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
fn main() {
2-
tauri_build::build()
2+
// Only run tauri_build when building the desktop app
3+
if std::env::var("CARGO_FEATURE_DESKTOP").is_ok() {
4+
tauri_build::build();
5+
}
36
}

0 commit comments

Comments
 (0)