EAS monorepo example
Enterprise-ready Expo Application Service monorepo with code sharing
apps- Expo apps that only use packages and aren't aware of other apps.
packages- Node packages that may use external and/or local packages.
apps/ejected- Expo bare app using
apps/managed- Expo managed app using
apps/with-sentry- Expo managed app with
packages/babel- Preconfigured Babel configuration for Expo.
packages/eslint- Preconfigured ESLint coniguration for Expo.
packages/ui- Shared React Native UI components for the apps, using the
preview- Publishes managed apps to a PR-specific release channel and adds a QR code to that PR.
standalone- Starts the EAS builds for user-provided OS and build profiles.
test- Ensures that the apps and packages are passing lint and build checks.
🚀 How to use it
To set this repository up, you need an Expo account with access to EAS. After that, you need to run these commands.
$ yarn- This installs all required Node libraries using Yarn Workspaces
$ yarn build- To precompile the packages to publish them to NPM and/or use them in your apps.
- Change the
app.jsonfor all apps.
After the initial setup, you can start the apps from their app directories. Or you can use
yarn workspace <name> expo start command, see
$ yarn ejected expo run:android|ios- This will execute
expo run:android|iosin the ejected app.
$ yarn managed expo start- This will execute
expo startin the managed app.
$ yarn with-sentry expo start- This will execute
expo startin the with-sentry app.
EAS only sends the files which are committed to the repository. That means the
packages/*/build folders need to be generated before building our apps. To tell EAS how to compile our packages, we can use the
Running EAS from apps directories
As of writing, the
eas build command needs to be executed from the package folder itself. EAS will still create a tarball with all files from your monorepo, but runs the build commands from this local folder. You can see this happening in the standalone workflow.
Using local credentials in CI
If you want to maintain the keystore or certificates yourself, you have to configure EAS with local credentials. When your CI provider doesn't allow you to add "secret files", you can encode these files to base64 strings and decode whenever you need it.
It's highly recommended to keep keystores and certificates out of your repository to avoid security issues.
❌ Common Errors
We are still testing for potential issues, but none are found yet!
with :heart: byCedric