This commit is contained in:
EthanShoeDev
2025-09-24 04:04:13 -04:00
parent 05b14a428e
commit 89a39fdd63
9 changed files with 455 additions and 62 deletions

322
.dockerignore Normal file
View File

@@ -0,0 +1,322 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# Dependencies
**/node_modules
**/.pnp
**/.pnp.js
# Testing
**/coverage
# Turbo
**/.turbo
# Vercel
**/.vercel
# Build Outputs
**/.next/
**/out/
**/dist
# Debug
**/npm-debug.log*
**/yarn-debug.log*
**/yarn-error.log*
# Misc
**/.DS_Store
**/*.pem
**/tmp/
**/**/tsconfig.tsbuildinfo
**/dep-log.json
**/mnt/*
**/*.log
**/.turbo/
# From apps/mobile/.gitignore
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files
# dependencies
apps/mobile/**/node_modules/
# Expo
apps/mobile/**/.expo/
apps/mobile/**/dist/
apps/mobile/**/web-build/
apps/mobile/**/expo-env.d.ts
# Native
apps/mobile/**/.kotlin/
apps/mobile/**/*.orig.*
apps/mobile/**/*.jks
apps/mobile/**/*.p8
apps/mobile/**/*.p12
apps/mobile/**/*.key
apps/mobile/**/*.mobileprovision
# Metro
apps/mobile/**/.metro-health-check*
# debug
apps/mobile/**/npm-debug.*
apps/mobile/**/yarn-debug.*
apps/mobile/**/yarn-error.*
# macOS
apps/mobile/**/.DS_Store
apps/mobile/**/*.pem
# local env files
apps/mobile/**/.env*.local
# typescript
apps/mobile/**/*.tsbuildinfo
# https://docs.expo.dev/workflow/continuous-native-generation/
apps/mobile/**/android/
apps/mobile/**/ios/
# From apps/web/.gitignore
# build output
apps/web/**/dist/
# generated types
apps/web/**/.astro/
# dependencies
apps/web/**/node_modules/
# logs
apps/web/**/npm-debug.log*
apps/web/**/yarn-debug.log*
apps/web/**/yarn-error.log*
apps/web/**/pnpm-debug.log*
# environment variables
apps/web/**/.env
apps/web/**/.env.production
# macOS-specific files
apps/web/**/.DS_Store
# jetbrains setting folder
apps/web/**/.idea/
# From packages/react-native-uniffi-russh/.gitignore
# OSX
#
packages/react-native-uniffi-russh/**/.DS_Store
# XDE
packages/react-native-uniffi-russh/**/.expo/
# VSCode
packages/react-native-uniffi-russh/**/.vscode/
packages/react-native-uniffi-russh/**/jsconfig.json
# Xcode
#
packages/react-native-uniffi-russh/**/build/
packages/react-native-uniffi-russh/**/*.pbxuser
!packages/react-native-uniffi-russh/**/default.pbxuser
packages/react-native-uniffi-russh/**/*.mode1v3
!packages/react-native-uniffi-russh/**/default.mode1v3
packages/react-native-uniffi-russh/**/*.mode2v3
!packages/react-native-uniffi-russh/**/default.mode2v3
packages/react-native-uniffi-russh/**/*.perspectivev3
!packages/react-native-uniffi-russh/**/default.perspectivev3
packages/react-native-uniffi-russh/**/xcuserdata
packages/react-native-uniffi-russh/**/*.xccheckout
packages/react-native-uniffi-russh/**/*.moved-aside
packages/react-native-uniffi-russh/**/DerivedData
packages/react-native-uniffi-russh/**/*.hmap
packages/react-native-uniffi-russh/**/*.ipa
packages/react-native-uniffi-russh/**/*.xcuserstate
packages/react-native-uniffi-russh/**/project.xcworkspace
packages/react-native-uniffi-russh/**/**/.xcode.env.local
# Android/IJ
#
packages/react-native-uniffi-russh/**/.classpath
packages/react-native-uniffi-russh/**/.cxx
packages/react-native-uniffi-russh/**/.gradle
packages/react-native-uniffi-russh/**/.idea
packages/react-native-uniffi-russh/**/.project
packages/react-native-uniffi-russh/**/.settings
packages/react-native-uniffi-russh/**/local.properties
packages/react-native-uniffi-russh/**/android.iml
# Cocoapods
#
packages/react-native-uniffi-russh/**/example/ios/Pods
# Ruby
packages/react-native-uniffi-russh/**/example/vendor/
# node.js
#
packages/react-native-uniffi-russh/**/node_modules/
packages/react-native-uniffi-russh/**/npm-debug.log
packages/react-native-uniffi-russh/**/yarn-debug.log
packages/react-native-uniffi-russh/**/yarn-error.log
# BUCK
packages/react-native-uniffi-russh/**/buck-out/
packages/react-native-uniffi-russh/**/\.buckd/
packages/react-native-uniffi-russh/**/android/app/libs
packages/react-native-uniffi-russh/**/android/keystores/debug.keystore
# Yarn
packages/react-native-uniffi-russh/**/.yarn/*
!packages/react-native-uniffi-russh/**/.yarn/patches
!packages/react-native-uniffi-russh/**/.yarn/plugins
!packages/react-native-uniffi-russh/**/.yarn/releases
!packages/react-native-uniffi-russh/**/.yarn/sdks
!packages/react-native-uniffi-russh/**/.yarn/versions
# Expo
packages/react-native-uniffi-russh/**/.expo/
# Turborepo
packages/react-native-uniffi-russh/**/.turbo/
# generated by bob
packages/react-native-uniffi-russh/lib
# React Native Codegen
packages/react-native-uniffi-russh/**/ios/generated
packages/react-native-uniffi-russh/**/android/generated
# React Native Nitro Modules
packages/react-native-uniffi-russh/**/nitrogen/
# From uniffi-bindgen-react-native
# rust_modules/
packages/react-native-uniffi-russh/**/*.a
packages/react-native-uniffi-russh/android
packages/react-native-uniffi-russh/ios
packages/react-native-uniffi-russh/cpp
packages/react-native-uniffi-russh/src/*
packages/react-native-uniffi-russh/**/*.xcframework
packages/react-native-uniffi-russh/**/*.podspec
!packages/react-native-uniffi-russh/**/src/api.ts
# From packages/react-native-uniffi-russh/rust/.gitignore
# Created by https://www.toptal.com/developers/gitignore/api/rust,xcode,android
# Edit at https://www.toptal.com/developers/gitignore?templates=rust,xcode,android
### Android ###
# Gradle files
packages/react-native-uniffi-russh/rust/**/.gradle/
packages/react-native-uniffi-russh/rust/**/build/
# Local configuration file (sdk path, etc)
packages/react-native-uniffi-russh/rust/**/local.properties
# Log/OS Files
packages/react-native-uniffi-russh/rust/**/*.log
# Android Studio generated files and folders
packages/react-native-uniffi-russh/rust/**/captures/
packages/react-native-uniffi-russh/rust/**/.externalNativeBuild/
packages/react-native-uniffi-russh/rust/**/.cxx/
packages/react-native-uniffi-russh/rust/**/*.apk
packages/react-native-uniffi-russh/rust/**/output.json
# IntelliJ
packages/react-native-uniffi-russh/rust/**/*.iml
packages/react-native-uniffi-russh/rust/**/.idea/
packages/react-native-uniffi-russh/rust/**/misc.xml
packages/react-native-uniffi-russh/rust/**/deploymentTargetDropDown.xml
packages/react-native-uniffi-russh/rust/**/render.experimental.xml
# Keystore files
packages/react-native-uniffi-russh/rust/**/*.jks
packages/react-native-uniffi-russh/rust/**/*.keystore
# Google Services (e.g. APIs or Firebase)
packages/react-native-uniffi-russh/rust/**/google-services.json
# Android Profiling
packages/react-native-uniffi-russh/rust/**/*.hprof
### Android Patch ###
packages/react-native-uniffi-russh/rust/**/gen-external-apklibs
# Replacement of .externalNativeBuild directories introduced
# with Android Studio 3.5.
### Rust ###
# Generated by Cargo
# will have compiled files and executables
packages/react-native-uniffi-russh/rust/**/debug/
packages/react-native-uniffi-russh/rust/**/target/
# These are backup files generated by rustfmt
packages/react-native-uniffi-russh/rust/**/**/*.rs.bk
# MSVC Windows builds of rustc generate these, which store debugging information
packages/react-native-uniffi-russh/rust/**/*.pdb
### Xcode ###
## User settings
packages/react-native-uniffi-russh/rust/**/xcuserdata/
## Xcode 8 and earlier
packages/react-native-uniffi-russh/rust/**/*.xcscmblueprint
packages/react-native-uniffi-russh/rust/**/*.xccheckout
### Xcode Patch ###
packages/react-native-uniffi-russh/rust/**/*.xcodeproj/*
!packages/react-native-uniffi-russh/rust/**/*.xcodeproj/project.pbxproj
!packages/react-native-uniffi-russh/rust/**/*.xcodeproj/xcshareddata/
!packages/react-native-uniffi-russh/rust/**/*.xcodeproj/project.xcworkspace/
!packages/react-native-uniffi-russh/rust/**/*.xcworkspace/contents.xcworkspacedata
packages/react-native-uniffi-russh/rust/*.gcno
packages/react-native-uniffi-russh/rust/**/**/xcshareddata/WorkspaceSettings.xcsettings
# End of https://www.toptal.com/developers/gitignore/api/rust,xcode,android
# Swift Package Manager
packages/react-native-uniffi-russh/rust/**/.build/
# macOS Ignores
packages/react-native-uniffi-russh/rust/**/.DS_Store
# Android (cargo-ndk outputs; they end up in the Android source tree)
packages/react-native-uniffi-russh/rust/**/*.so
# From packages/react-native-uniffi-russh/rust/uniffi-russh/.gitignore
!packages/react-native-uniffi-russh/rust/uniffi-russh/**/.vscode
packages/react-native-uniffi-russh/rust/uniffi-russh/**/mnt/
# From packages/react-native-xtermjs-webview/.gitignore
# Logs
packages/react-native-xtermjs-webview/**/logs
packages/react-native-xtermjs-webview/**/*.log
packages/react-native-xtermjs-webview/**/npm-debug.log*
packages/react-native-xtermjs-webview/**/yarn-debug.log*
packages/react-native-xtermjs-webview/**/yarn-error.log*
packages/react-native-xtermjs-webview/**/pnpm-debug.log*
packages/react-native-xtermjs-webview/**/lerna-debug.log*
packages/react-native-xtermjs-webview/**/node_modules
packages/react-native-xtermjs-webview/**/dist
packages/react-native-xtermjs-webview/**/dist-internal
packages/react-native-xtermjs-webview/**/dist-ssr
packages/react-native-xtermjs-webview/**/*.local
# Editor directories and files
packages/react-native-xtermjs-webview/**/.vscode/*
!packages/react-native-xtermjs-webview/**/.vscode/extensions.json
packages/react-native-xtermjs-webview/**/.idea
packages/react-native-xtermjs-webview/**/.DS_Store
packages/react-native-xtermjs-webview/**/*.suo
packages/react-native-xtermjs-webview/**/*.ntvs*
packages/react-native-xtermjs-webview/**/*.njsproj
packages/react-native-xtermjs-webview/**/*.sln
packages/react-native-xtermjs-webview/**/*.sw?

