diff --git a/apps/observability-tester/app/(tabs)/(metrics)/_layout.tsx b/apps/observability-tester/app/(tabs)/(metrics)/_layout.tsx deleted file mode 100644 index dd85d6fdc11773..00000000000000 --- a/apps/observability-tester/app/(tabs)/(metrics)/_layout.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import { Stack } from 'expo-router'; - -export default function MetricsLayout() { - return ( - - - - ); -} diff --git a/apps/observability-tester/app/(tabs)/debug/_layout.tsx b/apps/observability-tester/app/(tabs)/debug/_layout.tsx deleted file mode 100644 index 328223422f0709..00000000000000 --- a/apps/observability-tester/app/(tabs)/debug/_layout.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import { Stack } from 'expo-router'; - -export default function MetricsLayout() { - return ( - - - - ); -} diff --git a/apps/observability-tester/components/Button.tsx b/apps/observability-tester/components/Button.tsx deleted file mode 100644 index 9173de78b1bd7f..00000000000000 --- a/apps/observability-tester/components/Button.tsx +++ /dev/null @@ -1,85 +0,0 @@ -import React from 'react'; -import { Pressable, PressableProps, StyleSheet, Text, useColorScheme } from 'react-native'; - -type ButtonProps = { - title: string; - onPress?: () => void; - theme?: 'primary' | 'secondary' | 'tertiary'; - disabled?: boolean; -} & PressableProps; - -export function Button({ title, onPress, theme = 'primary', disabled, ...rest }: ButtonProps) { - const colorScheme = useColorScheme(); - const isDark = colorScheme === 'dark'; - - const buttonStyle = [ - styles.button, - theme === 'primary' && styles.buttonPrimary, - theme === 'secondary' && - (isDark ? { backgroundColor: '#1F1F1F', borderColor: '#404040' } : styles.buttonSecondary), - theme === 'tertiary' && styles.buttonTertiary, - disabled && styles.buttonDisabled, - ]; - - const textStyle = [ - styles.text, - theme === 'primary' && styles.textPrimary, - theme === 'secondary' && (isDark ? { color: '#FFFFFF' } : styles.textSecondary), - theme === 'tertiary' && (isDark ? { color: '#E5E5E5' } : styles.textTertiary), - ]; - - return ( - [buttonStyle, pressed ? styles.buttonFocused : null]} - disabled={disabled} - {...rest}> - {title} - - ); -} - -const styles = StyleSheet.create({ - button: { - flexDirection: 'row', - alignItems: 'center', - justifyContent: 'center', - borderRadius: 6, - paddingHorizontal: 20, - paddingVertical: 12, - marginBottom: 16, - borderWidth: 1, - }, - buttonFocused: { - opacity: 0.5, - }, - buttonPrimary: { - backgroundColor: '#007AFF', - borderColor: '#007AFF', - }, - buttonSecondary: { - backgroundColor: '#FFFFFF', - borderColor: '#D1D5DB', - }, - buttonTertiary: { - backgroundColor: 'transparent', - borderColor: 'transparent', - }, - buttonDisabled: { - opacity: 0.5, - }, - text: { - fontWeight: '600', - fontSize: 18, - letterSpacing: 0.5, - }, - textPrimary: { - color: '#FFFFFF', - }, - textSecondary: { - color: '#000000', - }, - textTertiary: { - color: '#1F2937', - }, -}); diff --git a/apps/observability-tester/scripts/test-ios.sh b/apps/observability-tester/scripts/test-ios.sh deleted file mode 100755 index 793c71decd79f9..00000000000000 --- a/apps/observability-tester/scripts/test-ios.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash -# Run the iOS unit-test schemes for ExpoAppMetrics and ExpoObserve against -# whichever iOS simulator is currently booted. Boot a simulator first -# (e.g. via `xcrun simctl boot ` or by opening Simulator.app) and -# then run `pnpm test:ios` from this app's directory. - -set -euo pipefail - -cd "$(dirname "$0")/.." - -UDID=$(xcrun simctl list devices available -j | \ - jq -r '.devices | to_entries | map(select(.key|test("iOS"))) | .[-1].value | map(select(.isAvailable)) | .[0].udid') - -echo "Running iOS unit tests against simulator: $UDID" - -xcodebuild test \ - -workspace ios/Observe.xcworkspace \ - -scheme ExpoAppMetrics-Unit-Tests \ - -destination "id=$UDID" - -xcodebuild test \ - -workspace ios/Observe.xcworkspace \ - -scheme ExpoObserve-Unit-Tests \ - -destination "id=$UDID" diff --git a/apps/observe-tester/.gitignore b/apps/observe-tester/.gitignore new file mode 100644 index 00000000000000..f25965cd078aa5 --- /dev/null +++ b/apps/observe-tester/.gitignore @@ -0,0 +1,42 @@ +# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files + +# dependencies +node_modules/ + +# Expo +.expo/ +dist/ +web-build/ +expo-env.d.ts + +#prebuild +android/ +ios/ + +# Native +*.orig.* +*.jks +*.p8 +*.p12 +*.key +*.mobileprovision + +# Metro +.metro-health-check* + +# debug +npm-debug.* +yarn-debug.* +yarn-error.* + +# macOS +.DS_Store +*.pem + +# local env files +.env*.local + +# typescript +*.tsbuildinfo + +app-example diff --git a/apps/observability-tester/app.config.ts b/apps/observe-tester/app.config.ts similarity index 90% rename from apps/observability-tester/app.config.ts rename to apps/observe-tester/app.config.ts index a7312b34f82c6a..44ff6222c94b72 100644 --- a/apps/observability-tester/app.config.ts +++ b/apps/observe-tester/app.config.ts @@ -3,8 +3,6 @@ import 'tsx/cjs'; const config = ({ config }: ConfigContext): ExpoConfig => ({ ...config, - name: 'Observe', - slug: 'observability', extra: { ...config.extra, eas: { diff --git a/apps/observability-tester/app.json b/apps/observe-tester/app.json similarity index 97% rename from apps/observability-tester/app.json rename to apps/observe-tester/app.json index 3c1600af836677..e1b5a7c77e13e9 100644 --- a/apps/observability-tester/app.json +++ b/apps/observe-tester/app.json @@ -1,11 +1,11 @@ { "expo": { - "name": "observability", + "name": "Observe", "slug": "observability", "version": "1.0.0", "orientation": "portrait", "icon": "./assets/images/icon.png", - "scheme": "observability", + "scheme": "observe", "userInterfaceStyle": "automatic", "ios": { "supportsTablet": true, diff --git a/apps/observe-tester/app/(tabs)/(metrics)/_layout.tsx b/apps/observe-tester/app/(tabs)/(metrics)/_layout.tsx new file mode 100644 index 00000000000000..e1fa42eec19b3d --- /dev/null +++ b/apps/observe-tester/app/(tabs)/(metrics)/_layout.tsx @@ -0,0 +1,16 @@ +import { Stack } from 'expo-router'; + +import { useTheme } from '@/utils/theme'; + +export default function MetricsLayout() { + const theme = useTheme(); + return ( + + + + ); +} diff --git a/apps/observability-tester/app/(tabs)/(metrics)/index.tsx b/apps/observe-tester/app/(tabs)/(metrics)/index.tsx similarity index 69% rename from apps/observability-tester/app/(tabs)/(metrics)/index.tsx rename to apps/observe-tester/app/(tabs)/(metrics)/index.tsx index 50046da1cfcb6b..4c50d8f4cf9b91 100644 --- a/apps/observability-tester/app/(tabs)/(metrics)/index.tsx +++ b/apps/observe-tester/app/(tabs)/(metrics)/index.tsx @@ -1,17 +1,17 @@ -import { Code } from '@expo/html-elements'; -import { useCallback, useEffect, useState } from 'react'; -import { Platform, ScrollView, StyleSheet, Text, View, useColorScheme } from 'react-native'; - -import { useRouterMetricsHelpers } from '@/router-metrics-integration'; import AppMetrics, { type Metric } from 'expo-app-metrics'; import ExpoObserve from 'expo-observe'; -import { Button } from '../../../components/Button'; - import { checkForUpdateAsync, fetchUpdateAsync, reloadAsync, useUpdates } from 'expo-updates'; +import { useCallback, useEffect, useState } from 'react'; +import { Platform, ScrollView, StyleSheet, Text, View } from 'react-native'; + +import { Button } from '@/components/Button'; +import { Divider } from '@/components/Divider'; +import { JSONView } from '@/components/JSONView'; +import { useRouterMetricsHelpers } from '@/router-metrics-integration'; +import { useTheme } from '@/utils/theme'; export default function Index() { - const colorScheme = useColorScheme(); - const isDark = colorScheme === 'dark'; + const theme = useTheme(); const [metrics, setMetrics] = useState([]); const [showEntries, setShowEntries] = useState(false); const { isUpdateAvailable, isUpdatePending, availableUpdate, currentlyRunning } = useUpdates(); @@ -61,7 +61,7 @@ export default function Index() { return (