-
Notifications
You must be signed in to change notification settings - Fork 932
Bring in global-cli
#4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This way people without react-native-cli can still do `npm start`
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?
This will remove the dependency on Ruby.
if directory already exist
Ask confirmation on init command
- "React" is a reserve word and cannot be used as a project name since it will break the Sample app when generated
[Docs] Document the react-native CLI init command
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 facebook/react-native#7859 Differential Revision: D3379234 fbshipit-source-id: 4fb6e5bae20904871c9c4f7504013dc18b1fe707
Summary: [email protected] is incompatible with [email protected]. 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 facebook/react-native#7879 Differential Revision: D3384705 Pulled By: davidaurelio fbshipit-source-id: d4dff418f9659bd083ae8826433a4e7c0355d03b
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 facebook/react-native#9406 Differential Revision: D3716357 Pulled By: bestander fbshipit-source-id: 6a460c881a20b9edb1bd1c8c5df09e5a7e5020ed
Summary: [react-native-cli] Remove the unnecessary 'var' in `runVerbose`, keep pace with `run`. Closes facebook/react-native#9758 Differential Revision: D3821139 Pulled By: javache fbshipit-source-id: 7651135a91a22d7e07af89fde20da3194ce054c8
Summary: As PR #5171 was reverted in 521bd03f0a94df35e21d368a3416599f5f01f5dc for breaking reason, ENOENT again in issues #5169 , this commit fix it ref to nodejs/node-v0.x-archive#2318 (comment) , and this is the smallest change in file to fix such Windows platform specific bug tdzl2003 mkonicek snowdream sunnylqm Closes facebook/react-native#10086 Differential Revision: D3919761 Pulled By: bestander fbshipit-source-id: b878bbade8142a87bd6703d485e501eb28761af5
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 facebook/react-native#10626 Differential Revision: D4110883 Pulled By: bestander fbshipit-source-id: 8a3427e2bc9158cf5fadd8ddf5b31e4b50ce6453
Summary: Turns out I published 1.1.0 previously by accident and unpublished /ducks Closes facebook/react-native#10684 Differential Revision: D4111999 Pulled By: bestander fbshipit-source-id: a85c8db6e7f48c9e96a649f017d82cbef44c73ae
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 facebook/react-native#10828
Differential Revision: D4168266
Pulled By: hramos
fbshipit-source-id: 079917622bf5b22a3cd6414f13865c1b9c01da01
…Yeoman in preparation for templates support Summary: This is the manually imported version of facebook/react-native#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: Looks like using 'let' was too ambitious :) This should fix the issue facebook/react-native#10976. **Test plan (required)** Travis & Circle CI tests on this PR. Closes facebook/react-native#11166 Differential Revision: D4237047 Pulled By: bestander fbshipit-source-id: 85b548d74a0847621519364201cf71d6649ad605
Summary:
- Added an option to override the install command in CI environments (see comment in code)
- Simplify the verbose mode
- Simplify how options are passed round
Test plan (only tested on Mac OS):
react-native init TestApp
react-native init TestApp --version 0.36
In both cases the app was generated, package.json contained the correct version (latest, or 0.36).
react-native init TestApp --verbose
Saw progress bar.
react-native init InstallCommandTest --installCommand "npm install bad-package-doesnt-exist"
404 error is printed to stdout correctly.
react-native init TestApp --installCommand "npm install react-native"
The app was generated.
react-native init InstallCommandTest --installCommand "npm install react-native --verbose" --verbose
Saw verbose output from npm.
Reviewed By: bestander
Differential Revision: D4284642
fbshipit-source-id: f2cdee52ab64831ae3ca064d50f23c5f73a0301f
Summary: We now show the npm progress bar. Reviewed By: mkonicek Differential Revision: D4307964 Ninja: OSS only, nit fbshipit-source-id: 7338ab08abe8cf6354f9a9c6d36c51b0cffc69ee
Summary: The `checkForVersionArgument` function tries to call `REACT_NATIVE_PACKAGE_JSON_PATH` which isn't defined yet prior to this change. This means that `react-native -v` never reports the version of react-native used in the current project, and in fact never detects the current project. Fixes #11463 Closes facebook/react-native#11464 Differential Revision: D4339279 Pulled By: mkonicek fbshipit-source-id: 324d96c97bb06b6156e5582f889bc30b28ca68b2
Summary: Small renaming after facebook/react-native#11464 **Test plan** Ran 'react-native init' and 'react-native -v' inside and outside a RN project. Reviewed By: mkonicek Differential Revision: D4339481 Ninja: OSS only fbshipit-source-id: b23daaee55907761ed0820a707f36ad70d1f1d09
Summary: **Motivation:** According to the meeting notes published by mkonicek yesterday, RN should support `yarn run ios` and `yarn run android` commands. **Test plan (required)** - [x] Generate a new project and start scaffolded app using `yarn(npm) run ios(android)` Closes facebook/react-native#12004 Differential Revision: D4441837 Pulled By: mkonicek fbshipit-source-id: 250f7a9e1efc59e0caa5c2c071b59b97e14e939b
Summary: Currently it is not trivial for people to get started with React Native. `react-native init MyApp` just creates a simple app with a single screen. People have to spend time figuring out how to add more screens, or how to accomplish very basic tasks such as rendering a list of data or handling text input. Let's add an option: `react-native init --template navigation` - this creates a "starter" app which can be easily tweaked into the actual app the person wants to build. **Test plan (required)** - Checked that 'react-native init MyApp' still works as before: <img width="487" alt="screenshot 2017-02-02 16 56 28" src="https://cloud.githubusercontent.com/assets/346214/22559344/b2348ebe-e968-11e6-9032-d1c33216f490.png"> <img width="603" alt="screenshot 2017-02-02 16 58 04" src="https://cloud.githubusercontent.com/assets/346214/22559370/c96a2ca6-e968-11e6-91f7-7afb967920fc.png"> - Ran 'react-native init MyNavApp --template'. This prints the available templates: ``` $ react-native init MyNavApp Closes facebook/react-native#12170 Differential Revision: D4516241 Pulled By: mkonicek fbshipit-source-id: 8ac081157919872e92947ed64ea64fb48078614d
Summary: PR for issue #12444 In `validateProjectName` in `react-native-cli` `name.match` is called but it's not certain that `name`is a String. This casts `name`to a String before doing the match. I didn't find any tests for this file so I didn't add any. Reproduce: ``` cd react-native-cli npm install node index.js init 123 ``` Before this PR the code throws an exception, after this PR the intended `console.error` is printed. Closes facebook/react-native#12447 Differential Revision: D4584041 fbshipit-source-id: 117e76570aa9975ac851192b030c5a77daf19bcc
Summary: Thanks for submitting a PR! Please read these instructions carefully: - [x] Explain the **motivation** for making this change. - [x] Provide a **test plan** demonstrating that the code is solid. - [x] Match the **code formatting** of the rest of the codebase. - [x] Target the `master` branch, NOT a "stable" branch. Fixes #14081. Prevents unnecessary error output on check for yarn package manager on Windows systems. Can't find existing tests for the CLI and JavaScript doesn't have much knowledge about this change anyhow. Example behavior with and without the fix:  Note that on master, the output contains the line "'yarn' is not recognized as an internal or external command, operable program or batch file." and on my branch, it does not. Sign the [CLA][2], if you haven't already. Small pull requests are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it. Make sure all **tests pass** on both [Travis][3] and [Circle CI][4]. PRs that break tests are unlikely to be merged. For more info, see the ["Pull Requests"][5] section of our "Contributing" guidelines. [1]: https://medium.com/martinkonicek/what-is-a-test-plan-8bfc840ec171#.y9lcuqqi9 [2]: https://code.facebook.com/cla [3]: https://travis-ci.org/facebook/react-native [4]: http://circleci.com/gh/facebook/react-native [5]: https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#pull-requests Closes facebook/react-native#14082 Differential Revision: D5141387 Pulled By: shergin fbshipit-source-id: 80f9aa9ecb7d8943f0b3b87b8ebbe7828c317bbd
Summary: `const` declarations were recently introduced into https://github.com/facebook/react-native/blob/master/react-native-cli/index.js, which runs before any transpilation so needs to be old-school. Replace them with `var`. Fixes facebook/react-native#11603 Closes facebook/react-native#11615 Differential Revision: D5148448 Pulled By: shergin fbshipit-source-id: ea23cdd26c0c1d0ac7f108aa9bf185abecfe399c
Reviewed By: zertosh Differential Revision: D5409825 fbshipit-source-id: 81f67be174cc8ecfcd0955dfec83955ebdc84622
Differential Revision: D5409825 fbshipit-source-id: f797a40b58bc6bcc6ae53ed820a10ab49d3f10f5
Summary:
Includes React Native and its dependencies Fresco, Metro, and Yoga. Excludes samples/examples/docs.
find: ^(?:( *)|( *(?:[\*~#]|::))( )? *)?Copyright (?:\(c\) )?(\d{4})\b.+Facebook[\s\S]+?BSD[\s\S]+?(?:this source tree|the same directory)\.$
replace: $1$2$3Copyright (c) $4-present, Facebook, Inc.\n$2\n$1$2$3This source code is licensed under the MIT license found in the\n$1$2$3LICENSE file in the root directory of this source tree.
Reviewed By: TheSavior, yungsters
Differential Revision: D7007050
fbshipit-source-id: 37dd6bf0ffec0923bfc99c260bb330683f35553e
Summary: Manual changes. Reviewed By: TheSavior, yungsters Differential Revision: D7012152 fbshipit-source-id: de7459be3db13c687868b45059856f125c4f2eb1
Reviewed By: yungsters Differential Revision: D7974564 fbshipit-source-id: 00db563ce24868c0fde117e981936b83cec30e48
Summary: [DOCS] [BUGFIX] [react-native-cli/README.md] - fixed sinopia configuration docs now that babel uses scoped packages the extra sinpoia config also requires the rule to cover ** which will satisfy such repositories like babel/core The only other issue I had with getting started using this doc was node-gyp being an absolute horror to get running (a dependancy of sinpoia) I don't really know if writing debugging tips/links for macos in these docs is relevant. Pull Request resolved: facebook/react-native#20789 Differential Revision: D9468340 Pulled By: hramos fbshipit-source-id: c7a41f384655b36e5e46b39d1e7e14313cab9f68
Summary: This change drops the year from the copyright headers and the LICENSE file. Reviewed By: yungsters Differential Revision: D9727774 fbshipit-source-id: df4fc1e4390733fe774b1a160dd41b4a3d83302a
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With its commits history