@nx/react-native 18.0.0-beta.1 → 18.0.0-beta.2

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 (161) hide show
  1. package/.eslintrc.json +6 -1
  2. package/executors.json +5 -0
  3. package/generators.json +12 -11
  4. package/migrations.json +73 -1
  5. package/package.json +10 -15
  6. package/plugins/metro-resolver.js +4 -1
  7. package/plugins/plugin.d.ts +2 -0
  8. package/plugins/plugin.js +12 -1
  9. package/plugins/with-nx-metro.js +6 -2
  10. package/src/executors/build-android/build-android.impl.js +1 -5
  11. package/src/executors/build-android/build-android.impl.ts +1 -5
  12. package/src/executors/bundle/schema.d.ts +1 -1
  13. package/src/executors/ensure-symlink/ensure-symlink.impl.d.ts +4 -0
  14. package/src/executors/ensure-symlink/ensure-symlink.impl.js +4 -0
  15. package/src/executors/ensure-symlink/ensure-symlink.impl.ts +4 -0
  16. package/src/executors/run-android/run-android.impl.js +4 -16
  17. package/src/executors/run-android/run-android.impl.ts +8 -17
  18. package/src/executors/run-ios/run-ios.impl.js +4 -16
  19. package/src/executors/run-ios/run-ios.impl.ts +9 -18
  20. package/src/executors/start/schema.d.ts +1 -1
  21. package/src/executors/start/start.impl.js +11 -26
  22. package/src/executors/start/start.impl.ts +14 -28
  23. package/src/executors/storybook/storybook.impl.d.ts +4 -0
  24. package/src/executors/storybook/storybook.impl.js +8 -1
  25. package/src/executors/storybook/storybook.impl.ts +16 -5
  26. package/src/executors/sync-deps/sync-deps.impl.d.ts +3 -2
  27. package/src/executors/sync-deps/sync-deps.impl.js +28 -11
  28. package/src/executors/sync-deps/sync-deps.impl.ts +45 -19
  29. package/src/executors/upgrade/schema.d.ts +1 -0
  30. package/src/executors/upgrade/schema.json +11 -0
  31. package/src/executors/upgrade/upgrade.impl.d.ts +13 -0
  32. package/src/executors/upgrade/upgrade.impl.js +47 -0
  33. package/src/executors/upgrade/upgrade.impl.ts +64 -0
  34. package/src/generators/application/application.js +27 -8
  35. package/src/generators/application/application.spec.ts +29 -2
  36. package/src/generators/application/files/app/.babelrc.js.template +23 -0
  37. package/src/generators/application/files/app/android/app/build.gradle.template +12 -28
  38. package/src/generators/application/files/app/android/app/src/debug/AndroidManifest.xml.template +2 -6
  39. package/src/generators/application/files/app/android/app/src/main/java/com/__lowerCaseName__/MainActivity.kt.template +22 -0
  40. package/src/generators/application/files/app/android/app/src/main/java/com/__lowerCaseName__/MainApplication.kt.template +45 -0
  41. package/src/generators/application/files/app/android/build.gradle.template +7 -20
  42. package/src/generators/application/files/app/android/gradle/wrapper/gradle-wrapper.properties +2 -1
  43. package/src/generators/application/files/app/android/gradle.properties +0 -3
  44. package/src/generators/application/files/app/android/gradlew.template +12 -7
  45. package/src/generators/application/files/app/android/settings.gradle.template +2 -2
  46. package/src/generators/application/files/app/ios/Podfile.template +0 -7
  47. package/src/generators/application/files/app/ios/__className__/AppDelegate.mm.template +5 -0
  48. package/src/generators/application/files/app/ios/__className__/Info.plist.template +5 -8
  49. package/src/generators/application/files/app/ios/__className__.xcodeproj/project.pbxproj.template +11 -33
  50. package/src/generators/application/files/app/metro.config.js.template +0 -4
  51. package/src/generators/application/files/app/src/app/App.tsx.template +29 -2
  52. package/src/generators/application/lib/add-e2e.d.ts +3 -0
  53. package/src/generators/application/lib/add-e2e.js +47 -0
  54. package/src/generators/application/lib/add-project.js +13 -17
  55. package/src/generators/application/lib/normalize-options.d.ts +4 -0
  56. package/src/generators/application/lib/normalize-options.js +9 -3
  57. package/src/generators/application/lib/normalize-options.spec.ts +53 -5
  58. package/src/generators/application/schema.d.ts +5 -3
  59. package/src/generators/application/schema.json +13 -5
  60. package/src/generators/component-story/component-story.d.ts +5 -8
  61. package/src/generators/component-story/component-story.js +8 -69
  62. package/src/generators/component-story/schema.d.ts +1 -0
  63. package/src/generators/component-story/schema.json +10 -2
  64. package/src/generators/init/init.d.ts +1 -0
  65. package/src/generators/init/init.js +14 -7
  66. package/src/generators/init/init.spec.ts +6 -2
  67. package/src/generators/init/schema.d.ts +1 -0
  68. package/src/generators/library/files/lib/.babelrc.js.template +21 -0
  69. package/src/generators/library/lib/normalize-options.js +1 -0
  70. package/src/generators/library/library.js +2 -1
  71. package/src/generators/library/library.spec.ts +12 -41
  72. package/src/generators/library/schema.d.ts +1 -0
  73. package/src/generators/library/schema.json +1 -1
  74. package/src/generators/stories/schema.d.ts +2 -0
  75. package/src/generators/stories/schema.json +14 -1
  76. package/src/generators/stories/stories.d.ts +5 -2
  77. package/src/generators/stories/stories.js +7 -50
  78. package/src/generators/storybook-configuration/configuration.d.ts +7 -2
  79. package/src/generators/storybook-configuration/configuration.js +15 -48
  80. package/src/generators/storybook-configuration/schema.d.ts +4 -2
  81. package/src/generators/storybook-configuration/schema.json +21 -11
  82. package/src/generators/upgrade-native/lib/normalize-options.d.ts +1 -1
  83. package/src/generators/upgrade-native/schema.d.ts +1 -1
  84. package/src/generators/upgrade-native/schema.json +2 -2
  85. package/src/generators/upgrade-native/upgrade-native.d.ts +2 -0
  86. package/src/generators/upgrade-native/upgrade-native.js +3 -0
  87. package/src/generators/web-configuration/files/base-vite/.babelrc.js.template +23 -0
  88. package/src/generators/web-configuration/files/base-vite/index.html__tmpl__ +15 -0
  89. package/src/generators/web-configuration/files/base-vite/public/favicon.ico +0 -0
  90. package/src/generators/web-configuration/files/base-vite/src/assets/.gitkeep +0 -0
  91. package/src/generators/web-configuration/files/base-vite/src/main-web.tsx__tmpl__ +9 -0
  92. package/src/generators/web-configuration/files/base-vite/vite.config.ts__tmpl__ +82 -0
  93. package/src/generators/web-configuration/files/base-webpack/.babelrc.js.template +23 -0
  94. package/src/generators/web-configuration/files/base-webpack/src/assets/.gitkeep +0 -0
  95. package/src/generators/web-configuration/files/base-webpack/src/favicon.ico +0 -0
  96. package/src/generators/web-configuration/files/base-webpack/src/index.html__tmpl__ +14 -0
  97. package/src/generators/web-configuration/files/base-webpack/src/main-web.tsx__tmpl__ +9 -0
  98. package/src/generators/web-configuration/files/base-webpack/webpack.config.js__tmpl__ +77 -0
  99. package/src/generators/web-configuration/lib/normalize-schema.d.ts +17 -0
  100. package/src/generators/web-configuration/lib/normalize-schema.js +16 -0
  101. package/src/generators/web-configuration/lib/webpack-targets.d.ts +7 -0
  102. package/src/generators/web-configuration/lib/webpack-targets.js +75 -0
  103. package/src/generators/web-configuration/schema.d.ts +6 -0
  104. package/src/generators/web-configuration/schema.json +42 -0
  105. package/src/generators/web-configuration/web-configuration.d.ts +12 -0
  106. package/src/generators/web-configuration/web-configuration.js +85 -0
  107. package/src/migrations/update-16-6-0/update-metro-config.js +0 -4
  108. package/src/migrations/update-16-9-0/remove-types-react-native.js +2 -9
  109. package/src/migrations/update-18-0-0/add-upgrade-target.d.ts +6 -0
  110. package/src/migrations/update-18-0-0/add-upgrade-target.js +33 -0
  111. package/src/migrations/update-18-0-0/add-web-configuration.d.ts +8 -0
  112. package/src/migrations/update-18-0-0/add-web-configuration.js +33 -0
  113. package/src/migrations/update-18-0-0/add-web-configuration.spec.ts +39 -0
  114. package/src/migrations/update-18-0-0/change-storybook-targets.d.ts +5 -0
  115. package/src/migrations/update-18-0-0/change-storybook-targets.js +57 -0
  116. package/src/migrations/update-18-0-0/remove-block-list.d.ts +6 -0
  117. package/src/migrations/update-18-0-0/remove-block-list.js +26 -0
  118. package/src/migrations/update-18-0-0/remove-block-list.spec.ts +68 -0
  119. package/src/migrations/update-18-0-0/remove-metro.d.ts +14 -0
  120. package/src/migrations/update-18-0-0/remove-metro.js +29 -0
  121. package/src/migrations/update-18-0-0/remove-symlink-target.d.ts +6 -0
  122. package/src/migrations/update-18-0-0/remove-symlink-target.js +30 -0
  123. package/src/migrations/update-18-0-0/remove-symlink-target.spec.ts +40 -0
  124. package/src/utils/add-jest.d.ts +1 -1
  125. package/src/utils/add-jest.js +13 -1
  126. package/src/utils/add-linting.d.ts +1 -0
  127. package/src/utils/add-linting.js +1 -0
  128. package/src/utils/add-linting.spec.ts +2 -4
  129. package/src/utils/ensure-dependencies.js +2 -6
  130. package/src/utils/testing-generators.js +1 -0
  131. package/src/utils/versions.d.ts +9 -12
  132. package/src/utils/versions.js +10 -13
  133. package/src/generators/application/files/app/android/app/src/debug/java/com/__lowerCaseName__/ReactNativeFlipper.java.template +0 -75
  134. package/src/generators/application/files/app/android/app/src/main/java/com/__lowerCaseName__/MainActivity.java.template +0 -32
  135. package/src/generators/application/files/app/android/app/src/main/java/com/__lowerCaseName__/MainApplication.java.template +0 -62
  136. package/src/generators/application/files/app/android/app/src/release/java/com/__lowerCaseName__/ReactNativeFlipper.java.template +0 -20
  137. package/src/generators/application/files/app/babel.config.json.template +0 -10
  138. package/src/generators/application/lib/add-detox.d.ts +0 -3
  139. package/src/generators/application/lib/add-detox.js +0 -23
  140. package/src/generators/component-story/component-story.spec.ts +0 -427
  141. package/src/generators/component-story/files/__componentFileName__.stories.__fileExt__ +0 -32
  142. package/src/generators/library/files/lib/babel.config.json.template +0 -19
  143. package/src/generators/stories/stories-app.spec.ts +0 -128
  144. package/src/generators/stories/stories-lib.spec.ts +0 -105
  145. package/src/generators/storybook-configuration/configuration.spec.ts +0 -135
  146. package/src/generators/storybook-configuration/files/app/storybook.ts.template +0 -9
  147. package/src/generators/storybook-configuration/files/app/toggle-storybook.tsx.template +0 -74
  148. package/src/generators/storybook-configuration/files/root/story-loader.ts.template +0 -5
  149. package/src/generators/storybook-configuration/lib/add-resolver-main-fields-to-metro-config.d.ts +0 -6
  150. package/src/generators/storybook-configuration/lib/add-resolver-main-fields-to-metro-config.js +0 -25
  151. package/src/generators/storybook-configuration/lib/add-resolver-main-fields-to-metro-config.spec.ts +0 -161
  152. package/src/generators/storybook-configuration/lib/create-storybook-files.d.ts +0 -6
  153. package/src/generators/storybook-configuration/lib/create-storybook-files.js +0 -42
  154. package/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.d.ts +0 -7
  155. package/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.js +0 -29
  156. package/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.spec.ts +0 -65
  157. package/src/utils/find-all-npm-dependencies.d.ts +0 -2
  158. package/src/utils/find-all-npm-dependencies.js +0 -25
  159. package/src/utils/find-all-npm-dependencies.spec.ts +0 -95
  160. package/src/utils/symlink-task.d.ts +0 -2
  161. package/src/utils/symlink-task.js +0 -18
