/
react-native.json
957 lines (957 loc) · 46.6 KB
/
react-native.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
{
"githubRoot": "https://github.com/nrwl/nx/blob/master",
"name": "react-native",
"packageName": "@nrwl/react-native",
"description": "The Nx Plugin for React Native contains generators for managing React Native applications and libraries within an Nx workspace. It provides: \n\n-Integration with libraries such as Jest, Detox, and Storybook.\n-Scaffolding for creating buildable libraries that can be published to npm.\n-Utilities for automatic workspace refactoring.",
"root": "/packages/react-native",
"source": "/packages/react-native/src",
"documentation": [
{
"id": "overview",
"name": "Overview",
"path": "/packages/react-native",
"file": "shared/react-native-plugin",
"content": "React Native brings React's declarative UI framework to iOS and Android. With React Native, you use native UI controls and have full access to the native platform.\n\nThe Nx Plugin for React Native contains generators for managing React Native applications and libraries within an Nx workspace. It provides:\n\n- Integration with libraries such as Jest, Detox, and Storybook.\n- Scaffolding for creating buildable libraries that can be published to npm.\n- Utilities for automatic workspace refactoring.\n\n## Setting Up React Native\n\n### Create a New Workspace\n\nThe easiest way to create your workspace is via `npx`.\n\n```shell\nnpx create-nx-workspace your-workspace-name \\\n--preset=react-native \\\n--appName=your-app-name\n```\n\n{% callout type=\"note\" title=\"Don't know what you need?\" %}\nYou can also run the command without arguments to go through the interactive prompts.\n{% /callout %}\n\n```shell\nnpx create-nx-workspace your-workspace-name\n```\n\n### Adding React Native to an Existing Workspace\n\nFor existing Nx workspaces, install the `@nrwl/react-native` package to add React Native capabilities to it.\n\n```shell\nnpm install @nrwl/react-native --save-dev\n\n# Or with yarn\nyarn add @nrwl/react-native --dev\n```\n\n### Generating Applications\n\nTo create additional React Native apps run:\n\n```shell\nnx g @nrwl/react-native:app your-app-name\n```\n\n### Generating Libraries\n\nTo generate a new library run:\n\n```shell\nnpx nx g @nrwl/react-native:lib your-lib-name\n```\n\n### Generating Components\n\nTo generate a new component inside library run:\n\n```shell\nnpx nx g @nrwl/react-native:component your-component-name --project=your-lib-name --export\n```\n\nReplace `your-lib-name` with the app's name as defined in your `tsconfig.base.json` file or the `name` property of your `package.json`\n\n## Using React Native\n\n- [run-ios](/packages/react-native/executors/run-ios) - Builds your app and starts it on iOS simulator or device\n- [run-android](/packages/react-native/executors/run-android) - Builds your app and starts it on a connected Android emulator or device\n- [build-android](/packages/react-native/executors/build-android) - Release Build for Android\n- [start](/packages/react-native/executors/start) - Starts the server that communicates with connected devices\n- [bundle](/packages/react-native/executors/bundle) - Builds the JavaScript bundle for offline use\n- [sync-deps](/packages/react-native/executors/sync-deps) - Syncs dependencies to package.json (required for autolinking)\n- [ensure-symlink](/packages/react-native/executors/ensure-symlink) - Ensure workspace node_modules is symlink under app's node_modules folder\n\n## More Documentation\n\n- [Using Detox](/packages/detox)\n- [Using Jest](/packages/jest)\n"
}
],
"generators": [
{
"name": "init",
"factory": "./src/generators/init/init#reactNativeInitGenerator",
"schema": {
"cli": "nx",
"$id": "NxReactNativeInit",
"$schema": "http://json-schema.org/schema",
"title": "Add Nx React Native Schematics",
"description": "Add Nx React native schematics.",
"type": "object",
"properties": {
"unitTestRunner": {
"description": "Adds the specified unit test runner.",
"type": "string",
"enum": ["jest", "none"],
"default": "jest"
},
"skipFormat": {
"description": "Skip formatting files.",
"type": "boolean",
"default": false
},
"e2eTestRunner": {
"description": "Adds the specified E2E test runner.",
"type": "string",
"enum": ["detox", "none"],
"default": "detox"
},
"js": {
"type": "boolean",
"default": false,
"description": "Use JavaScript instead of TypeScript"
}
},
"required": [],
"presets": []
},
"description": "Initialize the `@nrwl/react-native` plugin.",
"hidden": true,
"implementation": "/packages/react-native/src/generators/init/init#reactNativeInitGenerator.ts",
"aliases": [],
"path": "/packages/react-native/src/generators/init/schema.json"
},
{
"name": "application",
"factory": "./src/generators/application/application#reactNativeApplicationGenerator",
"schema": {
"cli": "nx",
"$id": "NxReactNativeApplication",
"$schema": "http://json-schema.org/schema",
"title": "Create a React Application for Nx",
"description": "Create a React Application for Nx.",
"examples": [
{
"command": "nx g app myapp --directory=nested",
"description": "Generate `apps/nested/myapp`"
},
{
"command": "nx g app myapp --classComponent",
"description": "Use class components instead of functional components"
}
],
"type": "object",
"properties": {
"name": {
"description": "The name of the application.",
"type": "string",
"$default": { "$source": "argv", "index": 0 },
"x-prompt": "What name would you like to use for the application?"
},
"displayName": {
"description": "The display name to show in the application. Defaults to name.",
"type": "string"
},
"directory": {
"description": "The directory of the new application.",
"type": "string",
"alias": "d"
},
"skipFormat": {
"description": "Skip formatting files",
"type": "boolean",
"default": false
},
"linter": {
"description": "The tool to use for running lint checks.",
"type": "string",
"enum": ["eslint"],
"default": "eslint"
},
"unitTestRunner": {
"type": "string",
"enum": ["jest", "none"],
"description": "Test runner to use for unit tests",
"default": "jest"
},
"tags": {
"type": "string",
"description": "Add tags to the application (used for linting).",
"alias": "t"
},
"js": {
"type": "boolean",
"description": "Generate JavaScript files rather than TypeScript files",
"default": false
},
"setParserOptionsProject": {
"type": "boolean",
"description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
"default": false
},
"e2eTestRunner": {
"description": "Adds the specified e2e test runner.",
"type": "string",
"enum": ["detox", "none"],
"default": "detox"
},
"install": {
"type": "boolean",
"description": "Runs `pod install` for native modules before building iOS app.",
"default": true
}
},
"required": [],
"presets": []
},
"aliases": ["app"],
"x-type": "application",
"description": "Create a React Native application.",
"implementation": "/packages/react-native/src/generators/application/application#reactNativeApplicationGenerator.ts",
"hidden": false,
"path": "/packages/react-native/src/generators/application/schema.json"
},
{
"name": "library",
"factory": "./src/generators/library/library#reactNativeLibraryGenerator",
"schema": {
"cli": "nx",
"$id": "NxReactNativeLibrary",
"$schema": "http://json-schema.org/schema",
"title": "Create a React Native Library for Nx",
"description": "Create a React Native Library for Nx.",
"type": "object",
"examples": [
{
"command": "nx g lib mylib --directory=myapp",
"description": "Generate `libs/myapp/mylib`"
}
],
"properties": {
"name": {
"type": "string",
"description": "Library name.",
"$default": { "$source": "argv", "index": 0 },
"x-prompt": "What name would you like to use for the library?",
"pattern": "^[a-zA-Z].*$"
},
"directory": {
"type": "string",
"description": "A directory where the lib is placed.",
"alias": "d"
},
"linter": {
"description": "The tool to use for running lint checks.",
"type": "string",
"enum": ["eslint"],
"default": "eslint"
},
"unitTestRunner": {
"type": "string",
"enum": ["jest", "none"],
"description": "Test runner to use for unit tests.",
"default": "jest"
},
"tags": {
"type": "string",
"description": "Add tags to the library (used for linting).",
"alias": "t"
},
"skipFormat": {
"description": "Skip formatting files.",
"type": "boolean",
"default": false
},
"skipTsConfig": {
"type": "boolean",
"default": false,
"description": "Do not update `tsconfig.json` for development experience."
},
"pascalCaseFiles": {
"type": "boolean",
"description": "Use pascal case component file name (e.g. `App.tsx`).",
"alias": "P",
"default": false
},
"publishable": {
"type": "boolean",
"description": "Create a publishable library."
},
"buildable": {
"type": "boolean",
"default": false,
"description": "Generate a buildable library."
},
"importPath": {
"type": "string",
"description": "The library name used to import it, like `@myorg/my-awesome-lib`."
},
"js": {
"type": "boolean",
"description": "Generate JavaScript files rather than TypeScript files.",
"default": false
},
"globalCss": {
"type": "boolean",
"description": "When `true`, the stylesheet is generated using global CSS instead of CSS modules (e.g. file is `*.css` rather than `*.module.css`).",
"default": false
},
"strict": {
"type": "boolean",
"description": "Whether to enable tsconfig strict mode or not.",
"default": true
},
"setParserOptionsProject": {
"type": "boolean",
"description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
"default": false
}
},
"required": ["name"],
"presets": []
},
"aliases": ["lib"],
"x-type": "library",
"description": "Create a React Native library.",
"implementation": "/packages/react-native/src/generators/library/library#reactNativeLibraryGenerator.ts",
"hidden": false,
"path": "/packages/react-native/src/generators/library/schema.json"
},
{
"name": "component",
"factory": "./src/generators/component/component#reactNativeComponentGenerator",
"schema": {
"cli": "nx",
"$id": "NxReactNativeApplication",
"$schema": "http://json-schema.org/schema",
"title": "Create a React Native Component for Nx",
"description": "Create a React native Component for Nx.",
"type": "object",
"examples": [
{
"command": "nx g component my-component --project=mylib",
"description": "Generate a component in the `mylib` library"
},
{
"command": "nx g component my-component --project=mylib --classComponent",
"description": "Generate a class component in the `mylib` library"
}
],
"properties": {
"project": {
"type": "string",
"description": "The name of the project.",
"alias": "p",
"$default": { "$source": "projectName" },
"x-prompt": "What is the name of the project for this component?"
},
"name": {
"type": "string",
"description": "The name of the component.",
"$default": { "$source": "argv", "index": 0 },
"x-prompt": "What name would you like to use for the component?"
},
"js": {
"type": "boolean",
"description": "Generate JavaScript files rather than TypeScript files.",
"default": false
},
"skipTests": {
"type": "boolean",
"description": "When true, does not create `spec.ts` test files for the new component.",
"default": false
},
"directory": {
"type": "string",
"description": "Create the component under this directory (can be nested).",
"alias": "d"
},
"flat": {
"type": "boolean",
"description": "Create component at the source root rather than its own directory.",
"default": false
},
"export": {
"type": "boolean",
"description": "When true, the component is exported from the project `index.ts` (if it exists).",
"alias": "e",
"default": false,
"x-prompt": "Should this component be exported in the project?"
},
"pascalCaseFiles": {
"type": "boolean",
"description": "Use pascal case component file name (e.g. `App.tsx`).",
"alias": "P",
"default": false
},
"classComponent": {
"type": "boolean",
"alias": "C",
"description": "Use class components instead of functional component.",
"default": false
}
},
"required": ["name", "project"],
"presets": []
},
"description": "Create a React Native component.",
"aliases": ["c"],
"implementation": "/packages/react-native/src/generators/component/component#reactNativeComponentGenerator.ts",
"hidden": false,
"path": "/packages/react-native/src/generators/component/schema.json"
},
{
"name": "storybook-configuration",
"factory": "./src/generators/storybook-configuration/configuration#storybookConfigurationGenerator",
"schema": {
"$schema": "http://json-schema.org/schema",
"cli": "nx",
"$id": "NxReactNativeStorybookConfigure",
"title": "React native Storybook configuration",
"description": "Set up Storybook for a React-Native app or library.",
"type": "object",
"properties": {
"name": {
"type": "string",
"aliases": ["project", "projectName"],
"description": "Project for which to generate Storybook configuration.",
"$default": { "$source": "argv", "index": 0 },
"x-prompt": "For which project do you want to generate Storybook configuration?",
"x-dropdown": "projects"
},
"generateStories": {
"type": "boolean",
"description": "Automatically generate *.stories.ts files for components declared in this project?",
"x-prompt": "Automatically generate *.stories.ts files for components declared in this project?",
"default": true
},
"js": {
"type": "boolean",
"description": "Generate JavaScript story files rather than TypeScript story files.",
"default": false
},
"tsConfiguration": {
"type": "boolean",
"description": "Configure your project with TypeScript. Generate main.ts and preview.ts files, instead of main.js and preview.js.",
"default": false
},
"linter": {
"description": "The tool to use for running lint checks.",
"type": "string",
"enum": ["eslint"],
"default": "eslint"
},
"standaloneConfig": {
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
"type": "boolean"
},
"ignorePaths": {
"type": "array",
"description": "Paths to ignore when looking for components.",
"items": { "type": "string", "description": "Path to ignore." },
"examples": [
"apps/my-app/src/not-stories/**",
"**/**/src/**/not-stories/**",
"libs/my-lib/**/*.something.ts",
"**/**/src/**/*.other.*",
"libs/my-lib/src/not-stories/**,**/**/src/**/*.other.*,apps/my-app/**/*.something.ts"
]
}
},
"required": ["name"],
"presets": []
},
"description": "Set up Storybook for a React-native application or library.",
"hidden": false,
"implementation": "/packages/react-native/src/generators/storybook-configuration/configuration#storybookConfigurationGenerator.ts",
"aliases": [],
"path": "/packages/react-native/src/generators/storybook-configuration/schema.json"
},
{
"name": "component-story",
"factory": "./src/generators/component-story/component-story#componentStoryGenerator",
"schema": {
"$schema": "http://json-schema.org/schema",
"cli": "nx",
"$id": "NxReactNativeComponentStory",
"title": "React native component story",
"description": "Generate storybook story for a react-native component.",
"type": "object",
"properties": {
"project": {
"type": "string",
"aliases": ["name", "projectName"],
"description": "The project where to add the components.",
"examples": ["shared-ui-component"],
"$default": { "$source": "projectName", "index": 0 },
"x-prompt": "What's the name of the project where the component lives?"
},
"componentPath": {
"type": "string",
"description": "Relative path to the component file from the library root.",
"examples": ["lib/components"],
"x-prompt": "What's path of the component relative to the project's lib root?"
}
},
"required": ["project", "componentPath"],
"presets": []
},
"description": "Generate Storybook story for a React-native component.",
"hidden": false,
"implementation": "/packages/react-native/src/generators/component-story/component-story#componentStoryGenerator.ts",
"aliases": [],
"path": "/packages/react-native/src/generators/component-story/schema.json"
},
{
"name": "stories",
"factory": "./src/generators/stories/stories#storiesGenerator",
"schema": {
"$schema": "http://json-schema.org/schema",
"cli": "nx",
"$id": "NxReactNativeStorybookStories",
"title": "Generate React Native Storybook stories",
"description": "Generate stories/specs for all components declared in a React Native project.",
"type": "object",
"properties": {
"project": {
"type": "string",
"aliases": ["name", "projectName"],
"description": "Project for which to generate stories.",
"$default": { "$source": "projectName", "index": 0 },
"x-prompt": "For which project do you want to generate stories?"
},
"ignorePaths": {
"type": "array",
"description": "Paths to ignore when looking for components.",
"items": { "type": "string", "description": "Path to ignore." },
"examples": [
"apps/my-app/src/not-stories/**",
"**/**/src/**/not-stories/**",
"libs/my-lib/**/*.something.ts",
"**/**/src/**/*.other.*",
"libs/my-lib/src/not-stories/**,**/**/src/**/*.other.*,apps/my-app/**/*.something.ts"
]
}
},
"required": ["project"],
"presets": []
},
"description": "Create stories/specs for all components declared in an application or library.",
"hidden": false,
"implementation": "/packages/react-native/src/generators/stories/stories#storiesGenerator.ts",
"aliases": [],
"path": "/packages/react-native/src/generators/stories/schema.json"
},
{
"name": "upgrade-native",
"factory": "./src/generators/upgrade-native/upgrade-native#reactNativeUpgradeNativeGenerator",
"schema": {
"$schema": "http://json-schema.org/schema",
"cli": "nx",
"$id": "NxReactNativeUpgradeNativeConfigure",
"title": "React native upgrade native configuration",
"description": "Upgrade native iOS and Android code to latest.",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Application project name to upgrade native files.",
"$default": { "$source": "argv", "index": 0 },
"x-dropdown": "project"
},
"displayName": {
"description": "The display name to show in the application. Defaults to name.",
"type": "string"
},
"js": {
"type": "boolean",
"description": "Generate JavaScript files rather than TypeScript files",
"default": false
},
"e2eTestRunner": {
"description": "Adds the specified e2e test runner.",
"type": "string",
"enum": ["detox", "none"],
"default": "detox"
},
"install": {
"type": "boolean",
"description": "Runs `pod install` for native modules before building iOS app.",
"default": true
}
},
"required": ["name"],
"presets": []
},
"description": "Destructive command to upgrade native iOS and Android code to latest.",
"hidden": false,
"implementation": "/packages/react-native/src/generators/upgrade-native/upgrade-native#reactNativeUpgradeNativeGenerator.ts",
"aliases": [],
"path": "/packages/react-native/src/generators/upgrade-native/schema.json"
}
],
"executors": [
{
"name": "run-android",
"implementation": "/packages/react-native/src/executors/run-android/run-android.impl.ts",
"schema": {
"version": 2,
"outputCapture": "direct-nodejs",
"cli": "nx",
"$id": "NxReactNativeRunAndroid",
"$schema": "http://json-schema.org/schema",
"title": "Run Android application",
"description": "Run Android target options.",
"type": "object",
"presets": [
{
"name": "Run Android without cache",
"keys": ["variant", "sync", "port", "packager", "resetCache"]
}
],
"properties": {
"variant": {
"type": "string",
"description": "Specify your app's build variant (e.g. `debug`, `release`).",
"default": "debug",
"examples": ["debug", "release"]
},
"appId": {
"type": "string",
"description": "Specify an `applicationId` to launch after build. If not specified, `package` from `AndroidManifest.xml` will be used."
},
"appIdSuffix": {
"type": "string",
"description": "Specify an `applicationIdSuffix` to launch after build."
},
"mainActivity": {
"type": "string",
"description": "Name of the activity to start.",
"default": "MainActivity"
},
"deviceId": {
"type": "string",
"description": "Builds your app and starts it on a specific device/simulator with the given device id (listed by running `adb devices` on the command line)."
},
"tasks": {
"type": "string",
"description": "Run custom Gradle tasks. If this argument is provided, then `--variant` option is ignored. Example: `yarn react-native run-android --tasks clean,installDebug`."
},
"jetifier": {
"type": "boolean",
"description": "Run Jetifier – the AndroidX transition tool. By default it runs before Gradle to ease working with libraries that don't support AndroidX yet.",
"default": true
},
"sync": {
"type": "boolean",
"description": "Syncs npm dependencies to `package.json` (for React Native autolink).",
"default": true
},
"port": {
"type": "number",
"description": "The port where the packager server is listening on.",
"default": 8081
},
"terminal": {
"type": "string",
"description": "Launches the Metro Bundler in a new window using the specified terminal path."
},
"packager": {
"type": "boolean",
"description": "Starts the packager server.",
"default": true
},
"resetCache": {
"type": "boolean",
"description": "Resets metro cache.",
"default": false
},
"interactive": {
"type": "boolean",
"description": "Run packager server in interactive mode.",
"default": true
}
},
"examplesFile": "`project.json`:\n\n```json\n{\n \"name\": \"mobile\",\n //...\n \"targets\": {\n //...\n \"run-android\": {\n \"executor\": \"@nrwl/react-native:run-android\",\n \"options\": {}\n }\n }\n}\n```\n\n```bash\nnx run mobile:run-android\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Run on a specific device/simulator\" %}\nTo see all the avaiable emulators, run command:\n\n```bash\nemulator -list-avds\n```\n\nThe `deviceId` option allows you to launch your android app in a specific device/simulator:\n\n```json\n \"run-android\": {\n \"executor\": \"@nrwl/react-native:run-android\",\n \"options\": {\n \"deviceId\": \"Pixel_5_API_30\"\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Run the debug/release app\" %}\nThe `variant` option allows to specify the build variant, such as `debug` or `release`.\n\n```json\n \"run-android\": {\n \"executor\": \"@nrwl/react-native:run-android\",\n \"options\": {\n \"variant\": \"release\"\n }\n }\n```\n\n{% /tab %}\n{% /tabs %}\n\n---\n"
},
"description": "Runs Android application.",
"aliases": [],
"hidden": false,
"path": "/packages/react-native/src/executors/run-android/schema.json"
},
{
"name": "run-ios",
"implementation": "/packages/react-native/src/executors/run-ios/run-ios.impl.ts",
"schema": {
"version": 2,
"outputCapture": "direct-nodejs",
"cli": "nx",
"$id": "NxReactNativeRunIos",
"$schema": "http://json-schema.org/schema",
"title": "Run iOS application",
"description": "Run iOS target options.",
"type": "object",
"presets": [
{
"name": "Run iOS without cache",
"keys": [
"xcodeConfiguration",
"install",
"sync",
"port",
"packager",
"resetCache"
]
}
],
"properties": {
"xcodeConfiguration": {
"type": "string",
"description": "Explicitly set the Xcode configuration to use.",
"default": "Debug",
"examples": ["Debug", "Release"]
},
"scheme": {
"type": "string",
"description": "Explicitly set the Xcode scheme to use."
},
"simulator": {
"type": "string",
"description": "Explicitly set simulator to use. Optionally include iOS version between parenthesis at the end to match an exact version: `iPhone X (12.1)`.",
"default": "iPhone 13",
"examples": ["iPhone 13", "iPhone X"]
},
"device": {
"type": "string",
"description": "Explicitly set device to use by name. The value is not required if you have a single device connected."
},
"install": {
"type": "boolean",
"description": "Runs `pod install` for native modules before building iOS app.",
"default": true
},
"sync": {
"type": "boolean",
"description": "Syncs npm dependencies to `package.json` (for React Native autolink). Always true when `--install` is used.",
"default": true
},
"port": {
"type": "number",
"description": "The port where the packager server is listening on.",
"default": 8081
},
"terminal": {
"type": "string",
"description": "Launches the Metro Bundler in a new window using the specified terminal path."
},
"packager": {
"type": "boolean",
"description": "Starts the packager server.",
"default": true
},
"resetCache": {
"type": "boolean",
"description": "Resets metro cache.",
"default": false
},
"interactive": {
"type": "boolean",
"description": "Run packager server in interactive mode.",
"default": true
}
},
"examplesFile": "`project.json`:\n\n```json\n{\n \"name\": \"mobile\",\n //...\n \"targets\": {\n //...\n \"run-ios\": {\n \"executor\": \"@nrwl/react-native:run-ios\",\n \"options\": {}\n }\n }\n}\n```\n\n```bash\nnx run mobile:run-ios\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Run on a simulator\" %}\nTo see all the avaiable simulators, run command:\n\n```bash\nxcrun simctl list\n```\n\nThe `simulator` option allows you to launch your iOS app in a specific simulator:\n\n```json\n \"run-ios\": {\n \"executor\": \"@nrwl/react-native:run-ios\",\n \"options\": {\n \"simulator\": \"iPhone 13 Pro\"\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Run on a device\" %}\nThe `device` option allows you to launch your iOS app in a specific device.\n\n```json\n \"run-ios\": {\n \"executor\": \"@nrwl/react-native:run-ios\",\n \"options\": {\n \"device\": \"deviceName\"\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Run the Debug/Release app\" %}\nThe `xcodeConfiguration` option allows to specify the xcode configuartion, such as `Debug` or `Release`.\n\n```json\n \"run-ios\": {\n \"executor\": \"@nrwl/react-native:run-ios\",\n \"options\": {\n \"xcodeConfiguration\": \"Release\"\n }\n }\n```\n\n{% /tab %}\n{% /tabs %}\n\n---\n"
},
"description": "Runs iOS application.",
"aliases": [],
"hidden": false,
"path": "/packages/react-native/src/executors/run-ios/schema.json"
},
{
"name": "bundle",
"implementation": "/packages/react-native/src/executors/bundle/bundle.impl.ts",
"schema": {
"version": 2,
"outputCapture": "direct-nodejs",
"cli": "nx",
"$id": "NxReactNativeBundle",
"$schema": "http://json-schema.org/schema",
"title": "Offline JS Bundle for React Native",
"description": "JS Bundle target options.",
"type": "object",
"properties": {
"entryFile": {
"type": "string",
"description": "The entry file relative to project root.",
"x-completion-type": "file",
"x-completion-glob": "main@(.js|.ts)"
},
"platform": {
"enum": ["ios", "android"],
"alias": "p",
"description": "Platform to build for."
},
"transformer": {
"type": "string",
"description": "Specify a custom transformer to be used."
},
"dev": {
"type": "boolean",
"description": "Generate a development build.",
"default": true
},
"minify": {
"type": "boolean",
"description": "Allows overriding whether bundle is minified."
},
"bundleOutput": {
"type": "string",
"description": "The output path of the generated files.",
"x-completion-type": "directory"
},
"maxWorkers": {
"type": "number",
"description": "The number of workers we should parallelize the transformer on."
},
"sourcemapOutput": {
"type": "string",
"description": "File name where to store the sourcemap file for resulting bundle, ex. /tmp/groups.map."
},
"sourcemapSourcesRoot": {
"type": "string",
"description": "Path to make sourcemaps sources entries relative to, ex. /root/dir."
},
"sourcemapUseAbsolutePath": {
"type": "boolean",
"description": "Report SourceMapURL using its full path.",
"default": false
},
"assetsDest": {
"type": "string",
"description": "Directory name where to store assets referenced in the bundle."
},
"resetCache": {
"type": "boolean",
"description": "Removes cached files.",
"default": false
},
"readGlobalCache": {
"type": "boolean",
"description": "Removes cached files.",
"default": false
}
},
"required": ["platform", "entryFile", "bundleOutput"],
"examplesFile": "`project.json`:\n\n```json\n{\n \"name\": \"mobile\",\n //...\n \"targets\": {\n //...\n \"bundle-ios\": {\n \"executor\": \"@nrwl/react-native:bundle\",\n \"outputs\": [\"apps/mobile/build\"],\n \"options\": {\n \"entryFile\": \"src/main.tsx\",\n \"platform\": \"ios\",\n \"bundleOutput\": \"dist/apps/mobile/ios/main.jsbundle\"\n }\n },\n \"bundle-android\": {\n \"executor\": \"@nrwl/react-native:bundle\",\n \"options\": {\n \"entryFile\": \"src/main.tsx\",\n \"platform\": \"android\",\n \"bundleOutput\": \"dist/apps/mobile/android/main.jsbundle\"\n }\n }\n }\n}\n```\n\n```bash\nnx run mobile:bundle-ios\nnx run mobile:bundle-android\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Bundle with sourcemap\" %}\nThe `sourcemapOutput` option allows you to specify the path of the source map relative to app folder:\n\n```json\n \"bundle-ios\": {\n \"executor\": \"@nrwl/react-native:bundle\",\n \"options\": {\n \"entryFile\": \"src/main.tsx\",\n \"platform\": \"ios\",\n \"bundleOutput\": \"dist/apps/mobile/ios/main.jsbundle\",\n \"sourcemapOutput\": \"../../dist/apps/mobile/ios/main.map\",\n }\n },\n \"bundle-android\": {\n \"executor\": \"@nrwl/react-native:bundle\",\n \"options\": {\n \"entryFile\": \"src/main.tsx\",\n \"platform\": \"android\",\n \"bundleOutput\": \"dist/apps/mobile/android/main.jsbundle\",\n \"sourcemapOutput\": \"../../dist/apps/mobile/android/main.map\",\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Create a dev/release bundle\" %}\n\nThe `dev` option determines whether to create a dev or release bundle. The default value is `true`, by setting it as `false`, warnings are disabled and the bundle is minified.\n\n```json\n \"bundle-ios\": {\n \"executor\": \"@nrwl/react-native:bundle\",\n \"options\": {\n \"entryFile\": \"src/main.tsx\",\n \"platform\": \"ios\",\n \"bundleOutput\": \"dist/apps/mobile/ios/main.jsbundle\",\n \"dev\": false\n }\n },\n \"bundle-android\": {\n \"executor\": \"@nrwl/react-native:bundle\",\n \"options\": {\n \"entryFile\": \"src/main.tsx\",\n \"platform\": \"android\",\n \"bundleOutput\": \"dist/apps/mobile/android/main.jsbundle\",\n \"dev\": false\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Create a minified bundle\" %}\n\nThe `minify` option allows you to create a minified bundle:\n\n```json\n \"bundle-ios\": {\n \"executor\": \"@nrwl/react-native:bundle\",\n \"options\": {\n \"entryFile\": \"src/main.tsx\",\n \"platform\": \"ios\",\n \"bundleOutput\": \"dist/apps/mobile/ios/main.jsbundle\",\n \"minify\": true\n }\n },\n \"bundle-android\": {\n \"executor\": \"@nrwl/react-native:bundle\",\n \"options\": {\n \"entryFile\": \"src/main.tsx\",\n \"platform\": \"android\",\n \"bundleOutput\": \"dist/apps/mobile/android/main.jsbundle\",\n \"minify\": true\n }\n }\n```\n\n{% /tab %}\n{% /tabs %}\n\n---\n",
"presets": []
},
"description": "Builds the JavaScript bundle for offline use.",
"aliases": [],
"hidden": false,
"path": "/packages/react-native/src/executors/bundle/schema.json"
},
{
"name": "build-android",
"implementation": "/packages/react-native/src/executors/build-android/build-android.impl.ts",
"schema": {
"version": 2,
"outputCapture": "direct-nodejs",
"cli": "nx",
"$id": "NxReactNativeBuildAndroid",
"$schema": "http://json-schema.org/schema",
"title": "Release Build for Android",
"description": "Build target options for Android.",
"type": "object",
"properties": {
"apk": {
"type": "boolean",
"description": "Generate apk file(s) rather than a bundle (`.aab`)."
},
"debug": {
"type": "boolean",
"description": "Generate a debug build instead of a release build."
},
"gradleTask": {
"type": "string",
"description": "Override default gradle task incase of multi build variants"
}
},
"required": [],
"examplesFile": "`project.json`:\n\n```json\n{\n \"name\": \"mobile\",\n //...\n \"targets\": {\n //...\n \"build-android\": {\n \"executor\": \"@nrwl/react-native:build-android\",\n \"outputs\": [\n \"apps/mobile/android/app/build/outputs/bundle\",\n \"apps/mobile/android/app/build/outputs/apk\"\n ],\n \"options\": {}\n }\n }\n}\n```\n\n```bash\nnx run mobile:build-android\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Build with custom gradleTask\" %}\nThe `gradleTask` option accepts any custom gradle task, such as `assembleDebug`, `assembleRelease`, `bundleDebug`, `bundleRelease`:\n\n```json\n \"build-android\": {\n \"executor\": \"@nrwl/react-native:build-android\",\n \"outputs\": [\n \"apps/mobile/android/app/build/outputs/bundle\",\n \"apps/mobile/android/app/build/outputs/apk\"\n ],\n \"options\": {\n \"gradleTask\": \"assembleDebug\"\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Create a build with apk format\" %}\n\nThe `apk` option allows you determine the format of android build. If set as true, it will create a build with `.apk` extension under apk folder; if set as false, it will create with `.aab` extension under bundle folder.\n\n```json\n \"build-android\": {\n \"executor\": \"@nrwl/react-native:build-android\",\n \"outputs\": [\n \"apps/mobile/android/app/build/outputs/bundle\",\n \"apps/mobile/android/app/build/outputs/apk\"\n ],\n \"options\": {\n \"apk\": true\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Build for debug/release\" %}\n\nIf set `debug` option as `true`, it will create a debug build; if set as `false`, it will create a release build.\n\n```json\n \"build-android\": {\n \"executor\": \"@nrwl/react-native:build-android\",\n \"outputs\": [\n \"apps/mobile/android/app/build/outputs/bundle\",\n \"apps/mobile/android/app/build/outputs/apk\"\n ],\n \"options\": {\n \"debug\": true\n }\n }\n```\n\n{% /tab %}\n{% /tabs %}\n\n---\n",
"presets": []
},
"description": "Release Build for Android.",
"aliases": [],
"hidden": false,
"path": "/packages/react-native/src/executors/build-android/schema.json"
},
{
"name": "start",
"implementation": "/packages/react-native/src/executors/start/start.impl.ts",
"schema": {
"version": 2,
"outputCapture": "direct-nodejs",
"cli": "nx",
"$id": "NxReactNativeStart",
"$schema": "http://json-schema.org/schema",
"title": "Packager Server for React Native",
"description": "Packager Server target options.",
"type": "object",
"properties": {
"port": {
"type": "number",
"description": "The port to listen on.",
"default": 8081
},
"resetCache": {
"type": "boolean",
"description": "Resets metro cache.",
"default": false
},
"interactive": {
"type": "boolean",
"description": "Run packager server in interactive mode.",
"default": true
}
},
"examplesFile": "`project.json`:\n\n```json\n{\n \"name\": \"mobile\",\n //...\n \"targets\": {\n //...\n \"start\": {\n \"executor\": \"@nrwl/react-native:start\",\n \"options\": {\n \"port\": 8081\n }\n }\n }\n}\n```\n\n```bash\nnx run mobile:start\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Starts the server non-interactively\" %}\nThe `interactive` option allows you to specify whether to use interactive mode:\n\n```json\n \"start\": {\n \"executor\": \"@nrwl/react-native:start\",\n \"options\": {\n \"port\": 8081,\n \"interactive\": false\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Starts the server with cache reset\" %}\n\nThe `resetCache` option allows you to remove cached files.\n\n```json\n \"start\": {\n \"executor\": \"@nrwl/react-native:start\",\n \"options\": {\n \"port\": 8081,\n \"resetCache\": true\n }\n }\n```\n\n{% /tab %}\n{% /tabs %}\n\n---\n",
"presets": []
},
"description": "Starts the Javascript server that communicates with connected devices.",
"aliases": [],
"hidden": false,
"path": "/packages/react-native/src/executors/start/schema.json"
},
{
"name": "sync-deps",
"implementation": "/packages/react-native/src/executors/sync-deps/sync-deps.impl.ts",
"schema": {
"version": 2,
"outputCapture": "direct-nodejs",
"cli": "nx",
"$id": "NxReactNativeSyncDeps",
"$schema": "http://json-schema.org/schema",
"title": "Sync Deps for React Native",
"description": "Updates `package.json` with project dependencies.",
"type": "object",
"properties": {
"include": {
"type": "array",
"items": { "type": "string" },
"default": [],
"description": "An array of additional npm packages to include."
},
"exclude": {
"type": "array",
"items": { "type": "string" },
"default": [],
"description": "An array of npm packages to exclude."
}
},
"presets": []
},
"description": "Syncs dependencies to `package.json` (required for autolinking).",
"aliases": [],
"hidden": false,
"path": "/packages/react-native/src/executors/sync-deps/schema.json"
},
{
"name": "ensure-symlink",
"implementation": "/packages/react-native/src/executors/ensure-symlink/ensure-symlink.impl.ts",
"schema": {
"version": 2,
"outputCapture": "direct-nodejs",
"cli": "nx",
"$id": "NxReactNativeEnsureSymlink",
"$schema": "http://json-schema.org/schema",
"title": "Ensure Symlink for React Native",
"description": "Ensure workspace node_modules is symlink under app's node_modules folder.",
"type": "object",
"properties": {},
"presets": []
},
"description": "Ensure workspace `node_modules` is symlink under app's `node_modules` folder.",
"aliases": [],
"hidden": false,
"path": "/packages/react-native/src/executors/ensure-symlink/schema.json"
},
{
"name": "storybook",
"implementation": "/packages/react-native/src/executors/storybook/storybook.impl.ts",
"schema": {
"version": 2,
"outputCapture": "direct-nodejs",
"title": "React Native Storybook Load Stories",
"cli": "nx",
"description": "Load stories for react native.",
"type": "object",
"properties": {
"searchDir": {
"type": "array",
"items": { "type": "string" },
"default": [],
"description": "The directory or directories, relative to the project root, to search for files in."
},
"outputFile": {
"type": "string",
"description": "The output file that will be written. It is relative to the project directory.",
"default": "./.storybook/story-loader.js"
},
"pattern": {
"type": "string",
"description": "The pattern of files to look at. It can be a specific file, or any valid glob. Note: if using the CLI, globs with `**/*...` must be escaped with quotes",
"default": "**/*.stories.@(js|jsx|ts|tsx|md)"
},
"silent": {
"type": "boolean",
"description": "Silences output.",
"default": false
}
},
"required": ["searchDir", "outputFile", "pattern"],
"presets": []
},
"description": "Serve React Native Storybook.",
"aliases": [],
"hidden": false,
"path": "/packages/react-native/src/executors/storybook/schema.json"
}
]
}