From b60901332e62bdb45d0ba8ffb63e29ec1661daf4 Mon Sep 17 00:00:00 2001 From: luke-h1 Date: Sat, 28 Dec 2024 10:58:36 +0000 Subject: [PATCH] feat(app): migrate to app config --- app.config.ts | 79 +++++++++++++++++++ app.json | 67 ---------------- package.json | 1 + pnpm-lock.yaml | 14 ++++ src/components/LiveStreamCard.tsx | 2 +- .../LiveStreamCard.test.tsx.snap | 11 +-- src/plugins/withFastImageWebPSupportIOS.js | 7 +- src/screens/ErrorScreen/ErrorDetails.tsx | 4 +- src/screens/SettingsScreen.tsx | 51 +++++++++++- src/screens/Stream/LiveStreamScreen.tsx | 2 +- 10 files changed, 155 insertions(+), 83 deletions(-) create mode 100644 app.config.ts delete mode 100644 app.json diff --git a/app.config.ts b/app.config.ts new file mode 100644 index 00000000..7f1c395c --- /dev/null +++ b/app.config.ts @@ -0,0 +1,79 @@ +import { ExpoConfig, ConfigContext } from '@expo/config'; +import { version } from './package.json'; + +const BUILD_NUMBER = 1; + +export default ({ config }: ConfigContext): ExpoConfig => ({ + ...config, + name: 'Foam', + slug: 'Foam', + scheme: 'foam', + version, + userInterfaceStyle: 'automatic', + newArchEnabled: true, + jsEngine: 'hermes', + assetBundlePatterns: ['**/*'], + + // ios + ios: { + buildNumber: String(BUILD_NUMBER), + supportsTablet: false, + // googleServicesFile: `./GoogleService-Info.plist`, + bundleIdentifier: 'com.foam', + config: { + // needed for expo-secure-store + usesNonExemptEncryption: false, + }, + }, + + // android + android: { + package: 'com.foam', + // needed for haptic feedback UI + permissions: ['VIBRATE'], + versionCode: BUILD_NUMBER, + // googleServicesFile: './google-services.json', + adaptiveIcon: { + foregroundImage: './assets/adaptive-icon.png', + backgroundColor: '#ffffff', + }, + }, + + // web + web: { + favicon: './assets/favicon.png', + }, + extra: { + eas: { + projectId: '950a1e2f-6b25-4be7-adb2-3c16287a2b5e', + }, + }, + runtimeVersion: { + policy: 'appVersion', + }, + updates: { + fallbackToCacheTimeout: 0, + }, + experiments: { + tsconfigPaths: true, + }, + plugins: [ + ['expo-font', 'expo-secure-store'], + [ + 'expo-build-properties', + { + ios: { + flipper: true, + }, + android: { + enableProguardInReleaseBuilds: true, + enableShrinkResourcesInReleaseBuilds: true, + }, + }, + ], + ['newrelic-react-native-agent'], + ['./src/plugins/withAnimatedWebPSupport.js'], + ['./src/plugins/withFastImageWebPSupportIOS.js'], + ['./src/plugins/withFastImageWebPSupportAndroid.js'], + ], +}); diff --git a/app.json b/app.json deleted file mode 100644 index a01d16fb..00000000 --- a/app.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "expo": { - "name": "foam", - "slug": "foam", - "newArchEnabled": true, - "version": "1.0.0", - "orientation": "portrait", - "icon": "./assets/icon.png", - "scheme": "foam", - "userInterfaceStyle": "automatic", - "splash": { - "image": "./assets/splash.png", - "resizeMode": "contain", - "backgroundColor": "#ffffff" - }, - "jsEngine": "hermes", - "assetBundlePatterns": ["**/*"], - "ios": { - "supportsTablet": false, - "bundleIdentifier": "com.foam", - "config": { - "usesNonExemptEncryption": false - } - }, - "android": { - "adaptiveIcon": { - "foregroundImage": "./assets/adaptive-icon.png", - "backgroundColor": "#ffffff" - }, - "package": "com.foam", - "permissions": ["VIBRATE"] - }, - "web": { - "favicon": "./assets/favicon.png" - }, - "extra": { - "eas": { - "projectId": "950a1e2f-6b25-4be7-adb2-3c16287a2b5e" - } - }, - "runtimeVersion": { - "policy": "appVersion" - }, - "updates": { - "fallbackToCacheTimeout": 0 - }, - "experiments": { - "tsconfigPaths": true - } - }, - "plugins": [ - ["expo-font", "expo-secure-store"], - [ - "expo-build-properties", - { - "ios": { - "flipper": true - }, - "android": {} - } - ], - ["newrelic-react-native-agent"], - ["./src/plugins/withAnimatedWebPSupport.js"], - ["./src/plugins/withFastImageWebPSupportIOS.js"], - ["./src/plugins/withFastImageWebPSupportAndroid.js"] - ] -} diff --git a/package.json b/package.json index c8cf8aba..4b3184ba 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,7 @@ "expo": "~52.0.7", "expo-auth-session": "~6.0.0", "expo-av": "~15.0.1", + "expo-build-properties": "^0.13.1", "expo-clipboard": "~7.0.0", "expo-constants": "~17.0.3", "expo-dev-client": "~5.0.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 33915e3a..9d0be3a0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -92,6 +92,9 @@ importers: expo-av: specifier: ~15.0.1 version: 15.0.1(expo@52.0.7(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(babel-plugin-react-compiler@19.0.0-beta-a7bf2bd-20241110)(encoding@0.1.13)(graphql@16.9.0)(react-native-webview@13.12.2(react-native@0.76.2(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@13.6.9(encoding@0.1.13))(@types/react@18.3.12)(encoding@0.1.13)(react@18.3.1))(react@18.3.1))(react-native@0.76.2(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@13.6.9(encoding@0.1.13))(@types/react@18.3.12)(encoding@0.1.13)(react@18.3.1))(react@18.3.1))(react-native-web@0.19.13(encoding@0.1.13)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-native@0.76.2(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@13.6.9(encoding@0.1.13))(@types/react@18.3.12)(encoding@0.1.13)(react@18.3.1))(react@18.3.1) + expo-build-properties: + specifier: ^0.13.1 + version: 0.13.1(expo@52.0.7(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(babel-plugin-react-compiler@19.0.0-beta-a7bf2bd-20241110)(encoding@0.1.13)(graphql@16.9.0)(react-native-webview@13.12.2(react-native@0.76.2(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@13.6.9(encoding@0.1.13))(@types/react@18.3.12)(encoding@0.1.13)(react@18.3.1))(react@18.3.1))(react-native@0.76.2(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@13.6.9(encoding@0.1.13))(@types/react@18.3.12)(encoding@0.1.13)(react@18.3.1))(react@18.3.1)) expo-clipboard: specifier: ~7.0.0 version: 7.0.0(expo@52.0.7(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(babel-plugin-react-compiler@19.0.0-beta-a7bf2bd-20241110)(encoding@0.1.13)(graphql@16.9.0)(react-native-webview@13.12.2(react-native@0.76.2(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@13.6.9(encoding@0.1.13))(@types/react@18.3.12)(encoding@0.1.13)(react@18.3.1))(react@18.3.1))(react-native@0.76.2(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@13.6.9(encoding@0.1.13))(@types/react@18.3.12)(encoding@0.1.13)(react@18.3.1))(react@18.3.1))(react-native@0.76.2(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@13.6.9(encoding@0.1.13))(@types/react@18.3.12)(encoding@0.1.13)(react@18.3.1))(react@18.3.1) @@ -4409,6 +4412,11 @@ packages: react-native-web: optional: true + expo-build-properties@0.13.1: + resolution: {integrity: sha512-7tDlAM0PPkXC0B00C6/FG19sMzwxZNyiDfn22AWVbBxWxZE1/3RqxPgT3MlPVNfvy+wJw7jt/qbAb0S06wFYVg==} + peerDependencies: + expo: '*' + expo-clipboard@7.0.0: resolution: {integrity: sha512-4Vuv1zZPTOiKzIeC0BIGUN8nyzkXlE6jKchtLxcoksBjHPdG5W2eH05B+hppTrK9N3+Xh02z4j3h1cFRqPJ1fw==} peerDependencies: @@ -15054,6 +15062,12 @@ snapshots: optionalDependencies: react-native-web: 0.19.13(encoding@0.1.13)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + expo-build-properties@0.13.1(expo@52.0.7(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(babel-plugin-react-compiler@19.0.0-beta-a7bf2bd-20241110)(encoding@0.1.13)(graphql@16.9.0)(react-native-webview@13.12.2(react-native@0.76.2(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@13.6.9(encoding@0.1.13))(@types/react@18.3.12)(encoding@0.1.13)(react@18.3.1))(react@18.3.1))(react-native@0.76.2(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@13.6.9(encoding@0.1.13))(@types/react@18.3.12)(encoding@0.1.13)(react@18.3.1))(react@18.3.1)): + dependencies: + ajv: 8.17.1 + expo: 52.0.7(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(babel-plugin-react-compiler@19.0.0-beta-a7bf2bd-20241110)(encoding@0.1.13)(graphql@16.9.0)(react-native-webview@13.12.2(react-native@0.76.2(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@13.6.9(encoding@0.1.13))(@types/react@18.3.12)(encoding@0.1.13)(react@18.3.1))(react@18.3.1))(react-native@0.76.2(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@13.6.9(encoding@0.1.13))(@types/react@18.3.12)(encoding@0.1.13)(react@18.3.1))(react@18.3.1) + semver: 7.6.3 + expo-clipboard@7.0.0(expo@52.0.7(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(babel-plugin-react-compiler@19.0.0-beta-a7bf2bd-20241110)(encoding@0.1.13)(graphql@16.9.0)(react-native-webview@13.12.2(react-native@0.76.2(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@13.6.9(encoding@0.1.13))(@types/react@18.3.12)(encoding@0.1.13)(react@18.3.1))(react@18.3.1))(react-native@0.76.2(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@13.6.9(encoding@0.1.13))(@types/react@18.3.12)(encoding@0.1.13)(react@18.3.1))(react@18.3.1))(react-native@0.76.2(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@13.6.9(encoding@0.1.13))(@types/react@18.3.12)(encoding@0.1.13)(react@18.3.1))(react@18.3.1): dependencies: expo: 52.0.7(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(babel-plugin-react-compiler@19.0.0-beta-a7bf2bd-20241110)(encoding@0.1.13)(graphql@16.9.0)(react-native-webview@13.12.2(react-native@0.76.2(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@13.6.9(encoding@0.1.13))(@types/react@18.3.12)(encoding@0.1.13)(react@18.3.1))(react@18.3.1))(react-native@0.76.2(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@13.6.9(encoding@0.1.13))(@types/react@18.3.12)(encoding@0.1.13)(react@18.3.1))(react@18.3.1) diff --git a/src/components/LiveStreamCard.tsx b/src/components/LiveStreamCard.tsx index 547912e2..fdef3cec 100644 --- a/src/components/LiveStreamCard.tsx +++ b/src/components/LiveStreamCard.tsx @@ -54,7 +54,7 @@ export default function LiveStreamCard({ stream }: Props) { - {stream.title} + {stream.title} { }); }; -export default createRunOncePlugin( +module.exports = createRunOncePlugin( withFastImageWebPSupportIOS, 'rnfi-expo-animated-webp-support', '1.0.0', diff --git a/src/screens/ErrorScreen/ErrorDetails.tsx b/src/screens/ErrorScreen/ErrorDetails.tsx index bda457a0..1cb3f785 100644 --- a/src/screens/ErrorScreen/ErrorDetails.tsx +++ b/src/screens/ErrorScreen/ErrorDetails.tsx @@ -1,11 +1,11 @@ import Button from '@app/components/ui/Button'; -import Icon from '@app/components/ui/Icon'; import Screen from '@app/components/ui/Screen'; import { Text } from '@app/components/ui/Text'; import { colors, spacing } from '@app/styles'; import { openLinkInBrowser } from '@app/utils/openLinkInBrowser'; import React, { ErrorInfo } from 'react'; import { ScrollView, TextStyle, View, ViewStyle } from 'react-native'; +import MaterialIcons from 'react-native-vector-icons/MaterialIcons'; export interface ErrorDetailsProps { error: Error | null; @@ -35,7 +35,7 @@ export default function ErrorDetails(props: ErrorDetailsProps) { contentContainerStyle={$contentContainer} > - + ), showRightArrow: true, - iconRight: , showSeperator: true, onPress: () => { bottomSheetModalRef.current?.present(); @@ -168,6 +167,54 @@ export default function SettingsScreen() { }} /> + + +