Live location tracking and playback for the game "manhunt"

Redo formatters

bwc9876.dev 9a68a299 2b894eb3

verified
+49 -38
+1
.gitignore
··· 1 1 result 2 2 target 3 3 *.jks 4 + .prettiercache
+2
.prettierignore
··· 1 1 frontend/dist 2 2 frontend/node_modules 3 + frontend/package-lock.json 3 4 backend/gen 4 5 backend/target 5 6 result 7 + .prettiercache
+7 -3
README.md
··· 1 1 # Man Hunt 2 2 3 + [![built with garnix](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fgarnix.io%2Fapi%2Fbadges%2FBwc9876%2Fmanhunt-app%3Fbranch%3Dmain)](https://garnix.io/repo/Bwc9876/manhunt-app) 4 + 3 5 An iOS and Android app that lets you play man hunt with friends. 4 6 5 7 The game is played over WebRTC Data Channels and is entirely P2P (except for the ··· 15 17 16 18 - [Rust](https://rustup.rs) 17 19 - [Just](https://just.systems) (`cargo install just`) 20 + - **On Windows**: Some implementation of `sh` (Git for Windows works well) 18 21 - [Tauri's Pre-reqs](https://tauri.app/start/prerequisites/) 19 - - [(Also pre-reqs for mobile dev if you are working on the app part)](https://tauri.app/start/prerequisites/#configure-for-mobile-targets) 22 + - [(Also pre-reqs for mobile dev if you are working on the app part)](https://tauri.app/start/prerequisites/#configure-for-mobile-targets) 20 23 - Tauri's CLI (`cargo install tauri-cli`) 21 24 - [NodeJS](https://nodejs.org) 25 + - [Prettier](https://prettier.io/) (`npm add -G prettier`) 22 26 23 27 #### With Nix 24 28 ··· 34 38 35 39 - `just dev`: Will run the app locally on your computer, this will open a 36 40 WebView with the frontend 37 - - Note: all geolocation returned from tauri-plugin-geolocation will be hard 38 - coded to `(0.0, 0.0)` in this mode. 41 + - Note: all geolocation returned from tauri-plugin-geolocation will be hard 42 + coded to `(0.0, 0.0)` in this mode. 39 43 - `just dev-android`: Will run the app on a connect Android device or VM via ADB 40 44 - `just signaling`: Will run the signaling server on port `3536` 41 45 (this is needed for clients to connect)
+11 -13
backend/capabilities/default.json
··· 1 1 { 2 - "$schema": "../gen/schemas/desktop-schema.json", 3 - "identifier": "default", 4 - "description": "Capability for the main window", 5 - "windows": [ 6 - "main" 7 - ], 8 - "permissions": [ 9 - "core:default", 10 - "opener:default", 11 - "notification:default", 12 - "log:default", 13 - "geolocation:default" 14 - ] 2 + "$schema": "../gen/schemas/desktop-schema.json", 3 + "identifier": "default", 4 + "description": "Capability for the main window", 5 + "windows": ["main"], 6 + "permissions": [ 7 + "core:default", 8 + "opener:default", 9 + "notification:default", 10 + "log:default", 11 + "geolocation:default" 12 + ] 15 13 }
+15 -4
flake.nix
··· 15 15 }; 16 16 17 17 flakelight.builtinFormatters = false; 18 - formatters = pkgs: { 19 - "*.nix" = "${pkgs.alejandra}/bin/alejandra ."; 20 - "*.{js,ts,jsx,tsx,md,json}" = "${pkgs.prettier}/bin/prettier --write . --config frontend/.prettierrc.yaml"; 21 - "*.rs" = "${pkgs.rustfmt}"; 18 + formatters = pkgs: let 19 + prettier = "${pkgs.prettier}/bin/prettier --write ."; 20 + alejandra = "${pkgs.alejandra}/bin/alejandra ."; 21 + rustfmt = "${pkgs.rustfmt}/bin/rustfmt"; 22 + just = "${pkgs.just}/bin/just --fmt --unstable"; 23 + in { 24 + "justfile" = just; 25 + "*.nix" = alejandra; 26 + "*.js" = prettier; 27 + "*.ts" = prettier; 28 + "*.jsx" = prettier; 29 + "*.tsx" = prettier; 30 + "*.md" = prettier; 31 + "*.json" = prettier; 32 + "*.rs" = rustfmt; 22 33 }; 23 34 24 35 devShell = pkgs: let
-4
frontend/.prettierignore
··· 1 - dist 2 - node_modules 3 - package-lock.json 4 -
frontend/.prettierrc.yaml .prettierrc.yaml
-1
frontend/package.json
··· 8 8 "build": "tsc && vite build", 9 9 "preview": "vite preview", 10 10 "lint": "prettier --check . && tsc && eslint --cache", 11 - "format": "prettier --write .", 12 11 "tauri": "tauri" 13 12 }, 14 13 "dependencies": {
+3 -3
garnix.yaml
··· 1 1 $schema: https://garnix.io/api/garnix-config-schema.json 2 2 builds: 3 - exclude: [] 4 - include: 5 - - "checks.x86_64-linux.*" 3 + exclude: [] 4 + include: 5 + - "checks.x86_64-linux.*"
+10 -10
justfile
··· 1 1 _default: 2 - @just --list --unsorted --justfile {{justfile()}} 3 - 2 + @just --list --unsorted --justfile {{ justfile() }} 4 3 5 4 # Perform setup for the frontend using `npm` 6 - [working-directory: 'frontend'] 5 + [working-directory('frontend')] 7 6 setup-frontend: 8 7 npm install --no-fund --no-audit 9 8 ··· 14 13 # Format everything 15 14 fmt: 16 15 cargo fmt 17 - cd frontend && npm run format 16 + prettier --write . --cache --cache-location .prettiercache --log-level warn 17 + just --fmt --unstable 18 18 19 19 # Connect and run on an Android VM/Physical device 20 20 dev-android: 21 21 cargo tauri android dev 22 22 23 23 # Run a check on the backend 24 - [working-directory: 'backend'] 24 + [working-directory('backend')] 25 25 check-backend: 26 26 cargo fmt --check 27 27 cargo check 28 28 cargo clippy --fix --allow-dirty --allow-staged -- -D warnings 29 29 30 - [working-directory: 'manhunt-signaling'] 30 + [working-directory('manhunt-signaling')] 31 31 check-signaling: 32 32 cargo fmt --check 33 33 cargo check 34 34 cargo clippy --fix --allow-dirty --allow-staged -- -D warnings 35 35 36 36 # Run lint on the frontend 37 - [working-directory: 'frontend'] 37 + [working-directory('frontend')] 38 38 check-frontend: 39 39 npm run lint 40 40 41 41 # Export types from the backend to TypeScript bindings 42 - [working-directory: 'backend'] 42 + [working-directory('backend')] 43 43 export-types: 44 44 cargo run --bin export-types ../frontend/src/bindings.ts 45 - prettier --write ../frontend/src/bindings.ts 45 + prettier --write ../frontend/src/bindings.ts --config ../.prettierrc.yaml 46 46 47 47 # Start the signaling server on localhost:3536 48 - [working-directory: 'manhunt-signaling'] 48 + [working-directory('manhunt-signaling')] 49 49 signaling: 50 50 cargo run 0.0.0.0:3536