@@ -0,0 +1,23 @@
1
+ module.exports = function (api) {
2
+ api.cache(true);
3
+
4
+ if (
5
+ process.env.NX_TASK_TARGET_TARGET === 'build' ||
6
+ process.env.NX_TASK_TARGET_TARGET.includes('storybook')
7
+ ) {
8
+ return {
9
+ presets: [
10
+ [
11
+ '@nx/react/babel',
12
+ {
13
+ runtime: 'automatic',
14
+ },
15
+ ],
16
+ ],
17
+ };
18
+ }
19
+
20
+ return {
21
+ presets: [['module:@react-native/babel-preset', { "useTransformReactJSX": true }]],
22
+ };
23
+ };
@@ -1,4 +1,5 @@
1
1
  apply plugin: "com.android.application"
2
+ apply plugin: "org.jetbrains.kotlin.android"
2
3
  apply plugin: "com.facebook.react"
3
4
 
4
5
  /**
@@ -9,12 +10,12 @@ react {
9
10
  /* Folders */
10
11
  // The root of your project, i.e. where "package.json" lives. Default is '..'
11
12
  // root = file("../")
12
- // The folder where the react-native NPM package is. Default is ../node_modules/react-native
13
- // reactNativeDir = file("../node_modules/react-native")
14
- // The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
15
- // codegenDir = file("../node_modules/@react-native/codegen")
16
- // The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
17
- // cliFile = file("../node_modules/react-native/cli.js")
13
+ // The folder where the react-native NPM package is. Default is <%= offsetFromRoot %>../../node_modules/react-native
14
+ reactNativeDir = file("<%= offsetFromRoot %>../../node_modules/react-native")
15
+ // The folder where the react-native Codegen package is. Default is <%= offsetFromRoot %>../../node_modules/@react-native/codegen
16
+ codegenDir = file("<%= offsetFromRoot %>../../node_modules/@react-native/codegen")
17
+ // The cli.js file which is the React Native CLI entrypoint. Default is <%= offsetFromRoot %>../../node_modules/react-native/cli.js
18
+ cliFile = file("<%= offsetFromRoot %>../../node_modules/react-native/cli.js")
18
19
 
