@nx/react-native 21.4.0-beta.10 → 21.4.0-beta.12

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 (73) hide show
  1. package/.eslintrc.json +2 -1
  2. package/generators.json +0 -5
  3. package/migrations.json +85 -0
  4. package/package.json +13 -14
  5. package/plugins/metro-resolver.d.ts.map +1 -1
  6. package/plugins/metro-resolver.js +26 -8
  7. package/plugins/with-nx-metro.d.ts +2 -2
  8. package/plugins/with-nx-metro.d.ts.map +1 -1
  9. package/plugins/with-nx-metro.js +18 -2
  10. package/src/executors/bundle/bundle.impl.d.ts.map +1 -1
  11. package/src/executors/bundle/bundle.impl.js +2 -2
  12. package/src/executors/storybook/storybook.impl.d.ts.map +1 -1
  13. package/src/executors/storybook/storybook.impl.js +3 -4
  14. package/src/generators/application/application.js +1 -1
  15. package/src/generators/application/files/app/android/app/build.gradle.template +2 -2
  16. package/src/generators/application/files/app/android/app/src/debug/AndroidManifest.xml.template +0 -1
  17. package/src/generators/application/files/app/android/app/src/main/AndroidManifest.xml.template +1 -2
  18. package/src/generators/application/files/app/android/build.gradle.template +3 -3
  19. package/src/generators/application/files/app/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  20. package/src/generators/application/files/app/android/gradle/wrapper/gradle-wrapper.properties +1 -1
  21. package/src/generators/application/files/app/android/gradlew.template +2 -3
  22. package/src/generators/application/files/app/ios/.xcode.env.template +0 -1
  23. package/src/generators/application/files/app/ios/Podfile.template +0 -5
  24. package/src/generators/application/files/app/ios/__className__/AppDelegate.swift.template +48 -0
  25. package/src/generators/application/files/app/ios/__className__/PrivacyInfo.xcprivacy +31 -32
  26. package/src/generators/application/files/app/ios/__className__.xcodeproj/project.pbxproj.template +9 -192
  27. package/src/generators/application/files/app/package.json.template +3 -3
  28. package/src/generators/application/lib/add-project.d.ts.map +1 -1
  29. package/src/generators/application/lib/add-project.js +2 -0
  30. package/src/generators/init/init.d.ts.map +1 -1
  31. package/src/generators/init/init.js +2 -0
  32. package/src/generators/library/library.js +1 -1
  33. package/src/generators/library/schema.json +1 -0
  34. package/src/generators/web-configuration/web-configuration.js +1 -1
  35. package/src/migrations/update-21-4-0/remove-deprecated-deps.d.ts +6 -0
  36. package/src/migrations/update-21-4-0/remove-deprecated-deps.d.ts.map +1 -0
  37. package/src/migrations/update-21-4-0/remove-deprecated-deps.js +27 -0
  38. package/src/migrations/update-21-4-0/upgrade-react-native-projects.d.ts +3 -0
  39. package/src/migrations/update-21-4-0/upgrade-react-native-projects.d.ts.map +1 -0
  40. package/src/migrations/update-21-4-0/upgrade-react-native-projects.js +30 -0
  41. package/src/utils/add-jest.d.ts +1 -1
  42. package/src/utils/add-jest.d.ts.map +1 -1
  43. package/src/utils/add-jest.js +3 -2
  44. package/src/utils/add-linting.d.ts +1 -0
  45. package/src/utils/add-linting.d.ts.map +1 -1
  46. package/src/utils/add-linting.js +26 -0
  47. package/src/utils/ensure-dependencies.d.ts +1 -1
  48. package/src/utils/ensure-dependencies.d.ts.map +1 -1
  49. package/src/utils/ensure-dependencies.js +7 -5
  50. package/src/utils/react-native-project-detection.d.ts +15 -0
  51. package/src/utils/react-native-project-detection.d.ts.map +1 -0
  52. package/src/utils/react-native-project-detection.js +111 -0
  53. package/src/utils/versions.d.ts +18 -19
  54. package/src/utils/versions.d.ts.map +1 -1
  55. package/src/utils/versions.js +19 -20
  56. package/src/generators/application/files/app/android/app/src/androidTest/java/com/__lowerCaseName__/DetoxTest.java.template +0 -30
  57. package/src/generators/application/files/app/android/app/src/main/res/xml/network_security_config.xml +0 -7
  58. package/src/generators/application/files/app/ios/__className__/AppDelegate.h +0 -6
  59. package/src/generators/application/files/app/ios/__className__/AppDelegate.mm.template +0 -31
  60. package/src/generators/application/files/app/ios/__className__/main.m +0 -10
  61. package/src/generators/application/files/app/ios/__className__Tests/Info.plist +0 -24
  62. package/src/generators/application/files/app/ios/__className__Tests/__className__Tests.m +0 -66
  63. package/src/generators/upgrade-native/lib/create-native-files.d.ts +0 -4
  64. package/src/generators/upgrade-native/lib/create-native-files.d.ts.map +0 -1
  65. package/src/generators/upgrade-native/lib/create-native-files.js +0 -13
  66. package/src/generators/upgrade-native/lib/normalize-options.d.ts +0 -13
  67. package/src/generators/upgrade-native/lib/normalize-options.d.ts.map +0 -1
  68. package/src/generators/upgrade-native/lib/normalize-options.js +0 -26
  69. package/src/generators/upgrade-native/schema.d.ts +0 -9
  70. package/src/generators/upgrade-native/schema.json +0 -41
  71. package/src/generators/upgrade-native/upgrade-native.d.ts +0 -11
  72. package/src/generators/upgrade-native/upgrade-native.d.ts.map +0 -1
  73. package/src/generators/upgrade-native/upgrade-native.js +0 -30
