react-native/react-native-git-upgrade
Jirat K 1877e1b1d1 Fix react-native-git-upgrade by get package.json instead of selective field
Summary:
Explain the **motivation** for making this change. What existing problem does the pull request solve?

To fixes #11330 and fixes #11334

Regarding to this command (using in `react-native-git-upgrade` - [cliEntry.js#L261](https://github.com/facebook/react-native/blob/master/react-native-git-upgrade/cliEntry.js#L261))
```bash
npm view react-native@latest peerDependencies.react version --json
```
The result from this command are not consistent across a different npm versions.

We better get a whole `package.json` file by calling (remove field and subfield option)

```
npm view react-native@latest  --json
```

**Test plan (required)**

**Setup**
- Publish `react-native-git-upgrade` to `sinopia`
- `npm install -g react-native-git-upgrade`
- Test against multiple npm versions (`2.15.8` or `3.7.5` or `3.10.10` or ` 4.0.3`)
- `react-native init AwesomeApp  --version 0.38.0 && cd AwesomeApp`
- `react-native-git-upgrade` and `react-native-git-upgrade 0.39.0` should be working properly

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

Differential Revision: D4305894

Pulled By: mkonicek

fbshipit-source-id: 36ea7846926b424f4dd63c77b47db5cb69285027
2016-12-09 07:58:34 -08:00
..
README.md Git upgrade: Tweak wording 2016-12-05 06:28:34 -08:00
checks.js Fix the parse error when specifying an unknown version. 2016-12-02 08:28:32 -08:00
cli.js New upgrading process, relying on Git 2016-11-28 08:28:35 -08:00
cliEntry.js Fix react-native-git-upgrade by get package.json instead of selective field 2016-12-09 07:58:34 -08:00
index.js Use Yarn if available 2016-12-02 00:13:32 -08:00
package.json Fix react-native-git-upgrade by get package.json instead of selective field 2016-12-09 07:58:34 -08:00
yarn.js Git upgrade: Tweak README, bump version, fix a bug 2016-12-05 05:58:29 -08:00

README.md

React Native Git Upgrade

This tool makes upgrading your apps to a new version of React Native easier than the stock react-native upgrade command.

It uses Git under the hood to automatically resolve merge conflicts in project templates (native iOS and Android files, .flowconfig etc.). These conflicts happen when a new React Native version introduces changes to those files and you have local changes in those files too, which is quite common.

Usage

See the Upgrading docs on the React Native website.

Basic usage:

$ npm install -g react-native-git-upgrade
$ cd MyReactNativeApp
$ react-native-git-upgrade