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

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
@@ -0,0 +1,68 @@
1
+ #### Convert `@nx/react-native` targets to inferred tasks
2
+
3
+ Nx 24 removes the `@nx/react-native:build-android`, `@nx/react-native:build-ios`, `@nx/react-native:bundle`, `@nx/react-native:pod-install`, `@nx/react-native:run-android`, `@nx/react-native:run-ios`, `@nx/react-native:start` and `@nx/react-native:upgrade` executors and their `@nrwl` aliases. The migration registers `@nx/react-native/plugin` in `nx.json` and converts the targets that use those executors to inferred tasks. Executor options become command-line arguments of the inferred tasks. The converter does not handle `bundle` targets, so they are left for manual conversion. A target with nothing left to override is removed from project configuration. When several projects share the same remaining options, those options move to a `targetDefaults` entry scoped to the plugin. `targetDefaults` entries keyed by a removed executor are removed once no target uses that executor.
4
+
5
+ The migration lists the targets the converter cannot convert safely. In agentic runs, an AI prompt finishes them and validates the project graph.
6
+
7
+ The `@nx/react-native:storybook`, `@nx/react-native:sync-deps` and `@nx/react-native:ensure-symlink` executors stay.
8
+
9
+ #### Sample code changes
10
+
11
+ The `build-android` target is removed because it matches the inferred target. The `bundle-android` target keeps its executor.
12
+
13
+ ##### Before
14
+
15
+ ```json title="apps/demo/project.json"
16
+ {
17
+ "name": "demo",
18
+ "targets": {
19
+ "build-android": {
20
+ "executor": "@nx/react-native:build-android",
21
+ "options": {}
22
+ },
23
+ "bundle-android": {
24
+ "executor": "@nx/react-native:bundle",
25
+ "options": {
26
+ "platform": "android"
27
+ }
28
+ }
29
+ }
30
+ }
31
+ ```
32
+
33
+ ##### After
34
+
35
+ ```json title="apps/demo/project.json"
36
+ {
37
+ "name": "demo",
38
+ "targets": {
39
+ "bundle-android": {
40
+ "executor": "@nx/react-native:bundle",
41
+ "options": {
42
+ "platform": "android"
43
+ }
44
+ }
45
+ }
46
+ }
47
+ ```
48
+
49
+ ```json title="nx.json"
50
+ {
51
+ "plugins": [
52
+ {
53
+ "plugin": "@nx/react-native/plugin",
54
+ "options": {
55
+ "buildAndroidTargetName": "build-android",
56
+ "buildIosTargetName": "build-ios",
57
+ "bundleTargetName": "bundle",
58
+ "podInstallTargetName": "pod-install",
59
+ "runAndroidTargetName": "run-android",
60
+ "runIosTargetName": "run-ios",
61
+ "startTargetName": "start",
62
+ "syncDepsTargetName": "sync-deps",
63
+ "upgradeTargetName": "upgrade"
64
+ }
65
+ }
66
+ ]
67
+ }
68
+ ```
@@ -1,2 +1,2 @@
1
1
  import { GeneratorCallback, Tree } from '@nx/devkit';