package/.eslintrc.json CHANGED
@@ -24,7 +24,6 @@
24
24
  {
25
25
  "buildTargets": ["build-base"],
26
26
  "ignoredDependencies": [
27
- "tslib",
28
27
  "nx",
29
28
  "eslint",
30
29
  "prettier",
@@ -33,6 +32,7 @@
33
32
  "react-native",
34
33
 
35
34
  // These are in ensurePackage
35
+ "@nx/jest",
36
36
  "@nx/rollup",
37
37
  "@nx/storybook",
38
38
  "@nx/vite",
@@ -51,6 +51,7 @@
51
51
  "rules": {
52
52
  "no-restricted-imports": [
53
53
  "error",
54
+ "@nx/workspace",
54
55
  {
55
56
  "name": "fs-extra",
56
57
  "message": "Please use equivalent utilities from `node:fs` instead."
package/generators.json CHANGED
@@ -29,11 +29,6 @@
29
29
  "description": "Create a React Native component.",
30
30
  "aliases": ["c"]
31
31
  },
32
- "upgrade-native": {
33
- "factory": "./src/generators/upgrade-native/upgrade-native#reactNativeUpgradeNativeGenerator",
34
- "schema": "./src/generators/upgrade-native/schema.json",
35
- "description": "Destructive command to upgrade native iOS and Android code to latest."
36
- },
37
32
  "web-configuration": {
38
33
  "factory": "./src/generators/web-configuration/web-configuration#webConfigurationGenerator",
39
34
  "schema": "./src/generators/web-configuration/schema.json",
package/migrations.json CHANGED
@@ -5,6 +5,18 @@
5
5
  "version": "19.6.0-beta.1",
6
6
  "description": "Rename upgrade target name to fix casing.",
7
7
  "implementation": "./src/migrations/update-19-6-0/rename-upgrade-target-name"
8
+ },
9
+ "update-21-4-0-remove-deprecated-deps": {
10
+ "version": "21.4.0-beta.0",
11
+ "cli": "nx",
12
+ "description": "Remove deprecated dependencies from package.json",
13
+ "factory": "./src/migrations/update-21-4-0/remove-deprecated-deps"
14
+ },
15
+ "update-21-4-0-upgrade-react-native-projects": {
16
+ "version": "21.4.0-beta.0",
17
+ "cli": "nx",
18
+ "description": "Run nx upgrade for each React Native project",
19
+ "factory": "./src/migrations/update-21-4-0/upgrade-react-native-projects"
8
20
  }
9
21
  },
10
22
  "packageJsonUpdates": {
@@ -167,6 +179,79 @@
167
179
  "alwaysAddToPackageJson": false
168
180
  }
169
181
  }
182
+ },
183
+ "21.4.0": {
184
+ "version": "21.4.0-beta.0",
185
+ "packages": {
186
+ "react-native": {
187
+ "version": "~0.79.3",
188
+ "alwaysAddToPackageJson": false
189
+ },
190
+ "@react-native-community/cli": {
191
+ "version": "~18.0.0",
192
+ "alwaysAddToPackageJson": true
193
+ },
194
+ "@react-native-community/cli-platform-android": {
195
+ "version": "~18.0.0",
196
+ "alwaysAddToPackageJson": true
197
+ },
198
+ "@react-native-community/cli-platform-ios": {
199
+ "version": "~18.0.0",
200
+ "alwaysAddToPackageJson": true
201
+ },
202
+ "@react-native/babel-preset": {
203
+ "version": "~0.79.3",
204
+ "alwaysAddToPackageJson": false
205
+ },
206
+ "@react-native/metro-config": {
207
+ "version": "~0.79.3",
208
+ "alwaysAddToPackageJson": false
209
+ },
210
+ "react-native-web": {
211
+ "version": "~0.20.0",
212
+ "alwaysAddToPackageJson": false
213
+ },
214
+ "react": {
215
+ "version": "19.0.0",
216
+ "alwaysAddToPackageJson": false
217
+ },
218
+ "react-dom": {
219
+ "version": "19.0.0",
220
+ "alwaysAddToPackageJson": false
221
+ },
222
+ "react-test-renderer": {
223
+ "version": "~19.0.0",
224
+ "alwaysAddToPackageJson": false
225
+ },
226
+ "@types/react": {
227
+ "version": "~19.0.10",
228
+ "alwaysAddToPackageJson": false
229
+ },
230
+ "@types/react-dom": {
231
+ "version": "~19.0.6",
232
+ "alwaysAddToPackageJson": false
233
+ },
234
+ "@testing-library/react-native": {
235
+ "version": "~13.2.0",
236
+ "alwaysAddToPackageJson": false
237
+ },
238
+ "react-native-svg-transformer": {
239
+ "version": "~1.5.1",
240
+ "alwaysAddToPackageJson": false
241
+ },
242
+ "react-native-svg": {
243
+ "version": "~15.11.2",
244
+ "alwaysAddToPackageJson": false
245
+ },
246
+ "react-native-svg-web": {
247
+ "version": "~1.0.9",
248
+ "alwaysAddToPackageJson": false
249
+ },
250
+ "@babel/runtime": {
251
+ "version": "~7.27.6",
252
+ "alwaysAddToPackageJson": false
253
+ }
254
+ }
170
255
  }
171
256
  }
