@nx/react-native 24.0.0-beta.2 → 24.0.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/dist/src/generators/application/application.js +2 -3
  2. package/dist/src/generators/application/lib/add-project.js +1 -83
  3. package/dist/src/generators/application/lib/normalize-options.js +0 -4
  4. package/dist/src/generators/application/schema.d.ts +0 -1
  5. package/dist/src/generators/convert-to-inferred/lib/create-process-options.d.ts +2 -2
  6. package/dist/src/generators/convert-to-inferred/lib/create-process-options.js +2 -2
  7. package/dist/src/generators/init/init.js +44 -53
  8. package/dist/src/generators/init/schema.d.ts +0 -1
  9. package/dist/src/generators/library/lib/normalize-options.js +0 -5
  10. package/dist/src/generators/library/library.js +2 -3
  11. package/dist/src/generators/library/schema.d.ts +0 -1
  12. package/dist/src/generators/web-configuration/files/base-vite/vite.config.mts__tmpl__ +6 -5
  13. package/dist/src/generators/web-configuration/files/base-webpack/webpack.config.js__tmpl__ +2 -51
  14. package/dist/src/generators/web-configuration/lib/webpack-targets.d.ts +1 -3
  15. package/dist/src/generators/web-configuration/lib/webpack-targets.js +0 -57
  16. package/dist/src/generators/web-configuration/web-configuration.js +9 -18
  17. package/dist/src/migrations/update-24-0-0/finish-inferred-conversion.md +12 -0
  18. package/dist/src/migrations/update-24-0-0/remove-deprecated-executors.d.ts +6 -0
  19. package/dist/src/migrations/update-24-0-0/remove-deprecated-executors.js +30 -0
  20. package/dist/src/migrations/update-24-0-0/remove-deprecated-executors.md +68 -0
  21. package/dist/src/utils/add-jest.d.ts +1 -1
  22. package/dist/src/utils/add-jest.js +1 -2
  23. package/dist/src/utils/add-linting.d.ts +0 -1
  24. package/dist/src/utils/add-linting.js +0 -1
  25. package/dist/src/utils/chmod-android-gradle-files.d.ts +0 -1
  26. package/dist/src/utils/chmod-android-gradle-files.js +0 -1
  27. package/dist/src/utils/pod-install-task.d.ts +0 -6
  28. package/dist/src/utils/pod-install-task.js +0 -1
  29. package/dist/src/utils/versions.d.ts +1 -0
  30. package/dist/src/utils/versions.js +2 -1
  31. package/executors.json +0 -40
  32. package/migrations.json +7 -0
  33. package/package.json +9 -9
  34. package/dist/src/executors/build-android/build-android.impl.d.ts +0 -6
  35. package/dist/src/executors/build-android/build-android.impl.js +0 -53
  36. package/dist/src/executors/build-android/schema.d.ts +0 -13
  37. package/dist/src/executors/build-android/schema.json +0 -82
  38. package/dist/src/executors/build-ios/build-ios.impl.d.ts +0 -6
  39. package/dist/src/executors/build-ios/build-ios.impl.js +0 -60
  40. package/dist/src/executors/build-ios/schema.d.ts +0 -17
  41. package/dist/src/executors/build-ios/schema.json +0 -92
  42. package/dist/src/executors/bundle/bundle.impl.d.ts +0 -6
  43. package/dist/src/executors/bundle/bundle.impl.js +0 -61
  44. package/dist/src/executors/bundle/schema.d.ts +0 -16
  45. package/dist/src/executors/bundle/schema.json +0 -93
  46. package/dist/src/executors/pod-install/pod-install.impl.d.ts +0 -6
  47. package/dist/src/executors/pod-install/pod-install.impl.js +0 -13
  48. package/dist/src/executors/pod-install/schema.d.ts +0 -6
  49. package/dist/src/executors/pod-install/schema.json +0 -34
  50. package/dist/src/executors/run-android/run-android.impl.d.ts +0 -6
  51. package/dist/src/executors/run-android/run-android.impl.js +0 -71
  52. package/dist/src/executors/run-android/schema.d.ts +0 -12
  53. package/dist/src/executors/run-android/schema.json +0 -102
  54. package/dist/src/executors/run-ios/run-ios.impl.d.ts +0 -6
  55. package/dist/src/executors/run-ios/run-ios.impl.js +0 -70
  56. package/dist/src/executors/run-ios/schema.d.ts +0 -7
  57. package/dist/src/executors/run-ios/schema.json +0 -98
  58. package/dist/src/executors/start/lib/is-packager-running.d.ts +0 -1
  59. package/dist/src/executors/start/lib/is-packager-running.js +0 -13
  60. package/dist/src/executors/start/schema.d.ts +0 -7
  61. package/dist/src/executors/start/schema.json +0 -30
  62. package/dist/src/executors/start/start.impl.d.ts +0 -9
  63. package/dist/src/executors/start/start.impl.js +0 -91
  64. package/dist/src/executors/upgrade/schema.d.ts +0 -1
  65. package/dist/src/executors/upgrade/schema.json +0 -12
  66. package/dist/src/executors/upgrade/upgrade.impl.d.ts +0 -12
  67. package/dist/src/executors/upgrade/upgrade.impl.js +0 -51
  68. package/dist/src/utils/deprecation.d.ts +0 -2
  69. package/dist/src/utils/deprecation.js +0 -19
  70. package/dist/src/utils/get-cli-options.d.ts +0 -8
  71. package/dist/src/utils/get-cli-options.js +0 -32
