@nx/react-native 24.0.0-pr.37405.acdaf31 → 24.0.0-rc.0

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 (77) hide show
  1. package/dist/plugins/metro-reporter.d.ts +1 -0
  2. package/dist/plugins/metro-reporter.js +50 -0
  3. package/dist/plugins/plugin.js +20 -5
  4. package/dist/src/generators/application/application.js +2 -3
  5. package/dist/src/generators/application/lib/add-e2e.js +0 -2
  6. package/dist/src/generators/application/lib/add-project.js +1 -83
  7. package/dist/src/generators/application/lib/normalize-options.js +0 -4
  8. package/dist/src/generators/application/schema.d.ts +0 -5
  9. package/dist/src/generators/application/schema.json +0 -6
  10. package/dist/src/generators/convert-to-inferred/lib/create-process-options.d.ts +2 -2
  11. package/dist/src/generators/convert-to-inferred/lib/create-process-options.js +2 -2
  12. package/dist/src/generators/init/init.js +44 -53
  13. package/dist/src/generators/init/schema.d.ts +0 -1
  14. package/dist/src/generators/library/lib/normalize-options.js +0 -5
  15. package/dist/src/generators/library/library.js +2 -3
  16. package/dist/src/generators/library/schema.d.ts +0 -5
  17. package/dist/src/generators/library/schema.json +0 -6
  18. package/dist/src/generators/web-configuration/files/base-vite/vite.config.mts__tmpl__ +6 -5
  19. package/dist/src/generators/web-configuration/files/base-webpack/webpack.config.js__tmpl__ +2 -51
  20. package/dist/src/generators/web-configuration/lib/webpack-targets.d.ts +1 -3
  21. package/dist/src/generators/web-configuration/lib/webpack-targets.js +0 -57
  22. package/dist/src/generators/web-configuration/web-configuration.js +9 -18
  23. package/dist/src/migrations/update-24-0-0/finish-inferred-conversion.md +12 -0
  24. package/dist/src/migrations/update-24-0-0/remove-deprecated-executors.d.ts +6 -0
  25. package/dist/src/migrations/update-24-0-0/remove-deprecated-executors.js +30 -0
  26. package/dist/src/migrations/update-24-0-0/remove-deprecated-executors.md +68 -0
  27. package/dist/src/utils/add-jest.d.ts +1 -1
  28. package/dist/src/utils/add-jest.js +1 -2
  29. package/dist/src/utils/add-linting.d.ts +0 -5
  30. package/dist/src/utils/add-linting.js +1 -2
  31. package/dist/src/utils/chmod-android-gradle-files.d.ts +0 -1
  32. package/dist/src/utils/chmod-android-gradle-files.js +0 -1
  33. package/dist/src/utils/pod-install-task.d.ts +0 -6
  34. package/dist/src/utils/pod-install-task.js +0 -1
  35. package/dist/src/utils/versions.d.ts +1 -0
  36. package/dist/src/utils/versions.js +2 -1
  37. package/executors.json +0 -40
  38. package/migrations.json +7 -0
  39. package/package.json +9 -9
  40. package/dist/src/executors/build-android/build-android.impl.d.ts +0 -6
  41. package/dist/src/executors/build-android/build-android.impl.js +0 -53
  42. package/dist/src/executors/build-android/schema.d.ts +0 -13
  43. package/dist/src/executors/build-android/schema.json +0 -82
  44. package/dist/src/executors/build-ios/build-ios.impl.d.ts +0 -6
  45. package/dist/src/executors/build-ios/build-ios.impl.js +0 -60
  46. package/dist/src/executors/build-ios/schema.d.ts +0 -17
  47. package/dist/src/executors/build-ios/schema.json +0 -92
  48. package/dist/src/executors/bundle/bundle.impl.d.ts +0 -6
  49. package/dist/src/executors/bundle/bundle.impl.js +0 -61
  50. package/dist/src/executors/bundle/schema.d.ts +0 -16
  51. package/dist/src/executors/bundle/schema.json +0 -93
  52. package/dist/src/executors/pod-install/pod-install.impl.d.ts +0 -6
  53. package/dist/src/executors/pod-install/pod-install.impl.js +0 -13
  54. package/dist/src/executors/pod-install/schema.d.ts +0 -6
  55. package/dist/src/executors/pod-install/schema.json +0 -34
  56. package/dist/src/executors/run-android/run-android.impl.d.ts +0 -6
  57. package/dist/src/executors/run-android/run-android.impl.js +0 -71
  58. package/dist/src/executors/run-android/schema.d.ts +0 -12
  59. package/dist/src/executors/run-android/schema.json +0 -102
  60. package/dist/src/executors/run-ios/run-ios.impl.d.ts +0 -6
  61. package/dist/src/executors/run-ios/run-ios.impl.js +0 -70
  62. package/dist/src/executors/run-ios/schema.d.ts +0 -7
  63. package/dist/src/executors/run-ios/schema.json +0 -98
  64. package/dist/src/executors/start/lib/is-packager-running.d.ts +0 -1
  65. package/dist/src/executors/start/lib/is-packager-running.js +0 -13
  66. package/dist/src/executors/start/schema.d.ts +0 -7
  67. package/dist/src/executors/start/schema.json +0 -30
  68. package/dist/src/executors/start/start.impl.d.ts +0 -9
  69. package/dist/src/executors/start/start.impl.js +0 -91
  70. package/dist/src/executors/upgrade/schema.d.ts +0 -1
  71. package/dist/src/executors/upgrade/schema.json +0 -12
  72. package/dist/src/executors/upgrade/upgrade.impl.d.ts +0 -12
  73. package/dist/src/executors/upgrade/upgrade.impl.js +0 -51
  74. package/dist/src/utils/deprecation.d.ts +0 -2
  75. package/dist/src/utils/deprecation.js +0 -19
  76. package/dist/src/utils/get-cli-options.d.ts +0 -8
  77. package/dist/src/utils/get-cli-options.js +0 -32
