Skip to content

Commit 0fd831e

Browse files
thecodrrthymikee
thecodrr
authored andcommitted
chore: revamp README for readability, about and updating info (#490)
* chore: add updating guide & improve about * update readme * fix typo
1 parent 34d6f70 commit 0fd831e

File tree

1 file changed

+31
-13
lines changed

1 file changed

+31
-13
lines changed

README.md

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
# React Native CLI
22

3-
Command line tools to interact with React Native projects.
3+
Command line tools that ship with [`react-native`](https://github.com/facebook/react-native) in form of the `@react-native-community/cli` package.
4+
5+
> It exposes `react-native` binary, so your can call `yarn react-native` or `npx react-native` directly from your project.
46
57
[![Build Status][build-badge]][build] [![Version][version-badge]][package] [![MIT License][license-badge]][license] [![PRs Welcome][prs-welcome-badge]][prs-welcome]
68

79
_Note: CLI has been extracted from core `react-native` as a part of "[Lean Core](https://github.com/facebook/react-native/issues/23313)" effort. Please read [this blog post](https://blog.callstack.io/the-react-native-cli-has-a-new-home-79b63838f0e6) for more details._
810

911
## Compatibility
1012

11-
This CLI is intended to be used with a certain version of React Native. You'll find the support table with compatible versions below.
13+
Our release cycle is independent of `react-native`. We follow semver and here is the compatibility table:
1214

13-
| CLI | React Native |
14-
| ------ | ------------ |
15-
| ^2.0.0 | ^0.60.0 |
16-
| ^1.0.0 | ^0.59.0 |
15+
| `@react-native-community/cli` | `react-native` |
16+
| ----------------------------- | -------------- |
17+
| ^2.0.0 | ^0.60.0 |
18+
| [^1.0.0](tree/1.x) | ^0.59.0 |
1719

1820
## Documentation
1921

@@ -25,18 +27,22 @@ This CLI is intended to be used with a certain version of React Native. You'll f
2527

2628
## About
2729

28-
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:
30+
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:
2931

30-
- this is a monorepo;
31-
- 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;
32+
- There are currently two CLIs:
33+
- [`@react-native-community/cli`](./packages/cli)**the one used directly by `react-native`**. That makes it a transitive dependency of your project.
34+
- [`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**.
35+
- When we say "the CLI" we mean `@react-native-community/cli`.
36+
- We update the CLI independently of React Native itself. Please see [how to use the latest version](#updating-the-cli).
37+
- This is a monorepo to keep stuff organized.
3238

33-
We know it's confusing, but we're actively working to make this indirection gone.
39+
We're actively working to make any indirections gone.
3440

3541
## Creating a new React Native project
3642

3743
There are two ways to start a React Native project.
3844

39-
### Using `npx`
45+
### Using `npx` (_recommended_)
4046

4147
> Available since `[email protected]`
4248
@@ -46,7 +52,7 @@ This method is preferred if you don't want to install global packages.
4652
npx react-native init MyApp
4753
```
4854

49-
### Using global CLI
55+
### Using global CLI (_legacy_)
5056

5157
You'll need to install a global module [`react-native-cli`](./packages/global-cli) and follow instructions there.
5258

@@ -62,7 +68,9 @@ Example running `start` command in terminal:
6268

6369
```sh
6470
yarn react-native start
65-
# or if you don't use Yarn:
71+
# or:
72+
npx react-native start
73+
# or
6674
node ./node_modules/.bin/react-native start
6775
```
6876

@@ -76,6 +84,16 @@ You can also add npm scripts to call it with whichever package manager you use:
7684
}
7785
```
7886

87+
## Updating the CLI
88+
89+
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:
90+
91+
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.
92+
2. If you don't use lock files – remove `node_modules` and run `yarn install` / `npm install` again.
93+
3. Run `yarn list @react-native-community/cli` or `npm list @react-native-community/cli` and verify you're on the latest version.
94+
95+
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.
96+
7997
## Maintainers
8098

8199
- Michał Pierzchała ([**@thymikee**](https://github.com/thymikee)) - [Callstack](https://callstack.com)

0 commit comments

Comments
 (0)