nx-react-native-cli 1.1.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -21
- package/lib/index.cjs +49 -39
- package/package.json +1 -1
- package/templates/.husky/pre-commit +0 -3
- package/templates/.husky/pre-push +0 -3
- package/templates/.vscode/settings.json +2 -5
- package/templates/apps/mobile/.eslintrc.json +4 -1
- package/templates/apps/mobile/Gemfile +5 -0
- package/templates/apps/mobile/android/app/build.gradle +3 -3
- package/templates/apps/mobile/android/app/src/main/java/com/appsmobile/MainActivity.kt +28 -0
- package/templates/apps/mobile/android/app/src/main/java/com/appsmobile/MainApplication.kt +2 -1
- package/templates/apps/mobile/android/build.gradle +3 -3
- package/templates/apps/mobile/android/gradle/wrapper/gradle-wrapper.properties +2 -2
- package/templates/apps/mobile/android/gradlew +4 -2
- package/templates/apps/mobile/android/gradlew.bat +2 -0
- package/templates/apps/mobile/babel.config.json +23 -0
- package/templates/apps/mobile/fastlane/.env.template +7 -2
- package/templates/apps/mobile/fastlane/Fastfile +46 -5
- package/templates/apps/mobile/fastlane/Matchfile +3 -3
- package/templates/apps/mobile/ios/AppDelegate.mm +33 -0
- package/templates/apps/mobile/metro.config.js +42 -0
- package/templates/apps/mobile/package.json +2 -3
- package/templates/apps/mobile/project.json +2 -1
- package/templates/apps/mobile/src/app/index.tsx +22 -7
- package/templates/apps/mobile/src/components/atoms/BottomSheet/bottom-sheet.component.tsx +9 -4
- package/templates/apps/mobile/src/components/atoms/Button/button.component.tsx +3 -3
- package/templates/apps/mobile/src/components/atoms/Divider/divider-component.tsx +3 -3
- package/templates/apps/mobile/src/components/atoms/ExcludedEdges/excluded-edges.component.tsx +2 -2
- package/templates/apps/mobile/src/components/atoms/InputLayout/input-layout.component.tsx +3 -3
- package/templates/apps/mobile/src/components/atoms/KeyboardAwareScrollView/keyboard-aware-scroll-view.component.tsx +11 -5
- package/templates/apps/mobile/src/components/atoms/ListLoadingItem/list-loading-item.component.tsx +4 -4
- package/templates/apps/mobile/src/components/atoms/Modal/modal.component.tsx +2 -2
- package/templates/apps/mobile/src/components/atoms/ScreenLoader/screen-loader.component.tsx +2 -2
- package/templates/apps/mobile/src/components/atoms/Skeleton/skeleton.component.tsx +7 -6
- package/templates/apps/mobile/src/components/atoms/TextInput/text-input.component.tsx +6 -4
- package/templates/apps/mobile/src/components/atoms/Typography/typography.component.tsx +2 -2
- package/templates/apps/mobile/src/components/molecules/BackButton/back-button.component.tsx +5 -5
- package/templates/apps/mobile/src/components/molecules/BottomActionsContainer/BottomActionsContainer.component.tsx +2 -2
- package/templates/apps/mobile/src/components/molecules/ScreenContainer/screen-container.component.tsx +11 -12
- package/templates/apps/mobile/src/components/molecules/ScreenHeader/screen-header.component.tsx +5 -5
- package/templates/apps/mobile/src/components/molecules/StorageManager/StorageManager.component.tsx +3 -1
- package/templates/apps/mobile/src/hooks/useGetLayoutHeight.hook.tsx +1 -1
- package/templates/apps/mobile/src/hooks/useGetLayoutWidth.hook.tsx +1 -1
- package/templates/apps/mobile/src/hooks/useNavigation.hook.tsx +1 -1
- package/templates/apps/mobile/src/hooks/useTextInputChangeFocus.hook.tsx +2 -2
- package/templates/apps/mobile/src/hooks/useToggleDarkMode.hook.tsx +1 -1
- package/templates/apps/mobile/src/main.tsx +1 -1
- package/templates/apps/mobile/src/routes/index.tsx +7 -7
- package/templates/apps/mobile/src/routes/privateRoutes.tsx +3 -4
- package/templates/apps/mobile/src/routes/publicRoutes.tsx +3 -4
- package/templates/apps/mobile/src/screens/HomeScreen/home.screen.tsx +3 -2
- package/templates/apps/mobile/src/screens/LandingScreen/landing.screen.tsx +12 -7
- package/templates/apps/mobile/src/stores/local-storage.store.ts +1 -1
- package/templates/apps/mobile/src/stores/mmkvStorage.ts +1 -1
- package/templates/apps/mobile/tsconfig.app.json +5 -1
- package/templates/clean-generated-outputs.sh +1 -1
- package/templates/apps/mobile/.env +0 -3
package/package.json
CHANGED
|
@@ -9,10 +9,7 @@
|
|
|
9
9
|
"[typescriptreact]": {
|
|
10
10
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
11
11
|
},
|
|
12
|
-
"typescript.preferences.importModuleSpecifier": "
|
|
12
|
+
"typescript.preferences.importModuleSpecifier": "non-relative",
|
|
13
13
|
"tailwindCSS.classAttributes": ["className", "style"],
|
|
14
|
-
"tailwindCSS.experimental.classRegex": [
|
|
15
|
-
"tw`([^`]*)",
|
|
16
|
-
["tw.style\\(([^)]*)\\)", "'([^']*)'"]
|
|
17
|
-
]
|
|
14
|
+
"tailwindCSS.experimental.classRegex": ["tw`([^`]*)", ["tw.style\\(([^)]*)\\)", "'([^']*)'"]]
|
|
18
15
|
}
|
|
@@ -2,8 +2,13 @@ source 'https://rubygems.org'
|
|
|
2
2
|
|
|
3
3
|
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
|
|
4
4
|
ruby ">= 2.6.10"
|
|
5
|
+
gem "fastlane", "= 2.221.1"
|
|
5
6
|
|
|
6
7
|
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
|
|
7
8
|
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
|
|
8
9
|
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
|
|
9
10
|
gem 'xcodeproj', '< 1.26.0'
|
|
11
|
+
gem 'concurrent-ruby', '< 1.3.4'
|
|
12
|
+
|
|
13
|
+
plugins_path = File.join(File.dirname(__FILE__), './fastlane', 'Pluginfile')
|
|
14
|
+
eval_gemfile(plugins_path) if File.exist?(plugins_path)
|
|
@@ -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 =
|
|
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 = '
|
|
73
|
+
def jscFlavor = 'io.github.react-native-community:jsc-android:2026004.+'
|
|
74
74
|
|
|
75
75
|
android {
|
|
76
76
|
ndkVersion rootProject.ext.ndkVersion
|
|
@@ -156,4 +156,4 @@ dependencies {
|
|
|
156
156
|
} else {
|
|
157
157
|
implementation jscFlavor
|
|
158
158
|
}
|
|
159
|
-
}
|
|
159
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
package com.appsmobile
|
|
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
|
+
import android.os.Bundle;
|
|
8
|
+
|
|
9
|
+
class MainActivity : ReactActivity() {
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Returns the name of the main component registered from JavaScript. This is used to schedule
|
|
13
|
+
* rendering of the component.
|
|
14
|
+
*/
|
|
15
|
+
override fun getMainComponentName(): String = "AppsMobile"
|
|
16
|
+
|
|
17
|
+
//react-native-screens override
|
|
18
|
+
override fun onCreate(savedInstanceState: Bundle?) {
|
|
19
|
+
super.onCreate(null);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
|
|
24
|
+
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
|
|
25
|
+
*/
|
|
26
|
+
override fun createReactActivityDelegate(): ReactActivityDelegate =
|
|
27
|
+
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
|
|
28
|
+
}
|
|
@@ -9,6 +9,7 @@ import com.facebook.react.ReactPackage
|
|
|
9
9
|
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
|
|
10
10
|
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
|
|
11
11
|
import com.facebook.react.defaults.DefaultReactNativeHost
|
|
12
|
+
import com.facebook.react.soloader.OpenSourceMergedSoMapping
|
|
12
13
|
import com.facebook.soloader.SoLoader
|
|
13
14
|
|
|
14
15
|
class MainApplication : Application(), ReactApplication {
|
|
@@ -34,7 +35,7 @@ class MainApplication : Application(), ReactApplication {
|
|
|
34
35
|
|
|
35
36
|
override fun onCreate() {
|
|
36
37
|
super.onCreate()
|
|
37
|
-
SoLoader.init(this,
|
|
38
|
+
SoLoader.init(this, OpenSourceMergedSoMapping)
|
|
38
39
|
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
|
|
39
40
|
// If you opted-in for the New Architecture, we load the native entry point for this app.
|
|
40
41
|
load()
|
|
@@ -3,9 +3,9 @@ buildscript {
|
|
|
3
3
|
buildToolsVersion = "35.0.0"
|
|
4
4
|
minSdkVersion = 24
|
|
5
5
|
compileSdkVersion = 35
|
|
6
|
-
targetSdkVersion =
|
|
7
|
-
ndkVersion = "
|
|
8
|
-
kotlinVersion = "
|
|
6
|
+
targetSdkVersion = 35
|
|
7
|
+
ndkVersion = "27.1.12297006"
|
|
8
|
+
kotlinVersion = "2.0.21"
|
|
9
9
|
}
|
|
10
10
|
repositories {
|
|
11
11
|
google()
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
distributionBase=GRADLE_USER_HOME
|
|
2
2
|
distributionPath=wrapper/dists
|
|
3
|
-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.
|
|
3
|
+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip
|
|
4
4
|
networkTimeout=10000
|
|
5
5
|
validateDistributionUrl=true
|
|
6
6
|
zipStoreBase=GRADLE_USER_HOME
|
|
7
|
-
zipStorePath=wrapper/dists
|
|
7
|
+
zipStorePath=wrapper/dists
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
# See the License for the specific language governing permissions and
|
|
16
16
|
# limitations under the License.
|
|
17
17
|
#
|
|
18
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
19
|
+
#
|
|
18
20
|
|
|
19
21
|
##############################################################################
|
|
20
22
|
#
|
|
@@ -55,7 +57,7 @@
|
|
|
55
57
|
# Darwin, MinGW, and NonStop.
|
|
56
58
|
#
|
|
57
59
|
# (3) This script is generated from the Groovy template
|
|
58
|
-
# https://github.com/gradle/gradle/blob/HEAD/
|
|
60
|
+
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
|
59
61
|
# within the Gradle project.
|
|
60
62
|
#
|
|
61
63
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
|
@@ -84,7 +86,7 @@ done
|
|
|
84
86
|
# shellcheck disable=SC2034
|
|
85
87
|
APP_BASE_NAME=${0##*/}
|
|
86
88
|
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
|
87
|
-
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null &&
|
|
89
|
+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
|
88
90
|
|
|
89
91
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
|
90
92
|
MAX_FD=maximum
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
@rem See the License for the specific language governing permissions and
|
|
14
14
|
@rem limitations under the License.
|
|
15
15
|
@rem
|
|
16
|
+
@rem SPDX-License-Identifier: Apache-2.0
|
|
17
|
+
@rem
|
|
16
18
|
|
|
17
19
|
@if "%DEBUG%"=="" @echo off
|
|
18
20
|
@rem ##########################################################################
|
|
@@ -10,6 +10,29 @@
|
|
|
10
10
|
"path": ".env"
|
|
11
11
|
}
|
|
12
12
|
],
|
|
13
|
+
[
|
|
14
|
+
"module-resolver",
|
|
15
|
+
{
|
|
16
|
+
"root": ["."],
|
|
17
|
+
"extensions": [
|
|
18
|
+
".ios.js",
|
|
19
|
+
".android.js",
|
|
20
|
+
".js",
|
|
21
|
+
".ts",
|
|
22
|
+
".tsx",
|
|
23
|
+
".json",
|
|
24
|
+
".png",
|
|
25
|
+
".jpg",
|
|
26
|
+
".jpeg",
|
|
27
|
+
".gif",
|
|
28
|
+
".svg",
|
|
29
|
+
".webp"
|
|
30
|
+
],
|
|
31
|
+
"alias": {
|
|
32
|
+
"@": "./src"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
],
|
|
13
36
|
"react-native-reanimated/plugin"
|
|
14
37
|
]
|
|
15
38
|
}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
# Fastlane ENV
|
|
2
2
|
IS_CI=false
|
|
3
3
|
|
|
4
|
+
# Match
|
|
5
|
+
GIT_URL=
|
|
6
|
+
GIT_BRANCH=
|
|
7
|
+
GIT_API_TOKEN=
|
|
8
|
+
|
|
4
9
|
# Firebase
|
|
10
|
+
FIREBASE_SERVICE_ACCOUNT=
|
|
5
11
|
FASTLANE_FIREBASE_APP_ID=
|
|
6
12
|
FASTLANE_FIREBASE_GROUP_TESTERS=
|
|
7
13
|
|
|
8
14
|
# AppStore
|
|
9
15
|
MATCH_PASSWORD=
|
|
10
|
-
GITHUB_API_TOKEN=
|
|
11
16
|
FASTLANE_APPSTORE_KEY_ID=
|
|
12
17
|
FASTLANE_APPSTORE_ISSUER_ID=
|
|
13
18
|
FASTLANE_APPSTORE_KEY_CONTENT=
|
|
@@ -18,7 +23,7 @@ FASTLANE_APPSTORE_EXTERNAL_DESTINATIONS=""
|
|
|
18
23
|
# MISC
|
|
19
24
|
FASTLANE_CHANGELOGS="Performance and Feature updates"
|
|
20
25
|
|
|
21
|
-
# Android (Production ONLY)
|
|
26
|
+
# Android (Production ONLY, Dev is already handled in build.gradle)
|
|
22
27
|
STORE_PASSWORD=
|
|
23
28
|
KEY_PASSWORD=
|
|
24
29
|
KEY_ALIAS=
|
|
@@ -1,7 +1,35 @@
|
|
|
1
1
|
|
|
2
2
|
require 'fileutils'
|
|
3
|
+
require 'base64'
|
|
4
|
+
require 'json'
|
|
3
5
|
|
|
4
6
|
def app_name = "AppsMobile"
|
|
7
|
+
def service_account_path = '/tmp/fbd-sa.json'
|
|
8
|
+
|
|
9
|
+
def decode_base64_to_json(encoded_string, output_path)
|
|
10
|
+
begin
|
|
11
|
+
# Decode the Base64 string
|
|
12
|
+
decoded_data = Base64.decode64(encoded_string)
|
|
13
|
+
|
|
14
|
+
# Parse JSON from the decoded data
|
|
15
|
+
json_data = JSON.parse(decoded_data)
|
|
16
|
+
|
|
17
|
+
# Write to the specified file
|
|
18
|
+
File.open(output_path, 'w') do |file|
|
|
19
|
+
file.write(JSON.pretty_generate(json_data))
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
puts "JSON file successfully written to: #{output_path}"
|
|
23
|
+
rescue JSON::ParserError
|
|
24
|
+
puts "Error: Decoded data is not valid JSON."
|
|
25
|
+
rescue StandardError => e
|
|
26
|
+
puts "Error: #{e.message}"
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def get_service_account_credentials()
|
|
31
|
+
decode_base64_to_json(ENV['FIREBASE_SERVICE_ACCOUNT'], service_account_path)
|
|
32
|
+
end
|
|
5
33
|
|
|
6
34
|
def delete_gradle_temp()
|
|
7
35
|
UI.message("Deleting Gradle Temp...")
|
|
@@ -136,6 +164,10 @@ def setup_android()
|
|
|
136
164
|
gradle_file_path: "./android/app/build.gradle",
|
|
137
165
|
version_code: build_number
|
|
138
166
|
)
|
|
167
|
+
|
|
168
|
+
# Retrieving Service Account Credentials
|
|
169
|
+
UI.message("Retrieving Service Account Credentials...")
|
|
170
|
+
get_service_account_credentials()
|
|
139
171
|
end
|
|
140
172
|
|
|
141
173
|
def ios_build_ipa(configuration, scheme)
|
|
@@ -216,7 +248,7 @@ end
|
|
|
216
248
|
def publish_bundle(flavor)
|
|
217
249
|
UI.message("Uploading aab build to Firebase...")
|
|
218
250
|
release = firebase_app_distribution(
|
|
219
|
-
service_credentials_file:
|
|
251
|
+
service_credentials_file: service_account_path,
|
|
220
252
|
app: ENV['FASTLANE_FIREBASE_APP_ID'],
|
|
221
253
|
android_artifact_type: "AAB",
|
|
222
254
|
android_artifact_path: "./android/app/build/outputs/bundle/#{flavor}Release/app-#{flavor}-release.aab",
|
|
@@ -228,7 +260,7 @@ end
|
|
|
228
260
|
def publish_apk(flavor)
|
|
229
261
|
UI.message("Uploading apk build to Firebase...")
|
|
230
262
|
release = firebase_app_distribution(
|
|
231
|
-
service_credentials_file:
|
|
263
|
+
service_credentials_file: service_account_path,
|
|
232
264
|
app: ENV['FASTLANE_FIREBASE_APP_ID'],
|
|
233
265
|
android_artifact_type: "APK",
|
|
234
266
|
android_artifact_path: "./android/app/build/outputs/apk/#{flavor}/release/app-#{flavor}-release.apk",
|
|
@@ -238,6 +270,11 @@ def publish_apk(flavor)
|
|
|
238
270
|
end
|
|
239
271
|
|
|
240
272
|
platform :android do
|
|
273
|
+
desc "Get Service Account Credentials"
|
|
274
|
+
lane :get_service_account_credentials do
|
|
275
|
+
get_service_account_credentials()
|
|
276
|
+
end
|
|
277
|
+
|
|
241
278
|
desc "Build Android (Dev Server)"
|
|
242
279
|
lane :dev do
|
|
243
280
|
begin
|
|
@@ -253,10 +290,14 @@ platform :android do
|
|
|
253
290
|
desc "Build Android (Production Server)"
|
|
254
291
|
lane :prod do
|
|
255
292
|
begin
|
|
256
|
-
flavor = '
|
|
293
|
+
flavor = 'prod'
|
|
257
294
|
setup_android()
|
|
258
|
-
|
|
259
|
-
|
|
295
|
+
# TODO: COMMENT IF FIREBASE PROD IS LINKED TO GOOGLE PLAY
|
|
296
|
+
android_build_apk(flavor)
|
|
297
|
+
publish_apk(flavor)
|
|
298
|
+
# TODO: UNCOMMENT IF FIREBASE PROD IS LINKED TO GOOGLE PLAY
|
|
299
|
+
# android_build_bundle(flavor)
|
|
300
|
+
# publish_bundle(flavor)
|
|
260
301
|
rescue => exception
|
|
261
302
|
UI.error(exception)
|
|
262
303
|
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#import "AppDelegate.h"
|
|
2
|
+
|
|
3
|
+
#import <React/RCTBundleURLProvider.h>
|
|
4
|
+
#import <ReactAppDependencyProvider/RCTAppDependencyProvider.h>
|
|
5
|
+
|
|
6
|
+
@implementation AppDelegate
|
|
7
|
+
|
|
8
|
+
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
|
9
|
+
{
|
|
10
|
+
self.moduleName = @"AppsMobile";
|
|
11
|
+
self.dependencyProvider = [RCTAppDependencyProvider new];
|
|
12
|
+
// You can add your custom initial props in the dictionary below.
|
|
13
|
+
// They will be passed down to the ViewController used by React Native.
|
|
14
|
+
self.initialProps = @{};
|
|
15
|
+
|
|
16
|
+
return [super application:application didFinishLaunchingWithOptions:launchOptions];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
|
|
20
|
+
{
|
|
21
|
+
return [self bundleURL];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
- (NSURL *)bundleURL
|
|
25
|
+
{
|
|
26
|
+
#if DEBUG
|
|
27
|
+
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"src/main"];
|
|
28
|
+
#else
|
|
29
|
+
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
|
|
30
|
+
#endif
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const { withNxMetro } = require('@nx/react-native');
|
|
3
|
+
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
|
|
4
|
+
|
|
5
|
+
const defaultConfig = getDefaultConfig(__dirname);
|
|
6
|
+
const { assetExts, sourceExts } = defaultConfig.resolver;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Metro configuration
|
|
10
|
+
* https://reactnative.dev/docs/metro
|
|
11
|
+
*
|
|
12
|
+
* @type {import('metro-config').MetroConfig}
|
|
13
|
+
*/
|
|
14
|
+
const customConfig = {
|
|
15
|
+
cacheVersion: 'mobile',
|
|
16
|
+
transformer: {
|
|
17
|
+
babelTransformerPath: require.resolve('react-native-svg-transformer'),
|
|
18
|
+
getTransformOptions: async () => ({
|
|
19
|
+
transform: {
|
|
20
|
+
experimentalImportSupport: false,
|
|
21
|
+
inlineRequires: true,
|
|
22
|
+
},
|
|
23
|
+
}),
|
|
24
|
+
},
|
|
25
|
+
resolver: {
|
|
26
|
+
extraNodeModules: {
|
|
27
|
+
'@': path.resolve(__dirname, 'src'),
|
|
28
|
+
},
|
|
29
|
+
assetExts: assetExts.filter((ext) => ext !== 'svg'),
|
|
30
|
+
sourceExts: [...sourceExts, 'cjs', 'mjs', 'svg'],
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
module.exports = withNxMetro(mergeConfig(defaultConfig, customConfig), {
|
|
35
|
+
// Change this to true to see debugging info.
|
|
36
|
+
// Useful if you have issues resolving modules
|
|
37
|
+
debug: false,
|
|
38
|
+
// all the file extensions used for imports other than 'ts', 'tsx', 'js', 'jsx', 'json'
|
|
39
|
+
extensions: [],
|
|
40
|
+
// Specify folders to watch, in addition to Nx defaults (workspace libraries and node_modules)
|
|
41
|
+
watchFolders: [],
|
|
42
|
+
});
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"pre-build": "npm run ensure-symlink && npm run sync-deps && npm run pod-install",
|
|
16
16
|
"list:ios-configurations": "cd ios && xcodebuild -list",
|
|
17
17
|
"list:ios-devices": "xcrun xctrace list devices",
|
|
18
|
-
"xcode": "open ios/AppsMobile.xcworkspace",
|
|
18
|
+
"xcode": "open -a Xcode ios/AppsMobile.xcworkspace",
|
|
19
19
|
"touch-xcode": "cd ios && touch .xcode.env",
|
|
20
20
|
"check-env:mobile": "cd ../.. && npm run check-env:mobile",
|
|
21
21
|
"setup-fastlane": "rbenv local && bundle install && bundle update",
|
|
@@ -26,7 +26,6 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@gorhom/bottom-sheet": "*",
|
|
28
28
|
"@hookform/resolvers": "*",
|
|
29
|
-
"@react-native-async-storage/async-storage": "*",
|
|
30
29
|
"@react-native-community/datetimepicker": "*",
|
|
31
30
|
"@react-native-community/hooks": "*",
|
|
32
31
|
"@react-native/metro-config": "*",
|
|
@@ -54,7 +53,6 @@
|
|
|
54
53
|
"metro-config": "*",
|
|
55
54
|
"react-hook-form": "*",
|
|
56
55
|
"react-native-dotenv": "*",
|
|
57
|
-
"react-native-fast-image": "*",
|
|
58
56
|
"react-native-gesture-handler": "*",
|
|
59
57
|
"react-native-get-random-values": "*",
|
|
60
58
|
"react-native-haptic-feedback": "*",
|
|
@@ -69,6 +67,7 @@
|
|
|
69
67
|
"react-native-simple-toast": "*",
|
|
70
68
|
"react-native-svg-transformer": "*",
|
|
71
69
|
"react-native-svg": "*",
|
|
70
|
+
"react-native-turbo-image": "*",
|
|
72
71
|
"react-native-url-polyfill": "*",
|
|
73
72
|
"react-native": "*",
|
|
74
73
|
"react": "*",
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import AsyncStorage from '@react-native-async-storage/async-storage';
|
|
2
1
|
import { createAsyncStoragePersister } from '@tanstack/query-async-storage-persister';
|
|
3
2
|
import { QueryClient } from '@tanstack/react-query';
|
|
4
|
-
import { PersistQueryClientProvider } from '@tanstack/react-query-persist-client';
|
|
3
|
+
import { AsyncStorage, PersistQueryClientProvider } from '@tanstack/react-query-persist-client';
|
|
5
4
|
import React from 'react';
|
|
6
5
|
import { LogBox } from 'react-native';
|
|
7
6
|
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
8
7
|
import 'react-native-get-random-values';
|
|
8
|
+
import { MMKV } from 'react-native-mmkv';
|
|
9
9
|
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
10
10
|
import { enableFreeze } from 'react-native-screens';
|
|
11
11
|
import { useDeviceContext } from 'twrnc';
|
|
12
12
|
|
|
13
|
+
import { StorageManager } from '@/components';
|
|
14
|
+
import CONFIG from '@/config';
|
|
15
|
+
import ApplicationRoutes from '@/routes';
|
|
16
|
+
import { tw } from '@/tailwind';
|
|
13
17
|
import 'react-native-url-polyfill/auto';
|
|
14
18
|
|
|
15
|
-
import { StorageManager } from '../components';
|
|
16
|
-
import ApplicationRoutes from '../routes';
|
|
17
|
-
import { tw } from '../tailwind';
|
|
18
|
-
|
|
19
19
|
LogBox.ignoreLogs(['VirtualizedLists', 'onAnimatedValueUpdate']);
|
|
20
20
|
|
|
21
21
|
enableFreeze(true);
|
|
@@ -31,8 +31,23 @@ const queryClient = new QueryClient({
|
|
|
31
31
|
},
|
|
32
32
|
});
|
|
33
33
|
|
|
34
|
+
const storage = new MMKV({
|
|
35
|
+
encryptionKey: CONFIG.STORAGE_KEY,
|
|
36
|
+
id: 'react-query-persist',
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export const MmkvStorage: AsyncStorage = {
|
|
40
|
+
getItem: (name) => {
|
|
41
|
+
const value = storage.getString(name);
|
|
42
|
+
|
|
43
|
+
return value ?? null;
|
|
44
|
+
},
|
|
45
|
+
removeItem: (name) => storage.delete(name),
|
|
46
|
+
setItem: (name, value) => storage.set(name, value),
|
|
47
|
+
};
|
|
48
|
+
|
|
34
49
|
const persister = createAsyncStoragePersister({
|
|
35
|
-
storage: AsyncStorage,
|
|
50
|
+
storage: MmkvStorage as AsyncStorage,
|
|
36
51
|
});
|
|
37
52
|
|
|
38
53
|
const persistOptions = { maxAge: CACHE_TIME, persister };
|
|
@@ -13,8 +13,8 @@ import { Keyboard, StyleProp, ViewStyle } from 'react-native';
|
|
|
13
13
|
import { TouchableWithoutFeedback } from 'react-native-gesture-handler';
|
|
14
14
|
import Animated, { Extrapolation, interpolate, useAnimatedStyle } from 'react-native-reanimated';
|
|
15
15
|
|
|
16
|
-
import { tw } from '
|
|
17
|
-
import { DefaultComponentProps } from '
|
|
16
|
+
import { tw } from '@/tailwind';
|
|
17
|
+
import { DefaultComponentProps } from '@/types';
|
|
18
18
|
|
|
19
19
|
export type BottomSheetProps = DefaultComponentProps & {
|
|
20
20
|
backgroundStyle?: StyleProp<Omit<ViewStyle, 'left' | 'right' | 'position' | 'top' | 'bottom'>>;
|
|
@@ -127,7 +127,12 @@ export function BottomSheet(props: BottomSheetProps) {
|
|
|
127
127
|
);
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
export function useBottomSheet() {
|
|
130
|
+
export function useBottomSheet(): {
|
|
131
|
+
closeSheet: () => void;
|
|
132
|
+
expandSheet: () => void;
|
|
133
|
+
isVisible: boolean;
|
|
134
|
+
sheetRef: RefObject<BottomSheetModal>;
|
|
135
|
+
} {
|
|
131
136
|
const [isVisible, setIsVisible] = useState<boolean>(false);
|
|
132
137
|
const sheetRef = useRef<BottomSheetModal>(null);
|
|
133
138
|
|
|
@@ -143,5 +148,5 @@ export function useBottomSheet() {
|
|
|
143
148
|
setIsVisible(false);
|
|
144
149
|
}, []);
|
|
145
150
|
|
|
146
|
-
return { closeSheet, expandSheet, isVisible, sheetRef };
|
|
151
|
+
return { closeSheet, expandSheet, isVisible, sheetRef: sheetRef as RefObject<BottomSheetModal> };
|
|
147
152
|
}
|
|
@@ -9,9 +9,9 @@ import {
|
|
|
9
9
|
ViewStyle,
|
|
10
10
|
} from 'react-native';
|
|
11
11
|
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
12
|
+
import { Typography } from '@/components/atoms/Typography';
|
|
13
|
+
import { colors, disabledInputStyle, tw } from '@/tailwind';
|
|
14
|
+
import { DefaultComponentProps } from '@/types';
|
|
15
15
|
|
|
16
16
|
type Props = DefaultComponentProps &
|
|
17
17
|
TouchableOpacityProps & {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
2
|
import { View } from 'react-native';
|
|
4
|
-
|
|
5
|
-
import {
|
|
3
|
+
|
|
4
|
+
import { tw } from '@/tailwind';
|
|
5
|
+
import { DefaultComponentProps } from '@/types';
|
|
6
6
|
|
|
7
7
|
type Props = DefaultComponentProps & {};
|
|
8
8
|
|
package/templates/apps/mobile/src/components/atoms/ExcludedEdges/excluded-edges.component.tsx
CHANGED
|
@@ -2,8 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import { Platform } from 'react-native';
|
|
3
3
|
import { Edge, SafeAreaView, useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
4
4
|
|
|
5
|
-
import { tw } from '
|
|
6
|
-
import { DefaultComponentProps } from '
|
|
5
|
+
import { tw } from '@/tailwind';
|
|
6
|
+
import { DefaultComponentProps } from '@/types';
|
|
7
7
|
|
|
8
8
|
type Props = DefaultComponentProps & {
|
|
9
9
|
children?: React.ReactNode;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StyleProp, TextStyle, View } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { Typography } from '@/components/atoms/Typography';
|
|
5
|
+
import { tw } from '@/tailwind';
|
|
6
|
+
import { DefaultComponentProps } from '@/types';
|
|
7
7
|
|
|
8
8
|
type Props = DefaultComponentProps & {
|
|
9
9
|
children?: React.ReactNode;
|
|
@@ -1,17 +1,23 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
NativeScrollEvent,
|
|
4
|
+
NativeSyntheticEvent,
|
|
5
|
+
RefreshControlProps,
|
|
6
|
+
StyleProp,
|
|
7
|
+
ViewStyle,
|
|
8
|
+
} from 'react-native';
|
|
3
9
|
import { KeyboardAwareScrollView as RNKeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
|
|
4
10
|
import Animated from 'react-native-reanimated';
|
|
5
11
|
|
|
6
|
-
import { tw } from '
|
|
7
|
-
import { DefaultComponentProps } from '
|
|
12
|
+
import { tw } from '@/tailwind';
|
|
13
|
+
import { DefaultComponentProps } from '@/types';
|
|
8
14
|
|
|
9
15
|
type Props = DefaultComponentProps & {
|
|
10
16
|
children?: React.ReactNode;
|
|
11
17
|
scrollViewRef?: React.RefObject<RNKeyboardAwareScrollView>;
|
|
12
18
|
containerStyle?: StyleProp<ViewStyle>;
|
|
13
19
|
extraBottomPadding?: number;
|
|
14
|
-
refreshControl?: ReactElement;
|
|
20
|
+
refreshControl?: React.ReactElement<RefreshControlProps> | undefined;
|
|
15
21
|
onScroll?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
|
|
16
22
|
};
|
|
17
23
|
|