react-native-macos/local-cli
Ville Immonen 6e99e314b2 Move HelloWorld template to a single index.js entry point
Summary:
This change (initially discussed in https://github.com/react-community/create-react-native-app/issues/26) moves the HelloWorld project template from two nearly identical entry points (`index.android.js` and `index.ios.js`) to a single, minimal `index.js` entry point. The root component is created in `App.js`. This unifies the project structure between `react-native init` and Create React Native App and allows CRNA's eject to use the entry point from the HelloWorld template without any hacks to customize it. Also examples in the docs can be just copy-pasted to `App.js` the same way in both HelloWorld and CRNA apps without having to first learn about  `AppRegistry.registerComponent`.

* Created a new project from the template using `./scripts/test-manual-e2e.sh` and verified that:
  * The app builds, starts and runs both on Android and iOS.
  * Editing and reloading changes works.
  * The new files (`index.js`, `App.js`, `__tests__/App.js`) get created in the project folder.

<img width="559" alt="screen shot 2017-08-01 at 19 10 51" src="https://user-images.githubusercontent.com/497214/28835171-300a12b6-76ed-11e7-81b2-623639c3b8f6.png">
<img width="467" alt="screen shot 2017-08-01 at 19 09 12" src="https://user-images.githubusercontent.com/497214/28835180-33d285e0-76ed-11e7-8d68-2b3bc44bf585.png">

<!--
Thank you for sending the PR!

If you changed any code, please provide us with clear instructions on how you verified your changes work. In other words, a test plan is *required*. Bonus points for screenshots and videos!

Please read the Contribution Guidelines at https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md to learn more about contributing to React Native.

Happy contributing!
-->
Closes https://github.com/facebook/react-native/pull/15312

Differential Revision: D5556276

Pulled By: hramos

fbshipit-source-id: 068fdf7e51381c2bc50321522f2be0db47296c5e
2017-08-03 14:02:43 -07:00
..
__mocks__ Fix lint in local-cli 2016-11-14 11:13:42 -08:00
bundle metro-bundler: remove hardcoded AssetRegistry path 2017-07-24 17:16:39 -07:00
core metro-bundler: remove hardcoded AssetRegistry path 2017-07-24 17:16:39 -07:00
dependencies Add missing `assetRegistryPath` to dependencies command 2017-07-27 18:05:49 -07:00
eject Eject CLI command to re-create native folders 2017-02-03 12:58:46 -08:00
generator Move HelloWorld template to a single index.js entry point 2017-08-03 14:02:43 -07:00
info added info CLI command 2017-07-18 11:45:47 -07:00
init CLI: Add support for project templates 2017-02-06 12:31:25 -08:00
install Use Yarn for Install/Uninstall CLI if available 2017-02-02 05:13:33 -08:00
library Fix new-library to copy to current project 2017-05-29 12:46:08 -07:00
link Make the CLI recognize CRNA projects 2017-08-03 12:10:47 -07:00
logAndroid Use native Promise in local-cli 2016-11-21 10:28:34 -08:00
logIOS Use native Promise in local-cli 2016-11-21 10:28:34 -08:00
runAndroid Make the CLI recognize CRNA projects 2017-08-03 12:10:47 -07:00
runIOS Make the CLI recognize CRNA projects 2017-08-03 12:10:47 -07:00
server Saner entry point 2017-07-27 18:05:49 -07:00
templates Move HelloWorld template to a single index.js entry point 2017-08-03 14:02:43 -07:00
upgrade New upgrading process, relying on Git 2016-11-28 08:28:35 -08:00
util Make the CLI recognize CRNA projects 2017-08-03 12:10:47 -07:00
.eslintrc disable `no-alert` eslint rule for node code 2017-05-03 06:51:47 -07:00
cli.js packager: centralize babelRegisterOnly callsites 2017-01-06 06:13:54 -08:00
cliEntry.js Stronger config types 2017-05-03 06:51:47 -07:00
commands.js added info CLI command 2017-07-18 11:45:47 -07:00
setup_env.bat Fix comments on .bat file 2015-10-28 21:36:07 -04:00
setup_env.sh CLI: Adding shebang to setup_env.sh script 2017-05-31 02:46:23 -07:00
wrong-react-native.js Run eslint on all js files 2017-07-12 14:09:53 -07:00