2
- export declare function addJest(host: Tree, unitTestRunner: 'jest' | 'none', projectName: string, appProjectRoot: string, js: boolean, skipPackageJson: boolean, addPlugin: boolean, runtimeTsconfigFileName: string): Promise<GeneratorCallback>;
2
+ export declare function addJest(host: Tree, unitTestRunner: 'jest' | 'none', projectName: string, appProjectRoot: string, js: boolean, skipPackageJson: boolean, runtimeTsconfigFileName: string): Promise<GeneratorCallback>;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addJest = addJest;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const versions_1 = require("./versions");
6
- async function addJest(host, unitTestRunner, projectName, appProjectRoot, js, skipPackageJson, addPlugin, runtimeTsconfigFileName) {
6
+ async function addJest(host, unitTestRunner, projectName, appProjectRoot, js, skipPackageJson, runtimeTsconfigFileName) {
7
7
  if (unitTestRunner !== 'jest') {
8
8
  return () => { };
9
9
  }
@@ -17,7 +17,6 @@ async function addJest(host, unitTestRunner, projectName, appProjectRoot, js, sk
17
17
  compiler: 'babel',
18
18
  skipPackageJson,
19
19
  skipFormat: true,
20
- addPlugin,
21
20
  runtimeTsconfigFileName,
22
21
  });
23
22
  // overwrite the jest.config.ts file because react native needs to have special transform property
@@ -12,7 +12,6 @@ interface NormalizedSchema {
12
12
  tsConfigPaths: string[];
13
13
  unitTestRunner?: string;
14
14
  skipPackageJson?: boolean;
15
- addPlugin?: boolean;
16
15
  buildable?: boolean;
17
16
  isTsSolutionSetup?: boolean;
18
17
  }
@@ -15,7 +15,6 @@ async function addLinting(host, options) {
15
15
  unitTestRunner: options.unitTestRunner,
16
16
  skipPackageJson: options.skipPackageJson,
17
17
  enableTypedLinting: (0, internal_1.isTypedLintingEnabled)(options),
18
- addPlugin: options.addPlugin,
19
18
  addPackageJsonDependencyChecks: options.buildable,
20
19
  }));
21
20
  // Everything below configures ESLint — predefined configs, `extends`, ignore
@@ -1,3 +1,2 @@
1
1
  import { GeneratorCallback } from '@nx/devkit';
2
- export declare function chmodAndroidGradlewFiles(androidFolder: string): void;
3
2
  export declare function chmodAndroidGradlewFilesTask(androidFolder: string): GeneratorCallback;
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.chmodAndroidGradlewFiles = chmodAndroidGradlewFiles;
4
3
  exports.chmodAndroidGradlewFilesTask = chmodAndroidGradlewFilesTask;
5
4
  const devkit_1 = require("@nx/devkit");
6
5
  const fs_1 = require("fs");
@@ -10,9 +10,3 @@ export declare function runPodInstall(iosDirectory: string, install?: boolean, o
10
10
  deployment?: boolean;
11
11
  useBundler?: boolean;
12
12
  }): GeneratorCallback;
13
- export declare function podInstall(iosDirectory: string, options?: {
14
- buildFolder?: string;
15
- repoUpdate?: boolean;
16
- deployment?: boolean;
17
- useBundler?: boolean;
18
- }): void;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.runPodInstall = runPodInstall;
4
- exports.podInstall = podInstall;
5
4
  const tslib_1 = require("tslib");
6
5
  const child_process_1 = require("child_process");
7
6
  const node_fs_1 = require("node:fs");
@@ -20,6 +20,7 @@ export declare const reactTestRendererVersion = "^19.2.0";
20
20
  export declare const reactNativeSvgTransformerVersion = "~1.5.1";
21
21
  export declare const reactNativeSvgVersion = "~15.15.0";
22
22
  export declare const reactNativeSvgWebVersion = "~1.0.9";
23
+ export declare const viteTsconfigPathsVersion = "~4.3.2";
23
24
  export declare const babelRuntimeVersion = "~7.27.6";
