nx-react-native-cli 1.0.7 → 1.0.8

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 (113) hide show
  1. package/README.md +1 -1
  2. package/contents/.eslintrc.json +293 -0
  3. package/contents/.husky/pre-commit +5 -0
  4. package/contents/.husky/pre-push +15 -0
  5. package/contents/.nvmrc +1 -0
  6. package/contents/.prettierignore +8 -0
  7. package/contents/.prettierrc +13 -0
  8. package/contents/.ruby-version +1 -0
  9. package/contents/.vscode/extensions.json +10 -0
  10. package/contents/.vscode/settings.json +18 -0
  11. package/contents/apps/mobile/.env.template +3 -0
  12. package/contents/apps/mobile/.eslintrc.json +34 -0
  13. package/contents/apps/mobile/Gemfile +11 -0
  14. package/contents/apps/mobile/android/app/build.gradle +164 -0
  15. package/contents/apps/mobile/android/app/src/dev/res/values/strings.xml +3 -0
  16. package/contents/apps/mobile/android/app/src/production/res/values/strings.xml +3 -0
  17. package/contents/apps/mobile/android/build.gradle +34 -0
  18. package/contents/apps/mobile/babel.config.json +14 -0
  19. package/contents/apps/mobile/fastlane/.env.template +24 -0
  20. package/contents/apps/mobile/fastlane/Fastfile +303 -0
  21. package/contents/apps/mobile/fastlane/Matchfile +5 -0
  22. package/contents/apps/mobile/fastlane/Pluginfile +6 -0
  23. package/contents/apps/mobile/fastlane/README.md +65 -0
  24. package/contents/apps/mobile/package.json +77 -0
  25. package/contents/apps/mobile/project.json +102 -0
  26. package/contents/apps/mobile/src/app/index.tsx +68 -0
  27. package/contents/apps/mobile/src/components/atoms/BottomSheet/bottom-sheet.component.tsx +145 -0
  28. package/contents/apps/mobile/src/components/atoms/BottomSheet/index.ts +1 -0
  29. package/contents/apps/mobile/src/components/atoms/Button/button.component.tsx +55 -0
  30. package/contents/apps/mobile/src/components/atoms/Button/index.ts +2 -0
  31. package/contents/apps/mobile/src/components/atoms/Button/outlined-button.component.tsx +59 -0
  32. package/contents/apps/mobile/src/components/atoms/Divider/divider-component.tsx +13 -0
  33. package/contents/apps/mobile/src/components/atoms/Divider/index.ts +1 -0
  34. package/contents/apps/mobile/src/components/atoms/InputLayout/index.ts +1 -0
  35. package/contents/apps/mobile/src/components/atoms/InputLayout/input-layout.component.tsx +34 -0
  36. package/contents/apps/mobile/src/components/atoms/ListLoadingItem/index.ts +1 -0
  37. package/contents/apps/mobile/src/components/atoms/ListLoadingItem/list-loading-item.component.tsx +56 -0
  38. package/contents/apps/mobile/src/components/atoms/Modal/index.ts +1 -0
  39. package/contents/apps/mobile/src/components/atoms/Modal/modal.component.tsx +58 -0
  40. package/contents/apps/mobile/src/components/atoms/ScreenLoader/index.ts +1 -0
  41. package/contents/apps/mobile/src/components/atoms/ScreenLoader/screen-loader.component.tsx +17 -0
  42. package/contents/apps/mobile/src/components/atoms/Skeleton/index.ts +1 -0
  43. package/contents/apps/mobile/src/components/atoms/Skeleton/skeleton.component.tsx +42 -0
  44. package/contents/apps/mobile/src/components/atoms/Text/index.ts +1 -0
  45. package/contents/apps/mobile/src/components/atoms/Text/text.component.tsx +23 -0
  46. package/contents/apps/mobile/src/components/atoms/TextInput/constants.ts +43 -0
  47. package/contents/apps/mobile/src/components/atoms/TextInput/index.ts +2 -0
  48. package/contents/apps/mobile/src/components/atoms/TextInput/text-input.component.tsx +137 -0
  49. package/contents/apps/mobile/src/components/atoms/index.ts +10 -0
  50. package/contents/apps/mobile/src/components/index.ts +3 -0
  51. package/contents/apps/mobile/src/components/molecules/BackButton/back-button.component.tsx +58 -0
  52. package/contents/apps/mobile/src/components/molecules/BackButton/index.ts +1 -0
  53. package/contents/apps/mobile/src/components/molecules/BottomActionsContainer/BottomActionsContainer.component.tsx +28 -0
  54. package/contents/apps/mobile/src/components/molecules/BottomActionsContainer/index.ts +1 -0
  55. package/contents/apps/mobile/src/components/molecules/ScreenContainer/index.ts +1 -0
  56. package/contents/apps/mobile/src/components/molecules/ScreenContainer/screen-container.component.tsx +100 -0
  57. package/contents/apps/mobile/src/components/molecules/ScreenHeader/index.ts +1 -0
  58. package/contents/apps/mobile/src/components/molecules/ScreenHeader/screen-header.component.tsx +71 -0
  59. package/contents/apps/mobile/src/components/molecules/StorageManager/StorageManager.component.tsx +18 -0
  60. package/contents/apps/mobile/src/components/molecules/StorageManager/index.ts +1 -0
  61. package/contents/apps/mobile/src/components/molecules/index.ts +5 -0
  62. package/contents/apps/mobile/src/components/organisms/index.ts +1 -0
  63. package/contents/apps/mobile/src/config/index.ts +13 -0
  64. package/contents/apps/mobile/src/dimens/index.ts +1 -0
  65. package/contents/apps/mobile/src/env.d.ts +17 -0
  66. package/contents/apps/mobile/src/hooks/index.ts +9 -0
  67. package/contents/apps/mobile/src/hooks/useAppState.hook.tsx +20 -0
  68. package/contents/apps/mobile/src/hooks/useApplicationDimensions.hook.tsx +10 -0
  69. package/contents/apps/mobile/src/hooks/useDebounce.hook.ts +11 -0
  70. package/contents/apps/mobile/src/hooks/useGetLayoutHeight.hook.tsx +27 -0
  71. package/contents/apps/mobile/src/hooks/useGetLayoutWidth.hook.tsx +27 -0
  72. package/contents/apps/mobile/src/hooks/useNavigation.hook.tsx +8 -0
  73. package/contents/apps/mobile/src/hooks/useShakeAnimation.hook.tsx +32 -0
  74. package/contents/apps/mobile/src/hooks/useTextInputChangeFocus.hook.tsx +12 -0
  75. package/contents/apps/mobile/src/hooks/useThrottle.hook.ts +11 -0
  76. package/contents/apps/mobile/src/icons/arrow-left.svg +3 -0
  77. package/contents/apps/mobile/src/icons/checkbox-active.svg +4 -0
  78. package/contents/apps/mobile/src/icons/checkbox-unactive.svg +4 -0
  79. package/contents/apps/mobile/src/icons/close.svg +3 -0
  80. package/contents/apps/mobile/src/icons/download.svg +4 -0
  81. package/contents/apps/mobile/src/icons/email.svg +10 -0
  82. package/contents/apps/mobile/src/icons/eye-slash.svg +11 -0
  83. package/contents/apps/mobile/src/icons/eye.svg +4 -0
  84. package/contents/apps/mobile/src/icons/gear.svg +4 -0
  85. package/contents/apps/mobile/src/icons/home.svg +3 -0
  86. package/contents/apps/mobile/src/icons/index.ts +33 -0
  87. package/contents/apps/mobile/src/icons/pencil.svg +3 -0
  88. package/contents/apps/mobile/src/icons/phone.svg +3 -0
  89. package/contents/apps/mobile/src/icons/user-circle.svg +3 -0
  90. package/contents/apps/mobile/src/icons/user.svg +4 -0
  91. package/contents/apps/mobile/src/icons/warning.svg +3 -0
  92. package/contents/apps/mobile/src/main.tsx +5 -0
  93. package/contents/apps/mobile/src/routes/index.tsx +65 -0
  94. package/contents/apps/mobile/src/routes/privateRoutes.tsx +32 -0
  95. package/contents/apps/mobile/src/routes/publicRoutes.tsx +26 -0
  96. package/contents/apps/mobile/src/routes/routes.enum.ts +5 -0
  97. package/contents/apps/mobile/src/routes/screen-options.ts +9 -0
  98. package/contents/apps/mobile/src/routes/screens.enum.ts +4 -0
  99. package/contents/apps/mobile/src/screens/HomeScreen/home.screen.tsx +12 -0
  100. package/contents/apps/mobile/src/screens/LoginScreen/login.screen.tsx +13 -0
  101. package/contents/apps/mobile/src/stores/index.ts +1 -0
  102. package/contents/apps/mobile/src/stores/local-storage.store.ts +60 -0
  103. package/contents/apps/mobile/src/stores/mmkvStorage.ts +19 -0
  104. package/contents/apps/mobile/src/tailwind/index.ts +24 -0
  105. package/contents/apps/mobile/src/types/component.type.ts +13 -0
  106. package/contents/apps/mobile/src/types/index.ts +1 -0
  107. package/contents/apps/mobile/tailwind.config.js +80 -0
  108. package/contents/apps/mobile/tsconfig.app.json +11 -0
  109. package/contents/check-env.sh +44 -0
  110. package/contents/clean-generated-outputs.sh +32 -0
  111. package/lib/index.cjs +39 -39
  112. package/package.json +3 -2
  113. package/lib/index.js +0 -75
