diff --git a/__fixtures__/test-project/.gitignore b/__fixtures__/test-project/.gitignore index 31d9637ed..a43a18726 100644 --- a/__fixtures__/test-project/.gitignore +++ b/__fixtures__/test-project/.gitignore @@ -22,3 +22,18 @@ api/src/lib/generateGraphiQLHeader.* !.yarn/releases !.yarn/sdks !.yarn/versions + +# Expo +.expo +web-build +expo-env.d.ts +.kotlin/ +*.orig.* +*.jks +*.p8 +*.p12 +*.key +*.mobileprovision +.metro-health-check* +*.pem +*.tsbuildinfo diff --git a/__fixtures__/test-project/app/.env.example b/__fixtures__/test-project/app/.env.example new file mode 100644 index 000000000..4f700f16d --- /dev/null +++ b/__fixtures__/test-project/app/.env.example @@ -0,0 +1,2 @@ +# EXPO_PUBLIC_RWJS_API_GRAPHQL_URL=http://localhost:8911/graphql +# EXPO_PUBLIC_API_URL=http://localhost:8911 diff --git a/__fixtures__/test-project/app/ambient.d.ts b/__fixtures__/test-project/app/ambient.d.ts new file mode 100644 index 000000000..6e4456a16 --- /dev/null +++ b/__fixtures__/test-project/app/ambient.d.ts @@ -0,0 +1,33 @@ +/* eslint-disable no-var */ + +declare global { + /** + * FQDN or absolute path to the GraphQL serverless function, without the trailing slash. + * Example: `./redwood/functions/graphql` or `https://api.redwoodjs.com/graphql` + */ + var RWJS_API_GRAPHQL_URL: string + + /** + * URL or absolute path to serverless functions, without the trailing slash. + * Example: `./redwood/functions/` or `https://api.redwoodjs.com/` + **/ + var RWJS_API_URL: string + + // Provided by Vite.config in the user's project + var RWJS_ENV: { + RWJS_API_GRAPHQL_URL: string + /** URL or absolute path to serverless functions */ + RWJS_API_URL: string + } + + namespace NodeJS { + interface Global { + /** URL or absolute path to the GraphQL serverless function */ + RWJS_API_GRAPHQL_URL: string + /** URL or absolute path to serverless functions */ + RWJS_API_URL: string + } + } +} + +export {} diff --git a/__fixtures__/test-project/app/app.json b/__fixtures__/test-project/app/app.json new file mode 100644 index 000000000..428a0b339 --- /dev/null +++ b/__fixtures__/test-project/app/app.json @@ -0,0 +1,42 @@ +{ + "expo": { + "name": "app", + "slug": "app", + "version": "1.0.0", + "orientation": "portrait", + "icon": "./assets/images/icon.png", + "scheme": "app", + "userInterfaceStyle": "automatic", + "newArchEnabled": true, + "ios": { + "supportsTablet": true + }, + "android": { + "adaptiveIcon": { + "foregroundImage": "./assets/images/adaptive-icon.png", + "backgroundColor": "#ffffff" + }, + "edgeToEdgeEnabled": true + }, + "web": { + "bundler": "metro", + "output": "static", + "favicon": "./assets/images/favicon.png" + }, + "plugins": [ + "expo-router", + [ + "expo-splash-screen", + { + "image": "./assets/images/splash-icon.png", + "imageWidth": 200, + "resizeMode": "contain", + "backgroundColor": "#ffffff" + } + ] + ], + "experiments": { + "typedRoutes": true + } + } +} diff --git a/__fixtures__/test-project/app/app/(tabs)/_layout.tsx b/__fixtures__/test-project/app/app/(tabs)/_layout.tsx new file mode 100644 index 000000000..dde407a02 --- /dev/null +++ b/__fixtures__/test-project/app/app/(tabs)/_layout.tsx @@ -0,0 +1,65 @@ +import React from 'react' + +import MaterialIcons from '@expo/vector-icons/MaterialIcons' +import { Link, Tabs } from 'expo-router' +import { Button, Platform, View } from 'react-native' + +import { HapticTab } from '@/components/HapticTab' +import TabBarBackground from '@/components/ui/TabBarBackground' +import { Colors } from '@/constants/Colors' +import { useAuth } from '@/context/auth' +import { useColorScheme } from '@/hooks/useColorScheme' + +export default function TabLayout() { + const colorScheme = useColorScheme() + const { isAuthenticated, logOut } = useAuth() + + return ( + ( + + {isAuthenticated ? ( +