{"id":16175963,"url":"https://github.com/sebastiandg7/nx-reactnative-appcenter","last_synced_at":"2025-04-01T19:31:28.281Z","repository":{"id":221748401,"uuid":"755151451","full_name":"sebastiandg7/nx-reactnative-appcenter","owner":"sebastiandg7","description":"Example React Native app using AppCenter in an Nx monorepo","archived":false,"fork":false,"pushed_at":"2024-02-21T17:40:52.000Z","size":668,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T06:55:27.514Z","etag":null,"topics":["android","appcenter","cd","ios","monorepo","nx","nx-workspace","react-native"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sebastiandg7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-09T14:29:33.000Z","updated_at":"2024-08-22T15:05:11.000Z","dependencies_parsed_at":"2024-11-02T18:11:24.414Z","dependency_job_id":null,"html_url":"https://github.com/sebastiandg7/nx-reactnative-appcenter","commit_stats":null,"previous_names":["sebastiandg7/nx-reactnative-appcenter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastiandg7%2Fnx-reactnative-appcenter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastiandg7%2Fnx-reactnative-appcenter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastiandg7%2Fnx-reactnative-appcenter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastiandg7%2Fnx-reactnative-appcenter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sebastiandg7","download_url":"https://codeload.github.com/sebastiandg7/nx-reactnative-appcenter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246644040,"owners_count":20810686,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","appcenter","cd","ios","monorepo","nx","nx-workspace","react-native"],"created_at":"2024-10-10T04:46:56.007Z","updated_at":"2025-04-01T19:31:23.271Z","avatar_url":"https://github.com/sebastiandg7.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Demo: Nx + React Native + AppCenter\n\nThis repo aims to provide an example react native application under an Nx workspace using [AppCenter](https://appcenter.ms/) for it's CI/CD.\n\nVersions used:\n\n- Package manager: `yarn@1`\n- Nx: `18.0.3`\n- Node: `18.X`\n- React native: `0.73.2`\n- Java JDK: `17.0.10`\n\n| Platform                                                                                                                                         | Status       |\n| ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------ |\n| Android \u003cimg width=\"16\" alt=\"image\" src=\"https://simpleicons.org/icons/android.svg\" style=\"filter: opacity(0.5) drop-shadow(0 0 0 lightgreen);\"\u003e | `working` ✅ |\n| iOS \u003cimg width=\"16\" alt=\"image\" src=\"https://simpleicons.org/icons/apple.svg\" style=\"filter: opacity(0.5) drop-shadow(0 0 0 white);\"\u003e            | `working` ✅ |\n\n## Backlog\n\n- [x] Re-use workspace dependencies installation\n- [x] Reusable AppCenter custom build scripts via [zx](https://github.com/google/zx)\n- [ ] Only run if `mobile` Nx project is affected by the changes\n- [ ] Cache `node_modules` dependencies\n- [ ] Cache Pod dependencies for iOS\n\n# Workspace layout\n\n\u003cimg width=\"756\" alt=\"image\" src=\"https://github.com/sebastiandg7/nx-reactnative-appcenter/assets/13395979/7bce8ee4-0eb7-4cde-b640-0e7a13047ec7\"\u003e\n\n# Configuration\n\nTo make things work in AppCenter, we need to tune our project configuration as follows.\n\n## AppCenter project creation\n\nGo ahead to AppCenter and create an Android project and an iOS project for your react native app.\n\n1. Create the AppCenter project using `React Native` as platform and `Android`/`iOS` as OS.\n\nAndroid\n\u003cimg width=\"601\" alt=\"image\" src=\"https://github.com/sebastiandg7/nx-reactnative-appcenter/assets/13395979/0c13f290-3833-4511-8075-0b61f2e193ec\"\u003e\n\niOS\n\u003cimg width=\"601\" alt=\"image\" src=\"https://github.com/sebastiandg7/nx-reactnative-appcenter/assets/13395979/08582fad-a743-4c96-ab35-60bc6661a944\"\u003e\n\n2. Add build configuration to your branch using the app's `package.json`, not the workspace root `package.json`.\n\n\u003cimg width=\"756\" alt=\"image\" src=\"https://github.com/sebastiandg7/nx-reactnative-appcenter/assets/13395979/00c97adb-5b98-4bde-89e4-a292fd361d3a\"\u003e\n\n3. Envrionment variables\n\nRefer to the [environment variables section](#appcenter-environment-variables) about what to add for each platform build configuration.\n\n## Custom build scripts\n\nUsing [AppCenter custom build scripts](https://learn.microsoft.com/en-us/appcenter/build/custom/scripts/) we can setup the Nx workspace dependencies so that workspace libs are included in our build.\n\nCheck the following scripts:\n\n- `apps/mobile/appcenter-post-clone.sh`\n\n## AppCenter environment variables\n\nThe following are the custom environment variables you need to add in the AppCenter build configuration for each project.\n\n| Name                         | Value                 | Platform |\n| ---------------------------- | --------------------- | -------- |\n| `APPCENTER_CURRENT_PLATFORM` | `android` or `ios`    | both     |\n| `APPCENTER_NX_PROJECT`       | `mobile`              | both     |\n| `APPCENTER_NX_PROJECT_DIR`   | `apps/mobile`         | both     |\n| `JAVA_HOME`                  | `$(JAVA_HOME_17_X64)` | android  |\n\n# Significant changes\n\nIn order to make the react-native build work from AppCenter some files needed changes as we cannot spawn the nx build targets (AppCenter runs their own build commands).\n\n`./apps/mobile/.babelrc.js`\n\n\u003cimg width=\"695\" alt=\"image\" src=\"https://github.com/sebastiandg7/nx-reactnative-appcenter/assets/13395979/5561e2ee-75b1-4c6e-b252-e86b1c08d0e4\"\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebastiandg7%2Fnx-reactnative-appcenter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsebastiandg7%2Fnx-reactnative-appcenter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebastiandg7%2Fnx-reactnative-appcenter/lists"}