From e0da61df88de566b16434cc9860dc14279fe350d Mon Sep 17 00:00:00 2001 From: thecodrr Date: Sat, 6 Jul 2019 13:32:15 +0500 Subject: [PATCH 1/3] chore: add updating guide & improve about --- README.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c4f4d548b..34a68c2c8 100644 --- a/README.md +++ b/README.md @@ -25,10 +25,13 @@ This CLI is intended to be used with a certain version of React Native. You'll f ## About -This repository contains tools and helpers for React Native projects in form of a CLI. We want to make a couple of things clear for you first: - -- this is a monorepo; -- there are currently two CLIs: the actual one called [`@react-native-community/cli`](./packages/cli) that does all the job and global [`react-native-cli`](./packages/global-cli) which is used as its proxy and installation helper; +This repository contains tools and helpers for React Native projects in form of a CLI. +### Let's clear some confusions: +1. This is a mono-repo. +2. There are currently two CLIs: the actual one called [`@react-native-community/cli`](./packages/cli) that does all the job and global [`react-native-cli`](./packages/global-cli) which is used as its proxy and installation helper. +3. [`@react-native-community/cli`](./packages/cli) is a dependency of `react-native`. That makes it a "transitive dependency" of your project. +4. [`react-native-cli`](./packages/global-cli) is a global package, we discourage to use it, it's kind of a proxy to [`@react-native-community/cli`](./packages/cli), but it's a bit more complicated that that. +5. We update the CLI independently of React Native itself. We know it's confusing, but we're actively working to make this indirection gone. @@ -75,6 +78,12 @@ You can also add npm scripts to call it with whichever package manager you use: } } ``` +## Updating the CLI +1. If you use lock files (`yarn.lock` or `package-lock.json`) - find the `@react-native-community/cli` entry, remove it, run `yarn`/`npm install` once again. +2. If you don't use lock files – you should. But in such a case, remove `node_modules` and run `yarn`/`npm install` again. +3. Run `npm list @react-native-community/cli` or `yarn list @react-native-community/cli` and verify you're on the latest version. + +After performing these steps you should be on the latest CLI version. Feel free to do it once in a while, because we release often. ## Maintainers From 2a2990a527b1c273fb0c02bf31f0ba5384c07f58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Sat, 6 Jul 2019 15:07:14 +0200 Subject: [PATCH 2/3] update readme --- README.md | 49 +++++++++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 34a68c2c8..a62aa8c8c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # React Native CLI -Command line tools to interact with React Native projects. +Command line tools that ship with [`react-native`](https://github.com/facebook/react-native) in form of the `@react-native-community/cli` package. + +> It exposes `react-native` binary, so your can call `yarn react-native` or `npx react-native` directly from your project. [![Build Status][build-badge]][build] [![Version][version-badge]][package] [![MIT License][license-badge]][license] [![PRs Welcome][prs-welcome-badge]][prs-welcome] @@ -8,12 +10,12 @@ _Note: CLI has been extracted from core `react-native` as a part of "[Lean Core] ## Compatibility -This CLI is intended to be used with a certain version of React Native. You'll find the support table with compatible versions below. +Our release cycle is indepdenent of `react-native`. We follow semver and here is the compatibility table: -| CLI | React Native | -| ------ | ------------ | -| ^2.0.0 | ^0.60.0 | -| ^1.0.0 | ^0.59.0 | +| `@react-native-community/cli` | `react-native` | +| ----------------------------- | -------------- | +| ^2.0.0 | ^0.60.0 | +| [^1.0.0](tree/1.x) | ^0.59.0 | ## Documentation @@ -25,21 +27,22 @@ This CLI is intended to be used with a certain version of React Native. You'll f ## About -This repository contains tools and helpers for React Native projects in form of a CLI. -### Let's clear some confusions: -1. This is a mono-repo. -2. There are currently two CLIs: the actual one called [`@react-native-community/cli`](./packages/cli) that does all the job and global [`react-native-cli`](./packages/global-cli) which is used as its proxy and installation helper. -3. [`@react-native-community/cli`](./packages/cli) is a dependency of `react-native`. That makes it a "transitive dependency" of your project. -4. [`react-native-cli`](./packages/global-cli) is a global package, we discourage to use it, it's kind of a proxy to [`@react-native-community/cli`](./packages/cli), but it's a bit more complicated that that. -5. We update the CLI independently of React Native itself. +This repository contains tools and helpers for React Native projects in form of a command line tool. There's been quite some confusion around that since the extraction from React Native core. Let's clear them up: + +- There are currently two CLIs: + - [`@react-native-community/cli`](./packages/cli) – **the one used directly by `react-native`**. That makes it a transitive dependency of your project. + - [`react-native-cli`](./packages/global-cli) – an optional global convenience package, which is a proxy to [`@react-native-community/cli`](./packages/cli) and global installation helper. **Please consider it legacy, because it's not necessary anymore**. +- When we say "the CLI" we mean `@react-native-community/cli`. +- We update the CLI independently of React Native itself. Please see [how to use the latest version](#updating-the-cli). +- This is a monorepo to keep stuff organized. -We know it's confusing, but we're actively working to make this indirection gone. +We're actively working to make any indirections gone. ## Creating a new React Native project There are two ways to start a React Native project. -### Using `npx` +### Using `npx` (_recommended_) > Available since `react-native@0.60` @@ -49,7 +52,7 @@ This method is preferred if you don't want to install global packages. npx react-native init MyApp ``` -### Using global CLI +### Using global CLI (_legacy_) You'll need to install a global module [`react-native-cli`](./packages/global-cli) and follow instructions there. @@ -65,7 +68,9 @@ Example running `start` command in terminal: ```sh yarn react-native start -# or if you don't use Yarn: +# or: +npx react-native start +# or node ./node_modules/.bin/react-native start ``` @@ -78,10 +83,14 @@ You can also add npm scripts to call it with whichever package manager you use: } } ``` + ## Updating the CLI -1. If you use lock files (`yarn.lock` or `package-lock.json`) - find the `@react-native-community/cli` entry, remove it, run `yarn`/`npm install` once again. -2. If you don't use lock files – you should. But in such a case, remove `node_modules` and run `yarn`/`npm install` again. -3. Run `npm list @react-native-community/cli` or `yarn list @react-native-community/cli` and verify you're on the latest version. + +Because we release independently of `react-native`, it happens that you may be locked on a version without fixes for bugs that affect you. Here's how to get it sorted: + +1. If you use lock files (`yarn.lock` or `package-lock.json`) - find the `@react-native-community/cli` entry, remove it, run `yarn install` / `npm install` once again. +2. If you don't use lock files – remove `node_modules` and run `yarn install` / `npm install` again. +3. Run `yarn list @react-native-community/cli` or `npm list @react-native-community/cli` and verify you're on the latest version. After performing these steps you should be on the latest CLI version. Feel free to do it once in a while, because we release often. From 3247b63c0ba6063c1dae265d56b5fb76b7094bd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Sat, 6 Jul 2019 15:09:45 +0200 Subject: [PATCH 3/3] fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a62aa8c8c..87470fcb0 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ _Note: CLI has been extracted from core `react-native` as a part of "[Lean Core] ## Compatibility -Our release cycle is indepdenent of `react-native`. We follow semver and here is the compatibility table: +Our release cycle is independent of `react-native`. We follow semver and here is the compatibility table: | `@react-native-community/cli` | `react-native` | | ----------------------------- | -------------- |