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
Summary:
This PR fixes#10784 by adding a `--help` and a `-h` option to `react-native-cli`.
**Test plan:**
Publish to sinopia and then outside of `react-native` project:
```
$ react-native --help #same goes for -h
Usage: react-native [command] [options]
Commands:
init <ProjectName> [options] generates a new project and installs its dependencies
Options:
-h, --help output usage information
-v, --version output the version number
```
```
$ react-native
You did not pass any commands, run `react-native --help` to see a list of all available commands.
```
**Notes:**
- There is no real consistency in the UX for `react-native-cli` and `local-cli` and even is no real consistency between the UI of `react-native [command] --help` and `react-native --help` in `local-cli` either. I tried to resemble the UX of `react-native --help` as close as possible since it's kind of the nearest neighbour.
- This *doesn't* add support for `react-native init --help` in `react-na
Closes https://github.com/facebook/react-native/pull/10828
Differential Revision: D4168266
Pulled By: hramos
fbshipit-source-id: 079917622bf5b22a3cd6414f13865c1b9c01da01
Summary:
I, like many before me, had to Google why react-native init appeared to hang the first time I tried it.
It turns out it can just take a really long time, but does not give any warning of this fact.
This patch provides such a warning.
Closes https://github.com/facebook/react-native/pull/9406
Differential Revision: D3716357
Pulled By: bestander
fbshipit-source-id: 6a460c881a20b9edb1bd1c8c5df09e5a7e5020ed
Summary:
React@15.1.0 is incompatible with React-Native@0.26.
This PR was cherry-picked to 0.26-stable branch now.
What this change does:
- react-native-cli (major release bump) saves exact versions of react-native and react (only in npm2) dependencies into package.json
- local-cli saves exact version of react (only npm3) dependency into package.json
Closes https://github.com/facebook/react-native/pull/7879
Differential Revision: D3384705
Pulled By: davidaurelio
fbshipit-source-id: d4dff418f9659bd083ae8826433a4e7c0355d03b
Summary:
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request:
(You can skip this if you're fixing a typo or adding an app to the Showcase.)
Kevin: This isn't quite a typo, but it's a change to an error message.
In my experience, frequently when this error message is displayed, the command is unrecognized because I haven't run npm install, I just checked out a repo of someone else's. We could just update this error message a bit, and I think it would improve the developer experience.
Closes https://github.com/facebook/react-native/pull/7859
Differential Revision: D3379234
fbshipit-source-id: 4fb6e5bae20904871c9c4f7504013dc18b1fe707
It caused problems on Windows unfortunately and when we tried to
fix it we got: https://github.com/facebook/react-native/issues/5159
Reverting to unblock people. In the future we'll do careful rc
releases of the CLI. We should try to make the change again without
breaking anyone, regardless of OS (OSX, Linux, Windows) or npm version.
To release a new version with the fix for Windows:
https://github.com/facebook/react-native/pull/5171
Thanks a lot @tdzl2003!
Tweaked the platform check to use `process.platform`
as that's more common in the codebase. No strong preference,
just for consistency.
`npm install` prints a lot of junk like gyp warnings
and the rest of the output is not super useful for
tracking progress.
Supress the output by default, show the output with
--debug, and show verbose output with --verbose.
We get a bunch of bugs because people are running old versions of Node that don't support modern JS. We have "engines" entries in the package.json files to catch this earlier but printing an explicit error message will also make this clear.
Test Plan: Changed react-native's package.json to require Node >= 5 and got an error message when running the CLI with Node 4.
Before:
> Command `foo` unrecognized.Did you mean to run this inside a react-native project?
After:
> Command `foo` unrecognized. Did you mean to run this inside a react-native project?
A cli package that is responsible for:
* starting a new react-native project
* forwarding all other commands to a cli module in react-native
* currently cli.js knows how to start the webserver, in the future it may do things like build the app etc.