@@ -1,65 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createBuildTarget = createBuildTarget;
4
- exports.createServeTarget = createServeTarget;
5
3
  exports.createNxWebpackPluginOptions = createNxWebpackPluginOptions;
6
4
  exports.determineTsConfig = determineTsConfig;
7
5
  const devkit_1 = require("@nx/devkit");
8
- function createBuildTarget(tree, options) {
9
- return {
10
- executor: '@nx/webpack:webpack',
11
- outputs: ['{options.outputPath}'],
12
- defaultConfiguration: 'production',
13
- options: {
14
- compiler: 'babel',
15
- outputPath: (0, devkit_1.joinPathFragments)('dist', options.projectRoot != '.' ? options.projectRoot : options.project, 'web'),
16
- index: (0, devkit_1.joinPathFragments)(options.projectRoot, 'src/index.html'),
17
- baseHref: '/',
18
- main: (0, devkit_1.joinPathFragments)(options.projectRoot, `src/main-web.tsx`),
19
- tsConfig: (0, devkit_1.joinPathFragments)(options.projectRoot, determineTsConfig(tree, options)),
20
- assets: [
21
- (0, devkit_1.joinPathFragments)(options.projectRoot, 'src/favicon.ico'),
22
- (0, devkit_1.joinPathFragments)(options.projectRoot, 'src/assets'),
23
- ],
24
- webpackConfig: (0, devkit_1.joinPathFragments)(options.projectRoot, 'webpack.config.js'),
25
- },
26
- configurations: {
27
- development: {
28
- extractLicenses: false,
29
- optimization: false,
30
- sourceMap: true,
31
- vendorChunk: true,
32
- },
33
- production: {
34
- optimization: true,
35
- outputHashing: 'all',
36
- sourceMap: false,
37
- namedChunks: false,
38
- extractLicenses: true,
39
- vendorChunk: false,
40
- },
41
- },
42
- };
43
- }
44
- function createServeTarget(options) {
45
- return {
46
- executor: '@nx/webpack:dev-server',
47
- defaultConfiguration: 'development',
48
- options: {
49
- buildTarget: `${options.project}:build`,
50
- hmr: true,
51
- },
52
- configurations: {
53
- development: {
54
- buildTarget: `${options.project}:build:development`,
55
- },
56
- production: {
57
- buildTarget: `${options.project}:build:production`,
58
- hmr: false,
59
- },
60
- },
61
- };
62
- }
63
6
  function createNxWebpackPluginOptions(tree, options) {
64
7
  return {
65
8
  target: 'web',
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.webConfigurationGenerator = webConfigurationGenerator;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const internal_1 = require("@nx/react/internal");
5
+ const semver_1 = require("semver");
6
6
  const versions_1 = require("../../utils/versions");
7
7
  const normalize_schema_1 = require("./lib/normalize-schema");
8
8
  const webpack_targets_1 = require("./lib/webpack-targets");
@@ -31,15 +31,19 @@ async function webConfigurationGenerator(tree, options) {
31
31
  tasks.push(...bundlerTasks);
32
32
  // create files for webpack and vite config, index.html
33
33
  if (normalizedSchema.bundler === 'vite') {
34
- (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, './files/base-vite'), normalizedSchema.projectRoot, { ...normalizedSchema, tmpl: '' });
34
+ // resolve.tsconfigPaths is native only from Vite 8; older majors ignore it.
35
+ const installedVite = (0, semver_1.coerce)((0, devkit_1.getDependencyVersionFromPackageJson)(tree, 'vite') ?? '');
36
+ const useNativeTsconfigPaths = !installedVite || (0, semver_1.major)(installedVite) >= 8;
37
+ (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, './files/base-vite'), normalizedSchema.projectRoot, { ...normalizedSchema, useNativeTsconfigPaths, tmpl: '' });
38
+ if (!useNativeTsconfigPaths && !options.skipPackageJson) {
39
+ tasks.push((0, devkit_1.addDependenciesToPackageJson)(tree, {}, { 'vite-tsconfig-paths': versions_1.viteTsconfigPathsVersion }, undefined, true));
40
+ }
35
41
  }
36
42
  else {
37
43
  (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, './files/base-webpack'), normalizedSchema.projectRoot, {
38
44
  ...normalizedSchema,
39
45
  tmpl: '',
40
- webpackPluginOptions: (0, internal_1.hasWebpackPlugin)(tree)
41
- ? (0, webpack_targets_1.createNxWebpackPluginOptions)(tree, normalizedSchema)
42
- : null,
46
+ webpackPluginOptions: (0, webpack_targets_1.createNxWebpackPluginOptions)(tree, normalizedSchema),
43
47
  });
44
48
  }
