fix: align CLI override & config plugin flag resolution#13
Merged
Conversation
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.
Why
The CLI and the config plugin each reassembled flag resolution by hand, consuming different subsets of the inputs (defaults, branch, env,
invertFor, platform). Two problems fell out of that:mergePathwith different logic, so re-running one undid the other.--skip-if-envonly existed to paper over this in EAS.invertFor.bundleIdwas unreliable under dynamic Expo config — inversion keys off the resolved bundle ID, which the plugin sees at prebuild but the CLI never did (it never resolved the Expo config).What changed
src/api/resolve.ts) is the only place flag values are computed — precedence: defaults → branch → inversion → enable → disable. CLI, plugin native side-effects, JS bundle module, and autolinking all route through it. Removed the duplicatedgenerateOverrides, the standaloneresolveFlagsToInvert, and theBuildFlagsclass.--skip-if-envis demoted to an optional optimization. An agreement test guards this.expo config --json(lazily, only when abundleIdmatcher exists, and cached), so it sees the same dynamically-derived bundle ID as the plugin.invertFor.platformmatcher + per-platform output — flags can resolve differently per platform; the runtime module splits into.ios.ts/.android.tsonly when values diverge (otherwise single module, with stale-file cleanup). The babel plugin picks the right file per compile platform.Compatibility
Pre-1.0, breaking by design.
override/ota-overrideandEXPO_BUILD_FLAGSare unchanged;flags.ymlgainsinvertFor.platform. ExistinginvertFor.bundleIdspecs get more reliable behavior with no changes.Closes #11