react-native/local-cli
Alex Kotliarskyi 8295d27a90 Fix usage of react-native cli inside package.json scripts
Summary:
IIRC we made `wrong-react-native` to warn people in case they installed `react-native` globally (instead of `react-native-cli` what the guide suggests). To do that we added `bin` entry to React Native's `package.json` that points to `local-cli/wrong-react-native.js`

However, this means that if we have a project that uses `react-native` package and has call to `react-native` CLI inside its package.json, npm will execute *local* override (which just prints a confusing in this context error message).

In fact, the template we generate with `react-native init` has `react-native start` as `start` script, which makes it useless. Let's fix it by making `wrong-react-native` script smarter – it can detect that it has been executed from local `node_modules` and run the actual CLI.

cc vjeux ide
Closes https://github.com/facebook/react-native/pull/7243

Differential Revision: D3226645

Pulled By: frantic

fb-gh-sync-id: be094eb0e70e491da4ebefc2abf11cff56c4c5b7
fbshipit-source-id: be094eb0e70e491da4ebefc2abf11cff56c4c5b7
2016-04-26 15:42:35 -07:00
..
__mocks__ Fix more tests 2015-09-16 13:05:30 -07:00
__tests__ Temporarily disable cli tests 2015-11-12 07:05:01 -08:00
bundle Remove socket interface from buildBundle command 2016-04-11 09:23:29 -07:00
dependencies Remove socket interface from dependencies command 2016-04-11 09:23:29 -07:00
generate Revert "Add folders to attempt to unblock sync" 2015-10-26 22:48:10 +00:00
generator Update imports in generated projects 2016-04-19 05:11:27 -07:00
generator-android E2e android 2016-04-13 08:20:05 -07:00
generator-ios Use xcodebuild and delete "Framework Search Paths" for Xcode 7.3 to un-stall the tests 2016-04-22 23:04:19 -07:00
library Introduce react-native link 2015-10-27 11:22:28 -07:00
runAndroid removing xterm from linux spawn 2016-04-22 09:01:22 -07:00
runIOS Make iOS project path configurable by parameter in run-ios cli command 2016-04-01 08:03:20 -07:00
server Whitelist the 'pdf' extension in the packager 2016-04-19 03:52:27 -07:00
upgrade Move `react` to peerDependencies 2016-02-09 15:38:37 -08:00
util Have parseCommandLine use a new instance of optimist for each run 2016-04-08 12:09:22 -07:00
cli.js Transform packager src files in cli entry point 2016-04-11 12:43:25 -07:00
default.config.js react app root path can be override by env var 'react_native_app_root' 2016-04-07 07:39:22 -07:00
generate-android.js Add license headers to local-cli 2015-10-20 09:55:21 -07:00
generator-utils.js flowconfig adds flow/ folder 2016-03-21 06:26:34 -07:00
setup_env.bat Fix comments on .bat file 2015-10-28 21:36:07 -04:00
setup_env.sh Change ulimit to 2048 for non root Mac users 2016-02-06 11:45:37 -08:00
wrong-react-native.js Fix usage of react-native cli inside package.json scripts 2016-04-26 15:42:35 -07:00