45
49
  if (!options.skipPackageJson) {
@@ -85,19 +89,6 @@ async function addBundlerConfiguration(tree, normalizedSchema) {
85
89
  const { ensureDependencies, } = require('@nx/webpack/internal');
86
90
  tasks.push(ensureDependencies(tree, { uiFramework: 'react' }));
87
91
  }
88
- if (!(0, internal_1.hasWebpackPlugin)(tree)) {
89
- // Mirrors warnWebpackExecutorGenerating from @nx/webpack/src/utils/deprecation.
90
- // Inlined to avoid a cross-package import where react-native does not
91
- // declare a TypeScript project reference to webpack.
92
- devkit_1.logger.warn('Generating targets that use the deprecated `@nx/webpack:webpack` and `@nx/webpack:dev-server` executors. These executors will be removed in Nx v24. Run `nx g @nx/webpack:convert-to-inferred` next to migrate these targets to the `@nx/webpack/plugin` inferred plugin and prevent future generators from emitting executor targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.');
93
- const projectConfiguration = (0, devkit_1.readProjectConfiguration)(tree, normalizedSchema.project);
94
- projectConfiguration.targets = {
95
- ...projectConfiguration.targets,
96
- build: (0, webpack_targets_1.createBuildTarget)(tree, normalizedSchema),
97
- serve: (0, webpack_targets_1.createServeTarget)(normalizedSchema),
98
- };
99
- (0, devkit_1.updateProjectConfiguration)(tree, normalizedSchema.project, projectConfiguration);
100
- }
101
92
  return tasks;
102
93
  }
103
94
  }
