mirror of
https://github.com/kuhyx/utils.git
synced 2026-11-10 19:07:17 +01:00
`crdt_sync` is pure Dart so it can run from CLI tools and headless systemd jobs, which means it takes closures instead of depending on flutter_secure_storage and google_sign_in. Every Flutter app then wrote the same ~390 lines to supply them, and five apps ended up carrying near-identical copies of firebase_backend.dart. Those copies drifted. `todo` gained an opt-out flag and a seeded-session path that home_inventory and wake_alarm never received, so the same bug was fixed in one copy and left live in the others -- which is the actual cost being paid here, not the line count. This package owns that glue once: the keystore adapter, the persisted per-install device id, the account store and a one-call bootstrap. A new app needs a SyncApp const and `openSync(kApp)`. The wrapper routes are a parameter rather than a constant, because todo's copy hardcoded its own `~/.config/todo/firebase_auth.json`. An extraction only one app could adopt would be worse than the copies. Also documents what made this hard to find: crdt_sync_dart's README covered only the *old* GitHub transport and never mentioned the Firebase surface at all, and sync_settings_ui -- a complete drop-in settings screen -- had no README whatsoever. The five existing apps stay on their copies and on crdt_sync_dart-v0.10.0. Migration is forward-only and those fallbacks are load-bearing; converging them is a separate task, and the README says so. 35 tests, 100% line coverage, no suppressions. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CFSGeWxHPY5rHUGrPqhcmG
31 lines
813 B
YAML
31 lines
813 B
YAML
name: crdt_sync_flutter
|
|
description: >-
|
|
The Flutter half of crdt_sync: keystore-backed Firebase credentials, a
|
|
persisted per-install device id, and a one-call bootstrap. Removes the
|
|
~150 lines of firebase_backend.dart every consuming app was copying.
|
|
publish_to: 'none'
|
|
version: 0.1.0
|
|
|
|
environment:
|
|
sdk: ^3.12.2
|
|
|
|
dependencies:
|
|
crdt_sync:
|
|
git:
|
|
url: https://github.com/kuhyx/utils
|
|
ref: crdt_sync_dart-v0.11.0
|
|
path: crdt_sync_dart
|
|
flutter:
|
|
sdk: flutter
|
|
flutter_secure_storage: ^9.2.4
|
|
# A real dependency, not a dev one: lib/testing/ ships the keystore fake so
|
|
# consuming apps can test their own sync wiring without rebuilding it.
|
|
flutter_test:
|
|
sdk: flutter
|
|
http: ^1.6.0
|
|
shared_preferences: ^2.5.3
|
|
uuid: ^4.5.1
|
|
|
|
dev_dependencies:
|
|
very_good_analysis: ^10.2.0
|