From 50b3f2d8107aa5e0dfb46093b9606e780e0fa09c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ramos?= Date: Wed, 6 Feb 2019 09:25:45 -0800 Subject: [PATCH] Remove CLI docs --- docs/understanding-cli.md | 75 --------------------------------------- website/i18n/en.json | 1 - website/sidebars.json | 3 +- 3 files changed, 1 insertion(+), 78 deletions(-) delete mode 100644 docs/understanding-cli.md diff --git a/docs/understanding-cli.md b/docs/understanding-cli.md deleted file mode 100644 index bb7503731e7..00000000000 --- a/docs/understanding-cli.md +++ /dev/null @@ -1,75 +0,0 @@ ---- -id: understanding-cli -title: Understanding the CLI ---- - -Though you may have installed the `react-native-cli` via npm as a separate module, it is a shell for accessing the CLI embedded in the React Native of each project. Your commands and their effects are dependent on the version of the module of `react-native` in context of the project. This guide will give a brief overview of the CLI in the module. - -# The local CLI - -React Native has a [`local-cli`](https://github.com/facebook/react-native/tree/master/local-cli) folder with a file named [`cliEntry.js`](https://github.com/facebook/react-native/blob/master/local-cli/cliEntry.js). Here, the commands are read from `commands.js` and added as possible CLI commands. _E.G._ the `react-native link` command, exists in the [`react-native/local-cli/link`](https://github.com/facebook/react-native/blob/master/local-cli/link/) folder, and is required in `commands.js`, which will register it as a documented command to be exposed to the CLI. - -# Command definitions - -At the end of each command entry is an export. The export is an object with a function to perform, description of the command, and the command name. The object structure for the `link` command looks like so: - -```javascript -module.exports = { - func: link, - description: 'links all native dependencies', - name: 'link [packageName]', -}; -``` - -### Parameters - -The command name identifies the parameters that a command would expect. When the command parameter is surrounded by greater-than, less-than symbols `< >`, this indicates that the parameter is expected. When a parameter is surrounded by brackets `[ ]`, this indicates that the parameter is optional. - -### Getting a list of all CLI commands - -Running `react-native --help` from inside a React Native project will list all of your current commands. Here is an example from version `0.56`: - -```sh - Usage: react-native [options] [command] - - Options: - - -V, --version output the version number - -h, --help output usage information - - Commands: - - start [options] starts the webserver - run-ios [options] builds your app and starts it on iOS simulator - run-android [options] builds your app and starts it on a connected Android emulator or device - new-library [options] generates a native library bridge - bundle [options] builds the javascript bundle for offline use - unbundle [options] builds javascript as "unbundle" for offline use - eject [options] Re-create the iOS and Android folders and native code - link [options] [packageName] links all native dependencies (updates native build files) - unlink [options] unlink native dependency - install [options] install and link native dependencies - uninstall [options] uninstall and unlink native dependencies - upgrade [options] upgrade your app's template files to the latest version; run this after updating the react-native version in your package.json and running npm install - log-android [options] starts adb logcat - log-ios [options] starts iOS device syslog tail - dependencies [options] lists dependencies - info [options] Get relevant version info about OS, toolchain and libraries -``` - -### CLI Configs - -When using `react-native start`, its platform derivatives, and `react-native bundle` you can use a file to define the CLI options used by React Native by default. If you create a file `rn-cli.config.js` in the root of your project, it will be evaluated and options for the commands will come from there. - -You can see the options for the CLI config on the [metro website](https://facebook.github.io/metro/docs/en/configuration). Here's a common `rn-cli.config.js` used for supporting TypeScript in React Native projects: - -```js -module.exports = { - getTransformModulePath() { - return require.resolve('react-native-typescript-transformer'); - }, - getSourceExts() { - return ['ts', 'tsx']; - }, -}; -``` diff --git a/website/i18n/en.json b/website/i18n/en.json index e8c98069b8e..500ec13b320 100644 --- a/website/i18n/en.json +++ b/website/i18n/en.json @@ -132,7 +132,6 @@ "transforms": "Transforms", "troubleshooting": "Troubleshooting", "tutorial": "Learn the Basics", - "understanding-cli": "Understanding the CLI", "upgrading": "Upgrading to new React Native versions", "using-a-listview": "Using List Views", "using-a-scrollview": "Using a ScrollView", diff --git a/website/sidebars.json b/website/sidebars.json index 60d85972224..33d90792242 100644 --- a/website/sidebars.json +++ b/website/sidebars.json @@ -57,8 +57,7 @@ "contributing", "maintainers", "building-from-source", - "testing", - "understanding-cli" + "testing" ], "Components": [ "activityindicator",