19
20
  /* Variants */
20
21
  // The list of variants to that are debuggable. For those we're going to
@@ -36,7 +37,7 @@ react {
36
37
  // bundleAssetName = "MyApplication.android.bundle"
37
38
  //
38
39
  // The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
39
- // entryFile = file("../js/MyApplication.android.js")
40
+ entryFile = file("../../<%= entryFile %>")
40
41
  //
41
42
  // A list of extra flags to pass to the 'bundle' commands.
42
43
  // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
@@ -48,7 +49,6 @@ react {
48
49
  //
49
50
  // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
50
51
  // hermesFlags = ["-O", "-output-source-map"]
51
- entryFile = file("../../<%= entryFile %>")
52
52
  }
53
53
 
54
54
  /**
@@ -71,8 +71,8 @@ def jscFlavor = 'org.webkit:android-jsc:+'
71
71
 
72
72
  android {
73
73
  ndkVersion rootProject.ext.ndkVersion
74
-
75
- compileSdkVersion rootProject.ext.compileSdkVersion
74
+ buildToolsVersion rootProject.ext.buildToolsVersion
75
+ compileSdk rootProject.ext.compileSdkVersion
76
76
 
77
77
  namespace "com.<%= lowerCaseName %>"
78
78
  defaultConfig {
@@ -81,10 +81,6 @@ android {
81
81
  targetSdkVersion rootProject.ext.targetSdkVersion
82
82
  versionCode 1
83
83
  versionName "1.0"
84
- <% if (e2eTestRunner === 'detox') { %>
85
- testBuildType System.getProperty('testBuildType', 'debug')
86
- testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
87
- <% } %>
88
84
  }
89
85
  signingConfigs {
90
86
  debug {
@@ -104,27 +100,15 @@ android {
104
100
  signingConfig signingConfigs.debug
105
101
  minifyEnabled enableProguardInReleaseBuilds
106
102
  proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
107
- <% if (e2eTestRunner === 'detox') { %>
108
- proguardFile "${rootProject.projectDir}/../node_modules/detox/android/detox/proguard-rules-app.pro"
109
- <% } %>
110
103
  }
111
104
  }
112
105
  }
113
106
 
114
107
  dependencies {
115
- <% if (e2eTestRunner === 'detox') { %>
116
- androidTestImplementation('com.wix:detox:+')
117
- implementation 'androidx.appcompat:appcompat:1.1.0'
118
- <% } %>
119
108
  // The version of react-native is set by the React Native Gradle Plugin
120
109
  implementation("com.facebook.react:react-android")
110
+ implementation("com.facebook.react:flipper-integration")
121
111
 
122
- debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
123
- debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
124
- exclude group:'com.squareup.okhttp3', module:'okhttp'
125
- }
126
-
127
- debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
128
112
  if (hermesEnabled.toBoolean()) {
129
113
  implementation("com.facebook.react:hermes-android")
130
114
  } else {
@@ -132,4 +116,4 @@ dependencies {
132
116
  }
133
117
  }
134
118
 
135
- apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
119
+ apply from: file("<%= offsetFromRoot %>../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
@@ -2,13 +2,9 @@
2
2
  <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
3
  xmlns:tools="http://schemas.android.com/tools">
4
4
 
5
- <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
6
-
7
5
  <application
8
6
  android:usesCleartextTraffic="true"
9
7
  tools:targetApi="28"
10
- tools:ignore="GoogleAppIndexingWarning"
11
- android:networkSecurityConfig="@xml/network_security_config">
12
- <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
13
- </application>
8
+ android:networkSecurityConfig="@xml/network_security_config"
9
+ tools:ignore="GoogleAppIndexingWarning"/>
14
10
  </manifest>
@@ -0,0 +1,22 @@
1
+ package com.<%= lowerCaseName %>
2
+
3
+ import com.facebook.react.ReactActivity
4
+ import com.facebook.react.ReactActivityDelegate
5
+ import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
6
+ import com.facebook.react.defaults.DefaultReactActivityDelegate
7
+
8
+ class MainActivity : ReactActivity() {
9
+
10
+ /**
11
+ * Returns the name of the main component registered from JavaScript. This is used to schedule
12
+ * rendering of the component.
13
+ */
14
+ override fun getMainComponentName(): String = "<%= className %>"
15
+
16
+ /**
17
+ * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
18
+ * which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
19
+ */
20
+ override fun createReactActivityDelegate(): ReactActivityDelegate =
21
+ DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
22
+ }
@@ -0,0 +1,45 @@
1
+ package com.<%= lowerCaseName %>
2
+
3
+ import android.app.Application
4
+ import com.facebook.react.PackageList
5
+ import com.facebook.react.ReactApplication
6
+ import com.facebook.react.ReactHost
7
+ import com.facebook.react.ReactNativeHost
8
+ import com.facebook.react.ReactPackage
9
+ import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
10
+ import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
11
+ import com.facebook.react.defaults.DefaultReactNativeHost
12
+ import com.facebook.react.flipper.ReactNativeFlipper
13
+ import com.facebook.soloader.SoLoader
14
+
15
+ class MainApplication : Application(), ReactApplication {
16
+
17
+ override val reactNativeHost: ReactNativeHost =
18
+ object : DefaultReactNativeHost(this) {
19
+ override fun getPackages(): List<ReactPackage> {
20
+ // Packages that cannot be autolinked yet can be added manually here, for example:
21
+ // packages.add(new MyReactNativePackage());
22
+ return PackageList(this).packages
23
+ }
24
+
25
+ override fun getJSMainModuleName(): String = "src/main"
26
+
27
+ override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
28
+
29
+ override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
30
+ override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
31
+ }
32
+
33
+ override val reactHost: ReactHost
34
+ get() = getDefaultReactHost(this.applicationContext, reactNativeHost)
35
+
36
+ override fun onCreate() {
37
+ super.onCreate()
38
+ SoLoader.init(this, false)
39
+ if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
40
+ // If you opted-in for the New Architecture, we load the native entry point for this app.
41
+ load()
42
+ }
43
+ ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager)
44
+ }
45
+ }
@@ -1,15 +1,11 @@
1
- // Top-level build file where you can add configuration options common to all sub-projects/modules.
2
-
3
1
  buildscript {
4
2
  ext {
5
- buildToolsVersion = "33.0.0"
3
+ buildToolsVersion = "34.0.0"
6
4
  minSdkVersion = 21
7
- compileSdkVersion = 33
8
- targetSdkVersion = 33
9
- kotlinVersion = "1.8.20"
10
-
11
- // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
12
- ndkVersion = "23.1.7779620"
5
+ compileSdkVersion = 34
6
+ targetSdkVersion = 34
7
+ ndkVersion = "25.1.8937393"
8
+ kotlinVersion = "1.8.0"
13
9
  }
14
10
  repositories {
15
11
  google()
@@ -18,17 +14,8 @@ buildscript {
18
14
  dependencies {
19
15
  classpath("com.android.tools.build:gradle")
20
16
  classpath("com.facebook.react:react-native-gradle-plugin")
21
- classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
17
+ classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
22
18
  }
23
19
  }
24
20
 
25
- allprojects {
26
- repositories {
27
- <% if (e2eTestRunner === 'detox') { %>
28
- maven {
29
- // https://wix.github.io/Detox/docs/introduction/project-setup
30
- url("$rootDir/../node_modules/detox/Detox-android")
31
- }
32
- <% } %>
33
- }
34
- }
21
+ apply plugin: "com.facebook.react.rootproject"
@@ -1,6 +1,7 @@
1
1
  distributionBase=GRADLE_USER_HOME
2
2
  distributionPath=wrapper/dists
3
- distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-all.zip
3
+ distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
4
4
  networkTimeout=10000
5
+ validateDistributionUrl=true
5
6
  zipStoreBase=GRADLE_USER_HOME
6
7
  zipStorePath=wrapper/dists
@@ -24,9 +24,6 @@ android.useAndroidX=true
24
24
  # Automatically convert third-party libraries to use AndroidX
25
25
  android.enableJetifier=true
26
26
 
27
- # Version of flipper SDK to use with React Native
28
- FLIPPER_VERSION=0.182.0
29
-
30
27
  # Use this property to specify which architecture you want to build.
31
28
  # You can also override it from the CLI using
32
29
  # ./gradlew <task> -PreactNativeArchitectures=x86_64
@@ -83,10 +83,8 @@ done
83
83
  # This is normally unused
84
84
  # shellcheck disable=SC2034
85
85
  APP_BASE_NAME=${0##*/}
86
- APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
87
-
88
- # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
89
- DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
86
+ # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87
+ APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
90
88
 
91
89
  # Use the maximum available, or set MAX_FD != -1 to use that value.
92
90
  MAX_FD=maximum
@@ -133,10 +131,13 @@ location of your Java installation."
133
131
  fi
134
132
  else
135
133
  JAVACMD=java
136
- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
134
+ if ! command -v java >/dev/null 2>&1
135
+ then
136
+ die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
137
137
 
138
138
  Please set the JAVA_HOME variable in your environment to match the
139
139
  location of your Java installation."
140
+ fi
140
141
  fi
141
142
 
142
143
  # Increase the maximum file descriptors if we can.
@@ -144,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144
145
  case $MAX_FD in #(
145
146
  max*)
146
147
  # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
147
- # shellcheck disable=SC3045
148
+ # shellcheck disable=SC3045
148
149
  MAX_FD=$( ulimit -H -n ) ||
149
150
  warn "Could not query maximum file descriptor limit"
150
151
  esac
@@ -152,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
152
153
  '' | soft) :;; #(
153
154
  *)
