Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

[config] add getPublicExpoConfig method and tests #2863

Merged
merged 3 commits into from
Nov 9, 2020

Conversation

esamelson
Copy link
Contributor

First piece of Constants.manifest support in bare workflow. Later we'll be adding a script to expo-constants that evaluates and generates and app config to include in bare apps for Constants.manifest.

This PR adds a method to @expo/config which that script can use to get the subset of the app config intended for public consumption (e.g. the data that would be served with the manifest from expo-cli or www).

From reading the publish code in XDL, it looks like the pieces of the app config that are deleted for the purpose of not being visible in the public manifest are the hooks, ios.config, and android.config fields. (Many other fields are changed, of course, but these seem to be the sensitive ones.) Therefore, the current implementation of this method simply deletes those fields.

Added some unit tests to ensure there are no accidental regressions here, and that other fields aren't touched.

@@ -74,6 +74,8 @@ export function getConfigWithMods(projectRoot: string, options?: GetConfigOption
* If a function is exported from the `app.config.js` then a partial config will be passed as an argument.
* The partial config is composed from any existing app.json, and certain fields from the `package.json` like name and description.
*
* If options.omitPrivateExpoConfig is true, the Expo config will include only public-facing portions.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* If options.omitPrivateExpoConfig is true, the Expo config will include only public-facing portions.
* If options.omitPrivateExpoConfig is true, the Expo config will include only public-facing options (omitting private keys).

Copy link
Contributor

@EvanBacon EvanBacon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@esamelson esamelson merged commit b718000 into master Nov 9, 2020
@esamelson esamelson deleted the @eric/public-config branch November 9, 2020 22:36
@jvgaeta
Copy link

jvgaeta commented Mar 16, 2022

This is causing my integration with react-native-maps to be broken. In the expo mapview docs, you have to set the field android.config.googleMaps.apiKey. Eas is using expo config and this pr causes that key to be filtered out, making the build of my app unusable.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants