Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
feat(core): add react native to main repo (#6493)
  • Loading branch information
xiongemi committed Aug 25, 2021
1 parent 5ff55ce commit 387af0c
Show file tree
Hide file tree
Showing 271 changed files with 11,693 additions and 9 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/e2e-matrix.yml
Expand Up @@ -44,6 +44,7 @@ jobs:
- e2e-web
- e2e-storybook
- e2e-workspace
- e2e-react-native,e2e-detox
exclude:
- os: ubuntu-latest
node_version: '14'
Expand Down Expand Up @@ -121,6 +122,13 @@ jobs:
with:
version: 6.9.1

- name: Install applesimutils, reset ios simulators
if: ${{ matrix.os == 'macos-latest' }}
run: |
HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew >/dev/null
brew install applesimutils
xcrun simctl shutdown all && xcrun simctl erase all
- name: Run e2e tests
run: yarn nx run-many --target=e2e --projects="${{ join(matrix.packages) }}"
env:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -4,7 +4,7 @@ node_modules
dist
/build
/coverage
test
./test
.DS_Store
tmp
*.log
Expand Down
23 changes: 23 additions & 0 deletions docs/angular/api-detox/executors/build.md
@@ -0,0 +1,23 @@
# @nrwl/detox:build

Run the command defined in build property of the specified configuration.

Options can be configured in `angular.json` when defining the executor, or when invoking it.

## Options

### configPath

Alias(es): cp

Type: `string`

Specify Detox config file path. If not supplied, detox searches for .detoxrc[.js] or "detox" section in package.json

### detoxConfiguration

Alias(es): C

Type: `string`

Select a device configuration from your defined configurations, if not supplied, and there's only one configuration, detox will default to it
177 changes: 177 additions & 0 deletions docs/angular/api-detox/executors/test.md
@@ -0,0 +1,177 @@
# @nrwl/detox:test

Initiating your detox test suite.

Options can be configured in `angular.json` when defining the executor, or when invoking it.

## Options

### appLaunchArgs

Type: `number`

Custom arguments to pass (through) onto the app every time it is launched.

### artifactsLocation

Alias(es): a

Type: `string`

Artifacts (logs, screenshots, etc) root directory.

### captureViewHierarchy

Type: `string`

[iOS Only] Capture \*.uihierarchy snapshots on view action errors and device.captureViewHierarchy() calls.

### cleanup

Type: `boolean`

Shutdown simulator when test is over, useful for CI scripts, to make sure detox exists cleanly with no residue

### configPath

Alias(es): cp

Type: `string`

Specify Detox config file path. If not supplied, detox searches for .detoxrc[.js] or "detox" section in package.json

### debugSynchronization

Alias(es): d

Type: `string`

Customize how long an action/expectation can take to complete before Detox starts querying the app why it is busy. By default, the app status will be printed if the action takes more than 10s to complete.

### detoxConfiguration

Alias(es): C

Type: `string`

Select a device configuration from your defined configurations, if not supplied, and there's only one configuration, detox will default to it

### deviceLaunchArgs

Type: `string`

A list of passthrough-arguments to use when (if) devices (Android emulator / iOS simulator) are launched by Detox.

### deviceName

Alias(es): n

Type: `string`

Override the device name specified in a configuration. Useful for running a single build configuration on multiple devices.

### forceAdbInstall

Type: `boolean`

Due to problems with the adb install command on Android, Detox resorts to a different scheme for install APK's. Setting true will disable that and force usage of adb install, instead.

### gpu

Type: `boolean`

[Android Only] Launch Emulator with the specific -gpu [gpu mode] parameter.

### headless

Type: `boolean`

Android Only] Launch Emulator in headless mode. Useful when running on CI.

### inspectBrk

Type: `boolean`

Uses node's --inspect-brk flag to let users debug the jest/mocha test runner

### jestReportSpecs

Type: `boolean`

[Jest Only] Whether to output logs per each running spec, in real-time. By default, disabled with multiple workers.

### loglevel

Alias(es): l

Type: `string`

Log level: fatal, error, warn, info, verbose, trace

### noColor

Type: `boolean`

Disable colors in log output

### recordLogs

Type: `string`

Save logs during each test to artifacts directory. Pass "failing" to save logs of failing tests only.

### recordPerformance

Type: `string`

[iOS Only] Save Detox Instruments performance recordings of each test to artifacts directory.

### recordTimeline

Type: `string`

[Jest Only] Record tests and events timeline, for visual display on the chrome://tracing tool.

### recordVideos

Type: `string`

Save screen recordings of each test to artifacts directory. Pass "failing" to save recordings of failing tests only.

### retries

Type: `number`

[Jest Circus Only] Re-spawn the test runner for individual failing suite files until they pass, or <N> times at least.

### reuse

Type: `boolean`

Reuse existing installed app (do not delete + reinstall) for a faster run.

### runnerConfig

Alias(es): o

Type: `string`

Test runner config file, defaults to 'e2e/mocha.opts' for mocha and 'e2e/config.json' for jest.

### takeScreenshots

Type: `string`

Save screenshots before and after each test to artifacts directory. Pass "failing" to save screenshots of failing tests only.

### useCustomLogger

Type: `boolean`

Use Detox' custom console-logging implementation, for logging Detox (non-device) logs. Disabling will fallback to node.js / test-runner's implementation (e.g. Jest / Mocha).

### workers

Type: `number`

Specifies number of workers the test runner should spawn, requires a test runner with parallel execution support (Detox CLI currently supports Jest).
81 changes: 81 additions & 0 deletions docs/angular/api-detox/generators/application.md
@@ -0,0 +1,81 @@
# @nrwl/detox:application

Create a detox application

## Usage

```bash
nx generate application ...
```

```bash
nx g app ... # same
```

By default, Nx will search for `application` in the default collection provisioned in `angular.json`.

You can specify the collection explicitly as follows:

```bash
nx g @nrwl/detox:application ...
```

Show what will be generated without writing to disk:

```bash
nx g application ... --dry-run
```

## Options

### name (_**required**_)

Type: `string`

Name of the E2E Project

### project (_**required**_)

Type: `string`

The name of the frontend project to test.

### directory

Type: `string`

A directory where the project is placed

### js

Default: `false`

Type: `boolean`

Generate JavaScript files rather than TypeScript files

### linter

Default: `eslint`

Type: `string`

Possible values: `eslint`, `tslint`, `none`

The tool to use for running lint checks.

### setParserOptionsProject

Default: `false`

Type: `boolean`

Whether or not to configure the ESLint "parserOptions.project" option. We do not do this by default for lint performance reasons.

### skipFormat

Default: `false`

Type: `boolean`

Skip formatting files
13 changes: 13 additions & 0 deletions docs/angular/api-react-native/executors/build-android.md
@@ -0,0 +1,13 @@
# @nrwl/react-native:build-android

Release Build for Android.

Options can be configured in `angular.json` when defining the executor, or when invoking it.

## Options

### apk

Type: `boolean`

Generate apk file(s) rather than a bundle (.aab).
45 changes: 45 additions & 0 deletions docs/angular/api-react-native/executors/bundle.md
@@ -0,0 +1,45 @@
# @nrwl/react-native:bundle

Builds the JS bundle.

Options can be configured in `angular.json` when defining the executor, or when invoking it.

## Options

### bundleOutput (_**required**_)

Type: `string`

The output path of the generated files.

### entryFile (_**required**_)

Type: `string`

The entry file relative to project root.

### platform (_**required**_)

Type: `string`

Platform to build for (ios, android).

### dev

Default: `true`

Type: `boolean`

Generate a development build.

### maxWorkers

Type: `number`

The number of workers we should parallelize the transformer on.

### sourceMap

Type: `boolean`

Whether source maps should be generated or not.
5 changes: 5 additions & 0 deletions docs/angular/api-react-native/executors/ensure-symlink.md
@@ -0,0 +1,5 @@
# @nrwl/react-native:ensure-symlink

Ensure workspace node_modules is symlink under app's node_modules folder.

Options can be configured in `angular.json` when defining the executor, or when invoking it.

1 comment on commit 387af0c

@vercel
Copy link

@vercel vercel bot commented on 387af0c Aug 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.