172
257
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/react-native",
3
- "version": "21.4.0-beta.10",
3
+ "version": "21.4.0-beta.12",
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": [
@@ -26,26 +26,25 @@
26
26
  "main": "./index.js",
27
27
  "types": "index.d.ts",
28
28
  "dependencies": {
29
- "@nx/detox": "21.4.0-beta.10",
30
- "@nx/devkit": "21.4.0-beta.10",
31
- "@nx/eslint": "21.4.0-beta.10",
32
- "@nx/jest": "21.4.0-beta.10",
33
- "@nx/js": "21.4.0-beta.10",
34
- "@nx/react": "21.4.0-beta.10",
35
- "@nx/rollup": "21.4.0-beta.10",
36
- "@nx/workspace": "21.4.0-beta.10",
29
+ "@nx/devkit": "21.4.0-beta.12",
30
+ "@nx/js": "21.4.0-beta.12",
31
+ "@nx/eslint": "21.4.0-beta.12",
32
+ "@nx/react": "21.4.0-beta.12",
37
33
  "ajv": "^8.12.0",
38
34
  "enhanced-resolve": "^5.8.3",
39
- "glob": "7.1.4",
40
35
  "ignore": "^5.0.4",
41
- "metro-config": "~0.80.4",
42
- "metro-resolver": "~0.80.4",
43
36
  "picocolors": "^1.1.0",
37
+ "tinyglobby": "^0.2.12",
44
38
  "tsconfig-paths": "^4.1.2",
45
39
  "tslib": "^2.3.0"
46
40
  },
