Commit Graph

14 Commits

Author SHA1 Message Date
Nicolas Cuillery 7d89b773a7 New upgrading process, relying on Git
Summary:
The upgrading process based on Yeoman is a pain. For each file, Yeoman (or the brand new copyAndReplace solution a477aec) compares the newly generated content with the existing one and prompts the user if it differs, with very basic options: overwrite or skip.

I have digged into this problem and came with [rn-diff](https://github.com/ncuillery/rn-diff) (you may have read [this article](https://medium.com/ncuillery/easier-react-native-upgrades-with-rn-diff-5020b5c3de2d#.llvy2dym5)). This repository helps people to upgrade RN on their projects. An alternative upgrading process using `git apply` instead of Yeoman is described [here](https://github.com/ncuillery/rn-diff/blob/master/USAGE.md).

This PR is the integration of this process into the core. I got rid of the drawbacks mentioned in the link below in order to make it a clean, elegant, one-step operation.

This process is based on some Shell operations that:
- Generate the blank sources of both old and new versions
Closes https://github.com/facebook/react-native/pull/11110

Differential Revision: D4237107

Pulled By: mkonicek

fbshipit-source-id: 15e82e030b762415c925ccb2a62ddb354a6e18b9
2016-11-28 08:28:35 -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
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
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
Mike Grabowski e8b508144f Merge `rnpm cli` into react-native
Summary:
This is an initial step of rewriting the CLI interface to use `rnpm` one (commander, plugins etc.).

It's scope is to move all existing commands to use rnpm CLI interface, so that we get plugins, flags and our existing ecosystem working out of the box.

<s>This is still WIP and some of the commands are left commented out.</s>

For the `config` of `rnpm` (functions get info about project and dependency), <s>I am thinking we can merge them with</s> we decided to merge it with [`default.config.js`](e57683e420/local-cli/default.config.js (L33)), so they are available on the `new Config()` [instance](e57683e420/local-cli/cliEntry.js (L59)) (which means we don't have to change anything and current plugins, like runIOS and runAndroid can just start using it [w/o depending on any extra argument](https://github.com/grabbou/react-native/blob/e57683e420210749a5a6b802b4e
Closes https://github.com/facebook/react-native/pull/7899

Differential Revision: D3613193

Pulled By: bestander

fbshipit-source-id: 09a072f3b21e5239dfcd8da88a205bd28dc5d037
2016-07-30 09:13:46 -07:00
Kasim Tan a7f1428d4a Fix comment typos
Summary: Closes https://github.com/facebook/react-native/pull/7901

Differential Revision: D3384624

Pulled By: javache

fbshipit-source-id: 741343dec5406af1855624069dd8dc426a93bdb3
2016-06-03 02:43:57 -07:00
Mike Grabowski e3bbd300f6 Update upgrade command with 0.26 breaking changes
Summary:
Generally it feels that at some point we will just integrate `rnpm upgrade` directly here, but this is a super temporary quick workaround for the people upgrading to 0.26. We might want to change it later to 0.27 and update this message in case we have any other stuff to upgrade.

![screen shot 2016-05-18 at 14 28 47](https://cloud.githubusercontent.com/assets/2464966/15358460/df3b1b66-1d04-11e6-825c-fa18fa96ee6e.png)

It is supposed to work for 0.26.0, 0.26.1 and all the others up to 0.27.
Closes https://github.com/facebook/react-native/pull/7614

Differential Revision: D3316420

fbshipit-source-id: 3861b4228ee878464e18ba3de1f3e0c12d5f30d1
2016-05-18 07:28:52 -07:00
Sawyer Hood 9425bcff8f Updated a warning string in upgrade.js
Summary:
I inserted an 'in' in the warning message that is displayed when the user's package.json file doesn't have a valid version number for react native.

Test plan
---------------
-run upgrade.js on a project with an invalid version number.
Closes https://github.com/facebook/react-native/pull/7314

Differential Revision: D3245839

fb-gh-sync-id: e38f3be0884d8c75f9610faced85d5c81c24a49e
fbshipit-source-id: e38f3be0884d8c75f9610faced85d5c81c24a49e
2016-04-30 18:21:17 -07:00
Adam Miskiewicz 9f01f96770 Move `react` to peerDependencies
Summary:
This PR moves `react` from dependencies to peerDependencies.

In general, this would have only been important for those people using packages that depend on `react` and were using npm@2...npm@3 would automatically de-dupe.

However, when #5812 gets merged, dependencies will be scoped to react-native (on both npm@2 & npm@3), thus breaking projects that are using a package like `react-redux` for example, which depends on `react`. There would be two copies of React installed, and due to the use of haste modules in `react`, this would break the packager and cause naming collisions.

This PR does three things -

1. Moves the dependency from dependencies to peerDependencies
2. Updates the local-cli to run `npm install react --save` when a new project is initialized.
3. Updates `react-native upgrade` to warn if `react` is not listed in the package.json's dependencies.

**Note: This will require a shrinkwrap update.**
Closes https://github.com/facebook/react-native/pull/5813

Reviewed By: svcscm

Differential Revision: D2918380

Pulled By: androidtrunkagent

fb-gh-sync-id: 6e4234a45284be2fdf6fedf29e70b2d2d0262486
shipit-source-id: 6e4234a45284be2fdf6fedf29e70b2d2d0262486
2016-02-09 15:38:37 -08:00
Satyajit Sahoo 80bf431f98 Add warnings while upgrading RN with `react-native upgrade`
Summary: Closes https://github.com/facebook/react-native/pull/4854

Reviewed By: svcscm

Differential Revision: D2803252

Pulled By: foghina

fb-gh-sync-id: e6b05b19cf45773d7683ae8ae35643f400e51692
2016-01-05 09:58:28 -08:00
Martin Konicek 3c730b1ce2 Revert "Add folders to attempt to unblock sync"
We don't need these files anymore, the sync from the internal
fb repo to github is working now.

This reverts commit 746ebc6a79.
2015-10-26 22:48:10 +00:00
Martín Bigio 849aa4dae6 Move `private-cli` commands to `local-cli`
Summary: public

We cannot remove `local-cli` because is referenced by the global cli explicitly. If we do so, people would have to upgrate this global thin cli which will cause some pain. So, lets move `private-cli` commands into `local-cli` instead.

Reviewed By: frantic

Differential Revision: D2571983

fb-gh-sync-id: 712c29430203660fb6f0d5f23813cb2a7156ee48
2015-10-26 15:36:04 -07:00
Martin Konicek 746ebc6a79 Add folders to attempt to unblock sync 2015-10-26 17:22:39 +00:00