• Stars
    star
    2,374
  • Rank 19,379 (Top 0.4 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created about 6 years ago
  • Updated 23 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The React Native Community CLI - command line tools to help you build RN apps

React Native CLI

Command line tools that ship with react-native in form of the @react-native-community/cli package.

It exposes react-native binary, so you can call yarn react-native or npx react-native directly from your project.

Build Status Version MIT License PRs Welcome Lean Core Extracted

Note: CLI has been extracted from core react-native as a part of "Lean Core" effort. Please read this blog post for more details.

Contents

Compatibility

Our release cycle is independent of react-native. We follow semver and here is the compatibility table:

@react-native-community/cli react-native
^12.0.0 ^0.73.0
^11.0.0 ^0.72.0
^10.0.0 ^0.71.0
^9.0.0 ^0.70.0
^8.0.0 ^0.69.0
^7.0.0 ^0.68.0
^6.0.0 ^0.65.0,^0.66.0,^0.67.0
^5.0.0 ^0.64.0
^4.0.0 ^0.62.0,^0.63.0
^3.0.0 ^0.61.0
^2.0.0 ^0.60.0
^1.0.0 ^0.59.0

Documentation

About

This monorepository contains tools and helpers for React Native projects in form of a Command Line Tool (or CLI). This CLI is used directly by the react-native package and is not intended for use directly. We update it independently of React Native itself.

Creating a new React Native project

Run the following command in your terminal prompt:

npx react-native init MyApp

Usage in an existing React Native project

Once you're inside an existing project, a local react-native binary will be available for you to use. Feel free to use Yarn to call it directly.

Example running start command in terminal:

yarn react-native start
# or:
npx react-native start

You can also add npm scripts to call it with whichever package manager you use:

{
  "scripts": {
    "start": "react-native start"
  }
}

Updating the CLI

React Native CLI is a dependency of react-native, which makes it a transitive dependency of your project. It happens that you may be locked on a version without fixes for bugs that may affect you. Here's how to get it sorted:

  1. If you use lock files (yarn.lock or package-lock.json) - find all the @react-native-community/cli prefixed entries, remove them, run yarn install / npm install once again. Here's an example using yarn.lock. Notice how whole @react-native-community/cli entries are removed. Make sure to delete all of them:

    diff --git a/yarn.lock b/yarn.lock
    index 073309f..0bb8c4b 100644
    --- a/yarn.lock
    +++ b/yarn.lock
    @@ -843,26 +843,6 @@
         "@types/istanbul-reports" "^1.1.1"
         "@types/yargs" "^13.0.0"
    
    -"@react-native-community/cli-debugger-ui@^3.0.0":
    -  version "3.0.0"
    -  resolved "https://registry.yarnpkg.com/@react-native-community/cli-debugger-ui/-/cli-debugger-ui-3.0.0.tgz#d01d08d1e5ddc1633d82c7d84d48fff07bd39416"
    -  integrity sha512-m3X+iWLsK/H7/b7PpbNO33eQayR/+M26la4ZbYe1KRke5Umg4PIWsvg21O8Tw4uJcY8LA5hsP+rBi/syBkBf0g==
    -  dependencies:
    -    serve-static "^1.13.1"
    -
    -"@react-native-community/cli-platform-android@^3.0.0":
    -  version "3.1.2"
    -  resolved "https://registry.yarnpkg.com/@react-native-community/cli-platform-android/-/cli-platform-android-3.1.2.tgz#313644fba81b5d673cc803009e1eddc930b9618c"
    -  integrity sha512-H30a00LLigsTh4eO0kc2YtaIkOJKrValWOU6n2VES3ZGS31qDx9GhZIwMCMcdzcSnypAyMAfauVatEmBSQZU7Q==
    -  dependencies:
    -    "@react-native-community/cli-tools" "^3.0.0"
    -    chalk "^2.4.2"
  2. If you don't use lock files โ€“ remove node_modules and run yarn install / npm install again.

  3. Run yarn list --pattern @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.

Maintainers

Previously:

License

Everything inside this repository is MIT licensed.

More Repositories

1

upgrade-helper

โš›๏ธ A web tool to support React Native developers in upgrading their apps.
TypeScript
3,628
star
2

hooks

React Native APIs turned into React Hooks for use in functional React components
TypeScript
3,451
star
3

react-native-template-typescript

๐Ÿ‘พ Clean and minimalist React Native template for a quick start with TypeScript.
Java
1,858
star
4

discussions-and-proposals

Discussions and proposals related to the main React Native project
1,684
star
5

releases

React Native releases
JavaScript
1,501
star
6

rn-diff-purge

Easier React Native upgrades by clearly exposing changes from a version to another. ๐Ÿš€ And what better way than to purge, init, then diff? Spoiler: there's no better way. ๐Ÿ˜Ž
Shell
1,266
star
7

jsc-android-buildscripts

Script for building JavaScriptCore for Android (for React Native but not only)
JavaScript
1,056
star
8

directory

A searchable and filterable directory of React Native libraries.
TypeScript
1,003
star
9

docker-android

Android Docker Image for React Native and common android development.
Dockerfile
473
star
10

RNNewArchitectureLibraries

A collection of sample React Native Libraries that will show you how to use the New Architecture (Fabric & TurboModules) step-by-step.
322
star
11

upgrade-support

A central community-backed place to request and give help when upgrading your app.
JavaScript
254
star
12

RNNewArchitectureApp

A collection of sample React Native Apps that will show you how to use the New Architecture (Fabric & TurboModules) step-by-step.
201
star
13

react-native-circleci-orb

A CircleCI Orb to Simplify Testing your React Native App
174
star
14

hermes-profile-transformer

TypeScript tool for converting Hermes Sampling Profiler output to Chrome Dev Tools format
TypeScript
86
star
15

boost-for-react-native

The Boost C++ library source code used to build React Native from source
C++
86
star
16

template

The React Native Community Template - getting started building RN apps for Android & iOS
JavaScript
46
star
17

eslint-plugin-react-native-globals

ESLint Environment for React Native
JavaScript
38
star
18

reproducer-react-native

A reproducer to easily recreate bugs and report problems for React Native
TypeScript
32
star
19

developer-experience-wg

Discussions-only repo for topics around React Developer Experience
18
star
20

rn-diff-lib-purge

Easier React Native library upgrades by clearly exposing changes from a version to another. ๐Ÿš€ And what better way than to purge, init, then diff? Spoiler: there's no better way. ๐Ÿ˜Ž
Shell
3
star