docs(react-native): add overview page for react native and detox (#8451)
This commit is contained in:
parent
75cc52fd48
commit
549b272158
@ -1,11 +1,11 @@
|
||||
---
|
||||
title: '@nrwl/react-native:bundle executor'
|
||||
description: 'Builds the JS bundle.'
|
||||
description: 'Builds the JavaScript bundle for offline use.'
|
||||
---
|
||||
|
||||
# @nrwl/react-native:bundle
|
||||
|
||||
Builds the JS bundle.
|
||||
Builds the JavaScript bundle for offline use.
|
||||
|
||||
Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets.
|
||||
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
---
|
||||
title: '@nrwl/react-native:start executor'
|
||||
description: 'Starts the dev server for JS bundle.'
|
||||
description: 'Starts the Javascript server that communicates with connected devices.'
|
||||
---
|
||||
|
||||
# @nrwl/react-native:start
|
||||
|
||||
Starts the dev server for JS bundle.
|
||||
Starts the Javascript server that communicates with connected devices.
|
||||
|
||||
Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets.
|
||||
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
---
|
||||
title: '@nrwl/react-native:application generator'
|
||||
description: 'Create an application'
|
||||
description: 'Create a React Native application'
|
||||
---
|
||||
|
||||
# @nrwl/react-native:application
|
||||
|
||||
Create an application
|
||||
Create a React Native application
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
---
|
||||
title: '@nrwl/react-native:component generator'
|
||||
description: 'Create a component'
|
||||
description: 'Create a React Native component'
|
||||
---
|
||||
|
||||
# @nrwl/react-native:component
|
||||
|
||||
Create a component
|
||||
Create a React Native component
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
---
|
||||
title: '@nrwl/react-native:library generator'
|
||||
description: 'Create a library'
|
||||
description: 'Create a React Native library'
|
||||
---
|
||||
|
||||
# @nrwl/react-native:library
|
||||
|
||||
Create a library
|
||||
Create a React Native library
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
---
|
||||
title: '@nrwl/react:application generator'
|
||||
description: 'Create an application'
|
||||
description: 'Create a React application'
|
||||
---
|
||||
|
||||
# @nrwl/react:application
|
||||
|
||||
Create an application
|
||||
Create a React application
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
---
|
||||
title: '@nrwl/react:component generator'
|
||||
description: 'Create a component'
|
||||
description: 'Create a React component'
|
||||
---
|
||||
|
||||
# @nrwl/react:component
|
||||
|
||||
Create a component
|
||||
Create a React component
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
---
|
||||
title: '@nrwl/react:library generator'
|
||||
description: 'Create a library'
|
||||
description: 'Create a React library'
|
||||
---
|
||||
|
||||
# @nrwl/react:library
|
||||
|
||||
Create a library
|
||||
Create a React library
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
@ -1169,6 +1169,12 @@
|
||||
"name": "detox",
|
||||
"id": "detox",
|
||||
"itemList": [
|
||||
{
|
||||
"id": "overview",
|
||||
"name": "Overview",
|
||||
"searchResultsName": "@nrwl/detox Overview",
|
||||
"file": "shared/detox-plugin"
|
||||
},
|
||||
{
|
||||
"name": "application generator",
|
||||
"id": "application",
|
||||
@ -1190,6 +1196,12 @@
|
||||
"name": "react native",
|
||||
"id": "react-native",
|
||||
"itemList": [
|
||||
{
|
||||
"id": "overview",
|
||||
"name": "Overview",
|
||||
"searchResultsName": "@nrwl/react-native Overview",
|
||||
"file": "shared/react-native-plugin"
|
||||
},
|
||||
{
|
||||
"name": "application generator",
|
||||
"id": "application",
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
Cypress is an e2e test runner built for modern web. It has a lot of great features:
|
||||
|
||||
- Time travel
|
||||
- Real time reloads
|
||||
- Real-time reloads
|
||||
- Automatic waiting
|
||||
- Spies, stubs, and clocks
|
||||
- Network traffic control
|
||||
@ -56,6 +56,12 @@ You can create a new Cypress E2E project for an existing project.
|
||||
If the `@nrwl/cypress` package is not installed, install the version that matches your `@nrwl/workspace` version.
|
||||
|
||||
```sh
|
||||
#yarn
|
||||
yarn add --dev @nrwl/cypress
|
||||
```
|
||||
|
||||
```sh
|
||||
#npm
|
||||
npm install --save-dev @nrwl/cypress
|
||||
```
|
||||
|
||||
|
||||
BIN
docs/shared/detox-logo.png
Normal file
BIN
docs/shared/detox-logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 133 KiB |
132
docs/shared/detox-plugin.md
Normal file
132
docs/shared/detox-plugin.md
Normal file
@ -0,0 +1,132 @@
|
||||
# Detox Plugin
|
||||
|
||||

|
||||
|
||||
Detox is gray box end-to-end testing and automation library for mobile apps. It has a lot of great features:
|
||||
|
||||
- Cross Platform
|
||||
- Runs on Devices
|
||||
- Automatically Synchronized
|
||||
|
||||
## How to Use Detox
|
||||
|
||||
### Setup
|
||||
|
||||
#### Install applesimutils (Mac only)
|
||||
|
||||
[applesimutils](https://github.com/wix/AppleSimulatorUtils) is a collection of utils for Apple simulators.
|
||||
|
||||
```sh
|
||||
brew tap wix/brew
|
||||
brew install applesimutils
|
||||
```
|
||||
|
||||
#### Install Jest Globally
|
||||
|
||||
```sh
|
||||
npm install -g jest
|
||||
```
|
||||
|
||||
### Generating Applications
|
||||
|
||||
By default, when creating a mobile application, Nx will use Detox to create the e2e tests project.
|
||||
|
||||
```bash
|
||||
nx g @nrwl/react-native:app frontend
|
||||
```
|
||||
|
||||
```treeview
|
||||
<workspace name>/
|
||||
├── apps/
|
||||
│ ├── frontend/
|
||||
│ └── frontend-e2e/
|
||||
│ ├── .detoxrc.json
|
||||
│ ├── src/
|
||||
│ │ └── app.spec.ts
|
||||
│ ├── .babelrc
|
||||
│ ├── jest.config.json
|
||||
│ ├── project.json
|
||||
│ ├── tsconfig.e2e.json
|
||||
│ └── tsconfig.json
|
||||
├── libs/
|
||||
├── tools/
|
||||
├── babel.config.json
|
||||
├── jest.config.js
|
||||
├── jest.preset.js
|
||||
├── nx.json
|
||||
├── package.json
|
||||
├── tsconfig.base.json
|
||||
└── workspace.json
|
||||
```
|
||||
|
||||
### Creating a Detox E2E project for an existing project
|
||||
|
||||
You can create a new Detox E2E project for an existing mobile project.
|
||||
|
||||
If the `@nrwl/detox` package is not installed, install the version that matches your `@nrwl/workspace` version.
|
||||
|
||||
```sh
|
||||
# yarn
|
||||
yarn add --dev @nrwl/detox
|
||||
```
|
||||
|
||||
```sh
|
||||
# npm
|
||||
npm install --save-dev @nrwl/detox
|
||||
```
|
||||
|
||||
Next, generate an E2E project based on an existing project.
|
||||
|
||||
```sh
|
||||
nx g @nrwl/detox:app your-app-name-e2e --project=your-app-name
|
||||
```
|
||||
|
||||
Replace `your-app-name` with the app's name as defined in your `workspace.json` file.
|
||||
|
||||
In addition, you need to follow [instructions at Detox](https://github.com/wix/Detox/blob/master/docs/Introduction.Android.md) to do manual setup for Android files.
|
||||
|
||||
### Testing Applications
|
||||
|
||||
- Run `nx e2e-ios frontend-e2e` to build the iOS app and execute e2e tests with Detox for iOS (Mac only)
|
||||
- Run `nx e2e-android frontend-e2e` to build the Android app and execute e2e tests with Detox for Android
|
||||
|
||||
You can also run below commands:
|
||||
|
||||
- `nx build-ios frontend-e2e`: build the iOS app (Mac only)
|
||||
- `nx test-ios frontend-e2e`: run e2e tests on the built iOS app (Mac only)
|
||||
- `nx build-android frontend-e2e`: build the Android app
|
||||
- `nx test-android frontend-e2e`: run e2e tests on the built Android app
|
||||
|
||||
`e2e-ios` is a shorthand command for running `build-ios` and `test-ios` sequentailly.
|
||||
`android-ios` is a shorthand command for running `build-android` and `test-android` sequentailly.
|
||||
|
||||
### Testing against Prod Build
|
||||
|
||||
You can run your e2e test against a production build:
|
||||
|
||||
- `nx e2e-ios frontend-e2e --prod` for iOS
|
||||
- `nx e2e-android frontend-e2e --prod` for Android
|
||||
|
||||
- `nx build-ios frontend-e2e --prod`: build the iOS app using Release configuration
|
||||
- `nx test-ios frontend-e2e --prod`: run e2e tests on the built iOS app with Release configuration (Mac only)
|
||||
- `nx build-android frontend-e2e --prod`: build the Android app using release build type
|
||||
- `nx test-android frontend-e2e`: run e2e tests on the built Android app with release build type
|
||||
|
||||
### Using .detoxrc.json
|
||||
|
||||
If you need to fine tune your Detox setup, you can do so by modifying `.detoxrc.json` in the e2e project.
|
||||
|
||||
#### Change Testing Simulator/Emulator
|
||||
|
||||
For iOS, in terminal, run `xcrun simctl list` to view a list of simulators on your Mac. To open your active simulator, `run open -a simulator`. In `frontend-e2e/.detoxrc.json`, you could change the simulator under `devices.simulator.device`.
|
||||
|
||||
For Android, in terminal, run `emulator -list-avds` to view a list of emulators installed. To open your emulator, run `emulator -avd <your emulator name>`. In `frontend-e2e/.detoxrc.json`, you could change the simulator under `devices.emulator.device`.
|
||||
|
||||
In additon, to override the device name specified in a configuration, you could use `--device-name` option: `nx test-ios <app-name-e2e> --device-name "iPhone 11"`. The `device-name` property provides you the ability to test an application run on specific device.
|
||||
|
||||
```bash
|
||||
nx e2e-ios frontend-e2e --device-name "iPhone 11"
|
||||
nx e2e-android frontend-e2e --device-name "Pixel_4a_API_30"
|
||||
nx test-ios frontend-e2e --device-name "iPhone 11"
|
||||
nx test-android frontend-e2e --device-name "Pixel_4a_API_30"
|
||||
```
|
||||
@ -27,31 +27,31 @@ Once the command completes, the workspace will look as follows:
|
||||
|
||||
```treeview
|
||||
happynrwl/
|
||||
├── apps
|
||||
│ ├── tuskdesk
|
||||
├── apps/
|
||||
│ ├── tuskdesk/
|
||||
│ │ ├── index.d.ts
|
||||
│ │ ├── jest.config.js
|
||||
│ │ ├── next-env.d.ts
|
||||
│ │ ├── next.config.js
|
||||
│ │ ├── pages
|
||||
│ │ ├── pages/
|
||||
│ │ │ ├── _app.tsx
|
||||
│ │ │ ├── index.module.css
|
||||
│ │ │ ├── index.tsx
|
||||
│ │ │ └── styles.css
|
||||
│ │ ├── public
|
||||
│ │ ├── public/
|
||||
│ │ │ ├── nx-logo-white.svg
|
||||
│ │ │ └── star.svg
|
||||
│ │ ├── specs
|
||||
│ │ ├── specs/
|
||||
│ │ │ └── index.spec.tsx
|
||||
│ │ ├── tsconfig.json
|
||||
│ │ └── tsconfig.spec.json
|
||||
│ └── tuskdesk-e2e
|
||||
│ └── tuskdesk-e2e/
|
||||
│ ├── cypress.json
|
||||
│ ├── src
|
||||
│ │ ├── fixtures
|
||||
│ │ ├── integration
|
||||
│ │ ├── plugins
|
||||
│ │ └── support
|
||||
│ ├── src/
|
||||
│ │ ├── fixtures/
|
||||
│ │ ├── integration/
|
||||
│ │ ├── plugins/
|
||||
│ │ └── support/
|
||||
│ ├── tsconfig.e2e.json
|
||||
│ └── tsconfig.json
|
||||
├── babel.config.json
|
||||
@ -61,7 +61,7 @@ happynrwl/
|
||||
├── nx.json
|
||||
├── package-lock.json
|
||||
├── package.json
|
||||
├── tools
|
||||
├── tools/
|
||||
│ ├── generators
|
||||
│ └── tsconfig.tools.json
|
||||
├── tsconfig.base.json
|
||||
@ -83,10 +83,10 @@ When using Next.js in Nx, you get the out-of-the-box support for TypeScript, Cyp
|
||||
For existing Nx workspaces, install the `@nrwl/next` package to add Next.js capabilities to it.
|
||||
|
||||
```bash
|
||||
npm install @nrwl/next
|
||||
npm install @nrwl/next --save-dev
|
||||
|
||||
# Or with yarn
|
||||
yarn add @nrwl/next
|
||||
yarn add @nrwl/next --dev
|
||||
```
|
||||
|
||||
## Generating an Application
|
||||
@ -118,26 +118,26 @@ And you will see the following:
|
||||
|
||||
```treeview
|
||||
happynrwl/
|
||||
├── apps
|
||||
│ └── tuskdesk
|
||||
│ └── tuskdesk-e2e
|
||||
├── apps/
|
||||
│ └── tuskdesk/
|
||||
│ └── tuskdesk-e2e/
|
||||
├── babel.config.json
|
||||
├── jest.config.js
|
||||
├── jest.preset.js
|
||||
├── libs
|
||||
│ └── shared-ui-layout
|
||||
├── libs/
|
||||
│ └── shared-ui-layout/
|
||||
│ ├── README.md
|
||||
│ ├── jest.config.js
|
||||
│ ├── src
|
||||
│ ├── src/
|
||||
│ │ ├── index.ts
|
||||
│ │ └── lib
|
||||
│ ├── tsconfig.json
|
||||
│ ├── tsconfig.json/
|
||||
│ ├── tsconfig.lib.json
|
||||
│ └── tsconfig.spec.json
|
||||
├── nx.json
|
||||
├── package-lock.json
|
||||
├── package.json
|
||||
├── tools
|
||||
├── tools/
|
||||
├── tsconfig.base.json
|
||||
└── workspace.json
|
||||
```
|
||||
@ -232,7 +232,7 @@ Run the tests again for the application: `npx nx test tuskdesk`.
|
||||
|
||||
## Code Sharing
|
||||
|
||||
Without Nx, creating a new shared library can take from several hours or even weeks: a new repo needs to be provisioned, CI needs to be set up, etc.. In an Nx Workspace, it only takes minutes.
|
||||
Without Nx, creating a new shared library can take from several hours to even weeks: a new repo needs to be provisioned, CI needs to be set up, etc... In an Nx Workspace, it only takes minutes.
|
||||
|
||||
You can share React components between multiple Next.js applications. You can also share web components between Next.js and plain React applications. You can even share code between the backend and the frontend. All can be done without any unnecessary ceremony.
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
# React Native with Nx
|
||||
|
||||

|
||||

|
||||
|
||||
Nx provides a holistic dev experience powered by an advanced CLI and editor plugins. It provides rich support for common tools like [Detox](/{{version}}/{{framework}}/detox/overview), Storybook, Jest, and more.
|
||||
Nx provides a holistic dev experience powered by an advanced CLI and editor plugins. It provides rich support for common tools like [Detox](/detox/overview), Storybook, Jest, and more.
|
||||
|
||||
In this guide we will show you how to develop [React Native](https://reactnative.dev/) applications with Nx.
|
||||
|
||||
@ -26,26 +26,26 @@ Once the command completes, the workspace will look as follows:
|
||||
|
||||
```treeview
|
||||
happynrwl/
|
||||
├── apps
|
||||
│ ├── mobile
|
||||
├── apps/
|
||||
│ ├── mobile/
|
||||
│ │ ├── app.json
|
||||
│ │ ├── metro.config.js
|
||||
│ │ ├── android
|
||||
│ │ │ ├── app
|
||||
│ │ │ ├── gradle
|
||||
│ │ ├── android/
|
||||
│ │ │ ├── app/
|
||||
│ │ │ ├── gradle/
|
||||
│ │ │ ├── build.gradle
|
||||
│ │ │ ├── gradle.properties
|
||||
│ │ │ ├── gradlew
|
||||
│ │ │ ├── settings.gradle
|
||||
│ │ ├── ios
|
||||
│ │ │ ├── Mobile
|
||||
│ │ │ ├── Mobile.xcodeproj
|
||||
│ │ │ ├── Mobile.xcworkspace
|
||||
│ │ │ ├── Prodfile
|
||||
│ │ │ ├── Prodfile.lock
|
||||
│ │ ├── src
|
||||
│ │ ├── ios/
|
||||
│ │ │ ├── Mobile/
|
||||
│ │ │ ├── Mobile.xcodeproj/
|
||||
│ │ │ ├── Mobile.xcworkspace/
|
||||
│ │ │ ├── Podfile
|
||||
│ │ │ ├── Podfile.lock
|
||||
│ │ ├── src/
|
||||
│ │ │ ├── main.tsx
|
||||
│ │ │ └── app
|
||||
│ │ │ └── app/
|
||||
│ │ │ ├── App.tsx
|
||||
│ │ │ └── App.spec.tsx
|
||||
│ │ ├── .babelrc
|
||||
@ -56,17 +56,18 @@ happynrwl/
|
||||
│ │ ├── tsconfig.json
|
||||
│ │ ├── tsconfig.app.json
|
||||
│ │ └── tsconfig.spec.json
|
||||
│ └── mobile-e2e
|
||||
│ └── mobile-e2e/
|
||||
│ ├── .detoxrc.json
|
||||
│ ├── src
|
||||
│ ├── src/
|
||||
│ │ └── app.spec.ts
|
||||
│ ├── .babelrc
|
||||
│ ├── jest.config.json
|
||||
│ ├── project.json
|
||||
│ ├── tsconfig.e2e.json
|
||||
│ └── tsconfig.json
|
||||
├── libs
|
||||
├── tools
|
||||
├── libs/
|
||||
├── tools/
|
||||
├── babel.config.json
|
||||
├── jest.config.js
|
||||
├── jest.preset.js
|
||||
├── nx.json
|
||||
@ -140,8 +141,8 @@ Nx allows you to create libraries with just one command. Some reasons you might
|
||||
- Publish a package to be used outside the monorepo
|
||||
- Better visualize the architecture using `npx nx dep-graph`
|
||||
|
||||
For more information on Nx libraries, see our documentation on [Creating Libraries](/{{version}}/{{framework}}/structure/creating-libraries)
|
||||
and [Library Types](/{{version}}/{{framework}}/structure/library-types).
|
||||
For more information on Nx libraries, see our documentation on [Creating Libraries](/structure/creating-libraries)
|
||||
and [Library Types](/structure/library-types).
|
||||
|
||||
To generate a new library run:
|
||||
|
||||
@ -153,12 +154,12 @@ And you will see the following:
|
||||
|
||||
```treeview
|
||||
happynrwl/
|
||||
├── apps
|
||||
│ └── mobile
|
||||
│ └── mobile-e2e
|
||||
├── libs
|
||||
│ └── shared-ui-layout
|
||||
│ ├── src
|
||||
├── apps/
|
||||
│ └── mobile/
|
||||
│ └── mobile-e2e/
|
||||
├── libs/
|
||||
│ └── shared-ui-layout/
|
||||
│ ├── src/
|
||||
│ │ └── index.ts
|
||||
│ ├── .babelrc
|
||||
│ ├── jest.config.js
|
||||
@ -168,7 +169,8 @@ happynrwl/
|
||||
│ ├── tsconfig.json
|
||||
│ ├── tsconfig.lib.json
|
||||
│ └── tsconfig.spec.json
|
||||
├── tools
|
||||
├── tools/
|
||||
├── babel.config.json
|
||||
├── jest.config.js
|
||||
├── jest.preset.js
|
||||
├── nx.json
|
||||
@ -193,12 +195,12 @@ And you will see the following updated for `shared-ui-layout`:
|
||||
|
||||
```treeview
|
||||
happynrwl/
|
||||
└── libs
|
||||
└── shared-ui-layout
|
||||
└── src
|
||||
└── libs/
|
||||
└── shared-ui-layout/
|
||||
└── src/
|
||||
├── index.ts
|
||||
└── lib
|
||||
└── layout
|
||||
└── lib/
|
||||
└── layout/
|
||||
├── layout.tsx
|
||||
└── layout.spec.tsx
|
||||
```
|
||||
@ -256,9 +258,9 @@ This dist folder is ready to be published to a registry.
|
||||
|
||||
## Code Sharing
|
||||
|
||||
Without Nx, creating a new shared library can take from several hours or even weeks: a new repo needs to be provisioned, CI needs to be set up, etc.. In an Nx Workspace, it only takes minutes.
|
||||
Without Nx, creating a new shared library can take from several hours to even weeks: a new repo needs to be provisioned, CI needs to be set up, etc... In an Nx Workspace, it only takes minutes.
|
||||
|
||||
You can share React Native components between multiple React Native applications. You can also share business logic code between React Native mobile applications and plain React webapplications. You can even share code between the backend and the frontend. All can be done without any unnecessary ceremony.
|
||||
You can share React Native components between multiple React Native applications, share business logic code between React Native mobile applications and plain React web applications. You can even share code between the backend and the frontend. All of these can be done without any unnecessary ceremony.
|
||||
|
||||
## Resources
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
100
docs/shared/react-native-plugin.md
Normal file
100
docs/shared/react-native-plugin.md
Normal file
@ -0,0 +1,100 @@
|
||||
# React Native Plugin
|
||||
|
||||

|
||||
|
||||
The Nx Plugin for React Native contains generators for managing React Native applications and libraries within an Nx workspace. It provides:
|
||||
|
||||
- Integration with libraries such as Jest, Detox, and Storybook.
|
||||
- Scaffolding for creating buildable libraries that can be published to npm.
|
||||
- Utilities for automatic workspace refactoring.
|
||||
|
||||
## Adding the React Native plugin
|
||||
|
||||
Adding the React plugin to a workspace can be done with the following:
|
||||
|
||||
```bash
|
||||
#yarn
|
||||
yarn add -D @nrwl/react-native
|
||||
```
|
||||
|
||||
```bash
|
||||
#npm
|
||||
npm install -D @nrwl/react-native
|
||||
```
|
||||
|
||||
> Note: You can create a new workspace that has React set up by doing `npx create-nx-workspace@latest --preset=react-native`
|
||||
|
||||
The file structure for a React application looks like:
|
||||
|
||||
```treeview
|
||||
<workspace name>/
|
||||
├── apps/
|
||||
│ ├── myapp/
|
||||
│ │ ├── app.json
|
||||
│ │ ├── metro.config.js
|
||||
│ │ ├── android/
|
||||
│ │ │ ├── app/
|
||||
│ │ │ ├── gradle/
|
||||
│ │ │ ├── build.gradle
|
||||
│ │ │ ├── gradle.properties
|
||||
│ │ │ ├── gradlew
|
||||
│ │ │ ├── settings.gradle
|
||||
│ │ ├── ios/
|
||||
│ │ │ ├── Mobile/
|
||||
│ │ │ ├── Mobile.xcodeproj/
|
||||
│ │ │ ├── Mobile.xcworkspace/
|
||||
│ │ │ ├── Podfile
|
||||
│ │ │ ├── Podfile.lock
|
||||
│ │ ├── src/
|
||||
│ │ │ ├── main.tsx
|
||||
│ │ │ └── app/
|
||||
│ │ │ ├── App.tsx
|
||||
│ │ │ └── App.spec.tsx
|
||||
│ │ ├── .babelrc
|
||||
│ │ ├── jest.config.js
|
||||
│ │ ├── test-setup.ts
|
||||
│ │ ├── package.json
|
||||
│ │ ├── project.json
|
||||
│ │ ├── tsconfig.json
|
||||
│ │ ├── tsconfig.app.json
|
||||
│ │ └── tsconfig.spec.json
|
||||
│ └── myapp-e2e/
|
||||
│ ├── .detoxrc.json
|
||||
│ ├── src/
|
||||
│ │ └── app.spec.ts
|
||||
│ ├── .babelrc
|
||||
│ ├── jest.config.json
|
||||
│ ├── project.json
|
||||
│ ├── tsconfig.e2e.json
|
||||
│ └── tsconfig.json
|
||||
├── libs/
|
||||
├── tools/
|
||||
├── babel.config.json
|
||||
├── jest.config.js
|
||||
├── jest.preset.js
|
||||
├── nx.json
|
||||
├── package.json
|
||||
├── tsconfig.base.json
|
||||
└── workspace.json
|
||||
```
|
||||
|
||||
## See Also
|
||||
|
||||
- [Using Detox](/detox/overview)
|
||||
- [Using Jest](/jest/overview)
|
||||
|
||||
## Executors / Builders
|
||||
|
||||
- [run-ios](/react-native/run-ios) - Builds your app and starts it on iOS simulator
|
||||
- [run-android](/react-native/run-android) - Builds your app and starts it on a connected Android emulator or device
|
||||
- [build-android](/react-native/build-android) - Release Build for Android
|
||||
- [start](/react-native/package) - Starts the server that communicates with connected devices
|
||||
- [bundle](/web/package) - Builds the JavaScript bundle for offline use
|
||||
- [sync-deps](/react-native/sync-deps) - Syncs dependencies to package.json (required for autolinking)
|
||||
- [ensure-symlink](/react-native/ensure-symlink) - Ensure workspace node_modules is symlink under app's node_modules folder
|
||||
|
||||
## Generators
|
||||
|
||||
- [application](/react-native/application) - Create a React Native application
|
||||
- [component](/react-native/component) - Create a React Native component
|
||||
- [library](/react-native/library) - Create a React Native library
|
||||
@ -1,4 +1,6 @@
|
||||
# Nx Plugin for React
|
||||
# React Plugin
|
||||
|
||||

|
||||
|
||||
The Nx Plugin for React contains generators for managing React applications and libraries within an Nx workspace. It provides:
|
||||
|
||||
@ -83,8 +85,8 @@ React applications are built using the executors from the `@nrwl/web` plugin.
|
||||
|
||||
## Generators
|
||||
|
||||
- [application](/react/application) - Create an React application
|
||||
- [component](/react/component) - Create an React component
|
||||
- [library](/react/library) - Create an React library
|
||||
- [application](/react/application) - Create a React application
|
||||
- [component](/react/component) - Create a React component
|
||||
- [library](/react/library) - Create a React library
|
||||
- [redux](/react/redux) - Generate a Redux slice for a project
|
||||
- [storybook-configuration](/react/storybook-configuration) - Set up Storybook for a react library
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"bundle": {
|
||||
"implementation": "./src/executors/bundle/bundle.impl",
|
||||
"schema": "./src/executors/bundle/schema.json",
|
||||
"description": "Builds the JS bundle."
|
||||
"description": "Builds the JavaScript bundle for offline use."
|
||||
},
|
||||
"build-android": {
|
||||
"implementation": "./src/executors/build-android/build-android.impl",
|
||||
@ -23,7 +23,7 @@
|
||||
"start": {
|
||||
"implementation": "./src/executors/start/start.impl",
|
||||
"schema": "./src/executors/start/schema.json",
|
||||
"description": "Starts the dev server for JS bundle."
|
||||
"description": "Starts the Javascript server that communicates with connected devices."
|
||||
},
|
||||
"sync-deps": {
|
||||
"implementation": "./src/executors/sync-deps/sync-deps.impl",
|
||||
@ -50,7 +50,7 @@
|
||||
"bundle": {
|
||||
"implementation": "./src/executors/bundle/compat",
|
||||
"schema": "./src/executors/bundle/schema.json",
|
||||
"description": "Builds the JS bundle."
|
||||
"description": "Builds the JavaScript bundle for offline use."
|
||||
},
|
||||
"build-android": {
|
||||
"implementation": "./src/executors/build-android/compat",
|
||||
@ -60,7 +60,7 @@
|
||||
"start": {
|
||||
"implementation": "./src/executors/start/compat",
|
||||
"schema": "./src/executors/start/schema.json",
|
||||
"description": "Starts the dev server for JS bundle."
|
||||
"description": "Starts the Javascript server that communicates with connected devices."
|
||||
},
|
||||
"sync-deps": {
|
||||
"implementation": "./src/executors/sync-deps/compat",
|
||||
|
||||
@ -14,19 +14,19 @@
|
||||
"schema": "./src/generators/application/schema.json",
|
||||
"aliases": ["app"],
|
||||
"x-type": "application",
|
||||
"description": "Create an application"
|
||||
"description": "Create a React Native application"
|
||||
},
|
||||
"library": {
|
||||
"factory": "./src/generators/library/library#reactNativeLibrarySchematic",
|
||||
"schema": "./src/generators/library/schema.json",
|
||||
"aliases": ["lib"],
|
||||
"x-type": "library",
|
||||
"description": "Create a library"
|
||||
"description": "Create a React Native library"
|
||||
},
|
||||
"component": {
|
||||
"factory": "./src/generators/component/component#reactNativeComponentSchematic",
|
||||
"schema": "./src/generators/component/schema.json",
|
||||
"description": "Create a component",
|
||||
"description": "Create a React Native component",
|
||||
"aliases": ["c"]
|
||||
}
|
||||
},
|
||||
@ -42,19 +42,19 @@
|
||||
"schema": "./src/generators/application/schema.json",
|
||||
"aliases": ["app"],
|
||||
"x-type": "application",
|
||||
"description": "Create an application"
|
||||
"description": "Create a React Native application"
|
||||
},
|
||||
"library": {
|
||||
"factory": "./src/generators/library/library#reactNativeLibraryGenerator",
|
||||
"schema": "./src/generators/library/schema.json",
|
||||
"aliases": ["lib"],
|
||||
"x-type": "library",
|
||||
"description": "Create a library"
|
||||
"description": "Create a React Native library"
|
||||
},
|
||||
"component": {
|
||||
"factory": "./src/generators/component/component#reactNativeComponentGenerator",
|
||||
"schema": "./src/generators/component/schema.json",
|
||||
"description": "Create a component",
|
||||
"description": "Create a React Native component",
|
||||
"aliases": ["c"]
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
"schema": "./src/generators/application/schema.json",
|
||||
"aliases": ["app"],
|
||||
"x-type": "application",
|
||||
"description": "Create an application"
|
||||
"description": "Create a React application"
|
||||
},
|
||||
|
||||
"library": {
|
||||
@ -24,13 +24,13 @@
|
||||
"schema": "./src/generators/library/schema.json",
|
||||
"aliases": ["lib"],
|
||||
"x-type": "library",
|
||||
"description": "Create a library"
|
||||
"description": "Create a React library"
|
||||
},
|
||||
|
||||
"component": {
|
||||
"factory": "./src/generators/component/component#componentSchematic",
|
||||
"schema": "./src/generators/component/schema.json",
|
||||
"description": "Create a component",
|
||||
"description": "Create a React component",
|
||||
"aliases": "c"
|
||||
},
|
||||
|
||||
@ -97,7 +97,7 @@
|
||||
"schema": "./src/generators/application/schema.json",
|
||||
"aliases": ["app"],
|
||||
"x-type": "application",
|
||||
"description": "Create an application"
|
||||
"description": "Create a React application"
|
||||
},
|
||||
|
||||
"library": {
|
||||
@ -105,13 +105,13 @@
|
||||
"schema": "./src/generators/library/schema.json",
|
||||
"aliases": ["lib"],
|
||||
"x-type": "library",
|
||||
"description": "Create a library"
|
||||
"description": "Create a React library"
|
||||
},
|
||||
|
||||
"component": {
|
||||
"factory": "./src/generators/component/component#componentGenerator",
|
||||
"schema": "./src/generators/component/schema.json",
|
||||
"description": "Create a component",
|
||||
"description": "Create a React component",
|
||||
"aliases": "c"
|
||||
},
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user