154
155
  # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
155
- # shellcheck disable=SC3045
156
+ # shellcheck disable=SC3045
156
157
  ulimit -n "$MAX_FD" ||
157
158
  warn "Could not set maximum file descriptor limit to $MAX_FD"
158
159
  esac
@@ -197,6 +198,10 @@ if "$cygwin" || "$msys" ; then
197
198
  done
198
199
  fi
199
200
 
201
+
202
+ # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
203
+ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
204
+
200
205
  # Collect all arguments for the java command;
201
206
  # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
202
207
  # shell script including quotes and variable substitutions, so put them in
@@ -1,4 +1,4 @@
1
1
  rootProject.name = '<%= className %>'
2
- apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
2
+ apply from: file("<%= offsetFromRoot %>../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
3
3
  include ':app'
4
- includeBuild('../node_modules/@react-native/gradle-plugin')
4
+ includeBuild('<%= offsetFromRoot %>../node_modules/@react-native/gradle-plugin')
@@ -28,14 +28,8 @@ end
28
28
  target '<%= className %>' do
29
29
  config = use_native_modules!
30
30
 
31
- # Flags change depending on the env values.
32
- flags = get_default_flags()
33
-
34
31
  use_react_native!(
35
32
  :path => config[:reactNativePath],
36
- # Hermes is now enabled by default. Disable by setting this flag to false.
37
- :hermes_enabled => flags[:hermes_enabled],
38
- :fabric_enabled => flags[:fabric_enabled],
39
33
  # Enables Flipper.
40
34
  #
41
35
  # Note that if you have use_frameworks! enabled, Flipper will not work and
@@ -57,6 +51,5 @@ target '<%= className %>' do
57
51
  config[:reactNativePath],
58
52
  :mac_catalyst_enabled => false
59
53
  )
60
- __apply_Xcode_12_5_M1_post_install_workaround(installer)
61
54
  end
62
55
  end
@@ -15,6 +15,11 @@
15
15
  }