47
- "devDependencies": {
48
- "nx": "21.4.0-beta.10"
41
+ "peerDependencies": {
42
+ "metro-config": ">= 0.82.0",
43
+ "metro-resolver": ">= 0.82.0"
44
+ },
45
+ "optionalDependencies": {
46
+ "@nx/detox": "21.4.0-beta.12",
47
+ "@nx/rollup": "21.4.0-beta.12"
49
48
  },
50
49
  "executors": "./executors.json",
51
50
  "ng-update": {
@@ -1 +1 @@
1
- {"version":3,"file":"metro-resolver.d.ts","sourceRoot":"","sources":["../../../../packages/react-native/plugins/metro-resolver.ts"],"names":[],"mappings":"AAeA,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,MAAM,EAAE,EACpB,qBAAqB,GAAE,MAAM,EAAO,EACpC,UAAU,GAAE,MAAM,EAAO,IAGvB,UAAU,GAAG,EACb,gBAAgB,MAAM,EACtB,UAAU,MAAM,GAAG,IAAI,SAwC1B"}
1
+ {"version":3,"file":"metro-resolver.d.ts","sourceRoot":"","sources":["../../../../packages/react-native/plugins/metro-resolver.ts"],"names":[],"mappings":"AAiCA,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,MAAM,EAAE,EACpB,qBAAqB,GAAE,MAAM,EAAO,EACpC,UAAU,GAAE,MAAM,EAAO,IAGvB,UAAU,GAAG,EACb,gBAAgB,MAAM,EACtB,UAAU,MAAM,GAAG,IAAI,SAwC1B"}
@@ -1,13 +1,28 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getResolveRequest = getResolveRequest;
4
- const metroResolver = require("metro-resolver");
5
4
  const tsconfig_paths_1 = require("tsconfig-paths");
6
5
  const pc = require("picocolors");
7
6
  const enhanced_resolve_1 = require("enhanced-resolve");
8
7
  const path_1 = require("path");
9
8
  const fs = require("fs");
10
9
  const devkit_1 = require("@nx/devkit");
10
+ // Cache for metro-resolver module
11
+ let metroResolver = null;
12
+ /**
13
+ * Lazily require metro-resolver to handle cases where it might not be installed
14
+ */
15
+ function getMetroResolver() {
16
+ if (!metroResolver) {
17
+ try {
18
+ metroResolver = require('metro-resolver');
19
+ }
20
+ catch (error) {
21
+ throw new Error('metro-resolver is required but not installed. Please install metro-resolver >= 0.82.0');
22
+ }
23
+ }
24
+ return metroResolver;
25
+ }
11
26
  /*
12
27
  * Use tsconfig to resolve additional workspace libs.
13
28
  *
@@ -46,7 +61,8 @@ function resolveRequestFromContext(resolveRequest, context, realModuleName, plat
46
61
  */
47
62
  function defaultMetroResolver(context, realModuleName, platform, debug) {
48
63
  try {
49
- return metroResolver.resolve(context, realModuleName, platform);
64
+ const resolver = getMetroResolver();
65
+ return resolver.resolve(context, realModuleName, platform);
50
66
  }
51
67
  catch {
52
68
  if (debug)
@@ -60,7 +76,7 @@ function defaultMetroResolver(context, realModuleName, platform, debug) {
60
76
  */
61
77
  function pnpmResolver(extensions, context, realModuleName, debug, exportsConditionNames = [], mainFields = []) {
62
78
  try {
63
- const pnpmResolve = getPnpmResolver(extensions);
79
+ const pnpmResolve = getPnpmResolver(extensions, exportsConditionNames, mainFields);
64
80
  const lookupStartPath = (0, path_1.dirname)(context.originModulePath);
65
81
  const filePath = pnpmResolve.resolveSync({}, lookupStartPath, realModuleName);
66
82
  if (filePath) {
@@ -80,7 +96,8 @@ function tsconfigPathsResolver(context, extensions, realModuleName, platform, de
80
96
  try {
81
97
  const tsConfigPathMatcher = getMatcher(debug);
82
98
  const match = tsConfigPathMatcher(realModuleName, undefined, undefined, extensions.map((ext) => `.${ext}`));
83
- return metroResolver.resolve(context, match, platform);
99
+ const resolver = getMetroResolver();
100
+ return resolver.resolve(context, match, platform);
84
101
  }
85
102
  catch {
86
103
  if (debug) {
@@ -115,14 +132,15 @@ function getMatcher(debug) {
115
132
  * This function returns resolver for pnpm.
116
133
  * It is inspired form https://github.com/vjpr/pnpm-expo-example/blob/main/packages/pnpm-expo-helper/util/make-resolver.js.
117
134
  */
118
- let resolver;
135
+ let pnpmpResolver;
119
136
  function getPnpmResolver(extensions, exportsConditionNames = [], mainFields = []) {
120
- if (!resolver) {
137
+ if (!pnpmpResolver) {
121
138
  // Create a filesystem adapter that matches enhanced-resolve's expected interface
139
+ // The issue is that Node.js fs types allow withFileTypes: true, but enhanced-resolve expects withFileTypes?: false
122
140
  // This is compatible with the latest version of enhanced-resolve and is the intended way to use it.
123
141
  // See https://github.com/webpack/enhanced-resolve/commit/d55471f20c17bce4def0b53cfe0b7027e7b48d82
124
142
  const fileSystem = new enhanced_resolve_1.CachedInputFileSystem(fs, 4000);
125
- resolver = enhanced_resolve_1.ResolverFactory.createResolver({
143
+ pnpmpResolver = enhanced_resolve_1.ResolverFactory.createResolver({
126
144
  fileSystem,
127
145
  extensions: extensions.map((extension) => '.' + extension),
128
146
  useSyncFileSystemCalls: true,
@@ -140,5 +158,5 @@ function getPnpmResolver(extensions, exportsConditionNames = [], mainFields = []
140
158
  aliasFields: ['browser'],
141
159
  });
142
160
  }
143
- return resolver;
161
+ return pnpmpResolver;
144
162
  }
@@ -1,4 +1,4 @@
1
- import type { MetroConfig } from 'metro-config';
1
+ type MetroConfig = any;
2
2
  interface WithNxOptions {
3
3
  /**
4
4
  * Change this to true to see debugging info.
@@ -21,6 +21,6 @@ interface WithNxOptions {
21
21
  */
22
22
  mainFields?: string[];
23
23
  }
24
- export declare function withNxMetro(userConfig: MetroConfig, opts?: WithNxOptions): Promise<import("metro-config").ConfigT>;
24
+ export declare function withNxMetro(userConfig: MetroConfig, opts?: WithNxOptions): Promise<any>;
25
25
  export {};
26
26
  //# sourceMappingURL=with-nx-metro.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"with-nx-metro.d.ts","sourceRoot":"","sources":["../../../../packages/react-native/plugins/with-nx-metro.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAMhD,UAAU,aAAa;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAKxB,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,wBAAsB,WAAW,CAC/B,UAAU,EAAE,WAAW,EACvB,IAAI,GAAE,aAAkB,2CAmCzB"}
1
+ {"version":3,"file":"with-nx-metro.d.ts","sourceRoot":"","sources":["../../../../packages/react-native/plugins/with-nx-metro.ts"],"names":[],"mappings":"AAuBA,KAAK,WAAW,GAAG,GAAG,CAAC;AAIvB,UAAU,aAAa;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAKxB,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,wBAAsB,WAAW,CAC/B,UAAU,EAAE,WAAW,EACvB,IAAI,GAAE,aAAkB,gBAoCzB"}
@@ -2,9 +2,24 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.withNxMetro = withNxMetro;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const metro_config_1 = require("metro-config");
6
5
  const node_fs_1 = require("node:fs");
7
6
  const path_1 = require("path");
7
+ // Cache for metro-config module
8
+ let metroConfig = null;
9
+ /**
10
+ * Lazily require metro-config to handle cases where it might not be installed
11
+ */
12
+ function getMetroConfig() {
13
+ if (!metroConfig) {
14
+ try {
15
+ metroConfig = require('metro-config');
16
+ }
17
+ catch (error) {
18
+ throw new Error('metro-config is required but not installed. Please install metro-config >= 0.82.0');
19
+ }
20
+ }
21
+ return metroConfig;
22
+ }
8
23
  const metro_resolver_1 = require("./metro-resolver");
9
24
  async function withNxMetro(userConfig, opts = {}) {
10
25
  const extensions = ['', 'ts', 'tsx', 'js', 'jsx', 'json'];
@@ -27,5 +42,6 @@ async function withNxMetro(userConfig, opts = {}) {
27
42
  },
28
43
  watchFolders,
29
44
  };
30
- return (0, metro_config_1.mergeConfig)(userConfig, nxConfig);
45
+ const { mergeConfig } = getMetroConfig();
46
+ return mergeConfig(userConfig, nxConfig);
31
47
  }
@@ -1 +1 @@
1
- {"version":3,"file":"bundle.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/react-native/src/executors/bundle/bundle.impl.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,eAAe,EAAE,MAAM,YAAY,CAAC;AAIpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAEpD,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,wBAA+B,cAAc,CAC3C,OAAO,EAAE,wBAAwB,EACjC,OAAO,EAAE,eAAe,GACvB,cAAc,CAAC,uBAAuB,CAAC,CAUzC"}
1
+ {"version":3,"file":"bundle.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/react-native/src/executors/bundle/bundle.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,eAAe,EAAE,MAAM,YAAY,CAAC;AAIpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAGpD,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,wBAA+B,cAAc,CAC3C,OAAO,EAAE,wBAAwB,EACjC,OAAO,EAAE,eAAe,GACvB,cAAc,CAAC,uBAAuB,CAAC,CAUzC"}
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = bundleExecutor;
4
- const fileutils_1 = require("@nx/workspace/src/utilities/fileutils");
5
4
  const devkit_1 = require("@nx/devkit");
6
5
  const path_1 = require("path");
7
6
  const child_process_1 = require("child_process");
7
+ const fs_1 = require("fs");
8
8
  async function* bundleExecutor(options, context) {
9
9
  const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
10
10
  options.bundleOutput = (0, path_1.join)(context.root, options.bundleOutput);
11
- (0, fileutils_1.createDirectory)((0, path_1.dirname)(options.bundleOutput));
11
+ (0, fs_1.mkdirSync)((0, path_1.dirname)(options.bundleOutput));
12
12
  await runCliBuild(context.root, projectRoot, options);
13
13
  yield { success: true };
14
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"storybook.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/react-native/src/executors/storybook/storybook.impl.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAwB,MAAM,YAAY,CAAC;AAKnE,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAOvD;;;GAGG;AACH,wBAA+B,4BAA4B,CACzD,OAAO,EAAE,2BAA2B,EACpC,OAAO,EAAE,eAAe,GACvB,cAAc,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CA2CtC;AAED,wBAAgB,eAAe,CAC7B,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,2BAA2B,QAwBrC"}
1
+ {"version":3,"file":"storybook.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/react-native/src/executors/storybook/storybook.impl.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAwB,MAAM,YAAY,CAAC;AAInE,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAOvD;;;GAGG;AACH,wBAA+B,4BAA4B,CACzD,OAAO,EAAE,2BAA2B,EACpC,OAAO,EAAE,eAAe,GACvB,cAAc,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CA2CtC;AAED,wBAAgB,eAAe,CAC7B,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,2BAA2B,QAwBrC"}
@@ -5,9 +5,8 @@ exports.runCliStorybook = runCliStorybook;
5
5
  const node_fs_1 = require("node:fs");
6
6
  const path_1 = require("path");
7
7
  const devkit_1 = require("@nx/devkit");
8
- const fileutils_1 = require("@nx/workspace/src/utilities/fileutils");
9
8
  const pc = require("picocolors");
10
- const glob_1 = require("glob");
9
+ const tinyglobby_1 = require("tinyglobby");
11
10
  const sync_deps_impl_1 = require("../sync-deps/sync-deps.impl");
12
11
  /**
13
12
  * TODO (@xiongemi): remove this function in v20.
@@ -22,7 +21,7 @@ async function* reactNativeStorybookExecutor(options, context) {
22
21
  const workspacePackageJsonPath = (0, path_1.join)(context.root, 'package.json');
23
22
  const workspacePackageJson = (0, devkit_1.readJsonFile)(workspacePackageJsonPath);
24
23
  const projectPackageJson = (0, devkit_1.readJsonFile)(packageJsonPath);
25
- if (isSyncDepsEnabled && (0, fileutils_1.fileExists)(packageJsonPath))
24
+ if (isSyncDepsEnabled && (0, node_fs_1.existsSync)(packageJsonPath))
26
25
  (0, sync_deps_impl_1.displayNewlyAddedDepsMessage)(context.projectName, await (0, sync_deps_impl_1.syncDeps)(context.projectName, projectPackageJson, packageJsonPath, workspacePackageJson, context.projectGraph, [
27
26
  `@storybook/react-native`,
28
27
  '@storybook/addon-ondevice-actions',
@@ -37,7 +36,7 @@ async function* reactNativeStorybookExecutor(options, context) {
37
36
  }
38
37
  function runCliStorybook(workspaceRoot, options) {
39
38
  const storiesFiles = options.searchDir.flatMap((dir) => {
40
- const storyFilePaths = (0, glob_1.sync)((0, path_1.join)(dir, options.pattern));
39
+ const storyFilePaths = (0, tinyglobby_1.globSync)((0, path_1.join)(dir, options.pattern));
41
40
  return storyFilePaths.map((storyFilePath) => {
42
41
  const loaderPath = (0, path_1.resolve)((0, path_1.dirname)(options.outputFile));
43
42
  return (0, path_1.relative)(loaderPath, storyFilePath);
@@ -41,7 +41,7 @@ async function reactNativeApplicationGeneratorInternal(host, schema) {
41
41
  const initTask = await (0, init_1.default)(host, { ...options, skipFormat: true });
42
42
  tasks.push(initTask);
43
43
  if (!options.skipPackageJson) {
44
- tasks.push((0, ensure_dependencies_1.ensureDependencies)(host));
44
+ tasks.push((0, ensure_dependencies_1.ensureDependencies)(host, options.unitTestRunner));
45
45
  }
46
46
  await (0, create_application_files_1.createApplicationFiles)(host, options);
47
47
  (0, add_project_1.addProject)(host, options);
@@ -63,14 +63,14 @@ def enableProguardInReleaseBuilds = false
63
63
  * The preferred build flavor of JavaScriptCore (JSC)
64
64
  *
65
65
  * For example, to use the international variant, you can use:
66
- * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
66
+ * `def jscFlavor = io.github.react-native-community:jsc-android-intl:2026004.+`
67
67
  *
68
68
  * The international variant includes ICU i18n library and necessary data
69
69
  * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
70
70
  * give correct results when using with locales other than en-US. Note that
71
71
  * this variant is about 6MiB larger per architecture than default.
72
72
  */
73
- def jscFlavor = 'org.webkit:android-jsc:+'
73
+ def jscFlavor = 'io.github.react-native-community:jsc-android:2026004.+'
74
74
 
75
75
  android {
76
76
  ndkVersion rootProject.ext.ndkVersion
@@ -5,6 +5,5 @@
5
5
  <application
6
6
  android:usesCleartextTraffic="true"
7
7
  tools:targetApi="28"
8
- android:networkSecurityConfig="@xml/network_security_config"
9
8
  tools:ignore="GoogleAppIndexingWarning"/>
10
9
  </manifest>
@@ -9,8 +9,7 @@
9
9
  android:roundIcon="@mipmap/ic_launcher_round"
10
10
  android:allowBackup="false"
11
11
  android:theme="@style/AppTheme"
12
- android:supportsRtl="true"
13
- android:networkSecurityConfig="@xml/network_security_config">
12
+ android:supportsRtl="true">
14
13
  <activity
15
14
  android:name=".MainActivity"
16
15
  android:label="@string/app_name"
@@ -3,9 +3,9 @@ buildscript {
3
3
  buildToolsVersion = "35.0.0"
4
4
  minSdkVersion = 24
5
5
  compileSdkVersion = 35
6
- targetSdkVersion = 34
7
- ndkVersion = "26.1.10909125"
8
- kotlinVersion = "1.9.24"
6
+ targetSdkVersion = 35
7
+ ndkVersion = "27.1.12297006"
8
+ kotlinVersion = "2.0.21"
9
9
  }
10
10
  repositories {
11
11
  google()
@@ -1,6 +1,6 @@
1
1
  distributionBase=GRADLE_USER_HOME
2
2
  distributionPath=wrapper/dists
3
- distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
3
+ distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
4
4
  networkTimeout=10000
5
5
  validateDistributionUrl=true
6
6
  zipStoreBase=GRADLE_USER_HOME
@@ -86,8 +86,7 @@ done
86
86
  # shellcheck disable=SC2034
87
87
  APP_BASE_NAME=${0##*/}
88
88
  # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
89
- APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
90
- ' "$PWD" ) || exit
89
+ APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
91
90
 
92
91
  # Use the maximum available, or set MAX_FD != -1 to use that value.
93
92
  MAX_FD=maximum
@@ -206,7 +205,7 @@ fi
206
205
  DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
207
206
 
208
207
  # Collect all arguments for the java command:
209
- # * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
208
+ # * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
210
209
  # and any embedded shellness will be escaped.
211
210
  # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
212
211
  # treated as '${Hostname}' itself on the command line.
@@ -9,4 +9,3 @@
9
9
  # For example, to use nvm with brew, add the following line
10
10
  # . "$(brew --prefix nvm)/nvm.sh" --no-use
11
11
  export NODE_BINARY=$(command -v node)
12
- export ENTRY_FILE="${PROJECT_DIR}/../<%= entryFile %>"
@@ -23,11 +23,6 @@ target '<%= className %>' do
23
23
  :app_path => "#{Pod::Config.instance.installation_root}/.."
24
24
  )
25
25
 
26
- target '<%= className %>Tests' do
27
- inherit! :complete
28
- # Pods for testing
29
- end
30
-
31
26
  post_install do |installer|
32
27
  # https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
33
28
  react_native_post_install(
@@ -0,0 +1,48 @@
1
+ import UIKit
2
+ import React
3
+ import React_RCTAppDelegate
4
+ import ReactAppDependencyProvider
5
+
6
+ @main
7
+ class AppDelegate: UIResponder, UIApplicationDelegate {
8
+ var window: UIWindow?
9
+
10
+ var reactNativeDelegate: ReactNativeDelegate?
11
+ var reactNativeFactory: RCTReactNativeFactory?
12
+
13
+ func application(
14
+ _ application: UIApplication,
15
+ didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
16
+ ) -> Bool {
17
+ let delegate = ReactNativeDelegate()
18
+ let factory = RCTReactNativeFactory(delegate: delegate)
19
+ delegate.dependencyProvider = RCTAppDependencyProvider()
20
+
21
+ reactNativeDelegate = delegate
22
+ reactNativeFactory = factory
23
+
24
+ window = UIWindow(frame: UIScreen.main.bounds)
25
+
26
+ factory.startReactNative(
27
+ withModuleName: "<%= className %>",
28
+ in: window,
29
+ launchOptions: launchOptions
30
+ )
31
+
32
+ return true
33
+ }
34
+ }
35
+
36
+ class ReactNativeDelegate: RCTDefaultReactNativeFactoryDelegate {
37
+ override func sourceURL(for bridge: RCTBridge) -> URL? {
38
+ self.bundleURL()
39
+ }
40
+
41
+ override func bundleURL() -> URL? {
42
+ #if DEBUG
43
+ RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "src/main")
44
+ #else
45
+ Bundle.main.url(forResource: "main", withExtension: "jsbundle")
46
+ #endif
47
+ }
48
+ }
@@ -2,37 +2,36 @@
2
2
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
3
  <plist version="1.0">
4
4
  <dict>
5
- <key>NSPrivacyCollectedDataTypes</key>
6
- <array>
7
- </array>
8
- <key>NSPrivacyAccessedAPITypes</key>
9
- <array>
10
- <dict>
11
- <key>NSPrivacyAccessedAPIType</key>
12
- <string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
13
- <key>NSPrivacyAccessedAPITypeReasons</key>
14
- <array>
15
- <string>C617.1</string>
16
- </array>
17
- </dict>
18
- <dict>
19
- <key>NSPrivacyAccessedAPIType</key>
20
- <string>NSPrivacyAccessedAPICategoryUserDefaults</string>
21
- <key>NSPrivacyAccessedAPITypeReasons</key>
22
- <array>
23
- <string>CA92.1</string>
24
- </array>
25
- </dict>
26
- <dict>
27
- <key>NSPrivacyAccessedAPIType</key>
28
- <string>NSPrivacyAccessedAPICategorySystemBootTime</string>
29
- <key>NSPrivacyAccessedAPITypeReasons</key>
30
- <array>
31
- <string>35F9.1</string>
32
- </array>
33
- </dict>
34
- </array>
35
- <key>NSPrivacyTracking</key>
36
- <false/>
5
+ <key>NSPrivacyAccessedAPITypes</key>
6
+ <array>
7
+ <dict>
8
+ <key>NSPrivacyAccessedAPIType</key>
9
+ <string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
10
+ <key>NSPrivacyAccessedAPITypeReasons</key>
11
+ <array>
12
+ <string>C617.1</string>
13
+ </array>
14
+ </dict>
15
+ <dict>
16
+ <key>NSPrivacyAccessedAPIType</key>
17
+ <string>NSPrivacyAccessedAPICategoryUserDefaults</string>
18
+ <key>NSPrivacyAccessedAPITypeReasons</key>
19
+ <array>
20
+ <string>CA92.1</string>
21
+ </array>
22
+ </dict>
23
+ <dict>
24
+ <key>NSPrivacyAccessedAPIType</key>
25
+ <string>NSPrivacyAccessedAPICategorySystemBootTime</string>
26
+ <key>NSPrivacyAccessedAPITypeReasons</key>
27
+ <array>
28
+ <string>35F9.1</string>
29
+ </array>
30
+ </dict>
31
+ </array>
32
+ <key>NSPrivacyCollectedDataTypes</key>
33
+ <array/>
34
+ <key>NSPrivacyTracking</key>
35
+ <false/>
37
36
  </dict>
38
37
  </plist>