Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incorporate guide to deploy with eas service #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 85 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,94 @@
# Expo Starter Kit (JavaScript)

In order to use it, you must

## Installation

```shell
npm install
To use it with EAS, you **MUST** create your own development tool. To do this, follow the steps described in this guide:

1. Execute `npm install` or `npx expo install`.
2. Follow the integration instructions at [Viro Community Documentation on Integrating with Expo](https://viro-community.readme.io/docs/integrating-with-expo).

3. After completing the prebuild process described below, you must check that files exist and include all the changes described in the [Viro Community Documentation on Installation Instructions](https://viro-community.readme.io/docs/installation-instructions).

4. Then, navigate to your `MainApplication.kt` file located at `android/src/main/java/com/${your_expo_account}/expostarterkit/MainApplication.kt` and replace its content with the provided code.

```kotlin
package com.lmatamoros.expostarterkit

import android.app.Application
import android.content.res.Configuration
import androidx.annotation.NonNull
import com.facebook.react.PackageList
import com.facebook.react.ReactApplication
import com.facebook.react.ReactNativeHost
import com.facebook.react.ReactPackage
import com.facebook.react.ReactHost
import com.facebook.react.config.ReactFeatureFlags
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
import com.facebook.react.defaults.DefaultReactNativeHost
import com.facebook.react.flipper.ReactNativeFlipper
import com.facebook.soloader.SoLoader
import expo.modules.ApplicationLifecycleDispatcher
import expo.modules.ReactNativeHostWrapper
import com.viromedia.bridge.ReactViroPackage // Correct import for ReactViroPackage

class MainApplication : Application(), ReactApplication {

override val reactNativeHost: ReactNativeHost = ReactNativeHostWrapper(
this,
object : DefaultReactNativeHost(this) {
override fun getPackages(): List<ReactPackage> {
val packages = PackageList(this).packages // Gets the list of auto-linked packages

// Adds ReactViroPackage to the list
packages.add(ReactViroPackage(ReactViroPackage.ViroPlatform.valueOf("AR")))

// Returns the modified list
return packages
}

override fun getJSMainModuleName(): String = "index" // Make sure this is the correct main module for your project

override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG

override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
}
)

override val reactHost: ReactHost
get() = getDefaultReactHost(this.applicationContext, reactNativeHost)

override fun onCreate() {
super.onCreate()
SoLoader.init(this, false)
if (!BuildConfig.REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS) {
ReactFeatureFlags.unstable_useRuntimeSchedulerAlways = false
}
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
// If you opted-in for the New Architecture, we load the native entry point for this app.
load()
}
if (BuildConfig.DEBUG) {
ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager)
}
ApplicationLifecycleDispatcher.onApplicationCreate(this)
}

override fun onConfigurationChanged(newConfig: Configuration) {
super.onConfigurationChanged(newConfig)
ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig)
}
}

```

5. Run `npx eas build --profile development`.

6. Execute `npx expo start -c`.

## Running

```shell
Expand Down
37 changes: 37 additions & 0 deletions eas.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"cli": {
"version": ">= 0.49.0",
"promptToConfigurePushNotifications": false
},
"build": {
"development": {
"developmentClient": true,
"distribution": "internal",
"node": "18.17.0",
"channel": "viro-sk"
},
"preview": {
"distribution": "internal",
"node": "18.17.0",
"android": {
"buildType": "apk"
},
"channel": "viro-sk"
},
"production": {
"node": "18.17.0",
"channel": "viro-sk"
},
"productionAPK": {
"node": "16.19.1",
"android": {
"buildType": "apk"
},
"channel": "viro-sk"
}

},
"submit": {
"production": {}
}
}