056459619b
Remove the draw_mode, move_count, is_won, and is_auto_completable fields from GameState; they are now &self methods deriving from the underlying card_game session (draw_mode from session config, move_count from history length, is_won/is_auto_completable from check_win/check_auto_complete). Tests previously fabricated these via direct field writes, which is no longer possible. Add gated test-support overrides on TestPileState (won/auto_completable/move_count) plus setters set_test_won, set_test_auto_completable, set_test_move_count, and set_test_draw_mode (re-deals the seed). All compiled out in production builds. Fix the field->method ripple across solitaire_data, solitaire_wasm, and solitaire_engine. Add a test-support dev-dependency to solitaire_data for the won-game storage test. cargo test --workspace and cargo clippy --workspace -- -D warnings pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
50 lines
1.9 KiB
TOML
50 lines
1.9 KiB
TOML
[package]
|
|
name = "solitaire_data"
|
|
version.workspace = true
|
|
license.workspace = true
|
|
edition.workspace = true
|
|
|
|
[dependencies]
|
|
solitaire_core = { workspace = true }
|
|
solitaire_sync = { workspace = true }
|
|
klondike = { workspace = true }
|
|
card_game = { workspace = true }
|
|
serde = { workspace = true }
|
|
serde_json = { workspace = true }
|
|
chrono = { workspace = true }
|
|
thiserror = { workspace = true }
|
|
async-trait = { workspace = true }
|
|
uuid = { workspace = true }
|
|
|
|
# These deps are not available / not needed on wasm32:
|
|
# dirs — platform data directories (no filesystem on browser)
|
|
# reqwest — native HTTP client (sync/analytics gated out on wasm32)
|
|
# tokio — OS-threaded async runtime (mio doesn't compile on wasm32)
|
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
|
dirs = { workspace = true }
|
|
reqwest = { workspace = true }
|
|
tokio = { workspace = true }
|
|
|
|
# `keyring-core` is the typed Entry/Error API used by
|
|
# `auth_tokens`. The crate's own dependency tree pulls in
|
|
# `rpassword` which uses `libc::__errno_location` — a symbol the
|
|
# Android NDK doesn't expose (`__errno` lives at a different path
|
|
# on bionic). On Android `auth_tokens` falls back to a stub
|
|
# implementation that always returns `KeychainUnavailable`; the
|
|
# real backend lands when we wire Android Keystore via JNI.
|
|
[target.'cfg(all(not(target_os = "android"), not(target_arch = "wasm32")))'.dependencies]
|
|
keyring-core = { workspace = true }
|
|
|
|
[target.'cfg(target_os = "android")'.dependencies]
|
|
jni = { workspace = true }
|
|
|
|
[dev-dependencies]
|
|
solitaire_core = { workspace = true, features = ["test-support"] }
|
|
solitaire_server = { path = "../solitaire_server" }
|
|
solitaire_sync = { workspace = true }
|
|
axum = { workspace = true }
|
|
sqlx = { workspace = true }
|
|
jsonwebtoken = { workspace = true }
|
|
uuid = { workspace = true }
|
|
chrono = { workspace = true }
|