@@ -0,0 +1,24 @@
1
+ # Fastlane ENV
2
+ IS_CI=false
3
+
4
+ # Firebase
5
+ FASTLANE_FIREBASE_APP_ID=
6
+ FASTLANE_FIREBASE_GROUP_TESTERS=
7
+
8
+ # AppStore
9
+ MATCH_PASSWORD=
10
+ GITHUB_API_TOKEN=
11
+ FASTLANE_APPSTORE_KEY_ID=
12
+ FASTLANE_APPSTORE_ISSUER_ID=
13
+ FASTLANE_APPSTORE_KEY_CONTENT=
14
+ FASTLANE_APP_IDENTIFIER=
15
+ FASTLANE_APP_IDENTIFIERS=
16
+ FASTLANE_APPSTORE_EXTERNAL_DESTINATIONS=""
17
+
18
+ # MISC
19
+ FASTLANE_CHANGELOGS="Performance and Feature updates"
20
+
21
+ # Android (Production ONLY)
22
+ STORE_PASSWORD=
23
+ KEY_PASSWORD=
24
+ KEY_ALIAS=
@@ -0,0 +1,303 @@
1
+
2
+ require 'fileutils'
3
+
4
+ def app_name = ""
5
+
6
+ def delete_gradle_temp()
7
+ UI.message("Deleting Gradle Temp...")
8
+ directory_path = '../android/.gradle'
9
+ if Dir.exist?(directory_path)
10
+ FileUtils.rm_rf(directory_path)
11
+ UI.success("Successfully deleted Gradle Temp at '#{directory_path}'")
12
+ else
13
+ UI.message("Directory '#{directory_path}' does not exist.")
14
+ end
15
+ end
16
+
17
+ def to_boolean(value)
18
+ return true if value =~ /^(true|t|yes|y|1)$/i
19
+ return false if value =~ /^(false|f|no|n|0)$/i
20
+ return false if value.nil? || value == ''
21
+ raise ArgumentError.new("Invalid value for boolean: #{value}")
22
+ end
23
+
24
+ def get_timestamp()
25
+ build_number = Time.now.to_i
26
+ UI.success("Using build number: #{build_number}")
27
+ return build_number
28
+ end
29
+
30
+ def appstore_api_key()
31
+ begin
32
+ api_key = app_store_connect_api_key(
33
+ key_id: ENV['FASTLANE_APPSTORE_KEY_ID'],
34
+ issuer_id: ENV['FASTLANE_APPSTORE_ISSUER_ID'],
35
+ key_content: ENV['FASTLANE_APPSTORE_KEY_CONTENT'],
36
+ duration: 1200,
37
+ in_house: false,
38
+ )
39
+ UI.success("Successfully connected to Appstore API Key: #{api_key}")
40
+ rescue => exception
41
+ UI.error(exception)
42
+ end
43
+ return api_key
44
+ end
45
+
46
+ def get_appstore_build_number(api_key)
47
+ build_number = 1
48
+ begin
49
+ build_number = latest_testflight_build_number(
50
+ api_key: api_key,
51
+ app_identifier: ENV['FASTLANE_APP_IDENTIFIER'],
52
+ ).to_i + 1
53
+ UI.success("Successfully connected to Appstore TestFlight build_num: #{build_number}")
54
+ rescue => exception
55
+ UI.error(exception)
56
+ end
57
+ return build_number
58
+ end
59
+
60
+ def get_appstore_external_testers()
61
+ external_destinations = (ENV['FASTLANE_APPSTORE_EXTERNAL_DESTINATIONS'] || "").split(',').map(&:strip)
62
+ UI.message("External Testers Found: #{external_destinations}")
63
+
64
+ return external_destinations
65
+ end
66
+
67
+ def get_certificates(api_key)
68
+ begin
69
+ # Get Signing Information (Ceritificates, Profiles, etc.)
70
+ UI.message("Getting Signing Information...")
71
+ match(
72
+ api_key: api_key,
73
+ app_identifier: ENV['FASTLANE_APP_IDENTIFIERS'],
74
+ readonly: false,
75
+ type: "development",
76
+ verbose: true,
77
+ force_for_new_devices: true,
78
+ generate_apple_certs: false,
79
+ )
80
+ match(
81
+ api_key: api_key,
82
+ app_identifier: ENV['FASTLANE_APP_IDENTIFIERS'],
83
+ readonly: false,
84
+ type: "appstore",
85
+ verbose: true,
86
+ generate_apple_certs: false,
87
+ )
88
+ rescue => exception
89
+ UI.error(exception)
90
+ end
91
+ end
92
+
93
+ def setup_ios()
94
+ skip_docs()
95
+
96
+ #Setup CI
97
+ UI.message("Setting up CI for match...")
98
+ setup_ci()
99
+
100
+ # Get Build Information
101
+ UI.message("Getting AppStore Metadata...")
102
+ api_key = appstore_api_key()
103
+ build_number = get_appstore_build_number(api_key)
104
+
105
+ increment_build_number(
106
+ build_number: build_number.to_s,
107
+ xcodeproj: "./ios/#{app_name}.xcodeproj",
108
+ )
109
+
110
+ # Get Signing Information (Ceritificates, Profiles, etc.)
111
+ UI.message("Getting Signing Information...")
112
+ get_certificates(api_key)
113
+
114
+ return build_number
115
+ end
116
+
117
+ def setup_android()
118
+ skip_docs()
119
+
120
+ # Clean Gradle Temp
121
+ delete_gradle_temp()
122
+
123
+ # Get Build Information
124
+ build_number = get_timestamp()
125
+
126
+ # Build Android App
127
+ UI.message("Cleaning build artifacts...")
128
+ gradle(
129
+ project_dir: './android',
130
+ task: 'clean',
131
+ )
132
+
133
+ # Increment version code
134
+ UI.message("Incrementing version code...")
135
+ increment_version_code(
136
+ gradle_file_path: "./android/app/build.gradle",
137
+ version_code: build_number
138
+ )
139
+ end
140
+
141
+ def ios_build_ipa(configuration, scheme)
142
+ # Build iOS App
143
+ UI.message("Building iOS app...")
144
+ gym(
145
+ clean: true,
146
+ configuration: "#{configuration}",
147
+ export_method: "app-store",
148
+ output_directory: "./build",
149
+ output_name: "#{app_name}-#{scheme}.ipa",
150
+ scheme: "#{scheme}",
151
+ workspace: "./ios/#{app_name}.xcworkspace",
152
+ )
153
+ end
154
+
155
+ def upload_dysm(scheme, firebase_env = "Dev")
156
+ # Upload dSYM to Crashlytics
157
+ UI.message("Uploading dSYM to Firebase Crashlytics...")
158
+ upload_symbols_to_crashlytics(
159
+ binary_path: "./ios/Pods/FirebaseCrashlytics/upload-symbols",
160
+ dsym_path: "./build/#{app_name}-#{scheme}.app.dSYM.zip",
161
+ gsp_path: "./ios/Firebase/#{firebase_env}/GoogleService-Info.plist",
162
+ )
163
+ end
164
+
165
+ def android_build_bundle(flavor)
166
+ UI.message("Building app...")
167
+ gradle(
168
+ build_type: 'Release',
169
+ flavor: flavor,
170
+ project_dir: './android',
171
+ task: 'bundle',
172
+ )
173
+ end
174
+
175
+ def android_build_apk(flavor)
176
+ UI.message("Building app...")
177
+ gradle(
178
+ build_type: 'Release',
179
+ flavor: flavor,
180
+ project_dir: './android',
181
+ task: 'assemble',
182
+ )
183
+ end
184
+
185
+ def publish_ipa(build_number, scheme)
186
+ api_key = appstore_api_key()
187
+
188
+ # Upload to App Store TestFlight
189
+ UI.message("Uploading build to AppStore TestFlight...")
190
+ external_destinations = get_appstore_external_testers()
191
+
192
+ if external_destinations.length > 0
193
+ UI.message("Distributing to external Testers: #{external_destinations}")
194
+ upload_to_testflight(
195
+ api_key: api_key,
196
+ build_number: build_number.to_s,
197
+ changelog: ENV["FASTLANE_CHANGELOGS"],
198
+ distribute_external: true,
199
+ distribute_only: false,
200
+ ipa: "./build/#{app_name}-#{scheme}.ipa",
201
+ groups: external_destinations,
202
+ skip_waiting_for_build_processing: false,
203
+ )
204
+ else
205
+ UI.message("No external testers to distribute to")
206
+ upload_to_testflight(
207
+ api_key: api_key,
208
+ build_number: build_number.to_s,
209
+ changelog: ENV["FASTLANE_CHANGELOGS"],
210
+ ipa: "./build/#{app_name}-#{scheme}.ipa",
211
+ skip_waiting_for_build_processing: true,
212
+ )
213
+ end
214
+ end
215
+
216
+ def publish_bundle(flavor)
217
+ UI.message("Uploading aab build to Firebase...")
218
+ release = firebase_app_distribution(
219
+ service_credentials_file: to_boolean(ENV['IS_CI']) ? '/tmp/google-service-account-key.json' : nil,
220
+ app: ENV['FASTLANE_FIREBASE_APP_ID'],
221
+ android_artifact_type: "AAB",
222
+ android_artifact_path: "./android/app/build/outputs/bundle/#{flavor}Release/app-#{flavor}-release.aab",
223
+ release_notes: ENV["FASTLANE_CHANGELOGS"],
224
+ groups: ENV["FASTLANE_FIREBASE_GROUP_TESTERS"]
225
+ )
226
+ end
227
+
228
+ def publish_apk(flavor)
229
+ UI.message("Uploading apk build to Firebase...")
230
+ release = firebase_app_distribution(
231
+ service_credentials_file: to_boolean(ENV['IS_CI']) ? '/tmp/google-service-account-key.json' : nil,
232
+ app: ENV['FASTLANE_FIREBASE_APP_ID'],
233
+ android_artifact_type: "APK",
234
+ android_artifact_path: "./android/app/build/outputs/apk/#{flavor}/release/app-#{flavor}-release.apk",
235
+ release_notes: ENV["FASTLANE_CHANGELOGS"],
236
+ groups: ENV["FASTLANE_FIREBASE_GROUP_TESTERS"]
237
+ )
238
+ end
239
+
240
+ platform :android do
241
+ desc "Build Android (Dev Server)"
242
+ lane :dev do
243
+ begin
244
+ flavor = 'dev'
245
+ setup_android()
246
+ android_build_apk(flavor)
247
+ publish_apk(flavor)
248
+ rescue => exception
249
+ UI.error(exception)
250
+ end
251
+ end
252
+
253
+ desc "Build Android (Production Server)"
254
+ lane :prod do
255
+ begin
256
+ flavor = 'production'
257
+ setup_android()
258
+ android_build_bundle(flavor)
259
+ publish_bundle(flavor)
260
+ rescue => exception
261
+ UI.error(exception)
262
+ end
263
+ end
264
+ end
265
+
266
+ platform :ios do
267
+ lane :certificates do
268
+ skip_docs()
269
+
270
+ api_key = appstore_api_key()
271
+
272
+ # Get Signing Information (Ceritificates, Profiles, etc.)
273
+ UI.message("Getting Signing Information...")
274
+ get_certificates(api_key)
275
+ end
276
+
277
+ desc "Build iOS (Dev Server)"
278
+ lane :dev do
279
+ begin
280
+ build_number = setup_ios()
281
+ ios_build_ipa("Dev.Release", "Dev")
282
+ # (Optional) Uncomment if you want to upload dSYM to Firebase Crashlytics
283
+ # upload_dysm("Dev", "Dev")
284
+ publish_ipa(build_number, "Dev")
285
+ rescue => exception
286
+ UI.error(exception)
287
+ end
288
+ end
289
+
290
+ desc "Build iOS (Production Server)"
291
+ lane :prod do
292
+ begin
293
+ build_number = setup_ios()
294
+ ios_build_ipa("Release", "Release")
295
+ # (Optional) Uncomment if you want to upload dSYM to Firebase Crashlytics
296
+ # upload_dysm("Release", "Prod")
297
+ publish_ipa(build_number, "Release")
298
+ rescue => exception
299
+ UI.error(exception)
300
+ end
301
+ end
302
+ end
303
+
@@ -0,0 +1,5 @@
1
+ git_url("")
2
+ git_branch("main")
3
+ git_basic_authorization(ENV['GITHUB_API_TOKEN'])
4
+ storage_mode("git")
5
+ type("appstore")
@@ -0,0 +1,6 @@
1
+ # Autogenerated by fastlane
2
+ #
3
+ # Ensure this file is checked in to source control!
4
+
5
+ gem 'fastlane-plugin-increment_version_code'
6
+ gem 'fastlane-plugin-firebase_app_distribution'
@@ -0,0 +1,65 @@
1
+ ## fastlane documentation
2
+
3
+ # Installation
4
+
5
+ Make sure you have the latest version of the Xcode command line tools installed:
6
+
7
+ ```sh
8
+ xcode-select --install
9
+ ```
10
+
11
+ For _fastlane_ installation instructions, see [Installing _fastlane_](https://docs.fastlane.tools/#installing-fastlane)
12
+
13
+ # Available Actions
14
+
15
+ ## Android
16
+
17
+ ### android dev
18
+
19
+ ```sh
20
+ [bundle exec] fastlane android dev
21
+ ```
22
+
23
+ Build Android (Dev Server)
24
+
25
+ ### android prod
26
+
27
+ ```sh
28
+ [bundle exec] fastlane android prod
29
+ ```
30
+
31
+ Build Android (Production Server)
32
+
33
+ ---
34
+
35
+ ## iOS
36
+
37
+ ### ios certificates
38
+
39
+ ```sh
40
+ [bundle exec] fastlane ios certificates
41
+ ```
42
+
43
+ ### ios dev
44
+
45
+ ```sh
46
+ [bundle exec] fastlane ios dev
47
+ ```
48
+
49
+ Build iOS (Dev Server)
50
+
51
+ ### ios prod
52
+
53
+ ```sh
54
+ [bundle exec] fastlane ios prod
55
+ ```
56
+
57
+ Build iOS (Production Server)
58
+
59
+ ---
60
+
61
+ This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run.
62
+
63
+ More information about _fastlane_ can be found on [fastlane.tools](https://fastlane.tools).
64
+
65
+ The documentation of _fastlane_ can be found on [docs.fastlane.tools](https://docs.fastlane.tools).
@@ -0,0 +1,77 @@
1
+ {
2
+ "name": "mobile",
3
+ "version": "0.0.1",
4
+ "private": true,
5
+ "scripts": {
6
+ "android:connect": "adb reverse tcp:8081 tcp:8081",
7
+ "start": "npx nx start mobile --skip-nx-cache",
8
+ "run-ios": "npx nx run-ios mobile --skip-nx-cache --scheme=Dev --simulator='iPhone 13 (A96A9251-28D7-48B1-8F6A-20B6CCB8810B)'",
9
+ "run-android": "npx nx run-android mobile --skip-nx-cache",
10
+ "ensure-symlink": "npx nx ensure-symlink mobile",
11
+ "sync-deps": "npx nx sync-deps mobile",
12
+ "pod-install": "npx nx pod-install mobile",
13
+ "bundle:pod-install": "cd ios && bundle install && bundle exec pod install --repo-update",
14
+ "pre-build": "npm run ensure-symlink && npm run sync-deps && npm run pod-install",
15
+ "list:ios-configurations": "cd ios && xcodebuild -list",
16
+ "list:ios-devices": "xcrun xctrace list devices",
17
+ "xcode": "open ios/AppsMobile.xcworkspace",
18
+ "check-env:mobile": "cd ../.. && npm run check-env:mobile",
19
+ "setup-fastlane": "rbenv local && bundle install && bundle update",
20
+ "deploy-android:dev": "bundle exec fastlane android dev --env development",
21
+ "deploy-ios:dev": "bundle exec fastlane ios dev --env development",
22
+ "ios-certificates": "npm run setup-fastlane && bundle exec fastlane ios certificates --env development"
23
+ },
24
+ "dependencies": {
25
+ "@gorhom/bottom-sheet": "*",
26
+ "@hookform/resolvers": "*",
27
+ "@react-native-async-storage/async-storage": "*",
28
+ "@react-native-community/datetimepicker": "*",
29
+ "@react-native-community/hooks": "*",
30
+ "@react-native/metro-config": "*",
31
+ "@react-navigation/core": "*",
32
+ "@react-navigation/material-top-tabs": "*",
33
+ "@react-navigation/native-stack": "*",
34
+ "@react-navigation/native": "*",
35
+ "@react-navigation/routers": "*",
36
+ "@react-navigation/stack": "*",
37
+ "@tanstack/query-async-storage-persister": "*",
38
+ "@tanstack/query-core": "*",
39
+ "@tanstack/query-sync-storage-persister": "*",
40
+ "@tanstack/react-query-persist-client": "*",
41
+ "@tanstack/react-query": "*",
42
+ "@testing-library/jest-native": "*",
43
+ "@testing-library/react-native": "*",
44
+ "axios": "*",
45
+ "babel-plugin-module-resolver": "*",
46
+ "dayjs": "*",
47
+ "jotai-optics": "*",
48
+ "jotai": "*",
49
+ "lodash": "*",
50
+ "metro-config": "*",
51
+ "react-hook-form": "*",
52
+ "react-native-dotenv": "*",
53
+ "react-native-fast-image": "*",
54
+ "react-native-gesture-handler": "*",
55
+ "react-native-get-random-values": "*",
56
+ "react-native-keyboard-aware-scroll-view": "*",
57
+ "react-native-mmkv": "*",
58
+ "react-native-modal-datetime-picker": "*",
59
+ "react-native-modal": "*",
60
+ "react-native-pager-view": "*",
61
+ "react-native-reanimated": "*",
62
+ "react-native-safe-area-context": "*",
63
+ "react-native-screens": "*",
64
+ "react-native-simple-toast": "*",
65
+ "react-native-svg-transformer": "*",
66
+ "react-native-svg": "*",
67
+ "react-native-url-polyfill": "*",
68
+ "react-native": "*",
69
+ "react": "*",
70
+ "tailwindcss": "*",
71
+ "twrnc": "*",
72
+ "uuid": "*",
73
+ "zod-validation-error": "*",
74
+ "zod": "*",
75
+ "zustand": "*"
76
+ }
77
+ }
@@ -0,0 +1,102 @@
1
+ {
2
+ "name": "mobile",
3
+ "$schema": "../../node_modules/nx/schemas/project-schema.json",
4
+ "sourceRoot": "apps/mobile/src",
5
+ "projectType": "application",
6
+ "targets": {
7
+ "check-env": {
8
+ "executor": "nx:run-script",
9
+ "options": {
10
+ "script": "check-env:mobile"
11
+ }
12
+ },
13
+ "start": {
14
+ "executor": "@nx/react-native:start",
15
+ "dependsOn": ["check-env", "ensure-symlink", "pod-install"],
16
+ "options": {
17
+ "port": 8081,
18
+ "resetCache": true
19
+ }
20
+ },
21
+ "serve": {
22
+ "executor": "nx:run-commands",
23
+ "options": {
24
+ "command": "nx start mobile"
25
+ }
26
+ },
27
+ "run-ios": {
28
+ "executor": "@nx/react-native:run-ios",
29
+ "dependsOn": ["ensure-symlink", "pod-install"],
30
+ "options": {}
31
+ },
32
+ "bundle-ios": {
33
+ "executor": "@nx/react-native:bundle",
34
+ "dependsOn": ["ensure-symlink"],
35
+ "outputs": ["{options.bundleOutput}"],
36
+ "options": {
37
+ "entryFile": "src/main.tsx",
38
+ "platform": "ios",
39
+ "bundleOutput": "dist/apps/mobile/ios/main.jsbundle"
40
+ }
41
+ },
42
+ "run-android": {
43
+ "executor": "@nx/react-native:run-android",
44
+ "dependsOn": ["ensure-symlink"],
45
+ "options": {}
46
+ },
47
+ "build-android": {
48
+ "executor": "@nx/react-native:build-android",
49
+ "outputs": [
50
+ "{projectRoot}/android/app/build/outputs/bundle",
51
+ "{projectRoot}/android/app/build/outputs/apk"
52
+ ],
53
+ "dependsOn": ["ensure-symlink"],
54
+ "options": {}
55
+ },
56
+ "build-ios": {
57
+ "executor": "@nx/react-native:build-ios",
58
+ "outputs": ["{projectRoot}/ios/build/Build"],
59
+ "dependsOn": ["ensure-symlink", "pod-install"],
60
+ "options": {}
61
+ },
62
+ "pod-install": {
63
+ "executor": "nx:run-script",
64
+ "options": {
65
+ "script": "bundle:pod-install"
66
+ }
67
+ },
68
+ "bundle-android": {
69
+ "executor": "@nx/react-native:bundle",
70
+ "dependsOn": ["ensure-symlink"],
71
+ "outputs": ["{options.bundleOutput}"],
72
+ "options": {
73
+ "entryFile": "src/main.tsx",
74
+ "platform": "android",
75
+ "bundleOutput": "dist/apps/mobile/android/main.jsbundle"
76
+ }
77
+ },
78
+ "sync-deps": {
79
+ "executor": "@nx/react-native:sync-deps",
80
+ "options": {}
81
+ },
82
+ "ensure-symlink": {
83
+ "executor": "@nx/react-native:ensure-symlink",
84
+ "options": {}
85
+ },
86
+ "lint": {
87
+ "executor": "@nx/eslint:lint",
88
+ "outputs": ["{options.outputFile}"],
89
+ "options": {
90
+ "lintFilePatterns": ["apps/mobile/**/*.{ts,tsx,js,jsx}"]
91
+ }
92
+ },
93
+ "test": {
94
+ "executor": "@nx/jest:jest",
95
+ "outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
96
+ "options": {
97
+ "jestConfig": "apps/mobile/jest.config.ts"
98
+ }
99
+ }
100
+ },
101
+ "tags": []
102
+ }
@@ -0,0 +1,68 @@
1
+ import AsyncStorage from '@react-native-async-storage/async-storage';
2
+ import { createAsyncStoragePersister } from '@tanstack/query-async-storage-persister';
3
+ import { QueryClient } from '@tanstack/react-query';
4
+ import { PersistQueryClientProvider } from '@tanstack/react-query-persist-client';
5
+ import React from 'react';
6
+ import { LogBox } from 'react-native';
7
+ import { GestureHandlerRootView } from 'react-native-gesture-handler';
8
+ import 'react-native-get-random-values';
9
+ import { SafeAreaProvider } from 'react-native-safe-area-context';
10
+ import { enableFreeze } from 'react-native-screens';
11
+ import 'react-native-url-polyfill/auto';
12
+
13
+ import { StorageManager } from '../components';
14
+ import ApplicationRoutes from '../routes';
15
+ import { tw } from '../tailwind';
16
+
17
+ LogBox.ignoreLogs(['VirtualizedLists', 'onAnimatedValueUpdate']);
18
+
19
+ enableFreeze(true);
20
+
21
+ const MS_IN_S = 1000;
22
+ const S_IN_A_MIN = 60;
23
+ const MIN_IN_AN_HOUR = 60;
24
+ const HOURS_IN_A_DAY = 24;
25
+ const MS_IN_DAYS = MS_IN_S * S_IN_A_MIN * MIN_IN_AN_HOUR * HOURS_IN_A_DAY;
26
+
27
+ const CACHE_TIME = MS_IN_DAYS * 1;
28
+ const STALE_TIME = MS_IN_S * S_IN_A_MIN * MIN_IN_AN_HOUR; // 5 minutes
29
+
30
+ const queryClient = new QueryClient({
31
+ defaultOptions: {
32
+ queries: {
33
+ staleTime: STALE_TIME,
34
+ },
35
+ },
36
+ });
37
+
38
+ const persister = createAsyncStoragePersister({
39
+ storage: AsyncStorage,
40
+ });
41
+
42
+ const persistOptions = { maxAge: CACHE_TIME, persister };
43
+
44
+ function Application(): JSX.Element {
45
+ return (
46
+ <GestureHandlerRootView style={tw`flex-1`}>
47
+ <SafeAreaProvider>
48
+ <PersistQueryClientProvider client={queryClient} persistOptions={persistOptions}>
49
+ <StorageManager>
50
+ <ApplicationRoutes />
51
+ </StorageManager>
52
+ </PersistQueryClientProvider>
53
+ </SafeAreaProvider>
54
+ </GestureHandlerRootView>
55
+ );
56
+ }
57
+
58
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
59
+ function HeadlessCheck({ isHeadless }: any) {
60
+ if (isHeadless) {
61
+ // App has been launched in the background by iOS, ignore
62
+ return null;
63
+ }
64
+
65
+ return <Application />;
66
+ }
67
+
68
+ export default HeadlessCheck;