16
16
 
17
17
  - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
18
+ {
19
+ return [self getBundleURL];
20
+ }
21
+
22
+ - (NSURL *)getBundleURL
18
23
  {
19
24
  #if DEBUG
20
25
  return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"<%= entryFileIos %>"];
@@ -26,14 +26,11 @@
26
26
  <true/>
27
27
  <key>NSAppTransportSecurity</key>
28
28
  <dict>
29
- <key>NSExceptionDomains</key>
30
- <dict>
31
- <key>localhost</key>
32
- <dict>
33
- <key>NSExceptionAllowsInsecureHTTPLoads</key>
34
- <true/>
35
- </dict>
36
- </dict>
29
+ <!-- Do not change NSAllowsArbitraryLoads to true, or you will risk app rejection! -->
30
+ <key>NSAllowsArbitraryLoads</key>
31
+ <false/>
32
+ <key>NSAllowsLocalNetworking</key>
33
+ <true/>
37
34
  </dict>
38
35
  <key>NSLocationWhenInUseUsageDescription</key>
39
36
  <string></string>
@@ -177,7 +177,6 @@
177
177
  buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "<%= className %>" */;
178
178
  buildPhases = (
179
179
  C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */,
180
- FD10A7F022414F080027D42C /* Start Packager */,
181
180
  13B07F871A680F5B00A75B9A /* Sources */,
182
181
  13B07F8C1A680F5B00A75B9A /* Frameworks */,
183
182
  13B07F8E1A680F5B00A75B9A /* Resources */,
@@ -264,7 +263,7 @@
264
263
  );