24
25
  export type ReactNativeVersions = {
25
26
  reactNativeVersion: string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.babelRuntimeVersion = exports.reactNativeSvgWebVersion = exports.reactNativeSvgVersion = exports.reactNativeSvgTransformerVersion = exports.reactTestRendererVersion = exports.testingLibraryReactNativeVersion = exports.typesReactDomVersion = exports.typesReactVersion = exports.reactDomVersion = exports.reactVersion = exports.reactNativeWebVersion = exports.typesNodeVersion = exports.reactNativeCommunityCliPlatformIosVersion = exports.reactNativeCommunityCliPlatformAndroidVersion = exports.reactNativeCommunityCliVersion = exports.metroVersion = exports.reactNativeMetroConfigVersion = exports.reactNativeBabelPresetVersion = exports.reactNativeVersion = exports.minSupportedReactNativeVersion = exports.nxVersion = void 0;
3
+ exports.babelRuntimeVersion = exports.viteTsconfigPathsVersion = exports.reactNativeSvgWebVersion = exports.reactNativeSvgVersion = exports.reactNativeSvgTransformerVersion = exports.reactTestRendererVersion = exports.testingLibraryReactNativeVersion = exports.typesReactDomVersion = exports.typesReactVersion = exports.reactDomVersion = exports.reactVersion = exports.reactNativeWebVersion = exports.typesNodeVersion = exports.reactNativeCommunityCliPlatformIosVersion = exports.reactNativeCommunityCliPlatformAndroidVersion = exports.reactNativeCommunityCliVersion = exports.metroVersion = exports.reactNativeMetroConfigVersion = exports.reactNativeBabelPresetVersion = exports.reactNativeVersion = exports.minSupportedReactNativeVersion = exports.nxVersion = void 0;
4
4
  exports.assertSupportedReactNativeVersion = assertSupportedReactNativeVersion;
5
5
  exports.versions = versions;
6
6
  const path_1 = require("path");
@@ -36,6 +36,7 @@ exports.reactTestRendererVersion = '^19.2.0';
36
36
  exports.reactNativeSvgTransformerVersion = '~1.5.1';
37
37
  exports.reactNativeSvgVersion = '~15.15.0';
38
38
  exports.reactNativeSvgWebVersion = '~1.0.9';
39
+ exports.viteTsconfigPathsVersion = '~4.3.2';
39
40
  exports.babelRuntimeVersion = '~7.27.6';
40
41
  // latestVersions reuses the top-level exports so `import { reactNativeVersion }`
41
42
  // stays valid for the fresh-install path while versions(tree).reactNativeVersion
package/executors.json CHANGED
@@ -1,35 +1,5 @@
1
1
  {
2
2
  "executors": {
3
- "run-android": {
4
- "implementation": "./dist/src/executors/run-android/run-android.impl",
5
- "schema": "./dist/src/executors/run-android/schema.json",
6
- "description": "Runs Android application."
7
- },
8
- "run-ios": {
9
- "implementation": "./dist/src/executors/run-ios/run-ios.impl",
10
- "schema": "./dist/src/executors/run-ios/schema.json",
11
- "description": "Runs iOS application."
12
- },
13
- "bundle": {
14
- "implementation": "./dist/src/executors/bundle/bundle.impl",
15
- "schema": "./dist/src/executors/bundle/schema.json",
16
- "description": "Builds the JavaScript bundle for offline use."
17
- },
18
- "build-android": {
19
- "implementation": "./dist/src/executors/build-android/build-android.impl",
20
- "schema": "./dist/src/executors/build-android/schema.json",
21
- "description": "Release Build for Android."
22
- },
23
- "build-ios": {
24
- "implementation": "./dist/src/executors/build-ios/build-ios.impl",
25
- "schema": "./dist/src/executors/build-ios/schema.json",
26
- "description": "Build iOS app"
27
- },
28
- "start": {
29
- "implementation": "./dist/src/executors/start/start.impl",
30
- "schema": "./dist/src/executors/start/schema.json",
31
- "description": "Starts the Javascript server that communicates with connected devices."
32
- },
33
3
  "sync-deps": {
34
4
  "implementation": "./dist/src/executors/sync-deps/sync-deps.impl",
35
5
  "schema": "./dist/src/executors/sync-deps/schema.json",
@@ -44,16 +14,6 @@
44
14
  "implementation": "./dist/src/executors/storybook/storybook.impl",
45
15
  "schema": "./dist/src/executors/storybook/schema.json",
46
16
  "description": "Serve React Native Storybook."
47
- },
48
- "pod-install": {
49
- "implementation": "./dist/src/executors/pod-install/pod-install.impl",
50
- "schema": "./dist/src/executors/pod-install/schema.json",
51
- "description": "Run `pod install` in the `ios` directory."
52
- },
53
- "upgrade": {
54
- "implementation": "./dist/src/executors/upgrade/upgrade.impl",
55
- "schema": "./dist/src/executors/upgrade/schema.json",
56
- "description": "upgrade executor"
57
17
  }
58
18
  }
59
19
  }
package/migrations.json CHANGED
@@ -20,6 +20,13 @@
20
20
  "description": "Rename imports of `createNodesV2` from `@nx/react-native/plugin` to the canonical `createNodes` export.",
21
21
  "implementation": "./dist/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes",
22
22
  "documentation": "./dist/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.md"
23
+ },
24
+ "remove-deprecated-executors": {
25
+ "version": "24.0.0-beta.3",
26
+ "description": "Converts targets using the removed `@nx/react-native` executors to inferred tasks; an AI prompt finishes the targets the converter cannot convert safely and validates the project graph.",
27
+ "implementation": "./dist/src/migrations/update-24-0-0/remove-deprecated-executors",
28
+ "prompt": "./dist/src/migrations/update-24-0-0/finish-inferred-conversion.md",
29
+ "documentation": "./dist/src/migrations/update-24-0-0/remove-deprecated-executors.md"
23
30
  }
