refactor: introduce cargo workspace + psysonic-core crate (M1/7)

First milestone of the workspace crate split. Sets up the workspace
skeleton and extracts shared logging + cross-crate port traits into a
new psysonic-core crate.

  src-tauri/Cargo.toml            now defines [workspace]; top package
                                  becomes the workspace root.
  crates/psysonic-core/           new lib crate, no Tauri-handler code:
    src/logging.rs                full logging facade (was src/logging.rs)
    src/ports.rs                  PlaybackQuery + AnalysisOrchestrator
                                  trait declarations (no impls yet)

The top crate re-exports `psysonic_core::logging` and the
`app_eprintln!` / `app_deprintln!` macros so every existing
`crate::logging::*` and `crate::app_eprintln!` callsite keeps working
unchanged.

Port traits intentionally take `tauri::AppHandle` — psysonic-core is a
workspace-internal crate, so depending on Tauri here is a feature, not
a leak. Implementers will register themselves as
`Arc<dyn PlaybackQuery>` / `Arc<dyn AnalysisOrchestrator>` Tauri State
in M2/M3.

Behaviour preserving. Cargo check + clippy --workspace clean.
This commit is contained in:
Psychotoxical
2026-05-09 13:06:28 +02:00
parent 9455879044
commit 7718ac3ee5
7 changed files with 104 additions and 5 deletions
+13 -3
View File
@@ -1,13 +1,22 @@
[workspace]
members = ["crates/*"]
resolver = "2"
[workspace.package]
version = "1.46.0-dev"
edition = "2021"
rust-version = "1.89"
[package]
name = "psysonic"
version = "1.46.0-dev"
version.workspace = true
description = "Psysonic Desktop Music Player"
authors = []
license = ""
repository = ""
default-run = "psysonic"
edition = "2021"
rust-version = "1.89"
edition.workspace = true
rust-version.workspace = true
[lib]
name = "psysonic_lib"
@@ -21,6 +30,7 @@ path = "src/main.rs"
tauri-build = { version = "2", features = [] }
[dependencies]
psysonic-core = { path = "crates/psysonic-core" }
tauri = { version = "2", features = ["tray-icon", "image-png"] }
tauri-plugin-single-instance = "2"
tauri-plugin-shell = "2"