Repository navigation
chore(eas): give each build profile its backend, and refuse a local one - #76
Merged
Merged
Conversation
The EAS profiles existed and said nothing about which server they talk to, so
every build inherited whatever `.env` happened to be on the machine that made
it. A QA build is only worth having if you know what it is pointing at.
Each profile now declares it:
development no API URL — inferred from the Metro host, which is how a dev
build reaches Django on the developer's own machine
preview https://blackdogstoreperu.com
production https://blackdogstoreperu.com
THESE ARE PUBLIC VALUES AND THEY ARE IN THE FILE ON PURPOSE. `EXPO_PUBLIC_*` is
inlined into the JavaScript bundle; it is client configuration, not a secret,
and the host is the storefront anybody can open. In the file it is reviewable
and it travels with the commit that built it. Secrets stay out of
`EXPO_PUBLIC_*` entirely, which the config module already says.
AND A DISTRIBUTED BUILD MAY NOT POINT AT A LOCAL MACHINE. `localhost` baked
into a preview binary is the developer's laptop as seen from somebody else's
phone: every request fails, or worse, reaches whatever answers on that port on
THEIR network. A release build that resolves to a local-only host — localhost,
127.0.0.1, 0.0.0.0, the Android emulator's 10.0.2.2, anything `.local` — now
resolves to NO api at all, so the app says it is unconfigured, once and
loudly, instead of failing one request at a time. Development is exempt,
because that is exactly where a local backend is the point.
The profile names are the project's own (`ios-simulator`, not a second
`development-simulator`), and `base` keeps pinning Node 24.16.0 so a bundle
that passes CI is built the same way.
Four scripts for the builds people actually run.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The EAS profiles existed and said nothing about which server they talk to, so every build inherited whatever
.envhappened to be on the machine that made it. A QA build is only worth having if you know what it points at.Each profile now declares it
These are public values and they are in the file on purpose.
EXPO_PUBLIC_*is inlined into the JS bundle — client configuration, not a secret — and the host is the storefront anybody can open. In the file it is reviewable and travels with the commit that built it. Secrets stay out ofEXPO_PUBLIC_*entirely, as the config module already states.A distributed build may not point at a local machine
localhostbaked into a preview binary is the developer's laptop as seen from somebody else's phone: every request fails, or worse, reaches whatever answers on that port on their network. A release build resolving to a local-only host —localhost,127.0.0.1,0.0.0.0, the Android emulator's10.0.2.2, anything.local— now resolves to no API at all, so the app says it is unconfigured once and loudly instead of failing one request at a time. Development is exempt: a local backend is the point there.There is no staging host and no QA tenant — I probed
staging./qa./dev.blackdogstoreperu.com(all unreachable) and thedemo/qa/test/sandboxtenant slugs (all 404). So preview points at production, with real customer data. Preview builds should be used for read-only smoke; anything destructive (sales, refunds, stock moves, service delivery) belongs on a local backend via thedevelopmentprofile, which is how the current QA flow already works.Kept as the project had it
Profile names are the project's own (
ios-simulator, not a seconddevelopment-simulator),basestill pins Node 24.16.0 so a bundle that passes CI is built the same way, and the bundle id / package / projectId are untouched.Checks
tsc --noEmitclean,eslint0 errors,expo-doctor21/21expo exportios + android passeas configresolves all profiles with their env🤖 Generated with Claude Code