265
264
  runOnlyForDeploymentPostprocessing = 0;
266
265
  shellPath = /bin/sh;
267
- shellScript = "set -e\n\nWITH_ENVIRONMENT=\"../node_modules/react-native/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"../node_modules/react-native/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n";
266
+ shellScript = "set -e\n\nWITH_ENVIRONMENT=\"<%= offsetFromRoot %>../node_modules/react-native/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"<%= offsetFromRoot %>../node_modules/react-native/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n";
268
267
  };
269
268
  00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */ = {
270
269
  isa = PBXShellScriptBuildPhase;
@@ -378,25 +377,6 @@
378
377
  shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-<%= className %>-<%= className %>Tests/Pods-<%= className %>-<%= className %>Tests-resources.sh\"\n";
379
378
  showEnvVarsInLog = 0;
380
379
  };
381
- FD10A7F022414F080027D42C /* Start Packager */ = {
382
- isa = PBXShellScriptBuildPhase;
383
- buildActionMask = 2147483647;
384
- files = (
385
- );
386
- inputFileListPaths = (
387
- );
388
- inputPaths = (
389
- );
390
- name = "Start Packager";
391
- outputFileListPaths = (
392
- );
393
- outputPaths = (
394
- );
395
- runOnlyForDeploymentPostprocessing = 0;
396
- shellPath = /bin/sh;
397
- shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n";
398
- showEnvVarsInLog = 0;
399
- };
400
380
  /* End PBXShellScriptBuildPhase section */
401
381
 
402
382
  /* Begin PBXSourcesBuildPhase section */
@@ -438,7 +418,7 @@
438
418
  "$(inherited)",
439
419
  );
440
420
  INFOPLIST_FILE = <%= className %>Tests/Info.plist;