@@ -1,61 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = bundleExecutor;
4
- const devkit_1 = require("@nx/devkit");
5
- const internal_1 = require("@nx/devkit/internal");
6
- const path_1 = require("path");
7
- const child_process_1 = require("child_process");
8
- const fs_1 = require("fs");
9
- const deprecation_1 = require("../../utils/deprecation");
10
- async function* bundleExecutor(options, context) {
11
- (0, deprecation_1.warnReactNativeExecutorDeprecation)('bundle');
12
- const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
13
- options.bundleOutput = (0, path_1.join)(context.root, options.bundleOutput);
14
- (0, fs_1.mkdirSync)((0, path_1.dirname)(options.bundleOutput));
15
- await runCliBuild(context.root, projectRoot, options);
16
- yield { success: true };
17
- }
18
- function runCliBuild(workspaceRoot, projectRoot, options) {
19
- return new Promise((resolve, reject) => {
20
- const cliOptions = createBundleOptions(options);
21
- const childProcess = (0, child_process_1.fork)(require.resolve('react-native/cli.js'), ['bundle', ...cliOptions], {
22
- stdio: 'inherit',
23
- cwd: (0, path_1.resolve)(workspaceRoot, projectRoot),
24
- env: process.env,
25
- });
26
- /**
27
- * Ensure the child process is killed when the parent exits
28
- */
29
- const processExitListener = (signal) => () => {
30
- childProcess.kill(signal);
31
- process.exit();
32
- };
33
- process.once('exit', (signal) => childProcess.kill(signal));
34
- process.once('SIGTERM', processExitListener);
35
- process.once('SIGINT', processExitListener);
36
- process.once('SIGQUIT', processExitListener);
37
- childProcess.on('error', (err) => {
38
- reject(err);
39
- });
40
- childProcess.on('exit', (code, signal) => {
41
- if (code === null)
42
- code = (0, internal_1.signalToCode)(signal);
43
- if (code === 0) {
44
- resolve(childProcess);
45
- }
46
- else {
47
- reject(code);
48
- }
49
- });
50
- });
51
- }
52
- function createBundleOptions(options) {
53
- return Object.keys(options).reduce((acc, _k) => {
54
- const v = options[_k];
55
- const k = (0, devkit_1.names)(_k).fileName;
56
- if (v === undefined)
57
- return acc;
58
- acc.push(`--${k}`, v);
59
- return acc;
60
- }, []);
61
- }
@@ -1,16 +0,0 @@
1
- // options form https://github.com/facebook/react-native/tree/main/packages/community-cli-plugin#bundle
2
- export interface ReactNativeBundleOptions {
3
- entryFile: string;
4
- platform: string;
5
- transfrom?: string;
6
- dev: boolean; // default is true
7
- minify?: boolean; // default is false, if dev is false, then minify will become true
8
- bundleOutput: string;
9
- maxWorkers: number;
10
- sourcemapOutput?: string;
11
- sourcemapSourcesRoot?: string;
12
- sourcemapUseAbsolutePath: boolean; // default is false
13
- assetDest?: string;
14
- resetCache: boolean; // default is false
15
- readGlobalCache?: boolean; // default is false
16
- }
@@ -1,93 +0,0 @@
1
- {
2
- "version": 2,
3
- "outputCapture": "direct-nodejs",
4
- "cli": "nx",
5
- "$id": "NxReactNativeBundle",
6
- "$schema": "https://json-schema.org/schema",
7
- "title": "Offline JS Bundle for React Native",
8
- "description": "JS Bundle target options.",
9
- "type": "object",
10
- "x-deprecated": "The `@nx/react-native:bundle` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/react-native:convert-to-inferred` to migrate to the `@nx/react-native/plugin` inferred plugin. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.",
11
- "presets": [
12
- {
13
- "name": "Bundle for a specific platform",
14
- "keys": ["platform"]
15
- },
16
- {
17
- "name": "Bundle a development build",
18
- "keys": ["dev"]
19
- },
20
- {
21
- "name": "Bundle to a specific output path",
22
- "keys": ["bundleOutput"]
23
- },
24
- {
25
- "name": "Bundle without global cache",
26
- "keys": ["resetCache"]
27
- }
28
- ],
29
- "properties": {
30
- "entryFile": {
31
- "type": "string",
32
- "description": "The entry file relative to project root.",
33
- "x-completion-type": "file",
34
- "x-completion-glob": "main@(.js|.ts)"
35
- },
36
- "platform": {
37
- "enum": ["ios", "android"],
38
- "alias": "p",
39
- "description": "Platform to build for."
40
- },
41
- "transformer": {
42
- "type": "string",
43
- "description": "Specify a custom transformer to be used."
44
- },
45
- "dev": {
46
- "type": "boolean",
47
- "description": "Generate a development build.",
48
- "default": true
49
- },
50
- "minify": {
51
- "type": "boolean",
52
- "description": "Allows overriding whether bundle is minified."
53
- },
54
- "bundleOutput": {
55
- "type": "string",
56
- "description": "The output path of the generated files.",
57
- "x-completion-type": "directory"
58
- },
59
- "maxWorkers": {
60
- "type": "number",
61
- "description": "The number of workers we should parallelize the transformer on."
62
- },
63
- "sourcemapOutput": {
64
- "type": "string",
65
- "description": "File name where to store the sourcemap file for resulting bundle, ex. /tmp/groups.map."
66
- },
67
- "sourcemapSourcesRoot": {
68
- "type": "string",
69
- "description": "Path to make sourcemaps sources entries relative to, ex. /root/dir."
70
- },
71
- "sourcemapUseAbsolutePath": {
72
- "type": "boolean",
73
- "description": "Report SourceMapURL using its full path.",
74
- "default": false
75
- },
76
- "assetsDest": {
77
- "type": "string",
78
- "description": "Directory name where to store assets referenced in the bundle."
79
- },
80
- "resetCache": {
81
- "type": "boolean",
82
- "description": "Removes cached files.",
83
- "default": false
84
- },
85
- "readGlobalCache": {
86
- "type": "boolean",
87
- "description": "Try to fetch transformed JS code from the global cache, if configured.",
88
- "default": false
89
- }
90
- },
91
- "required": ["platform", "entryFile", "bundleOutput"],
92
- "examplesFile": "../../../docs/bundle-examples.md"
93
- }
@@ -1,6 +0,0 @@
1
- import { ExecutorContext } from '@nx/devkit';
2
- import { ReactNativePodInstallOptions } from './schema';
3
- export interface ReactNativePodInstallOutput {
4
- success: boolean;
5
- }
6
- export default function podInstall(options: ReactNativePodInstallOptions, context: ExecutorContext): AsyncGenerator<ReactNativePodInstallOutput>;
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = podInstall;
4
- const path_1 = require("path");
5
- const pod_install_task_1 = require("../../utils/pod-install-task");
6
- const deprecation_1 = require("../../utils/deprecation");
7
- async function* podInstall(options, context) {
8
- (0, deprecation_1.warnReactNativeExecutorDeprecation)('pod-install');
9
- const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
10
- const iosDirectory = (0, path_1.join)(context.root, projectRoot, 'ios');
11
- await (0, pod_install_task_1.runPodInstall)(iosDirectory, true, options)();
12
- yield { success: true };
13
- }
@@ -1,6 +0,0 @@
1
- export interface ReactNativePodInstallOptions {
2
- buildFolder: string; // default is './build'
3
- repoUpdate: boolean; // default is false
4
- deployment: boolean; // default is false
5
- useBundler: boolean; // default is false
6
- }
@@ -1,34 +0,0 @@
1
- {
2
- "version": 2,
3
- "outputCapture": "direct-nodejs",
4
- "cli": "nx",
5
- "$id": "NxReactNativePodInstall",
6
- "$schema": "https://json-schema.org/schema",
7
- "title": "Run Pod Install for React Native iOS Project",
8
- "description": "Run `pod install` for React Native iOS Project.",
9
- "type": "object",
10
- "x-deprecated": "The `@nx/react-native:pod-install` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/react-native:convert-to-inferred` to migrate to the `@nx/react-native/plugin` inferred plugin. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.",
11
- "properties": {
12
- "buildFolder": {
13
- "description": "Location for iOS build artifacts. Corresponds to Xcode's \"-derivedDataPath\". Relative to ios directory.",
14
- "type": "string",
15
- "default": "./build"
16
- },
17
- "repoUpdate": {
18
- "description": "Force running `pod repo update` before install.",
19
- "type": "boolean",
20
- "default": false
21
- },
22
- "deployment": {
23
- "description": "Disallow any changes to the Podfile or the Podfile.lock during installation.",
24
- "type": "boolean",
25
- "default": false
26
- },
27
- "useBundler": {
28
- "description": "Run cocoapods within a Bundler environment, i.e. with the `bundle exec pod install` command",
29
- "type": "boolean",
30
- "default": false
31
- }
32
- },
33
- "required": ["buildFolder"]
34
- }
@@ -1,6 +0,0 @@
1
- import { ExecutorContext } from '@nx/devkit';
2
- import { ReactNativeRunAndroidOptions } from './schema';
3
- export interface ReactNativeRunAndroidOutput {
4
- success: boolean;
5
- }
6
- export default function runAndroidExecutor(options: ReactNativeRunAndroidOptions, context: ExecutorContext): AsyncGenerator<ReactNativeRunAndroidOutput>;
@@ -1,71 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = runAndroidExecutor;
4
- const internal_1 = require("@nx/devkit/internal");
5
- const path_1 = require("path");
6
- const child_process_1 = require("child_process");
7
- const start_impl_1 = require("../start/start.impl");
8
- const chmod_android_gradle_files_1 = require("../../utils/chmod-android-gradle-files");
9
- const get_cli_options_1 = require("../../utils/get-cli-options");
10
- const deprecation_1 = require("../../utils/deprecation");
11
- let childProcess;
12
- async function* runAndroidExecutor(options, context) {
13
- (0, deprecation_1.warnReactNativeExecutorDeprecation)('run-android');
14
- const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
15
- (0, chmod_android_gradle_files_1.chmodAndroidGradlewFiles)((0, path_1.join)(context.root, projectRoot, 'android'));
16
- const tasks = [runCliRunAndroid(context.root, projectRoot, options)];
17
- if (options.mode !== 'Release') {
18
- tasks.push((0, start_impl_1.runCliStart)(context.root, projectRoot, {
19
- port: options.port,
20
- resetCache: options.resetCache,
21
- interactive: true,
22
- }));
23
- }
24
- await Promise.all(tasks);
25
- yield { success: true };
26
- }
27
- function runCliRunAndroid(workspaceRoot, projectRoot, options) {
28
- return new Promise((resolve, reject) => {
29
- /**
30
- * Call the react native cli with option `--no-packager`
31
- * Not passing '--packager' due to cli will launch start command from the project root
32
- */
33
- childProcess = (0, child_process_1.fork)(require.resolve('react-native/cli.js'), ['run-android', ...createRunAndroidOptions(options), '--no-packager'], {
34
- stdio: 'inherit',
35
- cwd: (0, path_1.resolve)(workspaceRoot, projectRoot),
36
- env: { ...process.env, RCT_METRO_PORT: options.port.toString() },
37
- });
38
- /**
39
- * Ensure the child process is killed when the parent exits
40
- */
41
- const processExitListener = (signal) => () => {
42
- childProcess.kill(signal);
43
- process.exit();
44
- };
45
- process.once('exit', (signal) => childProcess.kill(signal));
46
- process.once('SIGTERM', processExitListener);
47
- process.once('SIGINT', processExitListener);
48
- process.once('SIGQUIT', processExitListener);
49
- childProcess.on('error', (err) => {
50
- reject(err);
51
- });
52
- childProcess.on('exit', (code, signal) => {
53
- if (code === null)
54
- code = (0, internal_1.signalToCode)(signal);
55
- if (code === 0) {
56
- resolve(childProcess);
57
- }
58
- else {
59
- reject(code);
60
- }
61
- });
62
- });
63
- }
64
- const startOptions = ['port', 'resetCache'];
65
- function createRunAndroidOptions(options) {
66
- return (0, get_cli_options_1.getCliOptions)(options, startOptions, [
67
- 'appId',
68
- 'appIdSuffix',
69
- 'deviceId',
70
- ]);
71
- }
@@ -1,12 +0,0 @@
1
- import { ReactNativeBuildAndroidOptions } from '../build-android/schema';
2
- import { ReactNativeStartOptions } from '../start/schema';
3
-
4
- // part of options from https://github.com/react-native-community/cli/blob/main/packages/cli-platform-android/src/commands/runAndroid/index.ts
5
- export interface ReactNativeRunAndroidOptions extends ReactNativeBuildAndroidOptions {
6
- appId: string;
7
- appIdSuffix: string;
8
- mainActiviy: string;
9
- deviceId: string;
10
- listDevices?: boolean;
11
- binaryPath?: string;
12
- }
@@ -1,102 +0,0 @@
1
- {
2
- "version": 2,
3
- "continuous": true,
4
- "outputCapture": "direct-nodejs",
5
- "cli": "nx",
6
- "$id": "NxReactNativeRunAndroid",
7
- "$schema": "https://json-schema.org/schema",
8
- "title": "Run Android application",
9
- "description": "Run Android target options.",
10
- "type": "object",
11
- "x-deprecated": "The `@nx/react-native:run-android` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/react-native:convert-to-inferred` to migrate to the `@nx/react-native/plugin` inferred plugin. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.",
12
- "presets": [
13
- {
14
- "name": "Run Android for the current device architecture",
15
- "keys": ["activeArchOnly"]
16
- },
17
- {
18
- "name": "Lists all available Android devices and simulators",
19
- "keys": ["listDevices"]
20
- },
21
- {
22
- "name": "Run Android without metro cache",
23
- "keys": ["resetCache"]
24
- }
25
- ],
26
- "properties": {
27
- "appId": {
28
- "type": "string",
29
- "description": "Specify an `applicationId` to launch after build. If not specified, `package` from `AndroidManifest.xml` will be used."
30
- },
31
- "appIdSuffix": {
32
- "type": "string",
33
- "description": "Specify an `applicationIdSuffix` to launch after build."
34
- },
35
- "mainActivity": {
36
- "type": "string",
37
- "description": "Name of the activity to start.",
38
- "default": "MainActivity"
39
- },
40
- "deviceId": {
41
- "type": "string",
42
- "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)."
43
- },
44
- "listDevices": {
45
- "type": "boolean",
46
- "description": "Lists all available Android devices and simulators and let you choose one to run the app"
47
- },
48
- "binaryPath": {
49
- "type": "string",
50
- "description": "Path relative to project root where pre-built .apk binary lives."
51
- },
52
- "mode": {
53
- "type": "string",
54
- "description": "Specify your app's build variant",
55
- "default": "debug",
56
- "examples": ["debug", "release"],
57
- "x-priority": "important"
58
- },
59
- "port": {
60
- "type": "number",
61
- "description": "The port where the packager server is listening on.",
62
- "default": 8081
63
- },
64
- "tasks": {
65
- "oneOf": [
66
- { "type": "array", "items": { "type": "string" } },
67
- { "type": "string" }
68
- ],
69
- "description": "Run custom Gradle tasks. By default it's \"assembleDebug\". Will override passed mode and variant arguments.",
70
- "examples": [
71
- "assembleDebug",
72
- "assembleRelease",
73
- "bundleDebug",
74
- "bundleRelease",
75
- "installDebug",
76
- "installRelease"
77
- ]
78
- },
79
- "activeArchOnly": {
80
- "type": "boolean",
81
- "description": "Build native libraries only for the current device architecture for debug builds.",
82
- "default": false
83
- },
84
- "extraParams": {
85
- "oneOf": [
86
- { "type": "array", "items": { "type": "string" } },
87
- { "type": "string" }
88
- ],
89
- "description": "Custom params passed to gradle build command"
90
- },
91
- "interactive": {
92
- "type": "boolean",
93
- "description": "Explicitly select build type and flavour to use before running a build"
94
- },
95
- "resetCache": {
96
- "type": "boolean",
97
- "description": "Resets metro cache.",
98
- "default": false
99
- }
100
- },
101
- "examplesFile": "../../../docs/run-android-examples.md"
102
- }
@@ -1,6 +0,0 @@
1
- import { ExecutorContext } from '@nx/devkit';
2
- import { ReactNativeRunIosOptions } from './schema';
3
- export interface ReactNativeRunIosOutput {
4
- success: boolean;
5
- }
6
- export default function runIosExecutor(options: ReactNativeRunIosOptions, context: ExecutorContext): AsyncGenerator<ReactNativeRunIosOutput>;
@@ -1,70 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = runIosExecutor;
4
- const internal_1 = require("@nx/devkit/internal");
5
- const path_1 = require("path");
6
- const child_process_1 = require("child_process");
7
- const os_1 = require("os");
8
- const start_impl_1 = require("../start/start.impl");
9
- const get_cli_options_1 = require("../../utils/get-cli-options");
10
- const deprecation_1 = require("../../utils/deprecation");
11
- async function* runIosExecutor(options, context) {
12
- (0, deprecation_1.warnReactNativeExecutorDeprecation)('run-ios');
13
- if ((0, os_1.platform)() !== 'darwin') {
14
- throw new Error(`The run-ios build requires Mac to run`);
15
- }
16
- const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
17
- const tasks = [runCliRunIOS(context.root, projectRoot, options)];
18
- if (options.mode !== 'Release') {
19
- tasks.push((0, start_impl_1.runCliStart)(context.root, projectRoot, {
20
- port: options.port,
21
- resetCache: options.resetCache,
22
- interactive: true,
23
- }));
24
- }
25
- await Promise.all(tasks);
26
- yield { success: true };
27
- }
28
- function runCliRunIOS(workspaceRoot, projectRoot, options) {
29
- return new Promise((resolve, reject) => {
30
- /**
31
- * Call the react native cli with option `--no-packager`
32
- * Not passing '--packager' due to cli will launch start command from the project root
33
- */
34
- const childProcess = (0, child_process_1.fork)(require.resolve('react-native/cli.js'), ['run-ios', ...createRunIOSOptions(options), '--no-packager'], {
35
- stdio: 'inherit',
36
- cwd: (0, path_1.resolve)(workspaceRoot, projectRoot),
37
- env: { ...process.env, RCT_METRO_PORT: options.port.toString() },
38
- });
39
- /**
40
- * Ensure the child process is killed when the parent exits
41
- */
42
- const processExitListener = (signal) => () => {
43
- childProcess.kill(signal);
44
- process.exit();
45
- };
46
- process.once('exit', (signal) => childProcess.kill(signal));
47
- process.once('SIGTERM', processExitListener);
48
- process.once('SIGINT', processExitListener);
49
- process.once('SIGQUIT', processExitListener);
50
- childProcess.on('error', (err) => {
51
- reject(err);
52
- });
53
- childProcess.on('exit', (code, signal) => {
54
- if (code === null)
55
- code = (0, internal_1.signalToCode)(signal);
56
- if (code === 0) {
57
- resolve(childProcess);
58
- }
59
- else {
60
- reject(code);
61
- }
62
- });
63
- });
64
- }
65
- const startOptions = ['port', 'resetCache'];
66
- function createRunIOSOptions(options) {
67
- return (0, get_cli_options_1.getCliOptions)(options, startOptions, [
68
- 'buildFolder',
69
- ]);
70
- }
@@ -1,7 +0,0 @@
1
- import { ReactNativeBuildIosOptions } from '../build-ios/schema';
2
- import { ReactNativeStartOptions } from '../start/schema';
3
-
4
- // part of options form https://github.com/react-native-community/cli/blob/main/packages/cli-platform-ios/src/commands/runIOS/index.ts
5
- export interface ReactNativeRunIosOptions extends ReactNativeBuildIosOptions {
6
- binaryPath?: string;
7
- }
@@ -1,98 +0,0 @@
1
- {
2
- "version": 2,
3
- "continuous": true,
4
- "outputCapture": "direct-nodejs",
5
- "cli": "nx",
6
- "$id": "NxReactNativeRunIos",
7
- "$schema": "https://json-schema.org/schema",
8
- "title": "Run iOS application",
9
- "description": "Run iOS target options.",
10
- "type": "object",
11
- "x-deprecated": "The `@nx/react-native:run-ios` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/react-native:convert-to-inferred` to migrate to the `@nx/react-native/plugin` inferred plugin. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.",
12
- "presets": [
13
- {
14
- "name": "Run iOS on a simulator",
15
- "keys": ["simulator"]
16
- },
17
- {
18
- "name": "Run iOS on a device",
19
- "keys": ["device"]
20
- },
21
- {
22
- "name": "Run iOS on a device with udid",
23
- "keys": ["udid"]
24
- }
25
- ],
26
- "properties": {
27
- "simulator": {
28
- "type": "string",
29
- "description": "Explicitly set simulator to use. Optionally include iOS version between parenthesis at the end to match an exact version: \"iPhone 6 (10.0)\"",
30
- "examples": [
31
- "iPhone 14",
32
- "iPhone 13",
33
- "iPhone 12",
34
- "iPhone 11",
35
- "iPhone X"
36
- ],
37
- "x-priority": "important"
38
- },
39
- "mode": {
40
- "type": "string",
41
- "description": "Explicitly set the scheme configuration to use",
42
- "default": "Debug",
43
- "examples": ["Debug", "Release"],
44
- "x-priority": "important"
45
- },
46
- "scheme": {
47
- "type": "string",
48
- "description": "Explicitly set Xcode scheme to use"
49
- },
50
- "device": {
51
- "type": "string",
52
- "description": "Explicitly set device to use by name. The value is not required if you have a single device connected."
53
- },
54
- "udid": {
55
- "type": "string",
56
- "description": "Explicitly set device to use by udid"
57
- },
58
- "verbose": {
59
- "type": "boolean",
60
- "description": "Do not use xcbeautify or xcpretty even if installed"
61
- },
62
- "port": {
63
- "type": "number",
64
- "description": "The port where the packager server is listening on.",
65
- "default": 8081
66
- },
67
- "xcconfig": {
68
- "type": "string",
69
- "description": "Explicitly set xcconfig to use"
70
- },
71
- "buildFolder": {
72
- "type": "string",
73
- "description": "Location for iOS build artifacts. Corresponds to Xcode's \"-derivedDataPath\". Relative to ios directory.",
74
- "buildFolder": "./build"
75
- },
76
- "interactive": {
77
- "type": "boolean",
78
- "description": "Explicitly select which scheme and configuration to use before running a build"
79
- },
80
- "extraParams": {
81
- "oneOf": [
82
- { "type": "array", "items": { "type": "string" } },
83
- { "type": "string" }
84
- ],
85
- "description": "Custom params that will be passed to xcodebuild command."
86
- },
87
- "resetCache": {
88
- "type": "boolean",
89
- "description": "Resets metro cache.",
90
- "default": false
91
- },
92
- "binaryPath": {
93
- "type": "string",
94
- "description": "Path relative to project root where pre-built .app binary lives."
95
- }
96
- },
97
- "examplesFile": "../../../docs/run-ios-examples.md"
98
- }
@@ -1 +0,0 @@
1
- export declare function isPackagerRunning(packagerPort: number): Promise<'running' | 'not_running' | 'unrecognized'>;
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isPackagerRunning = isPackagerRunning;
4
- async function isPackagerRunning(packagerPort) {
5
- try {
6
- const resp = await fetch(`http://localhost:${packagerPort}/status`);
7
- const data = await resp.text();
8
- return data === 'packager-status:running' ? 'running' : 'unrecognized';
9
- }
10
- catch {
11
- return 'not_running';
12
- }
13
- }
@@ -1,7 +0,0 @@
1
- // options from https://github.com/facebook/react-native/blob/main/packages/community-cli-plugin/src/commands/start/index.js
2
-
3
- export interface ReactNativeStartOptions {
4
- port: number;
5
- resetCache: boolean; // default is false
6
- interactive: boolean; // default is true
7
- }