@nx/react-native 16.6.0-beta.2 → 16.6.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/migrations.json +78 -0
- package/package.json +13 -12
- package/plugins/with-nx-metro.d.ts +5 -1
- package/plugins/with-nx-metro.js +27 -22
- package/src/executors/build-android/build-android.impl.js +18 -32
- package/src/executors/build-android/build-android.impl.ts +21 -50
- package/src/executors/build-android/schema.d.ts +5 -3
- package/src/executors/build-android/schema.json +14 -8
- package/src/executors/build-ios/build-ios.impl.d.ts +1 -1
- package/src/executors/build-ios/build-ios.impl.js +23 -42
- package/src/executors/build-ios/build-ios.impl.ts +26 -64
- package/src/executors/build-ios/schema.d.ts +3 -0
- package/src/executors/build-ios/schema.json +8 -6
- package/src/executors/bundle/bundle.impl.js +19 -17
- package/src/executors/bundle/bundle.impl.ts +24 -23
- package/src/executors/pod-install/pod-install.impl.js +1 -1
- package/src/executors/pod-install/pod-install.impl.ts +1 -1
- package/src/executors/pod-install/schema.d.ts +3 -1
- package/src/executors/pod-install/schema.json +11 -1
- package/src/executors/run-android/run-android.impl.js +47 -26
- package/src/executors/run-android/run-android.impl.ts +40 -45
- package/src/executors/run-android/schema.d.ts +2 -2
- package/src/executors/run-android/schema.json +9 -5
- package/src/executors/run-ios/run-ios.impl.js +47 -31
- package/src/executors/run-ios/run-ios.impl.ts +42 -56
- package/src/executors/run-ios/schema.d.ts +1 -1
- package/src/executors/run-ios/schema.json +7 -6
- package/src/executors/start/start.impl.d.ts +4 -2
- package/src/executors/start/start.impl.js +35 -24
- package/src/executors/start/start.impl.ts +42 -35
- package/src/executors/storybook/schema.d.ts +1 -1
- package/src/generators/application/application.js +1 -3
- package/src/generators/application/files/app/Gemfile.template +2 -2
- package/src/generators/application/files/app/android/app/build.gradle.template +2 -49
- package/src/generators/application/files/app/android/app/src/main/java/com/__lowerCaseName__/MainActivity.java.template +1 -4
- package/src/generators/application/files/app/android/app/src/main/res/drawable/rn_edit_text_material.xml +1 -1
- package/src/generators/application/files/app/android/build.gradle.template +1 -1
- package/src/generators/application/files/app/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/src/generators/application/files/app/android/gradle/wrapper/gradle-wrapper.properties +2 -1
- package/src/generators/application/files/app/android/gradle.properties +1 -1
- package/src/generators/application/files/app/android/gradlew.bat +9 -6
- package/src/generators/application/files/app/android/gradlew.template +14 -4
- package/src/generators/application/files/app/android/settings.gradle.template +1 -2
- package/src/generators/application/files/app/ios/Podfile.template +8 -6
- package/src/generators/application/files/app/ios/__className__/AppDelegate.mm.template +0 -10
- package/src/generators/application/files/app/ios/__className__.xcodeproj/project.pbxproj.template +6 -2
- package/src/generators/application/files/app/metro.config.js.template +32 -35
- package/src/generators/application/files/app/package.json.template +1 -0
- package/src/generators/application/lib/add-project.js +7 -0
- package/src/generators/init/init.js +1 -2
- package/src/generators/library/library.js +1 -1
- package/src/migrations/update-16-6-0/add-depends-on.d.ts +6 -0
- package/src/migrations/update-16-6-0/add-depends-on.js +43 -0
- package/src/migrations/update-16-6-0/update-metro-config.d.ts +6 -0
- package/src/migrations/update-16-6-0/update-metro-config.js +71 -0
- package/src/utils/get-cli-options.js +4 -1
- package/src/utils/pod-install-task.d.ts +10 -2
- package/src/utils/pod-install-task.js +12 -4
- package/src/utils/versions.d.ts +10 -9
- package/src/utils/versions.js +11 -10
- package/src/generators/application/files/app/.ruby-version +0 -1
- /package/src/generators/library/files/lib/{package.json__tmpl__ → package.json.template} +0 -0
- /package/src/generators/library/files/lib/src/{index.ts__tmpl__ → index.ts.template} +0 -0
- /package/src/generators/library/files/lib/{tsconfig.json__tmpl__ → tsconfig.json.template} +0 -0
- /package/src/generators/library/files/lib/{tsconfig.lib.json__tmpl__ → tsconfig.lib.json.template} +0 -0
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
apply plugin: "com.android.application"
|
|
2
2
|
apply plugin: "com.facebook.react"
|
|
3
3
|
|
|
4
|
-
import com.android.build.OutputFile
|
|
5
|
-
|
|
6
4
|
/**
|
|
7
5
|
* This is the configuration block to customize your React Native Android app.
|
|
8
6
|
* By default you don't need to apply any configuration, just uncomment the lines you need.
|
|
@@ -13,8 +11,8 @@ react {
|
|
|
13
11
|
// root = file("../")
|
|
14
12
|
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
|
|
15
13
|
// reactNativeDir = file("../node_modules/react-native")
|
|
16
|
-
// The folder where the react-native Codegen package is. Default is ../node_modules
|
|
17
|
-
// codegenDir = file("../node_modules
|
|
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")
|
|
18
16
|
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
|
|
19
17
|
// cliFile = file("../node_modules/react-native/cli.js")
|
|
20
18
|
|
|
@@ -53,14 +51,6 @@ react {
|
|
|
53
51
|
entryFile = file("../../<%= entryFile %>")
|
|
54
52
|
}
|
|
55
53
|
|
|
56
|
-
/**
|
|
57
|
-
* Set this to true to create four separate APKs instead of one,
|
|
58
|
-
* one for each native architecture. This is useful if you don't
|
|
59
|
-
* use App Bundles (https://developer.android.com/guide/app-bundle/)
|
|
60
|
-
* and want to have separate APKs to upload to the Play Store.
|
|
61
|
-
*/
|
|
62
|
-
def enableSeparateBuildPerCPUArchitecture = false
|
|
63
|
-
|
|
64
54
|
/**
|
|
65
55
|
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
|
|
66
56
|
*/
|
|
@@ -79,16 +69,6 @@ def enableProguardInReleaseBuilds = false
|
|
|
79
69
|
*/
|
|
80
70
|
def jscFlavor = 'org.webkit:android-jsc:+'
|
|
81
71
|
|
|
82
|
-
/**
|
|
83
|
-
* Private function to get the list of Native Architectures you want to build.
|
|
84
|
-
* This reads the value from reactNativeArchitectures in your gradle.properties
|
|
85
|
-
* file and works together with the --active-arch-only flag of react-native run-android.
|
|
86
|
-
*/
|
|
87
|
-
def reactNativeArchitectures() {
|
|
88
|
-
def value = project.getProperties().get("reactNativeArchitectures")
|
|
89
|
-
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
|
|
90
|
-
}
|
|
91
|
-
|
|
92
72
|
android {
|
|
93
73
|
ndkVersion rootProject.ext.ndkVersion
|
|
94
74
|
|
|
@@ -106,15 +86,6 @@ android {
|
|
|
106
86
|
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
|
|
107
87
|
<% } %>
|
|
108
88
|
}
|
|
109
|
-
|
|
110
|
-
splits {
|
|
111
|
-
abi {
|
|
112
|
-
reset()
|
|
113
|
-
enable enableSeparateBuildPerCPUArchitecture
|
|
114
|
-
universalApk false // If true, also generate a universal APK
|
|
115
|
-
include (*reactNativeArchitectures())
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
89
|
signingConfigs {
|
|
119
90
|
debug {
|
|
120
91
|
storeFile file('debug.keystore')
|
|
@@ -138,22 +109,6 @@ android {
|
|
|
138
109
|
<% } %>
|
|
139
110
|
}
|
|
140
111
|
}
|
|
141
|
-
|
|
142
|
-
// applicationVariants are e.g. debug, release
|
|
143
|
-
applicationVariants.all { variant ->
|
|
144
|
-
variant.outputs.each { output ->
|
|
145
|
-
// For each separate APK per architecture, set a unique version code as described here:
|
|
146
|
-
// https://developer.android.com/studio/build/configure-apk-splits.html
|
|
147
|
-
// Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
|
|
148
|
-
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
|
|
149
|
-
def abi = output.getFilter(OutputFile.ABI)
|
|
150
|
-
if (abi != null) { // null for the universal-debug, universal-release variants
|
|
151
|
-
output.versionCodeOverride =
|
|
152
|
-
defaultConfig.versionCode * 1000 + versionCodes.get(abi)
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
112
|
}
|
|
158
113
|
|
|
159
114
|
dependencies {
|
|
@@ -164,8 +119,6 @@ dependencies {
|
|
|
164
119
|
// The version of react-native is set by the React Native Gradle Plugin
|
|
165
120
|
implementation("com.facebook.react:react-android")
|
|
166
121
|
|
|
167
|
-
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")
|
|
168
|
-
|
|
169
122
|
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
|
|
170
123
|
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
|
|
171
124
|
exclude group:'com.squareup.okhttp3', module:'okhttp'
|
|
@@ -27,9 +27,6 @@ public class MainActivity extends ReactActivity {
|
|
|
27
27
|
this,
|
|
28
28
|
getMainComponentName(),
|
|
29
29
|
// If you opted-in for the New Architecture, we enable the Fabric Renderer.
|
|
30
|
-
DefaultNewArchitectureEntryPoint.getFabricEnabled()
|
|
31
|
-
// If you opted-in for the New Architecture, we enable Concurrent React (i.e. React 18).
|
|
32
|
-
DefaultNewArchitectureEntryPoint.getConcurrentReactEnabled() // concurrentRootEnabled
|
|
33
|
-
);
|
|
30
|
+
DefaultNewArchitectureEntryPoint.getFabricEnabled());
|
|
34
31
|
}
|
|
35
32
|
}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
android:insetBottom="@dimen/abc_edit_text_inset_bottom_material">
|
|
21
21
|
|
|
22
22
|
<selector>
|
|
23
|
-
<!--
|
|
23
|
+
<!--
|
|
24
24
|
This file is a copy of abc_edit_text_material (https://bit.ly/3k8fX7I).
|
|
25
25
|
The item below with state_pressed="false" and state_focused="false" causes a NullPointerException.
|
|
26
26
|
NullPointerException:tempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable(android.content.res.Resources)'
|
|
@@ -16,7 +16,7 @@ buildscript {
|
|
|
16
16
|
mavenCentral()
|
|
17
17
|
}
|
|
18
18
|
dependencies {
|
|
19
|
-
classpath("com.android.tools.build:gradle
|
|
19
|
+
classpath("com.android.tools.build:gradle")
|
|
20
20
|
classpath("com.facebook.react:react-native-gradle-plugin")
|
|
21
21
|
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
|
|
22
22
|
}
|
|
Binary file
|
package/src/generators/application/files/app/android/gradle/wrapper/gradle-wrapper.properties
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
distributionBase=GRADLE_USER_HOME
|
|
2
2
|
distributionPath=wrapper/dists
|
|
3
|
-
distributionUrl=https\://services.gradle.org/distributions/gradle-
|
|
3
|
+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-all.zip
|
|
4
|
+
networkTimeout=10000
|
|
4
5
|
zipStoreBase=GRADLE_USER_HOME
|
|
5
6
|
zipStorePath=wrapper/dists
|
|
@@ -25,7 +25,7 @@ android.useAndroidX=true
|
|
|
25
25
|
android.enableJetifier=true
|
|
26
26
|
|
|
27
27
|
# Version of flipper SDK to use with React Native
|
|
28
|
-
FLIPPER_VERSION=0.
|
|
28
|
+
FLIPPER_VERSION=0.182.0
|
|
29
29
|
|
|
30
30
|
# Use this property to specify which architecture you want to build.
|
|
31
31
|
# You can also override it from the CLI using
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
@rem limitations under the License.
|
|
15
15
|
@rem
|
|
16
16
|
|
|
17
|
-
@if "%DEBUG%"
|
|
17
|
+
@if "%DEBUG%"=="" @echo off
|
|
18
18
|
@rem ##########################################################################
|
|
19
19
|
@rem
|
|
20
20
|
@rem Gradle startup script for Windows
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
if "%OS%"=="Windows_NT" setlocal
|
|
26
26
|
|
|
27
27
|
set DIRNAME=%~dp0
|
|
28
|
-
if "%DIRNAME%"
|
|
28
|
+
if "%DIRNAME%"=="" set DIRNAME=.
|
|
29
|
+
@rem This is normally unused
|
|
29
30
|
set APP_BASE_NAME=%~n0
|
|
30
31
|
set APP_HOME=%DIRNAME%
|
|
31
32
|
|
|
@@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
|
|
|
40
41
|
|
|
41
42
|
set JAVA_EXE=java.exe
|
|
42
43
|
%JAVA_EXE% -version >NUL 2>&1
|
|
43
|
-
if
|
|
44
|
+
if %ERRORLEVEL% equ 0 goto execute
|
|
44
45
|
|
|
45
46
|
echo.
|
|
46
47
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
@@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
|
|
75
76
|
|
|
76
77
|
:end
|
|
77
78
|
@rem End local scope for the variables with windows NT shell
|
|
78
|
-
if
|
|
79
|
+
if %ERRORLEVEL% equ 0 goto mainEnd
|
|
79
80
|
|
|
80
81
|
:fail
|
|
81
82
|
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
|
82
83
|
rem the _cmd.exe /c_ return code!
|
|
83
|
-
|
|
84
|
-
|
|
84
|
+
set EXIT_CODE=%ERRORLEVEL%
|
|
85
|
+
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
|
86
|
+
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
|
87
|
+
exit /b %EXIT_CODE%
|
|
85
88
|
|
|
86
89
|
:mainEnd
|
|
87
90
|
if "%OS%"=="Windows_NT" endlocal
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
# Darwin, MinGW, and NonStop.
|
|
56
56
|
#
|
|
57
57
|
# (3) This script is generated from the Groovy template
|
|
58
|
-
# https://github.com/gradle/gradle/blob/
|
|
58
|
+
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
|
59
59
|
# within the Gradle project.
|
|
60
60
|
#
|
|
61
61
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
|
@@ -80,10 +80,10 @@ do
|
|
|
80
80
|
esac
|
|
81
81
|
done
|
|
82
82
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
APP_NAME="Gradle"
|
|
83
|
+
# This is normally unused
|
|
84
|
+
# shellcheck disable=SC2034
|
|
86
85
|
APP_BASE_NAME=${0##*/}
|
|
86
|
+
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
|
87
87
|
|
|
88
88
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
89
89
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
|
@@ -143,12 +143,16 @@ fi
|
|
|
143
143
|
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
|
144
144
|
case $MAX_FD in #(
|
|
145
145
|
max*)
|
|
146
|
+
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
|
147
|
+
# shellcheck disable=SC3045
|
|
146
148
|
MAX_FD=$( ulimit -H -n ) ||
|
|
147
149
|
warn "Could not query maximum file descriptor limit"
|
|
148
150
|
esac
|
|
149
151
|
case $MAX_FD in #(
|
|
150
152
|
'' | soft) :;; #(
|
|
151
153
|
*)
|
|
154
|
+
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
|
155
|
+
# shellcheck disable=SC3045
|
|
152
156
|
ulimit -n "$MAX_FD" ||
|
|
153
157
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
|
154
158
|
esac
|
|
@@ -205,6 +209,12 @@ set -- \
|
|
|
205
209
|
org.gradle.wrapper.GradleWrapperMain \
|
|
206
210
|
"$@"
|
|
207
211
|
|
|
212
|
+
# Stop when "xargs" is not available.
|
|
213
|
+
if ! command -v xargs >/dev/null 2>&1
|
|
214
|
+
then
|
|
215
|
+
die "xargs is not available"
|
|
216
|
+
fi
|
|
217
|
+
|
|
208
218
|
# Use "xargs" to parse quoted args.
|
|
209
219
|
#
|
|
210
220
|
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
rootProject.name = '<%= className %>'
|
|
2
|
-
|
|
3
2
|
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
|
|
4
3
|
include ':app'
|
|
5
|
-
includeBuild('../node_modules
|
|
4
|
+
includeBuild('../node_modules/@react-native/gradle-plugin')
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
# Resolve react_native_pods.rb with node to allow for hoisting
|
|
2
|
+
require Pod::Executable.execute_command('node', ['-p',
|
|
3
|
+
'require.resolve(
|
|
4
|
+
"react-native/scripts/react_native_pods.rb",
|
|
5
|
+
{paths: [process.argv[1]]},
|
|
6
|
+
)', __dir__]).strip
|
|
3
7
|
|
|
4
8
|
platform :ios, min_ios_version_supported
|
|
5
9
|
prepare_react_native_project!
|
|
@@ -30,8 +34,6 @@ target '<%= className %>' do
|
|
|
30
34
|
use_react_native!(
|
|
31
35
|
:path => config[:reactNativePath],
|
|
32
36
|
# Hermes is now enabled by default. Disable by setting this flag to false.
|
|
33
|
-
# Upcoming versions of React Native may rely on get_default_flags(), but
|
|
34
|
-
# we make it explicit here to aid in the React Native upgrade process.
|
|
35
37
|
:hermes_enabled => flags[:hermes_enabled],
|
|
36
38
|
:fabric_enabled => flags[:fabric_enabled],
|
|
37
39
|
# Enables Flipper.
|
|
@@ -49,10 +51,10 @@ target '<%= className %>' do
|
|
|
49
51
|
end
|
|
50
52
|
|
|
51
53
|
post_install do |installer|
|
|
54
|
+
# https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
|
|
52
55
|
react_native_post_install(
|
|
53
56
|
installer,
|
|
54
|
-
|
|
55
|
-
# necessary for Mac Catalyst builds
|
|
57
|
+
config[:reactNativePath],
|
|
56
58
|
:mac_catalyst_enabled => false
|
|
57
59
|
)
|
|
58
60
|
__apply_Xcode_12_5_M1_post_install_workaround(installer)
|
|
@@ -23,14 +23,4 @@
|
|
|
23
23
|
#endif
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
/// This method controls whether the `concurrentRoot`feature of React18 is turned on or off.
|
|
27
|
-
///
|
|
28
|
-
/// @see: https://reactjs.org/blog/2022/03/29/react-v18.html
|
|
29
|
-
/// @note: This requires to be rendering on Fabric (i.e. on the New Architecture).
|
|
30
|
-
/// @return: `true` if the `concurrentRoot` feature is enabled. Otherwise, it returns `false`.
|
|
31
|
-
- (BOOL)concurrentRootEnabled
|
|
32
|
-
{
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
26
|
@end
|
package/src/generators/application/files/app/ios/__className__.xcodeproj/project.pbxproj.template
CHANGED
|
@@ -564,7 +564,7 @@
|
|
|
564
564
|
COPY_PHASE_STRIP = NO;
|
|
565
565
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
566
566
|
ENABLE_TESTABILITY = YES;
|
|
567
|
-
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" =
|
|
567
|
+
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
|
|
568
568
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
569
569
|
GCC_DYNAMIC_NO_PIC = NO;
|
|
570
570
|
GCC_NO_COMMON_BLOCKS = YES;
|
|
@@ -592,12 +592,14 @@
|
|
|
592
592
|
);
|
|
593
593
|
MTL_ENABLE_DEBUG_INFO = YES;
|
|
594
594
|
ONLY_ACTIVE_ARCH = YES;
|
|
595
|
+
OTHER_CFLAGS = "$(inherited)";
|
|
595
596
|
OTHER_CPLUSPLUSFLAGS = (
|
|
596
597
|
"$(OTHER_CFLAGS)",
|
|
597
598
|
"-DFOLLY_NO_CONFIG",
|
|
598
599
|
"-DFOLLY_MOBILE=1",
|
|
599
600
|
"-DFOLLY_USE_LIBCPP=1",
|
|
600
601
|
);
|
|
602
|
+
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
|
|
601
603
|
SDKROOT = iphoneos;
|
|
602
604
|
};
|
|
603
605
|
name = Debug;
|
|
@@ -635,7 +637,7 @@
|
|
|
635
637
|
COPY_PHASE_STRIP = YES;
|
|
636
638
|
ENABLE_NS_ASSERTIONS = NO;
|
|
637
639
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
638
|
-
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" =
|
|
640
|
+
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
|
|
639
641
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
640
642
|
GCC_NO_COMMON_BLOCKS = YES;
|
|
641
643
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
|
@@ -655,12 +657,14 @@
|
|
|
655
657
|
"\"$(inherited)\"",
|
|
656
658
|
);
|
|
657
659
|
MTL_ENABLE_DEBUG_INFO = NO;
|
|
660
|
+
OTHER_CFLAGS = "$(inherited)";
|
|
658
661
|
OTHER_CPLUSPLUSFLAGS = (
|
|
659
662
|
"$(OTHER_CFLAGS)",
|
|
660
663
|
"-DFOLLY_NO_CONFIG",
|
|
661
664
|
"-DFOLLY_MOBILE=1",
|
|
662
665
|
"-DFOLLY_USE_LIBCPP=1",
|
|
663
666
|
);
|
|
667
|
+
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
|
|
664
668
|
SDKROOT = iphoneos;
|
|
665
669
|
VALIDATE_PRODUCT = YES;
|
|
666
670
|
};
|
|
@@ -1,38 +1,35 @@
|
|
|
1
1
|
const { withNxMetro } = require('@nx/react-native');
|
|
2
|
-
const { getDefaultConfig } = require('metro-config');
|
|
2
|
+
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
|
|
3
3
|
const exclusionList = require('metro-config/src/defaults/exclusionList');
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
);
|
|
38
|
-
})();
|
|
5
|
+
const defaultConfig = getDefaultConfig(__dirname);
|
|
6
|
+
const { assetExts, sourceExts } = defaultConfig.resolver;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Metro configuration
|
|
10
|
+
* https://facebook.github.io/metro/docs/configuration
|
|
11
|
+
*
|
|
12
|
+
* @type {import('metro-config').MetroConfig}
|
|
13
|
+
*/
|
|
14
|
+
const customConfig = {
|
|
15
|
+
transformer: {
|
|
16
|
+
babelTransformerPath: require.resolve('react-native-svg-transformer'),
|
|
17
|
+
},
|
|
18
|
+
resolver: {
|
|
19
|
+
assetExts: assetExts.filter((ext) => ext !== 'svg'),
|
|
20
|
+
sourceExts: [...sourceExts, 'svg'],
|
|
21
|
+
blockList: exclusionList([/^(?!.*node_modules).*\/dist\/.*/]),
|
|
22
|
+
unstable_enableSymlinks: true,
|
|
23
|
+
unstable_enablePackageExports: true,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
module.exports = withNxMetro(mergeConfig(defaultConfig, customConfig), {
|
|
28
|
+
// Change this to true to see debugging info.
|
|
29
|
+
// Useful if you have issues resolving modules
|
|
30
|
+
debug: false,
|
|
31
|
+
// all the file extensions used for imports other than 'ts', 'tsx', 'js', 'jsx', 'json'
|
|
32
|
+
extensions: [],
|
|
33
|
+
// Specify folders to watch, in addition to Nx defaults (workspace libraries and node_modules)
|
|
34
|
+
watchFolders: [],
|
|
35
|
+
});
|
|
@@ -17,6 +17,7 @@ function getTargets(options) {
|
|
|
17
17
|
const architect = {};
|
|
18
18
|
architect.start = {
|
|
19
19
|
executor: '@nx/react-native:start',
|
|
20
|
+
dependsOn: ['ensure-symlink', 'sync-deps', 'pod-install'],
|
|
20
21
|
options: {
|
|
21
22
|
port: 8081,
|
|
22
23
|
},
|
|
@@ -29,10 +30,12 @@ function getTargets(options) {
|
|
|
29
30
|
};
|
|
30
31
|
architect['run-ios'] = {
|
|
31
32
|
executor: '@nx/react-native:run-ios',
|
|
33
|
+
dependsOn: ['ensure-symlink', 'sync-deps', 'pod-install'],
|
|
32
34
|
options: {},
|
|
33
35
|
};
|
|
34
36
|
architect['bundle-ios'] = {
|
|
35
37
|
executor: '@nx/react-native:bundle',
|
|
38
|
+
dependsOn: ['ensure-symlink'],
|
|
36
39
|
outputs: ['{options.bundleOutput}'],
|
|
37
40
|
options: {
|
|
38
41
|
entryFile: options.entryFile,
|
|
@@ -42,6 +45,7 @@ function getTargets(options) {
|
|
|
42
45
|
};
|
|
43
46
|
architect['run-android'] = {
|
|
44
47
|
executor: '@nx/react-native:run-android',
|
|
48
|
+
dependsOn: ['ensure-symlink', 'sync-deps'],
|
|
45
49
|
options: {},
|
|
46
50
|
};
|
|
47
51
|
architect['build-android'] = {
|
|
@@ -50,11 +54,13 @@ function getTargets(options) {
|
|
|
50
54
|
`{projectRoot}/android/app/build/outputs/bundle`,
|
|
51
55
|
`{projectRoot}/android/app/build/outputs/apk`,
|
|
52
56
|
],
|
|
57
|
+
dependsOn: ['ensure-symlink', 'sync-deps'],
|
|
53
58
|
options: {},
|
|
54
59
|
};
|
|
55
60
|
architect['build-ios'] = {
|
|
56
61
|
executor: '@nx/react-native:build-ios',
|
|
57
62
|
outputs: ['{projectRoot}/ios/build/Build'],
|
|
63
|
+
dependsOn: ['ensure-symlink', 'sync-deps', 'pod-install'],
|
|
58
64
|
options: {},
|
|
59
65
|
};
|
|
60
66
|
architect['pod-install'] = {
|
|
@@ -63,6 +69,7 @@ function getTargets(options) {
|
|
|
63
69
|
};
|
|
64
70
|
architect['bundle-android'] = {
|
|
65
71
|
executor: '@nx/react-native:bundle',
|
|
72
|
+
dependsOn: ['ensure-symlink'],
|
|
66
73
|
outputs: ['{options.bundleOutput}'],
|
|
67
74
|
options: {
|
|
68
75
|
entryFile: options.entryFile,
|
|
@@ -40,9 +40,8 @@ function updateDependencies(host) {
|
|
|
40
40
|
react: versions_2.reactVersion,
|
|
41
41
|
'react-dom': versions_2.reactDomVersion,
|
|
42
42
|
'react-native': versions_2.reactNativeVersion,
|
|
43
|
-
}, Object.assign({ '@nx/react-native': versions_2.nxVersion, '@types/node': versions_2.typesNodeVersion, '@types/react': versions_2.typesReactVersion, '@types/react-native': versions_2.typesReactNativeVersion, '@react-native-community/cli': versions_2.reactNativeCommunityCli, '@react-native-community/cli-platform-android': versions_2.reactNativeCommunityCliAndroid, '@react-native-community/cli-platform-ios': versions_2.reactNativeCommunityCliIos, '@testing-library/react-native': versions_2.testingLibraryReactNativeVersion, '@testing-library/jest-native': versions_2.testingLibraryJestNativeVersion, 'jest-react-native': versions_2.jestReactNativeVersion, metro: versions_2.metroVersion, 'metro-resolver': versions_2.metroVersion, 'metro-babel-register': versions_2.metroVersion, 'metro-react-native-babel-preset': versions_2.metroVersion, 'metro-react-native-babel-transformer': versions_2.metroVersion, 'react-test-renderer': versions_2.reactTestRendererVersion, 'react-native-svg-transformer': versions_2.reactNativeSvgTransformerVersion, 'react-native-svg': versions_2.reactNativeSvgVersion, '@babel/preset-react': versions_1.babelPresetReactVersion }, (isPnpm
|
|
43
|
+
}, Object.assign({ '@nx/react-native': versions_2.nxVersion, '@types/node': versions_2.typesNodeVersion, '@types/react': versions_2.typesReactVersion, '@types/react-native': versions_2.typesReactNativeVersion, '@react-native/metro-config': versions_2.reactNativeMetroConfigVersion, '@react-native-community/cli': versions_2.reactNativeCommunityCli, '@react-native-community/cli-platform-android': versions_2.reactNativeCommunityCliAndroid, '@react-native-community/cli-platform-ios': versions_2.reactNativeCommunityCliIos, '@testing-library/react-native': versions_2.testingLibraryReactNativeVersion, '@testing-library/jest-native': versions_2.testingLibraryJestNativeVersion, 'jest-react-native': versions_2.jestReactNativeVersion, metro: versions_2.metroVersion, 'metro-config': versions_2.metroVersion, 'metro-resolver': versions_2.metroVersion, 'metro-babel-register': versions_2.metroVersion, 'metro-react-native-babel-preset': versions_2.metroVersion, 'metro-react-native-babel-transformer': versions_2.metroVersion, 'react-test-renderer': versions_2.reactTestRendererVersion, 'react-native-svg-transformer': versions_2.reactNativeSvgTransformerVersion, 'react-native-svg': versions_2.reactNativeSvgVersion, '@babel/preset-react': versions_1.babelPresetReactVersion }, (isPnpm
|
|
44
44
|
? {
|
|
45
|
-
'metro-config': versions_2.metroVersion,
|
|
46
45
|
'@babel/runtime': versions_2.babelRuntimeVersion, // @babel/runtime is used by react-native-svg
|
|
47
46
|
}
|
|
48
47
|
: {})));
|
|
@@ -97,7 +97,7 @@ function updateTsConfig(tree, options) {
|
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
99
|
function createFiles(host, options) {
|
|
100
|
-
(0, devkit_1.generateFiles)(host, (0, devkit_1.joinPathFragments)(__dirname, './files/lib'), options.projectRoot, Object.assign(Object.assign(Object.assign({}, options), (0, devkit_1.names)(options.name)), {
|
|
100
|
+
(0, devkit_1.generateFiles)(host, (0, devkit_1.joinPathFragments)(__dirname, './files/lib'), options.projectRoot, Object.assign(Object.assign(Object.assign({}, options), (0, devkit_1.names)(options.name)), { offsetFromRoot: (0, devkit_1.offsetFromRoot)(options.projectRoot), rootTsConfigPath: (0, js_1.getRelativePathToRootTsConfig)(host, options.projectRoot) }));
|
|
101
101
|
if (!options.publishable && !options.buildable) {
|
|
102
102
|
host.delete(`${options.projectRoot}/package.json`);
|
|
103
103
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
/**
|
|
6
|
+
* This migration adds dependsOn to project.json.
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
function update(tree) {
|
|
10
|
+
var _a, _b;
|
|
11
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
12
|
+
const projects = (0, devkit_1.getProjects)(tree);
|
|
13
|
+
for (const [name, config] of projects.entries()) {
|
|
14
|
+
if (((_b = (_a = config.targets) === null || _a === void 0 ? void 0 : _a['start']) === null || _b === void 0 ? void 0 : _b.executor) === '@nx/react-native:start') {
|
|
15
|
+
config.targets['start'].dependsOn = [
|
|
16
|
+
'ensure-symlink',
|
|
17
|
+
'sync-deps',
|
|
18
|
+
'pod-install',
|
|
19
|
+
];
|
|
20
|
+
config.targets['run-ios'].dependsOn = [
|
|
21
|
+
'ensure-symlink',
|
|
22
|
+
'sync-deps',
|
|
23
|
+
'pod-install',
|
|
24
|
+
];
|
|
25
|
+
config.targets['bundle-ios'].dependsOn = ['ensure-symlink'];
|
|
26
|
+
config.targets['run-android'].dependsOn = ['ensure-symlink', 'sync-deps'];
|
|
27
|
+
config.targets['build-android'].dependsOn = [
|
|
28
|
+
'ensure-symlink',
|
|
29
|
+
'sync-deps',
|
|
30
|
+
];
|
|
31
|
+
config.targets['build-ios'].dependsOn = [
|
|
32
|
+
'ensure-symlink',
|
|
33
|
+
'sync-deps',
|
|
34
|
+
'pod-install',
|
|
35
|
+
];
|
|
36
|
+
config.targets['pod-install'].dependsOn = ['ensure-symlink', 'sync-deps'];
|
|
37
|
+
config.targets['bundle-android'].dependsOn = ['ensure-symlink'];
|
|
38
|
+
(0, devkit_1.updateProjectConfiguration)(tree, name, config);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
exports.default = update;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
/**
|
|
7
|
+
* This migration updates metro.config.js to export config as a default.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
function update(tree) {
|
|
11
|
+
var _a, _b;
|
|
12
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
13
|
+
const projects = (0, devkit_1.getProjects)(tree);
|
|
14
|
+
for (const [_, config] of projects.entries()) {
|
|
15
|
+
if (((_b = (_a = config.targets) === null || _a === void 0 ? void 0 : _a['start']) === null || _b === void 0 ? void 0 : _b.executor) === '@nx/react-native:start') {
|
|
16
|
+
if (tree.exists((0, path_1.join)(config.root, 'metro.config.js'))) {
|
|
17
|
+
const oldConfig = tree
|
|
18
|
+
.read((0, path_1.join)(config.root, 'metro.config.js'))
|
|
19
|
+
.toString();
|
|
20
|
+
tree.write((0, path_1.join)(config.root, 'metro-v71.config.js'), oldConfigComment + oldConfig);
|
|
21
|
+
tree.write((0, path_1.join)(config.root, 'metro.config.js'), content);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
exports.default = update;
|
|
28
|
+
const oldConfigComment = `/**
|
|
29
|
+
* Old custom configuration for React Native v0.71.
|
|
30
|
+
* From @react-native/metro-config 0.72.1, it is no longer necessary to use a config function to access the complete default config.
|
|
31
|
+
* Please port your custom configuration to metro.config.js.
|
|
32
|
+
* Please see https://reactnative.dev/docs/metro to learn about configuration.
|
|
33
|
+
*/
|
|
34
|
+
`;
|
|
35
|
+
const content = `
|
|
36
|
+
const { withNxMetro } = require('@nx/react-native');
|
|
37
|
+
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
|
|
38
|
+
const exclusionList = require('metro-config/src/defaults/exclusionList');
|
|
39
|
+
|
|
40
|
+
const defaultConfig = getDefaultConfig(__dirname);
|
|
41
|
+
const { assetExts, sourceExts } = defaultConfig.resolver;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Metro configuration
|
|
45
|
+
* https://facebook.github.io/metro/docs/configuration
|
|
46
|
+
*
|
|
47
|
+
* @type {import('metro-config').MetroConfig}
|
|
48
|
+
*/
|
|
49
|
+
const customConfig = {
|
|
50
|
+
transformer: {
|
|
51
|
+
babelTransformerPath: require.resolve('react-native-svg-transformer'),
|
|
52
|
+
},
|
|
53
|
+
resolver: {
|
|
54
|
+
assetExts: assetExts.filter((ext) => ext !== 'svg'),
|
|
55
|
+
sourceExts: [...sourceExts, 'svg'],
|
|
56
|
+
blockList: exclusionList([/^(?!.*node_modules).*\/dist\/.*/]),
|
|
57
|
+
unstable_enableSymlinks: true,
|
|
58
|
+
unstable_enablePackageExports: true,
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
module.exports = withNxMetro(mergeConfig(defaultConfig, customConfig), {
|
|
63
|
+
// Change this to true to see debugging info.
|
|
64
|
+
// Useful if you have issues resolving modules
|
|
65
|
+
debug: false,
|
|
66
|
+
// all the file extensions used for imports other than 'ts', 'tsx', 'js', 'jsx', 'json'
|
|
67
|
+
extensions: [],
|
|
68
|
+
// Specify folders to watch, in addition to Nx defaults (workspace libraries and node_modules)
|
|
69
|
+
watchFolders: [],
|
|
70
|
+
});
|
|
71
|
+
`;
|