Skip to content

Commit aacd57c

Browse files
authored
expo upgrade 53 and fix eslint + prebuild config (#114)
* wip expo upgrade fix tslint * fix eslint * Refactor asset imports and update tsconfig paths for better module resolution * Update react-native-ficus-ui to version 1.3.5 * Update Node.js version to 20.x in workflow files * Fix prebuild override (#115) * Enhance splash screen implementation and update related assets * Add dark mode support for splash screen and related assets * Update app icon and splash screen handling in authentication flow * add bump build config * Refactor code structure for improved readability and maintainability * fix: update imports and clean up code - Disable eslint rule for require imports in bump-build.ts - Replace axios.isAxiosError with isAxiosError from axios in api-hooks.ts - Remove unnecessary whitespace in ConfirmationCodeModal index.tsx - Standardize import formatting in FieldCodeInput components - Add eslint disable comment for named exports in i18n.ts - Refactor useProtectedRoute hook to fix currentRouteRef assignment - Remove unused import in auth.hook.ts - Clean up utilities.d.ts by removing commented line
1 parent 802caba commit aacd57c

File tree

85 files changed

+5473
-5537
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+5473
-5537
lines changed

.eslintrc.json

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Setup Node
3232
uses: actions/setup-node@v3
3333
with:
34-
node-version: 18.x
34+
node-version: 20.x
3535
cache: pnpm
3636

3737
- name: Install dependencies

.github/workflows/update.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Setup Node
3030
uses: actions/setup-node@v3
3131
with:
32-
node-version: 18.x
32+
node-version: 20.x
3333
cache: pnpm
3434

3535
- name: Setup EAS

.prettierignore

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,25 @@
1-
.cache
2-
.next
3-
.db
4-
.history
5-
out
6-
node_modules
7-
package.json
8-
package-lock.json
9-
yarn.lock
10-
public
11-
*.md
12-
*.mdx
13-
*.hbs
14-
.env*
15-
android
16-
ios
17-
.expo
1+
# Ignore node_modules
2+
node_modules/
3+
4+
# Ignore build outputs
5+
android/
6+
ios/
7+
web-build/
8+
dist/
9+
build/
10+
11+
# Ignore Expo specific files
12+
.expo/
13+
.expo-shared/
14+
15+
# Ignore system files
16+
.DS_Store
17+
18+
# Ignore logs
19+
npm-debug.log*
20+
yarn-debug.log*
21+
yarn-error.log*
22+
23+
# Ignore environment files
24+
.env
25+
.env.*

android/app/build.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ react {
1414
hermesCommand = new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + "/sdks/hermesc/%OS-BIN%/hermesc"
1515
codegenDir = new File(["node", "--print", "require.resolve('@react-native/codegen/package.json', { paths: [require.resolve('react-native/package.json')] })"].execute(null, rootDir).text.trim()).getParentFile().getAbsoluteFile()
1616

17+
enableBundleCompression = (findProperty('android.enableBundleCompression') ?: false).toBoolean()
1718
// Use Expo CLI to bundle the app, this ensures the Metro config
1819
// works correctly with Expo projects.
1920
cliFile = new File(["node", "--print", "require.resolve('@expo/cli', { paths: [require.resolve('expo/package.json')] })"].execute(null, rootDir).text.trim())
@@ -78,7 +79,7 @@ def enableProguardInReleaseBuilds = (findProperty('android.enableProguardInRelea
7879
* give correct results when using with locales other than en-US. Note that
7980
* this variant is about 6MiB larger per architecture than default.
8081
*/
81-
def jscFlavor = 'org.webkit:android-jsc:+'
82+
def jscFlavor = 'io.github.react-native-community:jsc-android:2026004.+'
8283

8384
android {
8485
ndkVersion rootProject.ext.ndkVersion
@@ -156,15 +157,15 @@ dependencies {
156157

157158
if (isGifEnabled) {
158159
// For animated gif support
159-
implementation("com.facebook.fresco:animated-gif:${reactAndroidLibs.versions.fresco.get()}")
160+
implementation("com.facebook.fresco:animated-gif:${expoLibs.versions.fresco.get()}")
160161
}
161162

162163
if (isWebpEnabled) {
163164
// For webp support
164-
implementation("com.facebook.fresco:webpsupport:${reactAndroidLibs.versions.fresco.get()}")
165+
implementation("com.facebook.fresco:webpsupport:${expoLibs.versions.fresco.get()}")
165166
if (isWebpAnimatedEnabled) {
166167
// Animated webp support
167-
implementation("com.facebook.fresco:animated-webp:${reactAndroidLibs.versions.fresco.get()}")
168+
implementation("com.facebook.fresco:animated-webp:${expoLibs.versions.fresco.get()}")
168169
}
169170
}
170171

android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
1818
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0"/>
1919
<meta-data android:name="expo.modules.updates.EXPO_UPDATE_URL" android:value="https://u.expo.dev/b5bbd925-db32-4e2b-8f31-cf07e22fa4ef"/>
20-
<activity android:name=".MainActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:theme="@style/Theme.App.SplashScreen" android:exported="true" android:screenOrientation="portrait">
20+
<activity android:name=".MainActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout|uiMode|locale|layoutDirection" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:theme="@style/Theme.App.SplashScreen" android:exported="true" android:screenOrientation="portrait">
2121
<intent-filter>
2222
<action android:name="android.intent.action.MAIN"/>
2323
<category android:name="android.intent.category.LAUNCHER"/>

android/app/src/main/java/com/bearstudio/startuinative/MainActivity.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
package com.bearstudio.startuinative
2+
import expo.modules.splashscreen.SplashScreenManager
23

34
import android.os.Build
45
import android.os.Bundle
@@ -15,7 +16,10 @@ class MainActivity : ReactActivity() {
1516
// Set the theme to AppTheme BEFORE onCreate to support
1617
// coloring the background, status bar, and navigation bar.
1718
// This is required for expo-splash-screen.
18-
setTheme(R.style.AppTheme);
19+
// setTheme(R.style.AppTheme);
20+
// @generated begin expo-splashscreen - expo prebuild (DO NOT MODIFY) sync-f3ff59a738c56c9a6119210cb55f0b613eb8b6af
21+
SplashScreenManager.registerOnActivity(this)
22+
// @generated end expo-splashscreen
1923
super.onCreate(null)
2024
}
2125

Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
<resources/>
1+
<resources>
2+
<color name="splashscreen_background">#000000</color>
3+
</resources>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<resources>
2-
<color name="splashscreen_background">#ffffff</color>
2+
<color name="splashscreen_background">#FFFFFF</color>
33
<color name="iconBackground">#ffffff</color>
44
<color name="colorPrimary">#023c69</color>
5-
<color name="colorPrimaryDark">#ffffff</color>
5+
<color name="colorPrimaryDark">#FFFFFF</color>
66
</resources>
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
<resources xmlns:tools="http://schemas.android.com/tools">
2-
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
2+
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
33
<item name="android:textColor">@android:color/black</item>
44
<item name="android:editTextStyle">@style/ResetEditText</item>
55
<item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
66
<item name="colorPrimary">@color/colorPrimary</item>
7-
<item name="android:statusBarColor">#ffffff</item>
7+
<item name="android:statusBarColor">#FFFFFF</item>
8+
<item name="android:windowOptOutEdgeToEdgeEnforcement" tools:targetApi="35">true</item>
89
</style>
910
<style name="ResetEditText" parent="@android:style/Widget.EditText">
1011
<item name="android:padding">0dp</item>
1112
<item name="android:textColorHint">#c8c8c8</item>
1213
<item name="android:textColor">@android:color/black</item>
1314
</style>
14-
<style name="Theme.App.SplashScreen" parent="AppTheme">
15-
<item name="android:windowBackground">@drawable/splashscreen</item>
15+
<style name="Theme.App.SplashScreen" parent="Theme.SplashScreen">
16+
<item name="windowSplashScreenBackground">@color/splashscreen_background</item>
17+
<item name="windowSplashScreenAnimatedIcon">@drawable/splashscreen_logo</item>
18+
<item name="postSplashScreenTheme">@style/AppTheme</item>
1619
</style>
1720
</resources>

android/build.gradle

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,37 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

33
buildscript {
4-
ext {
5-
buildToolsVersion = findProperty('android.buildToolsVersion') ?: '35.0.0'
6-
minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '24')
7-
compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '35')
8-
targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '34')
9-
kotlinVersion = findProperty('android.kotlinVersion') ?: '1.9.24'
10-
11-
ndkVersion = "26.1.10909125"
12-
}
13-
repositories {
14-
google()
15-
mavenCentral()
16-
}
17-
dependencies {
18-
classpath('com.android.tools.build:gradle')
19-
classpath('com.facebook.react:react-native-gradle-plugin')
20-
classpath('org.jetbrains.kotlin:kotlin-gradle-plugin')
21-
}
4+
repositories {
5+
google()
6+
mavenCentral()
7+
}
8+
dependencies {
9+
classpath('com.android.tools.build:gradle')
10+
classpath('com.facebook.react:react-native-gradle-plugin')
11+
classpath('org.jetbrains.kotlin:kotlin-gradle-plugin')
12+
}
2213
}
2314

24-
apply plugin: "com.facebook.react.rootproject"
15+
def reactNativeAndroidDir = new File(
16+
providers.exec {
17+
workingDir(rootDir)
18+
commandLine("node", "--print", "require.resolve('react-native/package.json')")
19+
}.standardOutput.asText.get().trim(),
20+
"../android"
21+
)
2522

2623
allprojects {
27-
repositories {
28-
maven {
29-
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
30-
url(new File(['node', '--print', "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim(), '../android'))
31-
}
32-
maven {
33-
// Android JSC is installed from npm
34-
url(new File(['node', '--print', "require.resolve('jsc-android/package.json', { paths: [require.resolve('react-native/package.json')] })"].execute(null, rootDir).text.trim(), '../dist'))
35-
}
36-
37-
google()
38-
mavenCentral()
39-
maven { url 'https://www.jitpack.io' }
24+
repositories {
25+
maven {
26+
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
27+
url(reactNativeAndroidDir)
4028
}
29+
30+
google()
31+
mavenCentral()
32+
maven { url 'https://www.jitpack.io' }
33+
}
4134
}
35+
36+
apply plugin: "expo-root-project"
37+
apply plugin: "com.facebook.react.rootproject"

android/gradle.properties

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
2222
# https://developer.android.com/topic/libraries/support-library/androidx-rn
2323
android.useAndroidX=true
2424

25+
# Enable AAPT2 PNG crunching
26+
android.enablePngCrunchInReleaseBuilds=true
27+
2528
# Use this property to specify which architecture you want to build.
2629
# You can also override it from the CLI using
2730
# ./gradlew <task> -PreactNativeArchitectures=x86_64
@@ -52,4 +55,5 @@ EX_DEV_CLIENT_NETWORK_INSPECTOR=true
5255
# Use legacy packaging to compress native libraries in the resulting APK.
5356
expo.useLegacyPackaging=false
5457

55-
android.extraMavenRepos=[]
58+
# Whether the app is configured to use edge-to-edge via the app config or `react-native-edge-to-edge` plugin
59+
expo.edgeToEdgeEnabled=false

android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

android/gradlew

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ done
8686
# shellcheck disable=SC2034
8787
APP_BASE_NAME=${0##*/}
8888
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
89-
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
90-
' "$PWD" ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
9190

9291
# Use the maximum available, or set MAX_FD != -1 to use that value.
9392
MAX_FD=maximum

android/settings.gradle

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,39 @@
11
pluginManagement {
2-
includeBuild(new File(["node", "--print", "require.resolve('@react-native/gradle-plugin/package.json', { paths: [require.resolve('react-native/package.json')] })"].execute(null, rootDir).text.trim()).getParentFile().toString())
2+
def reactNativeGradlePlugin = new File(
3+
providers.exec {
4+
workingDir(rootDir)
5+
commandLine("node", "--print", "require.resolve('@react-native/gradle-plugin/package.json', { paths: [require.resolve('react-native/package.json')] })")
6+
}.standardOutput.asText.get().trim()
7+
).getParentFile().absolutePath
8+
includeBuild(reactNativeGradlePlugin)
9+
10+
def expoPluginsPath = new File(
11+
providers.exec {
12+
workingDir(rootDir)
13+
commandLine("node", "--print", "require.resolve('expo-modules-autolinking/package.json', { paths: [require.resolve('expo/package.json')] })")
14+
}.standardOutput.asText.get().trim(),
15+
"../android/expo-gradle-plugin"
16+
).absolutePath
17+
includeBuild(expoPluginsPath)
18+
}
19+
20+
plugins {
21+
id("com.facebook.react.settings")
22+
id("expo-autolinking-settings")
323
}
4-
plugins { id("com.facebook.react.settings") }
524

625
extensions.configure(com.facebook.react.ReactSettingsExtension) { ex ->
726
if (System.getenv('EXPO_USE_COMMUNITY_AUTOLINKING') == '1') {
827
ex.autolinkLibrariesFromCommand()
928
} else {
10-
def command = [
11-
'node',
12-
'--no-warnings',
13-
'--eval',
14-
'require(require.resolve(\'expo-modules-autolinking\', { paths: [require.resolve(\'expo/package.json\')] }))(process.argv.slice(1))',
15-
'react-native-config',
16-
'--json',
17-
'--platform',
18-
'android'
19-
].toList()
20-
ex.autolinkLibrariesFromCommand(command)
29+
ex.autolinkLibrariesFromCommand(expoAutolinking.rnConfigCommand)
2130
}
2231
}
32+
expoAutolinking.useExpoModules()
2333

2434
rootProject.name = 'Start UI Native'
2535

26-
dependencyResolutionManagement {
27-
versionCatalogs {
28-
reactAndroidLibs {
29-
from(files(new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim(), "../gradle/libs.versions.toml")))
30-
}
31-
}
32-
}
33-
34-
apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle");
35-
useExpoModules()
36+
expoAutolinking.useExpoVersionCatalog()
3637

3738
include ':app'
38-
includeBuild(new File(["node", "--print", "require.resolve('@react-native/gradle-plugin/package.json', { paths: [require.resolve('react-native/package.json')] })"].execute(null, rootDir).text.trim()).getParentFile())
39+
includeBuild(expoAutolinking.reactNativeGradlePlugin)

0 commit comments

Comments
 (0)