View File

@@ -1,21 +0,0 @@
name: Setup
description: Perform standard setup and install dependencies using pnpm.
inputs:
node-version:
description: The version of Node.js to install
required: true
default: 24.5.0
runs:
using: composite
steps:
- name: Install pnpm
uses: pnpm/action-setup@v3
- name: Install node
uses: actions/setup-node@v4
with:
cache: pnpm
node-version: ${{ inputs.node-version }}
- name: Install dependencies
shell: bash
run: pnpm install

View File

@@ -20,8 +20,35 @@ jobs:
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Cache Nix Store
uses: nix-community/cache-nix-action@main
with:
primary-key: ${{ runner.os }}-nix-${{ hashFiles('flake.lock') }}
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Load devShell environment
uses: nicknovitski/nix-develop@main
with:
arguments: .#android-remote
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
uses: ./.github/actions/setup
run: pnpm install
- run: pnpm exec turbo lint:check
# test:

20
Dockerfile Normal file
View File

@@ -0,0 +1,20 @@
FROM nixos/nix:latest
# Enable flakes and nix-command
RUN mkdir -p /etc/nix && \
echo 'experimental-features = nix-command flakes' > /etc/nix/nix.conf && \
echo 'accept-flake-config = true' >> /etc/nix/nix.conf
WORKDIR /workspace
COPY flake.nix flake.lock .
RUN nix develop .#android-remote
# Pre-populate pnpm store from lockfile only (fast, cacheable)
COPY pnpm-lock.yaml ./
COPY patches/* ./patches/
RUN nix develop .#android-remote -c pnpm fetch
# Now copy full source and link from the store (no network)
COPY . .
RUN nix develop .#android-remote -c pnpm install --offline --frozen-lockfile

12
flake.lock generated
View File

@@ -9,11 +9,11 @@
]
},
"locked": {
"lastModified": 1757621816,
"narHash": "sha256-r1cZQcvqcF7YUsw70Gxb2eGzuHl/hQHs01WNNeWklIc=",
"lastModified": 1758658832,
"narHash": "sha256-CWJUlYTqdCuWl6a7IYbrEficoz7gKouD7zzuHnko3sI=",
"owner": "tadfisher",
"repo": "android-nixpkgs",
"rev": "feba9bc6e12243ba9ee9bdb236866e1209c55a78",
"rev": "ee542f7fee389dca5c04622a8fb33459d825cd08",
"type": "github"
},
"original": {
@@ -63,11 +63,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1757487488,
"narHash": "sha256-zwE/e7CuPJUWKdvvTCB7iunV4E/+G0lKfv4kk/5Izdg=",
"lastModified": 1758427187,
"narHash": "sha256-pHpxZ/IyCwoTQPtFIAG2QaxuSm8jWzrzBGjwQZIttJc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ab0f3607a6c7486ea22229b92ed2d355f1482ee0",
"rev": "554be6495561ff07b6c724047bdd7e0716aa7b46",
"type": "github"
},
"original": {

View File

@@ -1,5 +1,5 @@
# nix flake update
{
# nix run nixpkgs#alejandra -- format ./flake.nix
description = "Expo RN devshells (local emulator / remote AVD)";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
@@ -10,6 +10,15 @@
};
};
nixConfig = {
extra-substituters = [
"https://android-nixpkgs.cachix.org"
];
extra-trusted-public-keys = [
"android-nixpkgs.cachix.org-1:2lZoPmwoyTVGaNDHqa6A32tdn8Gc0aMWBRrfXN1H3dQ="
];
};
outputs = {
self,
nixpkgs,
@@ -30,28 +39,56 @@
);
in {
devShells = forAllSystems ({pkgs}: let
defaultPkgs = with pkgs; [
# System
bash
git
pkg-config
jq
# JS
nodejs_22
turbo
nodePackages.pnpm
yarn
watchman
# Rust
rustc
clippy
rustfmt
cargo
cargo-ndk
# Android
jdk17
gradle_8
# Misc
cmake
ninja
just
alejandra
];
defaultAndroidPkgs = sdk:
with sdk; [
cmdline-tools-latest
platform-tools # adb/fastboot
platforms-android-36
build-tools-36-0-0
ndk-27-1-12297006
];
makeAndroidSdk = mode: let
androidSdk = pkgs.androidSdk (
sdk:
if mode == "full"
then
(with sdk; [
cmdline-tools-latest
platform-tools
emulator
build-tools-36-0-0
platforms-android-36
system-images-android-36-0-Baklava-google-apis-playstore-x86-64
# Add NDK + CMake for native builds
ndk-26-1-10909125
cmake-3-22-1
])
(with sdk;
[
emulator
system-images-android-36-0-Baklava-google-apis-playstore-x86-64
]
++ (defaultAndroidPkgs sdk))
else if mode == "remote"
then
(with sdk; [
cmdline-tools-latest # ← required for a valid SDK
platform-tools # adb/fastboot
])
then (with sdk; (defaultAndroidPkgs sdk))
else throw "makeAndroidSdk: unknown mode '${mode}'. Use \"full\" or \"remote\"."
);
@@ -64,20 +101,6 @@
fullAndroidSdk = makeAndroidSdk "full";
remoteAndroidSdk = makeAndroidSdk "remote";
defaultPkgs = with pkgs; [
nodejs_22
nodePackages.pnpm
git
just
jq
watchman
jdk17
gradle_8
cmake
ninja
pkg-config
];
in {
# Minimal: only universal dev tools you always want
default = pkgs.mkShell {
@@ -112,6 +135,9 @@
hash -r
echo "ANDROID_SDK_ROOT=$ANDROID_SDK_ROOT"
export ANDROID_NDK_ROOT="$ANDROID_SDK_ROOT/ndk/27.1.12297006"
export ANDROID_NDK_HOME="$ANDROID_NDK_ROOT"
export ANDROID_NDK="$ANDROID_NDK_ROOT"
which -a adb || true
which -a emulator || true
which -a avdmanager || true
@@ -128,7 +154,7 @@
packages =
defaultPkgs
++ [
remoteAndroidSdk.androidSdk # provides adb/fastboot only
(pkgs.androidSdk (sdk: (defaultAndroidPkgs sdk)))
pkgs.scrcpy
];
shellHook = ''
@@ -143,5 +169,6 @@
'';
};
});
formatter = forAllSystems ({pkgs}: pkgs.alejandra);
};
}

10
justfile Normal file
View File

@@ -0,0 +1,10 @@
default:
@just --list
docker-build:
docker build -t fressh .
docker-run:
docker run -it --rm fressh

View File

@@ -10,6 +10,8 @@
"scripts": {
"fmt:root": "prettier --cache --write .",
"fmt:check:root": "prettier --check .",
"fmt:root:nix": "nix fmt flake.nix",
"fmt:check:root:nix": "nix fmt flake.nix -- --c",
"syncpack:fix": "syncpack list-mismatches || (syncpack fix-mismatches && pnpm i)",
"syncpack:check": "syncpack list-mismatches",
"jscpd:check": "cross-env NODE_OPTIONS=--max-old-space-size=8192 jscpd --config .jscpd.json",

View File

@@ -30,8 +30,14 @@
},
"clean": { "cache": false, "dependsOn": ["^clean"] },
// Root tasks overrides
"//#fmt:root": {},
"//#fmt:check:root": {},
"//#fmt:root": {
"with": ["fmt:root:nix"],
},
"//#fmt:root:nix": {},
"//#fmt:check:root:nix": {},
"//#fmt:check:root": {
"with": ["fmt:check:root:nix"],
},
"//#lint:root": {
"dependsOn": ["fmt:root"],
"with": [