mirror of
https://github.com/hanzoai/gui.git
synced 2026-10-25 02:31:41 +00:00
This repo could never sync. There was NO merge-base with tamagui — 372 commits
here against 15,791 there, unrelated histories — because it began as a
copy-paste rebrand with a flattened layout. Every "sync" since was a hand
re-application that drifted, which is why the tree sat on 7.3.1 while upstream
shipped fixes we then rediscovered by hand.
This commit's PARENT IS TAMAGUI. A future sync is `git merge tama/main` then
`node scripts/rebrand.mjs` — a real merge, because the history is now shared.
174 packages: 166 upstream, our 8 restored (chrome, shell, telemetry, recipes,
get, font-geist-{sans,mono}, @hanzo/booker), bento-get gained. 170/170 build.
Our patches to files UPSTREAM ALSO OWNS are carried, which the package-level
delta missed and which was where the value actually was:
- useMedia's server snapshot (`initState ?? getMedia()`). Upstream still
returns undefined there, so every Tamagui Dialog kills a prerender — the
exact crash hanzo.app spent a day on.
- data-slot on web host nodes, absent upstream entirely.
Both applied ONTO upstream's newer files (it rewrote useMedia +150/-63 and
createComponent +160/-55), marked `PATCH (ours, carried across the transplant)`.
Seven traps are encoded in scripts/rebrand.mjs, each found by a gate:
skip itself and lockfiles; special-case the double-branded names in BOTH scoped
and bare form; map path strings, not just paths; drop a level for the flattened
group; check disk rather than a stale index.
Rust build artifacts are NOT committed. An earlier draft of this commit swept
apps/desktop/src-tauri/target/debug in via `git add -A` — 3,859 files including
a 272MB .a, over GitHub's 100MB cap, so the push could never have landed. They
are gitignored now.
Co-Authored-By: Hanzo Dev <[email protected]>
129 lines
3.3 KiB
Bash
Executable File
129 lines
3.3 KiB
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
# Run Maestro tests locally for kitchen-sink and kitchen-sink-go
|
|
# Usage: ./scripts/test-native-local.sh [kitchen-sink|kitchen-sink-go|all]
|
|
# Default: all
|
|
|
|
export PATH="$PATH:$HOME/.maestro/bin"
|
|
|
|
TARGET="${1:-all}"
|
|
|
|
echo "=== Gui Native Tests (Maestro) ==="
|
|
|
|
# Check maestro
|
|
if ! command -v maestro &> /dev/null; then
|
|
echo "Maestro not installed. Install with:"
|
|
echo " curl -Ls 'https://get.maestro.mobile.dev' | bash"
|
|
exit 1
|
|
fi
|
|
|
|
# Find a booted simulator or boot one
|
|
BOOTED_SIM=$(xcrun simctl list devices | grep "Booted" | head -1 | sed 's/.*(\([^)]*\)).*/\1/' | head -1)
|
|
|
|
if [ -z "$BOOTED_SIM" ]; then
|
|
echo "No simulator running. Booting iPhone 15 Pro..."
|
|
SIM_UDID=$(xcrun simctl list devices available | grep "iPhone 15 Pro (" | head -1 | sed 's/.*(\([^)]*\)).*/\1/')
|
|
|
|
if [ -z "$SIM_UDID" ]; then
|
|
echo "No iPhone 15 Pro simulator found. Create one in Xcode."
|
|
exit 1
|
|
fi
|
|
|
|
xcrun simctl boot "$SIM_UDID"
|
|
BOOTED_SIM="$SIM_UDID"
|
|
open -a Simulator
|
|
sleep 3
|
|
fi
|
|
|
|
echo "Using simulator: $BOOTED_SIM"
|
|
|
|
find_and_install_app() {
|
|
local APP_NAME="$1"
|
|
local APP_DIR="$2"
|
|
local APP_PATH=""
|
|
|
|
# Check DerivedData first
|
|
DERIVED_APP=$(find ~/Library/Developer/Xcode/DerivedData -name "${APP_NAME}.app" -path "*Debug-iphonesimulator*" -type d 2>/dev/null | head -1)
|
|
if [ -n "$DERIVED_APP" ] && [ -d "$DERIVED_APP" ]; then
|
|
APP_PATH="$DERIVED_APP"
|
|
fi
|
|
|
|
# Check local build folder
|
|
if [ -z "$APP_PATH" ]; then
|
|
LOCAL_APP="${APP_DIR}/ios/build/Build/Products/Debug-iphonesimulator/${APP_NAME}.app"
|
|
if [ -d "$LOCAL_APP" ]; then
|
|
APP_PATH="$LOCAL_APP"
|
|
fi
|
|
|
|
# Also check build/ directly
|
|
LOCAL_APP="${APP_DIR}/build/Build/Products/Debug-iphonesimulator/${APP_NAME}.app"
|
|
if [ -d "$LOCAL_APP" ]; then
|
|
APP_PATH="$LOCAL_APP"
|
|
fi
|
|
fi
|
|
|
|
if [ -z "$APP_PATH" ]; then
|
|
echo "No built ${APP_NAME}.app found. Build with:"
|
|
echo " cd ${APP_DIR} && bun run ios"
|
|
return 1
|
|
fi
|
|
|
|
echo "Found app: $APP_PATH"
|
|
echo "Installing on simulator..."
|
|
xcrun simctl install "$BOOTED_SIM" "$APP_PATH"
|
|
return 0
|
|
}
|
|
|
|
run_kitchen_sink() {
|
|
echo ""
|
|
echo "=== Kitchen Sink ==="
|
|
if find_and_install_app "hanzoguikitchensink" "apps/kitchen-sink"; then
|
|
cd apps/kitchen-sink
|
|
maestro test flows/ --exclude-tags=util
|
|
cd ../..
|
|
echo "Kitchen Sink tests passed!"
|
|
else
|
|
return 1
|
|
fi
|
|
}
|
|
|
|
run_kitchen_sink_go() {
|
|
echo ""
|
|
echo "=== Kitchen Sink Go ==="
|
|
if find_and_install_app "kitchensinkgo" "apps/kitchen-sink-go"; then
|
|
cd apps/kitchen-sink-go
|
|
maestro test flows/ --exclude-tags=util
|
|
cd ../..
|
|
echo "Kitchen Sink Go tests passed!"
|
|
else
|
|
return 1
|
|
fi
|
|
}
|
|
|
|
case "$TARGET" in
|
|
kitchen-sink)
|
|
run_kitchen_sink
|
|
;;
|
|
kitchen-sink-go|go)
|
|
run_kitchen_sink_go
|
|
;;
|
|
all)
|
|
FAILED=0
|
|
run_kitchen_sink || FAILED=1
|
|
run_kitchen_sink_go || FAILED=1
|
|
if [ $FAILED -ne 0 ]; then
|
|
echo ""
|
|
echo "Some tests failed!"
|
|
exit 1
|
|
fi
|
|
;;
|
|
*)
|
|
echo "Usage: $0 [kitchen-sink|kitchen-sink-go|all]"
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
echo ""
|
|
echo "All tests passed!"
|