24
31
  },
25
32
  "packageJsonUpdates": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/react-native",
3
- "version": "24.0.0-beta.2",
3
+ "version": "24.0.0-beta.3",
4
4
  "private": false,
5
5
  "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.",
6
6
  "keywords": [
@@ -54,10 +54,10 @@
54
54
  }
55
55
  },
56
56
  "dependencies": {
57
- "@nx/devkit": "24.0.0-beta.2",
58
- "@nx/js": "24.0.0-beta.2",
59
- "@nx/eslint": "24.0.0-beta.2",
60
- "@nx/react": "24.0.0-beta.2",
57
+ "@nx/devkit": "24.0.0-beta.3",
58
+ "@nx/js": "24.0.0-beta.3",
59
+ "@nx/eslint": "24.0.0-beta.3",
60
+ "@nx/react": "24.0.0-beta.3",
61
61
  "ajv": "^8.0.0",
62
62
  "enhanced-resolve": "^5.8.3",
63
63
  "ignore": "^7.0.5",
@@ -78,12 +78,12 @@
78
78
  }
79
79
  },
80
80
  "devDependencies": {
81
- "@nx/webpack": "24.0.0-beta.2",
82
- "nx": "24.0.0-beta.2"
81
+ "@nx/webpack": "24.0.0-beta.3",
82
+ "nx": "24.0.0-beta.3"
83
83
  },
84
84
  "optionalDependencies": {
85
- "@nx/detox": "24.0.0-beta.2",
86
- "@nx/rollup": "24.0.0-beta.2"
85
+ "@nx/detox": "24.0.0-beta.3",
86
+ "@nx/rollup": "24.0.0-beta.3"
87
87
  },
88
88
  "executors": "./executors.json",
