Highly ambitious ATProtocol AppView service and sdks
0
fork

Configure Feed

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

trying move cache to the image setup

Chad Miller 075885b9 99bc759c

+20 -15
+2 -1
frontend/deno.json
··· 15 15 }, 16 16 "compilerOptions": { 17 17 "jsx": "precompile", 18 - "jsxImportSource": "preact" 18 + "jsxImportSource": "preact", 19 + "types": ["./globals.d.ts"] 19 20 }, 20 21 "imports": { 21 22 "@slices/oauth": "jsr:@slices/oauth@^0.3.0",
+15 -13
frontend/flake.nix
··· 17 17 config = { allowUnfree = true; }; 18 18 }; 19 19 20 - # Package the frontend source 20 + # Compile the Deno binary with all dependencies 21 21 slice-frontend = pkgs.stdenv.mkDerivation { 22 22 pname = "slice-frontend"; 23 23 version = "0.1.0"; 24 24 src = ./.; 25 25 26 - buildInputs = [ pkgs.deno pkgs.cacert ]; 26 + nativeBuildInputs = [ pkgs.deno ]; 27 + 28 + # Fixed output derivation to allow network access 29 + outputHashMode = "recursive"; 30 + outputHashAlgo = "sha256"; 31 + outputHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="; 27 32 28 33 buildPhase = '' 34 + export HOME=$PWD 29 35 export DENO_DIR=$PWD/.deno 30 - ${pkgs.deno}/bin/deno cache --unstable-kv src/main.ts 36 + mkdir -p .deno 37 + deno compile -A --unstable-kv --no-check --output slice-frontend src/main.ts 31 38 ''; 32 39 33 40 installPhase = '' 34 - mkdir -p $out 35 - cp -r . $out/ 36 - # Copy the cached dependencies 37 - cp -r .deno $out/.deno 41 + mkdir -p $out/bin 42 + cp slice-frontend $out/bin/ 38 43 ''; 39 44 }; 40 45 ··· 50 55 copyToRoot = pkgs.buildEnv { 51 56 name = "image-root"; 52 57 paths = [ 53 - pkgs.deno 58 + slice-frontend 54 59 pkgs.sqlite 55 60 pkgs.cacert 56 61 ]; ··· 59 64 60 65 runAsRoot = '' 61 66 #!${pkgs.runtimeShell} 62 - mkdir -p /app 63 - cp -r ${slice-frontend}/* /app/ 64 67 # Create data directory for Deno KV with proper permissions 65 68 mkdir -p /data 66 69 chmod 755 /data 67 70 ''; 68 71 69 72 config = { 70 - Cmd = [ "/bin/deno" "run" "-A" "--unstable-kv" "/app/src/main.ts" ]; 73 + Cmd = [ "/bin/slice-frontend" ]; 71 74 ExposedPorts = { 72 75 "8080/tcp" = {}; 73 76 }; 74 - WorkingDir = "/app"; 77 + WorkingDir = "/"; 75 78 Env = [ 76 79 "PORT=8080" 77 80 "KV_PATH=/data/kv.db" 78 - "DENO_DIR=/app/.deno" 79 81 ]; 80 82 }; 81 83 };
+3 -1
frontend/globals.d.ts
··· 2 2 3 3 declare module "preact" { 4 4 namespace JSX { 5 - interface HTMLAttributes extends HtmxAttributes {} 5 + interface HTMLAttributes extends HtmxAttributes { 6 + _?: string; 7 + } 6 8 } 7 9 }