mobile bluesky app made with flutter lazurite.stormlightlabs.org/
mobile bluesky flutter
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: add objectbox to gh actions

+153 -17
+1 -1
.github/workflows/ci.yml
··· 32 32 run: flutter pub get 33 33 34 34 - name: Install ObjectBox native library 35 - run: curl -sSfL https://raw.githubusercontent.com/objectbox/objectbox-dart/main/install.sh | bash 35 + run: bash scripts/objectbox_runtime.sh install 36 36 37 37 - name: Analyze code 38 38 run: flutter analyze
+27 -16
DEVELOPMENT.md
··· 4 4 5 5 ```sh 6 6 flutter pub get 7 + just objectbox-setup # once per machine (macOS/Linux) 7 8 just gen 8 9 flutter run 9 10 ``` ··· 12 13 13 14 Use `just` for common workflows: 14 15 15 - | Command | Description | 16 - | ------------- | -------------------------------------- | 17 - | `just format` | Run `dart format` | 18 - | `just lint` | Run `flutter analyze` | 19 - | `just test` | Run the full `flutter test` suite | 20 - | `just gen` | Run `build_runner` for code generation | 21 - | `just check` | Format, lint, and test in sequence | 16 + | Command | Description | 17 + | ---------------------- | ----------------------------------------------------- | 18 + | `just format` | Run `dart format` | 19 + | `just lint` | Run `flutter analyze` | 20 + | `just objectbox-setup` | Install pinned ObjectBox native runtime (macOS/Linux) | 21 + | `just objectbox-check` | Verify ObjectBox native runtime is present | 22 + | `just test` | Run the full `flutter test` suite | 23 + | `just gen` | Run `build_runner` for code generation | 24 + | `just check` | Format, lint, and test in sequence | 22 25 23 26 ## Architecture 24 27 ··· 94 97 95 98 #### Running unit tests (ObjectBox native library) 96 99 97 - ObjectBox requires a platform native library to run `flutter test` locally: 100 + ObjectBox requires a platform native library to run `flutter test` locally. 101 + Lazurite standardizes this setup through a pinned installer script. 102 + 103 + Supported local platforms: macOS and Linux. 104 + 105 + Run this once per machine: 98 106 99 107 ```sh 100 - bash <(curl -s https://raw.githubusercontent.com/objectbox/objectbox-dart/main/install.sh) 108 + just objectbox-setup 101 109 ``` 102 110 103 - This installs `lib/libobjectbox.dylib` (macOS) or the equivalent. The file is gitignored and not required to build the app. 111 + `just test` and `just test-quiet` intentionally run a preflight check 112 + (`just objectbox-check`) and fail fast with setup instructions if the 113 + runtime is missing. 104 114 105 115 ## Semantic Search 106 116 ··· 119 129 120 130 **`LikedPostsRepository`** (`lib/features/feed/data/liked_posts_repository.dart`): 121 131 122 - | Method | Description | 123 - | -------------------------------------------- | -------------------------------------------------------------------------------------------------------- | 124 - | `syncLikes(accountDid)` | Paginate `getActorLikes` until a known URI is hit or 1000-post cap is reached; evicts oldest on overflow | 125 - | `getLikedPosts(accountDid, {limit, offset})` | Paginated query ordered by `likedAt DESC` | 126 - | `removeLike(accountDid, postUri)` | Delete a single entry | 132 + | Method | Description | 133 + | -------------------------------------------- | ----------------------------------------------------------------------------- | 134 + | `syncLikes(accountDid)` | Paginate `getActorLikes` until a known URI is hit or 1000-post cap is reached | 135 + | | evicts oldest on overflow | 136 + | `getLikedPosts(accountDid, {limit, offset})` | Paginated query ordered by `likedAt DESC` | 137 + | `removeLike(accountDid, postUri)` | Delete a single entry | 127 138 128 139 ## Testing 129 140 ··· 132 143 ```sh 133 144 just test 134 145 # or with failure-only reporter (recommended for large suites): 135 - flutter test --reporter=failures-only 146 + just test-quiet 136 147 ``` 137 148 138 149 Coverage target: **>99%** (±5% acceptable). All new code must have tests. Widget tests use `NativeDatabase.memory()` for Drift and mocktail for API mocks.
+2
README.md
··· 101 101 ``` 102 102 103 103 For development setup, tooling, database schema, and contribution notes, see [DEVELOPMENT.md](DEVELOPMENT.md). 104 + If you run tests locally on macOS or Linux, run `just objectbox-setup` once 105 + to install the pinned ObjectBox native runtime. 104 106 105 107 ## References 106 108
+10
justfile
··· 11 11 lint: 12 12 flutter analyze 13 13 14 + # Install pinned ObjectBox runtime library for local development 15 + objectbox-setup: 16 + bash scripts/objectbox_runtime.sh install 17 + 18 + # Verify ObjectBox runtime library is present (fails fast if missing) 19 + objectbox-check: 20 + bash scripts/objectbox_runtime.sh check 21 + 14 22 # Test with failures only to focus on failures and hanging tests 15 23 test-quiet *paths='': 24 + just objectbox-check 16 25 flutter test {{ paths }} --reporter=failures-only --fail-fast --timeout=120s 17 26 18 27 # Run all tests 19 28 test *paths='': 29 + just objectbox-check 20 30 flutter test {{ paths }} --fail-fast --timeout=120s 21 31 22 32 generate:
+113
scripts/objectbox_runtime.sh
··· 1 + #!/usr/bin/env bash 2 + set -euo pipefail 3 + 4 + readonly OBJECTBOX_DART_COMMIT="5c96e04" 5 + readonly INSTALL_URL="https://raw.githubusercontent.com/objectbox/objectbox-dart/${OBJECTBOX_DART_COMMIT}/install.sh" 6 + readonly SCRIPT_NAME="$(basename "$0")" 7 + 8 + usage() { 9 + cat <<'EOF' 10 + Usage: 11 + scripts/objectbox_runtime.sh check 12 + scripts/objectbox_runtime.sh install 13 + 14 + Commands: 15 + check Verify the ObjectBox native runtime library exists for this platform. 16 + install Install ObjectBox native runtime from a pinned upstream revision, 17 + then run check. 18 + EOF 19 + } 20 + 21 + platform_label() { 22 + case "$(uname -s)" in 23 + Darwin) echo "macos" ;; 24 + Linux) echo "linux" ;; 25 + *) echo "unsupported" ;; 26 + esac 27 + } 28 + 29 + expected_libs() { 30 + case "$(platform_label)" in 31 + macos) 32 + printf '%s\n' "lib/libobjectbox.dylib" 33 + ;; 34 + linux) 35 + printf '%s\n' \ 36 + "lib/libobjectbox.so" \ 37 + "lib/libobjectbox-arm.so" \ 38 + "lib/libobjectbox-arm64.so" 39 + ;; 40 + *) 41 + return 1 42 + ;; 43 + esac 44 + } 45 + 46 + check_runtime() { 47 + local platform 48 + platform="$(platform_label)" 49 + 50 + if [[ "${platform}" == "unsupported" ]]; then 51 + echo "Unsupported platform: $(uname -s). Supported local platforms: macOS and Linux." 52 + return 2 53 + fi 54 + 55 + local found=1 56 + while IFS= read -r lib_path; do 57 + if [[ -f "${lib_path}" ]]; then 58 + found=0 59 + break 60 + fi 61 + done < <(expected_libs) 62 + 63 + if [[ "${found}" -ne 0 ]]; then 64 + cat <<EOF 65 + ObjectBox native runtime library is missing for ${platform}. 66 + 67 + Expected one of: 68 + $(expected_libs | sed 's/^/ - /') 69 + 70 + Install it with: 71 + just objectbox-setup 72 + 73 + Or run directly: 74 + ${SCRIPT_NAME} install 75 + EOF 76 + return 1 77 + fi 78 + 79 + echo "ObjectBox runtime check passed for ${platform}." 80 + } 81 + 82 + install_runtime() { 83 + local platform 84 + platform="$(platform_label)" 85 + if [[ "${platform}" == "unsupported" ]]; then 86 + echo "Unsupported platform: $(uname -s). Supported local platforms: macOS and Linux." 87 + return 2 88 + fi 89 + 90 + echo "Installing ObjectBox runtime from pinned revision ${OBJECTBOX_DART_COMMIT}..." 91 + curl -sSfL "${INSTALL_URL}" | bash 92 + check_runtime 93 + } 94 + 95 + main() { 96 + if [[ $# -ne 1 ]]; then 97 + usage 98 + return 1 99 + fi 100 + 101 + case "$1" in 102 + check) check_runtime ;; 103 + install) install_runtime ;; 104 + -h|--help|help) usage ;; 105 + *) 106 + echo "Unknown command: $1" 107 + usage 108 + return 1 109 + ;; 110 + esac 111 + } 112 + 113 + main "$@"