89
89
  "ng-update": {
@@ -1,6 +0,0 @@
1
- import { ExecutorContext } from '@nx/devkit';
2
- import { ReactNativeBuildAndroidOptions } from './schema';
3
- export interface ReactNativeBuildOutput {
4
- success: boolean;
5
- }
6
- export default function buildAndroidExecutor(options: ReactNativeBuildAndroidOptions, context: ExecutorContext): AsyncGenerator<ReactNativeBuildOutput>;
@@ -1,53 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = buildAndroidExecutor;
4
- const internal_1 = require("@nx/devkit/internal");
5
- const path_1 = require("path");
6
- const child_process_1 = require("child_process");
7
- const chmod_android_gradle_files_1 = require("../../utils/chmod-android-gradle-files");
8
- const get_cli_options_1 = require("../../utils/get-cli-options");
9
- const deprecation_1 = require("../../utils/deprecation");
10
- async function* buildAndroidExecutor(options, context) {
11
- (0, deprecation_1.warnReactNativeExecutorDeprecation)('build-android');
12
- const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
13
- (0, chmod_android_gradle_files_1.chmodAndroidGradlewFiles)((0, path_1.join)(context.root, projectRoot, 'android'));
14
- await runCliBuild(context.root, projectRoot, options);
15
- yield { success: true };
16
- }
17
- function runCliBuild(workspaceRoot, projectRoot, options) {
18
- return new Promise((res, reject) => {
19
- const childProcess = (0, child_process_1.fork)(require.resolve('react-native/cli.js'), ['build-android', ...createBuildAndroidOptions(options)], {
20
- stdio: 'inherit',
21
- cwd: (0, path_1.resolve)(workspaceRoot, projectRoot),
22
- env: { ...process.env, RCT_METRO_PORT: options.port.toString() },
23
- });
24
- /**
25
- * Ensure the child process is killed when the parent exits
26
- */
27
- const processExitListener = (signal) => () => {
28
- childProcess.kill(signal);
29
- process.exit();
30
- };
31
- process.once('exit', (signal) => childProcess.kill(signal));
32
- process.once('SIGTERM', processExitListener);
33
- process.once('SIGINT', processExitListener);
34
- process.once('SIGQUIT', processExitListener);
35
- childProcess.on('error', (err) => {
36
- reject(err);
37
- });
38
- childProcess.on('exit', (code, signal) => {
39
- if (code === null)
40
- code = (0, internal_1.signalToCode)(signal);
41
- if (code === 0) {
42
- res(childProcess);
43
- }
44
- else {
45
- reject(code);
46
- }
47
- });
48
- });
49
- }
50
- const startOptions = ['port', 'resetCache'];
51
- function createBuildAndroidOptions(options) {
52
- return (0, get_cli_options_1.getCliOptions)(options, startOptions);
53
- }
@@ -1,13 +0,0 @@
1
- // options taken from https://github.com/react-native-community/cli/blob/main/packages/cli-platform-android/src/commands/buildAndroid/index.ts
2
- // https://github.com/react-native-community/cli/blob/main/packages/cli-platform-android/README.md#build-android
3
-
4
- import { ReactNativeStartOptions } from '../start/schema';
5
-
6
- export interface ReactNativeBuildAndroidOptions extends ReactNativeStartOptions {
7
- // react native options
8
- mode: string; // default is debug
9
- activeArchOnly: boolean; // default is false
10
- tasks?: string | Array<string>;
11
- extraParams?: Array<string>;
12
- interactive: boolean;
13
- }
@@ -1,82 +0,0 @@
1
- {
2
- "version": 2,
3
- "outputCapture": "direct-nodejs",
4
- "cli": "nx",
5
- "$id": "NxReactNativeBuildAndroid",
6
- "$schema": "https://json-schema.org/schema",
7
- "title": "Release Build for Android",
8
- "description": "Build target options for Android.",
9
- "type": "object",
10
- "x-deprecated": "The `@nx/react-native:build-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.",
11
- "presets": [
12
- {
13
- "name": "Build Android for current device architecture",
14
- "keys": ["activeArchOnly"]
15
- },
16
- {
17
- "name": "Build Android without metro cache",
18
- "keys": ["resetCache"]
19
- },
20
- {
21
- "name": "Build Android with specific tasks",
22
- "keys": ["tasks"]
23
- },
24
- {
25
- "name": "Build Android with a specific mode",
26
- "keys": ["mode"]
27
- }
28
- ],
29
- "properties": {
30
- "mode": {
31
- "type": "string",
32
- "description": "Specify your app's build variant",
33
- "default": "debug",
34
- "examples": ["debug", "release"],
35
- "x-priority": "important"
36
- },
37
- "port": {
38
- "type": "number",
39
- "description": "The port where the packager server is listening on.",
40
- "default": 8081
41
- },
42
- "tasks": {
43
- "oneOf": [
44
- { "type": "array", "items": { "type": "string" } },
45
- { "type": "string" }
46
- ],
47
- "description": "Run custom Gradle tasks. By default it's \"assembleDebug\". Will override passed mode and variant arguments.",
48
- "examples": [
49
- "assembleDebug",
50
- "assembleRelease",
51
- "bundleDebug",
52
- "bundleRelease",
53
- "installDebug",
54
- "installRelease"
55
- ]
56
- },
57
- "activeArchOnly": {
58
- "type": "boolean",
59
- "description": "Build native libraries only for the current device architecture for debug builds.",
60
- "default": false
61
- },
62
- "extraParams": {
63
- "oneOf": [
64
- { "type": "array", "items": { "type": "string" } },
65
- { "type": "string" }
66
- ],
67
- "description": "Custom params passed to gradle build command",
68
- "examples": ["-x lint -x test"]
69
- },
70
- "interactive": {
71
- "type": "boolean",
72
- "description": "Explicitly select build type and flavour to use before running a build"
73
- },
74
- "resetCache": {
75
- "type": "boolean",
76
- "description": "Resets metro cache.",
77
- "default": false
78
- }
79
- },
80
- "required": [],
81
- "examplesFile": "../../../docs/build-android-examples.md"
82
- }
@@ -1,6 +0,0 @@
1
- import { ExecutorContext } from '@nx/devkit';
2
- import { ReactNativeBuildIosOptions } from './schema';
3
- export interface ReactNativeBuildIosOutput {
4
- success: boolean;
5
- }
6
- export default function buildIosExecutor(options: ReactNativeBuildIosOptions, context: ExecutorContext): AsyncGenerator<ReactNativeBuildIosOutput>;
@@ -1,60 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = buildIosExecutor;
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 get_cli_options_1 = require("../../utils/get-cli-options");
9
- const deprecation_1 = require("../../utils/deprecation");
10
- async function* buildIosExecutor(options, context) {
11
- (0, deprecation_1.warnReactNativeExecutorDeprecation)('build-ios');
12
- if ((0, os_1.platform)() !== 'darwin') {
13
- throw new Error(`The run-ios build requires Mac to run`);
14
- }
15
- const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
16
- await runCliBuildIOS(context.root, projectRoot, options);
17
- return { success: true };
18
- }
19
- function runCliBuildIOS(workspaceRoot, projectRoot, options) {
20
- return new Promise((resolve, reject) => {
21
- const childProcess = (0, child_process_1.fork)(require.resolve('react-native/cli.js'), [
22
- 'build-ios',
23
- ...createBuildIOSOptions(options),
24
- ...(process.env.NX_VERBOSE_LOGGING === 'true' ? ['--verbose'] : []),
25
- ], {
26
- cwd: (0, path_1.resolve)(workspaceRoot, projectRoot),
27
- env: { ...process.env, RCT_METRO_PORT: options.port.toString() },
28
- });
29
- /**
30
- * Ensure the child process is killed when the parent exits
31
- */
32
- const processExitListener = (signal) => () => {
33
- childProcess.kill(signal);
34
- process.exit();
35
- };
36
- process.once('exit', (signal) => childProcess.kill(signal));
37
- process.once('SIGTERM', processExitListener);
38
- process.once('SIGINT', processExitListener);
39
- process.once('SIGQUIT', processExitListener);
40
- childProcess.on('error', (err) => {
41
- reject(err);
42
- });
43
- childProcess.on('exit', (code, signal) => {
44
- if (code === null)
45
- code = (0, internal_1.signalToCode)(signal);
46
- if (code === 0) {
47
- resolve(childProcess);
48
- }
49
- else {
50
- reject(code);
51
- }
52
- });
53
- });
54
- }
55
- const startOptions = ['port', 'resetCache'];
56
- function createBuildIOSOptions(options) {
57
- return (0, get_cli_options_1.getCliOptions)(options, startOptions, [
58
- 'buildFolder',
59
- ]);
60
- }
@@ -1,17 +0,0 @@
1
- // options from https://github.com/react-native-community/cli/blob/main/packages/cli-platform-ios/src/commands/buildIOS/index.ts
2
-
3
- import { ReactNativeStartOptions } from '../start/schema';
4
-
5
- export interface ReactNativeBuildIosOptions extends ReactNativeStartOptions {
6
- // react native options
7
- simulator?: string;
8
- mode: string; // default if 'Debug'
9
- scheme?: string;
10
- device?: string;
11
- udid?: string;
12
- verbose?: boolean;
13
- port: number; // default is 8081
14
- xcconfig?: string;
15
- buildFolder?: string;
16
- extraParams?: string;
17
- }
@@ -1,92 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/schema",
3
- "version": 2,
4
- "cli": "nx",
5
- "title": "React Native Build iOS executor",
6
- "description": "Build iOS app.",
7
- "type": "object",
8
- "x-deprecated": "The `@nx/react-native:build-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.",
9
- "presets": [
10
- {
11
- "name": "Build iOS for a simulator",
12
- "keys": ["simulator"]
13
- },
14
- {
15
- "name": "Build iOS for a device",
16
- "keys": ["device"]
17
- },
18
- {
19
- "name": "Build iOS for a device with udid",
20
- "keys": ["udid"]
21
- }
22
- ],
23
- "properties": {
24
- "simulator": {
25
- "type": "string",
26
- "description": "Explicitly set simulator to use. Optionally include iOS version between parenthesis at the end to match an exact version: \"iPhone 6 (10.0)\"",
27
- "examples": [
28
- "iPhone 14",
29
- "iPhone 13",
30
- "iPhone 12",
31
- "iPhone 11",
32
- "iPhone X"
33
- ],
34
- "x-priority": "important"
35
- },
36
- "mode": {
37
- "type": "string",
38
- "description": "Explicitly set the scheme configuration to use",
39
- "default": "Debug",
40
- "examples": ["Debug", "Release"],
41
- "x-priority": "important"
42
- },
43
- "scheme": {
44
- "type": "string",
45
- "description": "Explicitly set Xcode scheme to use"
46
- },
47
- "device": {
48
- "type": "string",
49
- "description": "Explicitly set device to use by name. The value is not required if you have a single device connected."
50
- },
51
- "udid": {
52
- "type": "string",
53
- "description": "Explicitly set device to use by udid"
54
- },
55
- "verbose": {
56
- "type": "boolean",
57
- "description": "Do not use xcbeautify or xcpretty even if installed"
58
- },
59
- "port": {
60
- "type": "number",
61
- "description": "The port where the packager server is listening on.",
62
- "default": 8081
63
- },
64
- "xcconfig": {
65
- "type": "string",
66
- "description": "Explicitly set xcconfig to use"
67
- },
68
- "buildFolder": {
69
- "type": "string",
70
- "description": "Location for iOS build artifacts. Corresponds to Xcode's \"-derivedDataPath\". Relative to ios directory",
71
- "default": "./build"
72
- },
73
- "interactive": {
74
- "type": "boolean",
75
- "description": "Explicitly select which scheme and configuration to use before running a build"
76
- },
77
- "extraParams": {
78
- "oneOf": [
79
- { "type": "array", "items": { "type": "string" } },
80
- { "type": "string" }
81
- ],
82
- "description": "Custom params that will be passed to xcodebuild command."
83
- },
84
- "resetCache": {
85
- "type": "boolean",
86
- "description": "Resets metro cache.",
87
- "default": false
88
- }
89
- },
90
- "required": [],
91
- "examplesFile": "../../../docs/build-ios-examples.md"
92
- }
@@ -1,6 +0,0 @@
1
- import { ExecutorContext } from '@nx/devkit';
2
- import { ReactNativeBundleOptions } from './schema';
3
- export interface ReactNativeBundleOutput {
4
- success: boolean;
5
- }
6
- export default function bundleExecutor(options: ReactNativeBundleOptions, context: ExecutorContext): AsyncGenerator<ReactNativeBundleOutput>;