From d511258e02a1e55f6a8fe0006a316f839e88bbef Mon Sep 17 00:00:00 2001 From: Anna Doubkova Date: Fri, 31 May 2019 09:41:01 +0100 Subject: [PATCH 1/3] Update CONTRIBUTING.md --- CONTRIBUTING.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fd506a249..8052f569b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -61,6 +61,21 @@ react-native init --version ${RN_VERSION} npm config set registry https://registry.npmjs.org/ ``` +## Running RN using local version of CLI + +To start a new project with local version of CLI without publishing, or proxy, you can follow these steps: + +1. Check out `react-native` repo and update template following [Christoph's instructions](https://gist.github.com/cpojer/38a91f90614f35769e88410e3a387b48) + +1. Check out `react-native-cli` repo, cd into it and run `yarn` and `yarn build`. + +1. Go back up and create a new RN project: `node ./cli/packages/cli/build/index.js init --template=file:///Users/annadoubkova/Workspace/react-native RNTestProject` + +1. Update gradle config in the newly created project following the second part of [Christoph's instructions](https://gist.github.com/cpojer/38a91f90614f35769e88410e3a387b48) + +1. Run start command `REACT_NATIVE_APP_ROOT=../cli node ../cli/packages/cli/build/index.js start` + +1. Compile your app eg `node ../cli/packages/cli/build/index.js run-android` ## Typechecking, linting and testing From 2f58be88950361aeb67f67d0ddb8b670d38798b3 Mon Sep 17 00:00:00 2001 From: Anna Doubkova Date: Fri, 31 May 2019 09:47:57 +0100 Subject: [PATCH 2/3] Update CONTRIBUTING.md --- CONTRIBUTING.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8052f569b..6f400865f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -63,19 +63,19 @@ npm config set registry https://registry.npmjs.org/ ## Running RN using local version of CLI -To start a new project with local version of CLI without publishing, or proxy, you can follow these steps: +To start a new project with local version of CLI and RN without publishing or proxy, you can follow these steps: -1. Check out `react-native` repo and update template following [Christoph's instructions](https://gist.github.com/cpojer/38a91f90614f35769e88410e3a387b48) +1. Check out `react-native` repo. Then update template in local `react-native/template/package.json`, replacing dependency version of `react-native` with the absolute path of the react native repo, for example: "react-native": "file:///Users/username/react-native" 1. Check out `react-native-cli` repo, cd into it and run `yarn` and `yarn build`. -1. Go back up and create a new RN project: `node ./cli/packages/cli/build/index.js init --template=file:///Users/annadoubkova/Workspace/react-native RNTestProject` +1. Go back up and create a new RN project: `node ./cli/packages/cli/build/index.js init --template=file:///path/to/local/react-native RNTestProject` -1. Update gradle config in the newly created project following the second part of [Christoph's instructions](https://gist.github.com/cpojer/38a91f90614f35769e88410e3a387b48) +1. To work with android, update gradle config in the newly created project following the second part of [Christoph's instructions](https://gist.github.com/cpojer/38a91f90614f35769e88410e3a387b48) 1. Run start command `REACT_NATIVE_APP_ROOT=../cli node ../cli/packages/cli/build/index.js start` -1. Compile your app eg `node ../cli/packages/cli/build/index.js run-android` +1. Compile your app eg `node ../cli/packages/cli/build/index.js run-android` (make sure you definitely have NDK r17c installed before building android) ## Typechecking, linting and testing From 8af6447b7de6de7355d6d3cc651c200cdd9d3a92 Mon Sep 17 00:00:00 2001 From: Anna Doubkova Date: Fri, 31 May 2019 11:36:44 +0100 Subject: [PATCH 3/3] Update CONTRIBUTING.md --- CONTRIBUTING.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6f400865f..fdb38e7f9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -61,21 +61,25 @@ react-native init --version ${RN_VERSION} npm config set registry https://registry.npmjs.org/ ``` -## Running RN using local version of CLI +## Running `start` command -To start a new project with local version of CLI and RN without publishing or proxy, you can follow these steps: +In order for symlinks to work correctly when running `start` locally, set REACT_NATIVE_APP_ROOT as the root folder of your cli project: -1. Check out `react-native` repo. Then update template in local `react-native/template/package.json`, replacing dependency version of `react-native` with the absolute path of the react native repo, for example: "react-native": "file:///Users/username/react-native" +``` +REACT_NATIVE_APP_ROOT=path/to/cli node path/to/cli/packages/cli/build/index.js start +``` + +## Running CLI with React Native from the source -1. Check out `react-native-cli` repo, cd into it and run `yarn` and `yarn build`. +First make sure you have RN repo checked out and CLI repo checked out and built. Then you can start a new RN project with local version of CLI and RN without publishing or proxy: + +1. Check out `react-native` repo. Then update template in local `react-native/template/package.json`, replacing dependency version of `react-native` with the absolute path of the react native repo, for example: "react-native": "file:///Users/username/react-native" (you can find the absolute path using `pwd` command) 1. Go back up and create a new RN project: `node ./cli/packages/cli/build/index.js init --template=file:///path/to/local/react-native RNTestProject` 1. To work with android, update gradle config in the newly created project following the second part of [Christoph's instructions](https://gist.github.com/cpojer/38a91f90614f35769e88410e3a387b48) -1. Run start command `REACT_NATIVE_APP_ROOT=../cli node ../cli/packages/cli/build/index.js start` - -1. Compile your app eg `node ../cli/packages/cli/build/index.js run-android` (make sure you definitely have NDK r17c installed before building android) +1. Run start (as described above) and compile your app eg `node ../cli/packages/cli/build/index.js run-android` (make sure you definitely have NDK r17c installed before building android) ## Typechecking, linting and testing