441
- IPHONEOS_DEPLOYMENT_TARGET = 12.4;
421
+ IPHONEOS_DEPLOYMENT_TARGET = 13.4;
442
422
  LD_RUNPATH_SEARCH_PATHS = (
443
423
  "$(inherited)",
444
424
  "@executable_path/Frameworks",
@@ -462,7 +442,7 @@
462
442
  BUNDLE_LOADER = "$(TEST_HOST)";
463
443
  COPY_PHASE_STRIP = NO;
464
444
  INFOPLIST_FILE = <%= className %>Tests/Info.plist;
465
- IPHONEOS_DEPLOYMENT_TARGET = 12.4;
445
+ IPHONEOS_DEPLOYMENT_TARGET = 13.4;
466
446
  LD_RUNPATH_SEARCH_PATHS = (
467
447
  "$(inherited)",
468
448
  "@executable_path/Frameworks",
@@ -536,7 +516,7 @@
536
516
  buildSettings = {
537
517
  ALWAYS_SEARCH_USER_PATHS = NO;
538
518
  CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
539
- CLANG_CXX_LANGUAGE_STANDARD = "c++17";
519
+ CLANG_CXX_LANGUAGE_STANDARD = "c++20";
540
520
  CLANG_CXX_LIBRARY = "libc++";
541
521
  CLANG_ENABLE_MODULES = YES;
542
522
  CLANG_ENABLE_OBJC_ARC = YES;
@@ -564,7 +544,7 @@
564
544
  COPY_PHASE_STRIP = NO;
565
545
  ENABLE_STRICT_OBJC_MSGSEND = YES;
566
546
  ENABLE_TESTABILITY = YES;
567
- "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
547
+ "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
568
548
  GCC_C_LANGUAGE_STANDARD = gnu99;
569
549
  GCC_DYNAMIC_NO_PIC = NO;
570
550
  GCC_NO_COMMON_BLOCKS = YES;
@@ -580,7 +560,7 @@
580
560
  GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
581
561
  GCC_WARN_UNUSED_FUNCTION = YES;
582
562
  GCC_WARN_UNUSED_VARIABLE = YES;
583
- IPHONEOS_DEPLOYMENT_TARGET = 12.4;
563
+ IPHONEOS_DEPLOYMENT_TARGET = 13.4;
584
564
  LD_RUNPATH_SEARCH_PATHS = (
585
565
  /usr/lib/swift,
586
566
  "$(inherited)",
@@ -592,14 +572,13 @@
592
572
  );
593
573
  MTL_ENABLE_DEBUG_INFO = YES;
594
574
  ONLY_ACTIVE_ARCH = YES;
595
- OTHER_CFLAGS = "$(inherited)";
596
575
  OTHER_CPLUSPLUSFLAGS = (
597
576
  "$(OTHER_CFLAGS)",
598
577
  "-DFOLLY_NO_CONFIG",
599
578
  "-DFOLLY_MOBILE=1",
600
579
  "-DFOLLY_USE_LIBCPP=1",
580
+ "-DFOLLY_CFG_NO_COROUTINES=1",
601
581
  );
602
- REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
603
582
  SDKROOT = iphoneos;
604
583
  };
605
584
  name = Debug;
@@ -609,7 +588,7 @@
609
588
  buildSettings = {
610
589
  ALWAYS_SEARCH_USER_PATHS = NO;
611
590
  CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
612
- CLANG_CXX_LANGUAGE_STANDARD = "c++17";
591
+ CLANG_CXX_LANGUAGE_STANDARD = "c++20";
613
592
  CLANG_CXX_LIBRARY = "libc++";
614
593
  CLANG_ENABLE_MODULES = YES;
615
594
  CLANG_ENABLE_OBJC_ARC = YES;
@@ -637,7 +616,7 @@
637
616
  COPY_PHASE_STRIP = YES;
638
617
  ENABLE_NS_ASSERTIONS = NO;
639
618
  ENABLE_STRICT_OBJC_MSGSEND = YES;
640
- "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
619
+ "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
641
620
  GCC_C_LANGUAGE_STANDARD = gnu99;
642
621
  GCC_NO_COMMON_BLOCKS = YES;
643
622
  GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
@@ -646,7 +625,7 @@
646
625
  GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
647
626
  GCC_WARN_UNUSED_FUNCTION = YES;
648
627
  GCC_WARN_UNUSED_VARIABLE = YES;
649
- IPHONEOS_DEPLOYMENT_TARGET = 12.4;
628
+ IPHONEOS_DEPLOYMENT_TARGET = 13.4;
650
629
  LD_RUNPATH_SEARCH_PATHS = (
651
630
  /usr/lib/swift,
652
631
  "$(inherited)",
@@ -657,14 +636,13 @@
657
636
  "\"$(inherited)\"",
658
637
  );
659
638
  MTL_ENABLE_DEBUG_INFO = NO;
660
- OTHER_CFLAGS = "$(inherited)";
661
639
  OTHER_CPLUSPLUSFLAGS = (
662
640
  "$(OTHER_CFLAGS)",
663
641
  "-DFOLLY_NO_CONFIG",
664
642
  "-DFOLLY_MOBILE=1",
665
643
  "-DFOLLY_USE_LIBCPP=1",
644
+ "-DFOLLY_CFG_NO_COROUTINES=1",
666
645
  );
667
- REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
668
646
  SDKROOT = iphoneos;
669
647
  VALIDATE_PRODUCT = YES;
670
648
  };
@@ -1,6 +1,5 @@
1
1
  const { withNxMetro } = require('@nx/react-native');
2
2
  const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
3
- const exclusionList = require('metro-config/src/defaults/exclusionList');
4
3
 
5
4
  const defaultConfig = getDefaultConfig(__dirname);
6
5
  const { assetExts, sourceExts } = defaultConfig.resolver;
@@ -18,9 +17,6 @@ const customConfig = {
18
17
  resolver: {
19
18
  assetExts: assetExts.filter((ext) => ext !== 'svg'),
20
19
  sourceExts: [...sourceExts, 'svg'],
21
- blockList: exclusionList([/^(?!.*node_modules).*\/dist\/.*/]),
22
- // unstable_enableSymlinks: true,
23
- // unstable_enablePackageExports: true,
24
20
  },
25
21
  };
26
22
 
@@ -19,7 +19,10 @@ export const App = () => {
19
19
  return (
20
20
  <>
21
21
  <StatusBar barStyle="dark-content" />
22
- <SafeAreaView>
22
+ <SafeAreaView
23
+ style={{
24
+ flex: 1,
25
+ }}>
23
26
  <ScrollView
24
27
  ref={(ref) => {
25
28
  scrollViewRef.current = ref;
@@ -29,7 +32,7 @@ export const App = () => {
29
32
  >
30
33
  <View style={styles.section}>
31
34
  <Text style={styles.textLg}>Hello there,</Text>
32
- <Text style={[styles.textXL, styles.appTitleText]} testID="heading">
35
+ <Text style={[styles.textXL, styles.appTitleText]} testID="heading" role="heading">
33
36
  Welcome <%= displayName %> 👋
34
37
  </Text>
35
38
  </View>
@@ -475,6 +478,30 @@ export const App = () => {
475
478
  ui/src/lib/button
476
479
  </Text>
477
480
  </View>
481
+ <View style={styles.listItem}>
482
+ <Svg
483
+ width={24}
484
+ height={24}
485
+ stroke="#000000"
486
+ fill="none"
487
+ viewBox="0 0 24 24"
488
+ >
489
+ <Path
490
+ strokeLinecap="round"
491
+ strokeLinejoin="round"
492
+ strokeWidth="2"
493
+ d="M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"
494
+ />
495
+ </Svg>
496
+ <View style={styles.listItemTextContainer}>
497
+ <Text style={styles.textSm}>
498
+ View project details
499
+ </Text>
500
+ </View>
501
+ </View>
502
+ <View style={[styles.codeBlock, styles.marginBottomLg]}>
503
+ <Text style={[styles.textXS, styles.monospace]}>nx show project <%= displayName %> --web</Text>
504
+ </View>
478
505
  <View style={styles.listItem}>
479
506
  <Svg
480
507
  width={24}
@@ -0,0 +1,3 @@
1
+ import { GeneratorCallback, Tree } from '@nx/devkit';
2
+ import { NormalizedSchema } from './normalize-options';
3
+ export declare function addE2e(host: Tree, options: NormalizedSchema): Promise<GeneratorCallback>;
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addE2e = void 0;
4
+ const add_e2e_1 = require("@nx/react/src/generators/application/lib/add-e2e");
5
+ const devkit_1 = require("@nx/devkit");
6
+ const versions_1 = require("../../../utils/versions");
7
+ async function addE2e(host, options) {
8
+ switch (options.e2eTestRunner) {
9
+ case 'cypress':
10
+ return (0, add_e2e_1.addE2e)(host, {
11
+ ...options,
12
+ e2eTestRunner: 'cypress',
13
+ style: 'none',
14
+ styledModule: null,
15
+ hasStyles: false,
16
+ unitTestRunner: 'none',
17
+ });
18
+ case 'playwright':
19
+ return (0, add_e2e_1.addE2e)(host, {
20
+ ...options,
21
+ e2eTestRunner: 'playwright',
22
+ style: 'none',
23
+ styledModule: null,
24
+ hasStyles: false,
25
+ unitTestRunner: 'none',
26
+ });
27
+ case 'detox':
28
+ case 'detox':
29
+ const { detoxApplicationGenerator } = (0, devkit_1.ensurePackage)('@nx/detox', versions_1.nxVersion);
30
+ return detoxApplicationGenerator(host, {
31
+ ...options,
32
+ e2eName: options.e2eProjectName,
33
+ e2eDirectory: options.e2eProjectRoot,
34
+ projectNameAndRootFormat: 'as-provided',
35
+ appProject: options.projectName,
36
+ appDisplayName: options.displayName,
37
+ appName: options.name,
38
+ framework: 'react-native',
39
+ setParserOptionsProject: options.setParserOptionsProject,
40
+ skipFormat: true,
41
+ });
42
+ case 'none':
43
+ default:
44
+ return () => { };
45
+ }
46
+ }
47
+ exports.addE2e = addE2e;