Files
Kudo Chien 3229162cfd [expo-cli] Enhance Hermes support for expo export and publish (#3536)
# Why

this pr addresses some missing parts of hermes support.

# How

1. add hermes bytecode bundle to `printBundleSizes`.
2. add hermes bytecode bundle support for `expo publish`.
3. support managed workflow by reading the `android.jsEngine` config in app.json.
4. `android.jsEngine` in app.json is now the single source of truth to determine  if we need to generate hermes bytecode bundle.
5. introduce `maybeInconsistentEngineAsync()` to show an error prompt if there are inconsistencies between app config and native project.

# Test Plan

1. expo export + managed workflow app with `android.jsEngine=hermes` in app.json.
    make sure exported assets has hermes bytecode bundle.

2. expo publish + managed workflow app with `android.jsEngine=hermes` in app.json.
    download the asset and make sure it is a hermes bytecode bundle.

### Unit Test

```
packages/dev-server/src/__tests__/HermesBundler-test.ts
  maybeInconsistentEngineAsync - android
     should return false for managed project
     should return false if "enableHermes: true" in app/build.gradle and "jsEngine: 'hermes'" in app.json (1 ms)
     should return true if "enableHermes: false" in app/build.gradle and "jsEngine: 'hermes'" in app.json
     should return false if "expo.jsEngine=hermes" in gradle.properties and "jsEngine: 'hermes'" in app.json (2 ms)
     should return false for default sdk41 bare project
     should return true for default sdk41 bare project but user enabled hermes manually
     should handle the inconsistency between app/build.gradle and gradle.properties
```
2021-06-11 01:34:52 +08:00
..