[build-tools] Use production mode for app config and Expo commands - #4180
[build-tools] Use production mode for app config and Expo commands#4180ramonclaudio wants to merge 13 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4180 +/- ##
==========================================
+ Coverage 63.74% 63.86% +0.12%
==========================================
Files 1030 1032 +2
Lines 47477 47511 +34
Branches 9990 9993 +3
==========================================
+ Hits 30260 30338 +78
+ Misses 17116 17072 -44
Partials 101 101 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
0822cb4 to
bdc5d2b
Compare
ad8a21c to
0822cb4
Compare
# Why The EAS changes in [#4180](expo/eas-cli#4180) tell Expo to use development or production mode when loading app config, so we needed a temporary internal environment variable that Expo reads and removes before app config loads. # How I added `__EXPO_CONFIG_MODE` as an internal handoff that `@expo/env` reads and removes before Expo loads the dotenv files and app config. I blocked `.env` files from setting the handoff and updated `getOriginalEnv()` and `getOriginalEnvValue()` to exclude dotenv values inherited from a parent process. We still use `EAS_BUILD` as the production fallback for older EAS versions. # Test Plan Tests and package checks pass. # Checklist - [x] I added a `changelog.md` entry and rebuilt the package sources according to [this short guide](https://github.com/expo/expo/blob/main/CONTRIBUTING.md#-before-submitting) - [ ] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
0822cb4 to
e3e4ea2
Compare
a028130 to
f045885
Compare
f045885 to
2ce2235
Compare
2ce2235 to
df98b5f
Compare
|
✅ Thank you for adding the changelog entry! |
|
/review |
🤖 AI code reviewDecision: Ready for human review Overall PR risk: High. The change modifies existing behavior. It forces No findings. This review is advisory — it never blocks a merge and never auto-approves. |
|
/verify |
Why
EAS Build can use an existing
NODE_ENVwhen it loads app config or runs Expo commands, which can make it load different env files for the same build.How
I updated EAS Build to use
productionmode for app config, prebuild, Expo Doctor, and runtime version resolution, and kept the original build env for dep installs.Test Plan
Tests and CI checks pass.