Commit Graph

424 Commits

Author SHA1 Message Date
Felix Krause 5e008c932c Add fastlane to default .gitignore
Summary:
Taken from the [github/gitignore repo](https://github.com/github/gitignore/blob/master/Objective-C.gitignore)
Closes https://github.com/facebook/react-native/pull/11113

Differential Revision: D4231705

fbshipit-source-id: 3d768b6b73cb53a313a2260f825cfef94b809ece
2016-11-24 08:28:25 -08:00
David Aurelio ca58e0af82 BREAKING kill deprecated asset support
Summary:
This removes support for `require('image!…')`, which has been deprecated for a long time.

It is still possible to use images that are already bundled by the native app using the `nativeImageSource` module.
Check http://facebook.github.io/react-native/docs/images.html for detailed documentation.

Reviewed By: matryoshcow

Differential Revision: D4231208

fbshipit-source-id: 05ec4c1ca0fabdc3fbb652f8ad1acdf240a67955
2016-11-24 05:43:38 -08:00
Pieter De Baets e1577df1fd Move all header imports to "<React/..>"
Summary:
To make React Native play nicely with our internal build infrastructure we need to properly namespace all of our header includes.

Where previously you could do `#import "RCTBridge.h"`, you must now write this as `#import <React/RCTBridge.h>`. If your xcode project still has a custom header include path, both variants will likely continue to work, but for new projects, we're defaulting the header include path to `$(BUILT_PRODUCTS_DIR)/usr/local/include`, where the React and CSSLayout targets will copy a subset of headers too. To make Xcode copy headers phase work properly, you may need to add React as an explicit dependency to your app's scheme and disable "parallelize build".

Reviewed By: mmmulani

Differential Revision: D4213120

fbshipit-source-id: 84a32a4b250c27699e6795f43584f13d594a9a82
2016-11-23 07:58:39 -08:00
Mike Grabowski 9fb520e3b2 Add ability to specify main Activity in run-android
Summary:
Follow up to #8190

Tested with custom parameter as well as w/o (using default value). All worked well.

Differential Revision: D4220565

Pulled By: mkonicek

fbshipit-source-id: e8a98542d3ff96d60ff6045b328f5b464f78ee74
2016-11-23 06:43:50 -08:00
Martin Konicek 3aa25f7917 Allow git to merge pbxproj files
Summary:
Follow on in https://github.com/facebook/react-native/pull/10864.

**Motivation**

ncuillery Is has a lot of experience with upgrading RN projects (see his [talk](http://www.slideshare.net/ncuillery/introducing-the-new-reactnative-upgrade)) and is rewriting 'react-native upgrade' to use git.

He tells me that we actually want git to merge changes in the .pbxproj file. In his words: "Making the project.pbxproj invisible for "git diff" means that react-native-git-upgrade will never be able to upgrade the project.pbxproj."

Note the git docs explicitly recommend not to use git to merge .pbxproj files: https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes#Binary-Files

ncuillery do we have an alternative? Some ideas:

1. Use a 3rd-party tool in 'react-native upgrade' to merge the .pbxproj file?
2. We could always re-generate and overwrite the .pbxproj file (never merge) and then run 'react-native link' to update native 3rd-party dependencies in the Xcode project?
3. Last resort: stay away
Closes https://github.com/facebook/react-native/pull/11047

Differential Revision: D4220521

fbshipit-source-id: 823c735856b519be114aa4349ca1392910f00445
2016-11-22 17:58:29 -08:00
Wojciech Ogrodowczyk 145692a940 Fix typo when running an unknown simulator
Summary:
Just fixes a typo in an error message when running a simulator that XCode doesn't recognise.
Closes https://github.com/facebook/react-native/pull/11060

Differential Revision: D4220364

Pulled By: mkonicek

fbshipit-source-id: da7b9a529ad8cd77c6e144f4bbf3ea594a9efee4
2016-11-22 11:58:37 -08:00
David Aurelio f3779502d3 Add flow types for output modules
Summary: Adds flow types for output functionality for easier maintenance and interop with new code

Reviewed By: matryoshcow

Differential Revision: D4211863

fbshipit-source-id: 591407d3a6d49536054ae94ba31125c18a1e1fa1
2016-11-21 13:28:30 -08:00
Martin Konicek 9712d335e2 Fix handling of dotfiles in 'react-native init' and 'react-native upgrade'
Summary:
Followup for CLI rewrite (a477aec10d). See the comment in the code for details.

**Test plan (required)**

- Published to Sinopia locally ([docs](https://github.com/facebook/react-native/tree/master/react-native-cli))
- Ran 'react-native init MyApp', the correct files were created (no more .npmignore, but have .gitignore):

      $ cd MyApp
      $ ls -a
      .			.flowconfig		__tests__		ios
      ..			.gitattributes		android			node_modules
      .babelrc		.gitignore		index.android.js	package.json
      .buckconfig		.watchmanconfig		index.ios.js		yarn.lock

- Changed .flowconfig, ran 'react-native upgrade'. Saw a prompt "Do you want to overwrite .flowconfig", tried answering first 'n' and then 'y'. When answering 'y' the file was overwritten by the version from the template as expected.
Closes https://github.com/facebook/react-native/pull/11051

Differential Revision: D4214831

Pulled By: ericvicenti

fbshipit-source-id: 7c6aae4f97c7d45e7241bf017ed2f6527d5d29fe
2016-11-21 12:58:29 -08:00
Ovidiu Viorel Iepure 8dbb025959 Fix lint in local-cli
Summary: Fix more lint warnings in local-cli

Reviewed By: davidaurelio

Differential Revision: D4213265

fbshipit-source-id: a7f251f2af1e1de67a2b51908713e7a18faf6f18
2016-11-21 10:28:34 -08:00
Ovidiu Viorel Iepure 812591ac42 Use native Promise in local-cli
Summary: Switch to native promises in the local cli

Reviewed By: davidaurelio

Differential Revision: D4213142

fbshipit-source-id: aff99f8bb3dc237cecc852cdb09dee9b49b05753
2016-11-21 10:28:34 -08:00
Pieter De Baets 7c91f894ba Fix CSSLayout import hack, update podspec
Summary: Correct header import paths, update podspec so we point at the copy in ReactCommon (and can eventually remove the copy under React)

Reviewed By: astreet

Differential Revision: D4204501

fbshipit-source-id: e979a010092f025b2cdc289e1e5f22fc7b65a8d1
2016-11-21 09:13:36 -08:00
Martin Konicek b74da13a75 Fix after using hg
Summary:
I had to re-do my CLI pull request internally using hg because shipit couldn't import binary files even after debugging with the OSS team. While using hg I messed up. This should fix it:

- Remove files added by mistake when using 'hg addremove'
- Add Xcode project that was ignored by hg (probably at fb we don't want people to check in Xcode projects since we use Buck)

**Test Plan**
Travis tests on this pull request.
Closes https://github.com/facebook/react-native/pull/11043

Differential Revision: D4212755

Pulled By: bestander

fbshipit-source-id: c762472ed31b9845425c1766510dce7761a35ae0
2016-11-21 04:58:29 -08:00
Cristian Carlesso c8a5b42b45 Remove unused jest-react-native leftovers
Reviewed By: cpojer

Differential Revision: D4212163

fbshipit-source-id: 61d86d03ea817088b378c21d16a35104bc33920b
2016-11-21 00:13:25 -08:00
Tim Yung 0ec0b9df8e RN: Logger for Hot Module Reloading Logs
Summary: Uses `Logger` for the HMR Server output so that we get timestamps for free and the packager server output does not look as crappy.

Reviewed By: cpojer

Differential Revision: D4210827

fbshipit-source-id: e1ae64c359150b98c33e7b074f1111d37a2bc39b
2016-11-20 19:58:30 -08:00
Martin Konicek a477aec10d Rewrite 'react-native init' and 'react-native upgrade' without using Yeoman in preparation for templates support
Summary:
This is the manually imported version of https://github.com/facebook/react-native/pull/10786

This was mostly straigthforward by replacing the local-cli folder with the version I had in my local git checkout,
plus a few other files I listed with git diff --name-only.

Reviewed By: hramos

Differential Revision: D4201118

fbshipit-source-id: 4d0fb54b0edda9de1abba427958e420fd2ac105c
2016-11-18 18:28:51 -08:00
David Aurelio 112bdc99dc Add `--indexed-unbundle` flag to force iOS ra-bundle format
Summary: This adds a new flag to the `unbundle` command: `--indexed-unbundle` allows to output the indexed file format even when building for android.

Reviewed By: cpojer

Differential Revision: D4189485

fbshipit-source-id: e56192456de764eb38c25b574ceaaf52eb8a6fca
2016-11-17 02:43:26 -08:00
Christoph Pojer a9338d6af1 New file watching implementation
Summary:
This is the next incremental step to rewrite node-haste. I apologize for the size of this diff but there is really no smaller way to do this. The current architecture passes a single file watcher instance into many classes that each subscribe to file changes. It's really hard to keep track of this. The new implementation reduces the listeners to two (will eventually be just one!) - one in DependencyGraph and one in it's parent's parent's parent (ugh! This doesn't make any sense). This should make it much more straightforward to understand what happens when a file changes.

I was able to remove a bunch of tests because jest's watcher takes care of things like ignore patterns. Some of the tests were specifically testing for whether the change events were invoked and they are now much more straightforward as well by manually invoking the `processFileChange` methods.

(Relanding a fixed version of D4161662)

Reviewed By: kentaromiura

Differential Revision: D4194378

fbshipit-source-id: 8c008247a911573f6b5f6b0b374d50d38f62a4f5
2016-11-16 20:13:26 -08:00
Martin Konicek 14ac051c19 Revert D4161662: [RNP] New file watching implementation
Differential Revision: D4161662

fbshipit-source-id: 00604387b4f4b808f95275458f1c653981f91b86
2016-11-16 10:28:31 -08:00
Christoph Pojer e8a623a2ab New file watching implementation
Reviewed By: davidaurelio

Differential Revision: D4161662

fbshipit-source-id: 9a2a399304c83b411a8b0b74ea015c18b599fbaf
2016-11-16 01:13:40 -08:00
Alexander Blom 2cc57d05a4 Support loading source maps
Reviewed By: davidaurelio

Differential Revision: D4121492

fbshipit-source-id: e2f9c42de3e28cd231580d8b7d3230d47e300d2e
2016-11-15 08:59:02 -08:00
Alexander Blom f571d28e68 Allow launching inspector from dev menu
Reviewed By: davidaurelio

Differential Revision: D4095356

fbshipit-source-id: 46e43578cdcd663316efb82dffde27b77294c5c0
2016-11-15 08:59:02 -08:00
Alexander Blom 655fe2796a Add packager inspector proxy
Summary:
Implements a multi-device proxy for the Chrome debugging protocol. Each device connects
to the proxy over a single websocket connection that is able to multiplex messages to multiple
Javascript VMs. An inspector instance running in Chrome can connect to a specific VM via this
proxy.

Reviewed By: davidaurelio

Differential Revision: D4088492

fbshipit-source-id: 3ee934e98604b5a378da732e687ca05fe3d23ce0
2016-11-15 08:59:02 -08:00
Ovidiu Viorel Iepure 24d2bbfbab Fix lint in local-cli
Reviewed By: cpojer

Differential Revision: D4166993

fbshipit-source-id: 9a8249175d98b42d7557817846d8c09c9769485e
2016-11-14 11:13:42 -08:00
Sandro Machado 2a2d3c6e5a Add the configuration option to the run-android command
Summary:
Currently, to generate a `Release` build in `Android` it is required to get into the `android` directory and run the `react native bundle`with a lot of options and after that run the `gradle` to assemble or install the application with the build type `Release`.

This PR improves the process adding that feature to the `React Native CLI`.

To generate a release build is only required to use the parameter `--configuration` with the value `Release`.

**Examples**

To generate a release build:
```sh
react-native run-android --configuration release
```

To generate a release build for the product flavors staging:
```sh
react-native run-android --configuration release --flavor staging
```

To generate a debug build:
```sh
react-native run-android
```

To generate a debug build for the product flavors staging:
```sh
react-native run-android --flavor staging
```

This PR also removes the option `--install-debug` from the `react-native run-android` because that is always the default value,
Closes https://github.com/facebook/react-native/pull/10867

Differential Revision: D4167203

Pulled By: cpojer

fbshipit-source-id: c5ac07f81feeeea00ee0e8b059b46ef0d258a1a6
2016-11-13 18:58:29 -08:00
Dustin Ingram 07dc35e4ad Add .gitattributes file, treat .pbxproj as binary
Summary:
By default, the `.pbxproj` file generated by React Native should be treated as binary data to prevent Git from possibly automatically converting or fixing CRLF issues with this file, which would break it.

See https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes#identifying-binary-files-znTLIVhvhG (where it specifically mentions `.pbxproj` files) for more information.
Closes https://github.com/facebook/react-native/pull/10864

Differential Revision: D4162492

fbshipit-source-id: 2c8f2f0ab2bb41c23b1460ef6cba672ef38f6310
2016-11-10 17:58:41 -08:00
Sandro Machado ca7cbdee85 Add the scheme configuration option to the run-ios command
Summary:
With the current `run-ios` script it is not possible to create/run iOS release builds or any other kind of scheme configuration from the terminal (we need to use `Xcode`). The reason for this is that the `run-ios` script does not expose the scheme configuration option for the `xcodebuild` command. This PR exposes that property and allows the developers to directly create/run release builds from the terminal.

This PR also closes [this](https://productpains.com/post/react-native/create-ios-release-builds-from-terminal) request at `productpains`.

And answers to [this](http://stackoverflow.com/questions/40303229/run-a-react-native-ios-release-build-from-terminal) question at the `stackoverflow`.

**Test plan (required)**

To generate a release build just run:

``` sh
react-native run-ios --configuration Release
```

The output

``` sh
Found Xcode project App.xcodeproj
Launching iPhone 6 (iOS 9.3)...
Building using "xcodebuild -project App.xcodeproj -scheme App -destination id=B0738993-CE4A-4D
Closes https://github.com/facebook/react-native/pull/10637

Differential Revision: D4151793

Pulled By: cpojer

fbshipit-source-id: 5a0fcdd59589977f3e251ec9bb3ba85e8919cffc
2016-11-10 09:58:42 -08:00
Sreejith R 8965f11769 Included NativeAnimation module on iOS in the starter project
Summary:
Fixes #10638.

Added NativeAnimation library to the starter project iOS generator. Passing `useNativeDriver: true` to `Animated` config will enable the app to tap into the native code for animations.

**Test plan**

Init a RN project and animate an element. Enable native driver as follows:

```
Animated.timing(
      this.state.value,
      {
        toValue: 300,  // some value
        useNativeDriver: true
      }
    ).start();
```
Earlier, this used to crash.
Closes https://github.com/facebook/react-native/pull/10783

Differential Revision: D4159386

Pulled By: mkonicek

fbshipit-source-id: 993481a31b4446eab24ef4ee35ae1941d7a7aae9
2016-11-10 00:58:33 -08:00
Ovidiu Viorel Iepure 33fb428a07 Use npm for e2e tests
Summary:
Force npm for e2e tests.
Bonus: tracked down and removed a non-standard `.done()` call that was breaking e2e tests.

Reviewed By: bestander

Differential Revision: D4153514

fbshipit-source-id: 079939874ea75c7ea6e3e5376d37873c95fc74c1
2016-11-09 09:31:12 -08:00
Yariv Kenan f0a58af37b Change matching pattern on settings.gradle
Summary:
Link doesn't work on f8app,
as it is, android projects don't have to contain the matching string and then the linking would not work, I've switched it to the much simpler new-line.
If you can find a better common minimum string for settings.gradle please do.

Commit Msg:
Current string, `include ':app'\n`, is not a minimum common string.
Instead a simple `\n` will do.
Closes https://github.com/facebook/react-native/pull/10172

Differential Revision: D4150313

fbshipit-source-id: 34470e1fb67194e41354b6085fb3eb90ddaa7ff8
2016-11-08 16:28:43 -08:00
Ovidiu Viorel Iepure b12db7645e Use native Promises
Summary: Use native Promises in React Native Packager. Remove all the non-standard `Promise.done()` calls throughout the codebase & replace `Promise.denodeify` with the stand-alone `denodeify` module.

Reviewed By: davidaurelio

Differential Revision: D4146965

fbshipit-source-id: 1730531c914863ac3c52626801d9f91c28eed717
2016-11-08 12:28:47 -08:00
Andres Suarez ba8bbcbe2f Remove prepack bundle functionality
Reviewed By: davidaurelio

Differential Revision: D4138495

fbshipit-source-id: 52793fc1a8ef8b2fc461156607c360f34c4cb362
2016-11-07 03:43:37 -08:00
Matthew Dapena-Tretter a643784144 Allow arguments in the editor env var
Reviewed By: frantic

Differential Revision: D4129207

fbshipit-source-id: a92fbbbe917db9c9afc0d970e3ac546e2a14bced
2016-11-04 12:59:17 -07:00
Martin Konicek c02c7f3024 CLI: Only use yarn if global CLI uses it
Summary:
Check that 'react-native init' itself used yarn to install React Native.
When using an old global react-native-cli@1.0.0 (or older), we don't want to install React Native with npm, and React + Jest with yarn. Let's be safe and not mix yarn and npm in a single project.

**Test plan**

Publish the code in this PR to Sinopia, use that when creating a new project.

Using old CLI:

    npm install -g react-native-cli@1.0.0
    react-native init AwesomeApp

The generated project doesn't contain `yarn.lock` (everything was installed with the npm client).

 ---

Using new CLI:

    npm install -g react-native-cli@1.2.0
    react-native init AwesomeApp

The generated project contains `yarn.lock`, output shows that yarn is used to install React Native, React, Jest.

 ---

In both cases the project runs and Reload JS works:

![screenshot 2016-11-04 17 20 50](https://cloud.githubusercontent.com/assets/346214/20015719/719effb0-a2b4-11e6-84a0-43474314009b.png)
Closes https://github.com/facebook/react-native/pull/10752

Differential Revision: D4131812

Pulled By: bestander

fbshipit-source-id: efaaf97a27005e2c2d10cae5d07afe108d5c0dee
2016-11-04 11:28:40 -07:00
Felix Oghina 0907ef6689 Call SoLoader.init in MainApplication#onCreate
Summary:
Fixes #10352.
Closes https://github.com/facebook/react-native/pull/10724

Differential Revision: D4126371

fbshipit-source-id: e1765e2d2a3ff80a962f1db6bdc9e90d797d3ab6
2016-11-03 13:29:09 -07:00
Ben Bodenmiller dc0a5ec75d ignore all keystore files
Summary:
Ignore all keystore files as we do not want users to accidentally check in their keystore file.
Closes https://github.com/facebook/react-native/pull/10214

Differential Revision: D4118169

Pulled By: bestander

fbshipit-source-id: a81fc99afd1715d52dfdce8c47dfc10808470008
2016-11-02 11:15:10 -07:00
Martin Konicek 94711bfb06 Use yarn when available
Summary:
**Motivation**

`react-native init` takes minutes even on a fast network. Yarn makes it much quicker.

When yarn is not installed on the system:

<img width="440" alt="screenshot 2016-10-31 22 21 19" src="https://cloud.githubusercontent.com/assets/346214/19873897/7bad5662-9fb9-11e6-85fb-ad4879949dad.png">

When yarn is installed:

<img width="441" alt="screenshot 2016-10-31 22 02 20" src="https://cloud.githubusercontent.com/assets/346214/19873898/7baf4c56-9fb9-11e6-96b3-007f93d2438a.png">

Also added the option `react-native init AwesomeApp --npm` as a fallback in case yarn is not stable enough for some people (I saw some Github issues that yarn hangs for example; for me it works great though).

**Test plan**
1. Publish to Sinopia: https://github.com/facebook/react-native/tree/master/react-native-cli
2. `react-native init AwesomeApp`

***Tested the following setups***

- New CLI - uses yarn, new react-native - uses yarn
- Old CLI (1.0.0) - doesn't use yarn, new react-native - uses yarn
-
Closes https://github.com/facebook/react-native/pull/10626

Differential Revision: D4110883

Pulled By: bestander

fbshipit-source-id: 8a3427e2bc9158cf5fadd8ddf5b31e4b50ce6453
2016-11-01 09:28:52 -07:00
Cristian Carlesso 6d3e074dd4 Adding Jest preset so that people can configure Jest using react-native as preset
Reviewed By: cpojer

Differential Revision: D4081817

fbshipit-source-id: 43cf2ec467ea69651705162b6a58e0b3f1ad1dbf
2016-10-31 12:58:35 -07:00
Tim Yung 8b653cde56 RN: Show Warning for Background Remote Debuggers
Summary:
Some recent change to Chrome causes the remote debugger to be throttled unexpectedly if it is in a background tab. Although this does not fix the problem, it raises the issue and suggests a workaround.

I also cleaned up some littering of the global namespace in the debugger web worker.

Reviewed By: jingc

Differential Revision: D4104515

fbshipit-source-id: 56e46c0e759bec4c42d3baedd4d2d46cdea2e4a0
2016-10-31 11:29:57 -07:00
Tim Yung 448e66b3fa RN: Cleanup Debugger HTML
Summary: Minor cleanup to `debugger.html`.

Reviewed By: fkgozali

Differential Revision: D4104499

fbshipit-source-id: f484711b4a855a1fd703d3a457b96ad45e0250e2
2016-10-31 11:29:57 -07:00
Mehdi AHRAOUI a16d72842d debuggerWorker.js contains code incompatible with node 5
Summary:
Hi,

This is a small fix for issue #10564.
Closes https://github.com/facebook/react-native/pull/10571

Differential Revision: D4086542

fbshipit-source-id: a50b4b3afdefe4abfe64869768ce51c6c628708a
2016-10-26 19:28:38 -07:00
Charles Dick 6ddf8a8795 refactor aggrow to make adding new sources of data easier
Reviewed By: michalgr

Differential Revision: D3961648

fbshipit-source-id: 3c77d3c1352fd89e12163eee393ffcebe09ea8e3
2016-10-25 07:13:51 -07:00
aleclarson 178a19f3da Fix 'mapHeaderSearchPaths'
Summary:
👍
Closes https://github.com/facebook/react-native/pull/9976

Differential Revision: D4070412

fbshipit-source-id: fc0a1d10606faa117d46eeab62669c62923ce935
2016-10-24 15:13:30 -07:00
Kevin Lacker c4aa29c753 Update Android support URL
Summary:
> Explain the **motivation** for making this change. What existing problem does the pull request solve?

There's no longer a seaprate page for Android setup instructions, it just redirects to the getting started page, where you have to navigate futher.

**Test plan (required)**

None.
Closes https://github.com/facebook/react-native/pull/10524

Differential Revision: D4069696

Pulled By: lacker

fbshipit-source-id: 67f6450f550cbbf446476ea824a6915125e823ba
2016-10-24 13:43:36 -07:00
Rob Clouth 157a03dd8d Fixes react-native link for apps with extra xcode projects in the root folder
Summary:
Adds a ```sort``` to ```findProject(folder)``` to boost ones in IOS_BASE to the top. Otherwise, if for example there is a git submodule project in the root app folder, the method will pick that one instead and linking will fail.
Fixes issue #10494
Closes https://github.com/facebook/react-native/pull/10495

Differential Revision: D4069439

Pulled By: lacker

fbshipit-source-id: 4328ac55389ed51cb42759fcf8360e56d5058136
2016-10-24 13:13:46 -07:00
David Aurelio d7aa297762 Break out defaults, add flow for Config
Summary: In order to make `Config` and defaults available to our new code, I’ve added flow types and put default values into one shared modile

Reviewed By: cpojer

Differential Revision: D4044600

fbshipit-source-id: 875ed3ade69c5b22bb3c1b177e7bad732834d476
2016-10-22 06:13:42 -07:00
Christoph Pojer fb4f34bc9b Remove fastpath
Summary: I originally added fastpath to node-haste to speed up `path` operations by an order of magnitude. Now we are exclusively using Node 6 at FB so we don't need to ship this thing any more.

Reviewed By: bestander

Differential Revision: D4029092

fbshipit-source-id: 064cf67f4f79ce4f2774fb4e430d22eef4a95434
2016-10-20 00:14:03 -07:00
Yoshiya Hinosawa 71676809d6 Fix indent of .gradle files
Summary:
In most .gradle files, lines are indented with 4 spaces, but in some places they are indented with 2 spaces. This PR fixes them and enforce it by adding .editorconfig settings.
Closes https://github.com/facebook/react-native/pull/10267

Differential Revision: D4048335

Pulled By: lacker

fbshipit-source-id: df2f2556380f56672cf85690eb1c80e640a6aedf
2016-10-19 16:58:36 -07:00
Stephen Poter 8b55e50d1d Fix error in react-native run-ios when Product Name and Scheme are inequal
Summary:
In xcode, you can modify the Product Name per build configuration.  During the build, the app file name is made using that value.  For example, I name my app "MyApp Dev", it will build into "MyApp Dev.app".

react-native run-ios doesn't extract the proper app name.  Instead it uses the scheme name + ".app".  So if in the example above I use the default Scheme "MyApp", which references the build configuration whose name is "MyApp Dev".  The build will succeed, but when runIOS.js goes to run the app, it fails because the file name doesn't exist.

My fix parses the build output and extracts the app name from the line "export FULL_PRODUCT_NAME=$(appfilename)" and uses that instead of the scheme.  If there is any issue parsing, the scheme name is used like it currently is.

**Test plan (required)**

1) Change the Product Name in xcode project manager to be something different than the scheme name.
2) Run react-native run-ios and ensure it works.
Closes https://github.com/facebook/react-native/pull/10178

Differential Revision: D4022116

Pulled By: javache

fbshipit-source-id: c1bd8e7a1f6364d681c505557a96955a293bc05c
2016-10-14 14:43:52 -07:00
David Aurelio d26af5811d Monkey-patch `fs` with graceful-fs before anything else runs
Reviewed By: matryoshcow, kentaromiura

Differential Revision: D4020645

fbshipit-source-id: a7985109476b78b588c3e2a75ae6f25ea8f09237
2016-10-14 11:13:54 -07:00
Ben Hughes 41f4f1eaaf CLI errors if no package.json is found
Summary:
If you don't have a `package.json` in your project you can't do anything with the cli as it errors. This fixes that by wrapping the reading of the `package.json` file and returns `my-react-native-app` if an error is caught.
Closes https://github.com/facebook/react-native/pull/10207

Differential Revision: D4022113

Pulled By: javache

fbshipit-source-id: ffe940160f9d0b58e630adfab5e0dc9d34b859e5
2016-10-14 10:58:43 -07:00