Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(readme): updating the README #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .idea/codestream.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

12 changes: 0 additions & 12 deletions .idea/rn-template.iml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

64 changes: 0 additions & 64 deletions .idea/workspace.xml

This file was deleted.

85 changes: 25 additions & 60 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,7 @@
<p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-react.png" width="600" alt="Nx - Smart, Extensible Build Framework"></p>

{{links}}

<hr>

# React Native Plugin for Nx

{{what-is-nx}}

{{getting-started}}

## Table of Contents

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [Getting started](#getting-started)
- [Create a new Nx workspace:](#create-a-new-nx-workspace)
- [Install React Native plugin](#install-react-native-plugin)
- [Create an app](#create-an-app)
- [Start the JavaScript bundler](#start-the-javascript-bundler)
- [Run on devices](#run-on-devices)
- [Release build](#release-build)
- [Test/lint the app](#testlint-the-app)
- [E2e test the app](#e2e-test-the-app)
- [Setup](#setup)
- [Install applesimutils (Mac only)](#install-applesimutils-mac-only)
- [Install Jest Globally](#install-jest-globally)
- [Commands](#commands)
- [Manually Add E2E Folder](#manually-add-e2e-folder)
- [Change Testing Simulator/Emulator](#change-testing-simulatoremulator)
- [Using components from React library](#using-components-from-react-library)
- [CLI Commands and Options](#cli-commands-and-options)
- [`start`](#start)
- [`--port [number]`](#--port-number)
- [`run-ios`](#run-ios)
- [`--port [number]`](#--port-number-1)
- [`--install`](#--install)
- [`--sync`](#--sync)
- [`run-android`](#run-android)
- [`--port [number]`](#--port-number-2)
- [`--sync`](#--sync-1)
- [`sync-deps`](#sync-deps)
- [`--include [string]`](#--include-string)
- [Learn more](#learn-more)
- [Contributing](#contributing)
- [Debugging](#debugging)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->
# Mirahi/rn-template

This repo contains the template we use at [Mirahi](https;//mirahi.io) to start our React Native projects.
It is based on an [Nx](https://nx.dev) monorepo that can contain web and native applications sharing code code between each other.

## Getting started

Expand All @@ -57,23 +11,28 @@
npx create-nx-workspace --cli=nx --preset=empty
```

### Install React Native plugin
### Install the plugin

```sh
# Using npm
npm install --save-dev @nrwl/react-native
npm install --save-dev @xorob0/[email protected]

# Using yarn
yarn add -D @nrwl/react-native
yarn add -D @xorob0/[email protected]
```
TODO: publish under `@mirahi`

### Create an app

To create a react native app use
```sh
npx nx g @nrwl/react-native:app <app-name>
npx nx g @xorob0/rn-template:app <app-name>
```

When using Nx, you can create multiple applications and themes in the same workspace. If you don't want to prefix your commands with npx, install `@nrwl/cli` globally.
Of course you can still use
```sh
nx generate @nrwl/react:app <app-name>
```
to create a react web application

### Start the JavaScript bundler

Expand Down Expand Up @@ -125,13 +84,17 @@ npx nx lint <app-name>
You can use a component from React library generated using Nx package for React. Once you run:

```sh
npx nx g @nrwl/react-native:lib ui-button
npx nx g @xorob0/rn-template:lib ui
```

This will generate the `UiButton` component, which you can use in your app.
This will generate the `Ui` library, which you can use in your native app and your web app.

```jsx
import { UiButton } from '@myorg/ui-button';
import { Button } from '@myorg/ui/native';
```

```jsx
import { Button } from '@myorg/ui/web';
```

## CLI Commands and Options
Expand Down Expand Up @@ -188,6 +151,8 @@ A comma-separate list of additional packages to include.

e.g. `nx sync-deps [app] --include react-native-gesture,react-native-safe-area-context`

## Learn more

# References
This template is based on [`@nrwl/nx-react-native`](https://github.com/nrwl/nx-react-native)

Visit the [Nx Documentation](https://nx.dev) to learn more.
Loading