expo / config-plugins

Out-of-tree Expo config plugins for packages that haven't adopted the config plugin system yet.
427 stars 91 forks source link

feat(tv): Add TV plugin (@config-plugins/tv) #194

Closed douglowder closed 9 months ago

douglowder commented 9 months ago

Why

We need a way to allow Expo users to modify their Android and iOS projects to support TV.

After internal discussion, we intend to support that with this plugin, which will allow faster iteration than if these features are implemented within the CLI or elsewhere in the Expo monorepo.

How

The plugin has an isTV setting, that can be enabled either with the environment (EXPO_TV) or an optional plugin parameter isTV.

When isTV is true, the iOS Podfile, Xcode project, and splash screen storyboard are modified to support TV.

When isTV is false, the plugin sees if the above TV modifications have been made, and reverts them.

The plugin requires (but does not check) that the React Native TV repo be used in place of the normal React Native dependency:

{
  "dependencies": {
    "react-native": "npm:react-native-tvos@^0.72.4-0"
  }
}

If this is not the case, the plugin will run successfully, but Cocoapods installation will fail, since the React Native core repo does not support Apple TV.

Test Plan

douglowder commented 9 months ago

ENG-10042

douglowder commented 9 months ago

Test app to try this plugin out: https://github.com/douglowder/TestConfigPluginTV