@@ -0,0 +1,12 @@
1
+ # Replace removed @nx/react-native executors with inferred tasks
2
+
3
+ Nx 24 removed `@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`, `@nx/react-native:upgrade` (including old `@nrwl` aliases).
4
+
5
+ Before changing anything, check for leftover work: a project target, a package.json target or a `targetDefaults` entry still uses a removed executor, or the advisory context reports a conversion error. If none applies, make no changes and stop. Treat each advisory-context item as pending work.
6
+
7
+ 1. Inspect all affected projects and workspace defaults. Repair config-loading errors first. Do not restore executor registrations or install older Nx packages.
8
+ 2. Preserve platform variants, bundle output paths, Metro config and native setup. Keep storybook, sync-deps and ensure-symlink executors. Device validation may be skipped explicitly; graph creation may not.
9
+ 3. Register `@nx/react-native/plugin` with options/includes that preserve custom target names and mixed inferred/explicit projects. Replace remaining removed-executor targets, including those in package.json and filtered targetDefaults. Transfer their behavior before removing obsolete defaults. Preserve configurations, dependencies, cache inputs/outputs and environment behavior. Do not silently delete unsupported options or unrelated targets. Migrate old @nrwl aliases too.
10
+ 4. Run project graph creation with the daemon and graph cache disabled (`NX_DAEMON=false NX_CACHE_PROJECT_GRAPH=false`), using the workspace package manager. Inspect resolved project targets and verify each migrated entrypoint exists and is inferred (a thin alias to an inferred target is acceptable). Resolve graph errors before completing this migration, even if task validation was skipped. Configs must load for subsequent migrations.
11
+ 5. By default run relevant real builds/tests with task cache disabled, including alternate configurations. Honor an existing preference to skip expensive task validation; otherwise offer that option when validation is slow. Skipping expensive tasks never skips conversion or the graph check. Report each skipped task as unverified. Never weaken assertions or change application behavior to make checks pass.
12
+ 6. Report converted projects, graph validation, task results and any skipped checks. Unconverted targets or a broken graph mean the migration is incomplete. Investigate task failures and distinguish missing environment prerequisites from conversion regressions; do not claim a working workspace with unresolved regressions.
@@ -0,0 +1,6 @@
1
+ import type { Tree } from '@nx/devkit';
2
+ export default function update(tree: Tree): Promise<{
3
+ nextSteps?: string[];
4
+ agentContext?: string[];
5
+ skipAgentic?: boolean;
6
+ }>;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = update;
4
+ const internal_1 = require("@nx/devkit/internal");
5
+ function update(tree) {
6
+ return (0, internal_1.migrateRemovedExecutors)(tree, [
7
+ '@nx/react-native:build-android',
8
+ '@nx/react-native:build-ios',
9
+ '@nx/react-native:bundle',
10
+ '@nx/react-native:pod-install',
11
+ '@nx/react-native:run-android',
12
+ '@nx/react-native:run-ios',
13
+ '@nx/react-native:start',
14
+ '@nx/react-native:upgrade',
15
+ '@nrwl/react-native:build-android',
16
+ '@nrwl/react-native:build-ios',
17
+ '@nrwl/react-native:bundle',
18
+ '@nrwl/react-native:pod-install',
19
+ '@nrwl/react-native:run-android',
20
+ '@nrwl/react-native:run-ios',
21
+ '@nrwl/react-native:start',
22
+ '@nrwl/react-native:upgrade',
23
+ ], async (tree, options) => {
24
+ const { convertToInferred } = require('../../generators/convert-to-inferred/convert-to-inferred');
25
+ // The callback only prints the options the converter could not carry
26
+ // over; migrateRemovedExecutors discards it.
27
+ const flushLogs = await convertToInferred(tree, options);
28
+ flushLogs();
29
+ });
30
+ }
@@ -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
@@ -5,14 +5,9 @@ interface NormalizedSchema {
5
5
  projectName: string;
6
6
  projectRoot: string;
7
7
  enableTypedLinting?: boolean;
8
- /**
9
- * @deprecated Use `enableTypedLinting` instead. This option will be removed in Nx v24.
10
- */
11
- setParserOptionsProject?: boolean;
12
8
  tsConfigPaths: string[];
13
9
  unitTestRunner?: string;
14
10
  skipPackageJson?: boolean;
15
- addPlugin?: boolean;
16
11
  buildable?: boolean;
17
12
  isTsSolutionSetup?: boolean;
18
13
  }
@@ -14,8 +14,7 @@ async function addLinting(host, options) {
14
14
  tsConfigPaths: options.tsConfigPaths,
15
15
  unitTestRunner: options.unitTestRunner,
16
16
  skipPackageJson: options.skipPackageJson,
17
- enableTypedLinting: (0, internal_1.isTypedLintingEnabled)(options),
18
- addPlugin: options.addPlugin,
17
+ enableTypedLinting: options.enableTypedLinting,
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-pr.37405.acdaf31",
3
+ "version": "24.0.0-rc.0",
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-pr.37405.acdaf31",
58
- "@nx/js": "24.0.0-pr.37405.acdaf31",
59
- "@nx/eslint": "24.0.0-pr.37405.acdaf31",
60
- "@nx/react": "24.0.0-pr.37405.acdaf31",
57
+ "@nx/devkit": "24.0.0-rc.0",
58
+ "@nx/js": "24.0.0-rc.0",
59
+ "@nx/eslint": "24.0.0-rc.0",
60
+ "@nx/react": "24.0.0-rc.0",
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-pr.37405.acdaf31",
82
- "nx": "24.0.0-pr.37405.acdaf31"
81
+ "@nx/webpack": "24.0.0-rc.0",
82
+ "nx": "24.0.0-rc.0"
83
83
  },
84
84
  "optionalDependencies": {
85
- "@nx/detox": "24.0.0-pr.37405.acdaf31",
86
- "@nx/rollup": "24.0.0-pr.37405.acdaf31"
85
+ "@nx/detox": "24.0.0-rc.0",
86
+ "@nx/rollup": "24.0.0-rc.0"
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>;