nx-react-native-cli 2.6.12 → 2.7.1
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/lib/index.cjs +43 -43
- package/package.json +1 -1
- package/templates/19.7.0/apps/mobile/.ignorefile +1 -0
- package/templates/19.7.0/apps/mobile/android/app/src/main/java/com/appsmobile/MainActivity.kt +5 -1
- package/templates/19.7.0/apps/mobile/ios/AppsMobile/AppDelegate.mm +6 -0
- package/templates/19.7.0/apps/mobile/ios/AppsMobile/Images.xcassets/AppIcon.appiconset/AppIcon-20@2x.png +0 -0
- package/templates/19.7.0/apps/mobile/ios/AppsMobile/Images.xcassets/AppIcon.appiconset/AppIcon-20@2x~ipad.png +0 -0
- package/templates/19.7.0/apps/mobile/ios/AppsMobile/Images.xcassets/AppIcon.appiconset/AppIcon-20@3x.png +0 -0
- package/templates/19.7.0/apps/mobile/ios/AppsMobile/Images.xcassets/AppIcon.appiconset/AppIcon-20~ipad.png +0 -0
- package/templates/19.7.0/apps/mobile/ios/AppsMobile/Images.xcassets/AppIcon.appiconset/AppIcon-29.png +0 -0
- package/templates/19.7.0/apps/mobile/ios/AppsMobile/Images.xcassets/AppIcon.appiconset/AppIcon-29@2x.png +0 -0
- package/templates/19.7.0/apps/mobile/ios/AppsMobile/Images.xcassets/AppIcon.appiconset/AppIcon-29@2x~ipad.png +0 -0
- package/templates/19.7.0/apps/mobile/ios/AppsMobile/Images.xcassets/AppIcon.appiconset/AppIcon-29@3x.png +0 -0
- package/templates/19.7.0/apps/mobile/ios/AppsMobile/Images.xcassets/AppIcon.appiconset/AppIcon-29~ipad.png +0 -0
- package/templates/19.7.0/apps/mobile/ios/AppsMobile/Images.xcassets/AppIcon.appiconset/AppIcon-40@2x.png +0 -0
- package/templates/19.7.0/apps/mobile/ios/AppsMobile/Images.xcassets/AppIcon.appiconset/AppIcon-40@2x~ipad.png +0 -0
- package/templates/19.7.0/apps/mobile/ios/AppsMobile/Images.xcassets/AppIcon.appiconset/AppIcon-40@3x.png +0 -0
- package/templates/19.7.0/apps/mobile/ios/AppsMobile/Images.xcassets/AppIcon.appiconset/AppIcon-40~ipad.png +0 -0
- package/templates/19.7.0/apps/mobile/ios/AppsMobile/Images.xcassets/AppIcon.appiconset/AppIcon-60@2x~car.png +0 -0
- package/templates/19.7.0/apps/mobile/ios/AppsMobile/Images.xcassets/AppIcon.appiconset/AppIcon-60@3x~car.png +0 -0
- package/templates/19.7.0/apps/mobile/ios/AppsMobile/Images.xcassets/AppIcon.appiconset/AppIcon-83.5@2x~ipad.png +0 -0
- package/templates/19.7.0/apps/mobile/ios/AppsMobile/Images.xcassets/AppIcon.appiconset/AppIcon@2x.png +0 -0
- package/templates/19.7.0/apps/mobile/ios/AppsMobile/Images.xcassets/AppIcon.appiconset/AppIcon@2x~ipad.png +0 -0
- package/templates/19.7.0/apps/mobile/ios/AppsMobile/Images.xcassets/AppIcon.appiconset/AppIcon@3x.png +0 -0
- package/templates/19.7.0/apps/mobile/ios/AppsMobile/Images.xcassets/AppIcon.appiconset/AppIcon~ios-marketing.png +0 -0
- package/templates/19.7.0/apps/mobile/ios/AppsMobile/Images.xcassets/AppIcon.appiconset/AppIcon~ipad.png +0 -0
- package/templates/19.7.0/apps/mobile/ios/AppsMobile/Images.xcassets/AppIcon.appiconset/Contents.json +134 -0
- package/templates/19.7.0/apps/mobile/ios/AppsMobile/Images.xcassets/Contents.json +6 -0
- package/templates/19.7.0/apps/mobile/project.json +17 -19
- package/templates/21.2.2/apps/mobile/.ignorefile +1 -0
- package/templates/21.2.2/apps/mobile/android/app/src/main/java/com/mobile/MainActivity.kt +5 -1
- package/templates/21.2.2/apps/mobile/ios/Mobile/AppDelegate.mm +6 -0
- package/templates/21.2.2/apps/mobile/ios/Mobile/Images.xcassets/AppIcon.appiconset/AppIcon-20@2x.png +0 -0
- package/templates/21.2.2/apps/mobile/ios/Mobile/Images.xcassets/AppIcon.appiconset/AppIcon-20@2x~ipad.png +0 -0
- package/templates/21.2.2/apps/mobile/ios/Mobile/Images.xcassets/AppIcon.appiconset/AppIcon-20@3x.png +0 -0
- package/templates/21.2.2/apps/mobile/ios/Mobile/Images.xcassets/AppIcon.appiconset/AppIcon-20~ipad.png +0 -0
- package/templates/21.2.2/apps/mobile/ios/Mobile/Images.xcassets/AppIcon.appiconset/AppIcon-29.png +0 -0
- package/templates/21.2.2/apps/mobile/ios/Mobile/Images.xcassets/AppIcon.appiconset/AppIcon-29@2x.png +0 -0
- package/templates/21.2.2/apps/mobile/ios/Mobile/Images.xcassets/AppIcon.appiconset/AppIcon-29@2x~ipad.png +0 -0
- package/templates/21.2.2/apps/mobile/ios/Mobile/Images.xcassets/AppIcon.appiconset/AppIcon-29@3x.png +0 -0
- package/templates/21.2.2/apps/mobile/ios/Mobile/Images.xcassets/AppIcon.appiconset/AppIcon-29~ipad.png +0 -0
- package/templates/21.2.2/apps/mobile/ios/Mobile/Images.xcassets/AppIcon.appiconset/AppIcon-40@2x.png +0 -0
- package/templates/21.2.2/apps/mobile/ios/Mobile/Images.xcassets/AppIcon.appiconset/AppIcon-40@2x~ipad.png +0 -0
- package/templates/21.2.2/apps/mobile/ios/Mobile/Images.xcassets/AppIcon.appiconset/AppIcon-40@3x.png +0 -0
- package/templates/21.2.2/apps/mobile/ios/Mobile/Images.xcassets/AppIcon.appiconset/AppIcon-40~ipad.png +0 -0
- package/templates/21.2.2/apps/mobile/ios/Mobile/Images.xcassets/AppIcon.appiconset/AppIcon-60@2x~car.png +0 -0
- package/templates/21.2.2/apps/mobile/ios/Mobile/Images.xcassets/AppIcon.appiconset/AppIcon-60@3x~car.png +0 -0
- package/templates/21.2.2/apps/mobile/ios/Mobile/Images.xcassets/AppIcon.appiconset/AppIcon-83.5@2x~ipad.png +0 -0
- package/templates/21.2.2/apps/mobile/ios/Mobile/Images.xcassets/AppIcon.appiconset/AppIcon@2x.png +0 -0
- package/templates/21.2.2/apps/mobile/ios/Mobile/Images.xcassets/AppIcon.appiconset/AppIcon@2x~ipad.png +0 -0
- package/templates/21.2.2/apps/mobile/ios/Mobile/Images.xcassets/AppIcon.appiconset/AppIcon@3x.png +0 -0
- package/templates/21.2.2/apps/mobile/ios/Mobile/Images.xcassets/AppIcon.appiconset/AppIcon~ios-marketing.png +0 -0
- package/templates/21.2.2/apps/mobile/ios/Mobile/Images.xcassets/AppIcon.appiconset/AppIcon~ipad.png +0 -0
- package/templates/21.2.2/apps/mobile/ios/Mobile/Images.xcassets/AppIcon.appiconset/Contents.json +134 -0
- package/templates/21.2.2/apps/mobile/ios/Mobile/Images.xcassets/Contents.json +6 -0
- package/templates/21.2.2/apps/mobile/project.json +17 -19
- package/templates/shared/.ignorefile +1 -0
- package/templates/shared/apps/mobile/android/app/src/main/AndroidManifest.xml +28 -0
- package/templates/shared/apps/mobile/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +6 -0
- package/templates/shared/apps/mobile/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/templates/shared/apps/mobile/android/app/src/main/res/mipmap-hdpi/ic_launcher_background.png +0 -0
- package/templates/shared/apps/mobile/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png +0 -0
- package/templates/shared/apps/mobile/android/app/src/main/res/mipmap-hdpi/ic_launcher_monochrome.png +0 -0
- package/templates/shared/apps/mobile/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/templates/shared/apps/mobile/android/app/src/main/res/mipmap-mdpi/ic_launcher_background.png +0 -0
- package/templates/shared/apps/mobile/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png +0 -0
- package/templates/shared/apps/mobile/android/app/src/main/res/mipmap-mdpi/ic_launcher_monochrome.png +0 -0
- package/templates/shared/apps/mobile/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/templates/shared/apps/mobile/android/app/src/main/res/mipmap-xhdpi/ic_launcher_background.png +0 -0
- package/templates/shared/apps/mobile/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png +0 -0
- package/templates/shared/apps/mobile/android/app/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.png +0 -0
- package/templates/shared/apps/mobile/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/templates/shared/apps/mobile/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png +0 -0
- package/templates/shared/apps/mobile/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png +0 -0
- package/templates/shared/apps/mobile/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.png +0 -0
- package/templates/shared/apps/mobile/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/templates/shared/apps/mobile/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png +0 -0
- package/templates/shared/apps/mobile/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png +0 -0
- package/templates/shared/apps/mobile/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.png +0 -0
- package/templates/shared/apps/mobile/android/app/src/main/res/styles.xml +14 -0
- package/templates/shared/apps/mobile/deploy.sh +107 -0
- package/templates/shared/apps/mobile/package.json +1 -78
- package/templates/shared/apps/mobile/picker.sh +151 -0
- package/templates/shared/apps/mobile/pod-install.sh +40 -0
- package/templates/shared/apps/mobile/react-native.config.js +15 -0
- package/templates/shared/apps/mobile/run-android.sh +131 -0
- package/templates/shared/apps/mobile/run-ios.sh +89 -0
- package/templates/shared/apps/mobile/scripts/setup-ios-dev-scheme.rb +101 -1
- package/templates/shared/apps/mobile/src/app/index.tsx +3 -39
- package/templates/shared/apps/mobile/src/app/query-client.ts +40 -0
- package/templates/shared/apps/mobile/src/assets/images/logo.png +0 -0
- package/templates/shared/apps/mobile/src/components/atoms/KeyboardAwareScrollView/keyboard-aware-scroll-view.component.tsx +1 -0
- package/templates/shared/apps/mobile/src/components/atoms/Modal/modal.component.tsx +19 -6
- package/templates/shared/apps/mobile/src/components/atoms/Typography/typography.component.tsx +1 -1
- package/templates/shared/apps/mobile/src/components/molecules/ScreenContainer/screen-container.component.tsx +2 -2
- package/templates/shared/apps/mobile/src/components/molecules/ScreenHeader/screen-header.component.tsx +1 -1
- package/templates/shared/apps/mobile/src/routes/index.tsx +7 -1
- package/templates/shared/clean-generated-outputs.sh +4 -0
- package/templates/shared/apps/mobile/src/assets/images/.gitkeep +0 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Interactive iOS launcher - picks scheme and simulator
|
|
3
|
+
|
|
4
|
+
if [[ "$OSTYPE" != "darwin"* ]]; then
|
|
5
|
+
echo "iOS builds only work on macOS"
|
|
6
|
+
exit 1
|
|
7
|
+
fi
|
|
8
|
+
|
|
9
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
10
|
+
PROJECT_DIR="$SCRIPT_DIR/ios"
|
|
11
|
+
|
|
12
|
+
source "$SCRIPT_DIR/picker.sh"
|
|
13
|
+
|
|
14
|
+
# --- Scheme selection ---
|
|
15
|
+
SCHEMES=$(cd "$PROJECT_DIR" && xcodebuild -list -json 2>/dev/null | python3 -c "
|
|
16
|
+
import sys, json
|
|
17
|
+
data = json.load(sys.stdin)
|
|
18
|
+
for s in data.get('project', {}).get('schemes', []):
|
|
19
|
+
print(s)
|
|
20
|
+
")
|
|
21
|
+
|
|
22
|
+
if [ -z "$SCHEMES" ]; then
|
|
23
|
+
echo "Could not read schemes from Xcode project"
|
|
24
|
+
exit 1
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
SCHEME_ARRAY=()
|
|
28
|
+
while IFS= read -r line; do
|
|
29
|
+
SCHEME_ARRAY+=("$line")
|
|
30
|
+
done <<< "$SCHEMES"
|
|
31
|
+
|
|
32
|
+
pick "Select a scheme:" "${SCHEME_ARRAY[@]}" --key "ios-scheme"
|
|
33
|
+
SELECTED_SCHEME="${SCHEME_ARRAY[$PICKED_INDEX]}"
|
|
34
|
+
|
|
35
|
+
# --- Simulator selection (booted first, then by name, then iOS version desc) ---
|
|
36
|
+
SIMULATORS=$(xcrun simctl list devices available -j 2>/dev/null | python3 -c "
|
|
37
|
+
import sys, json, re
|
|
38
|
+
|
|
39
|
+
data = json.load(sys.stdin)
|
|
40
|
+
devices_list = []
|
|
41
|
+
|
|
42
|
+
for runtime, devices in data.get('devices', {}).items():
|
|
43
|
+
if 'iOS' not in runtime:
|
|
44
|
+
continue
|
|
45
|
+
ver_match = re.search(r'(\d+)[\-\.](\d+)', runtime)
|
|
46
|
+
if not ver_match:
|
|
47
|
+
continue
|
|
48
|
+
ver_major, ver_minor = int(ver_match.group(1)), int(ver_match.group(2))
|
|
49
|
+
ver = f'{ver_major}.{ver_minor}'
|
|
50
|
+
for d in devices:
|
|
51
|
+
is_booted = d['state'] == 'Booted'
|
|
52
|
+
devices_list.append((is_booted, d['name'], ver_major, ver_minor, ver))
|
|
53
|
+
|
|
54
|
+
# Parse model number from name (e.g. 'iPhone 16 Pro Max' -> 16)
|
|
55
|
+
def sort_key(x):
|
|
56
|
+
is_booted, name, ver_major, ver_minor, ver = x
|
|
57
|
+
is_iphone = name.startswith('iPhone')
|
|
58
|
+
model_match = re.search(r'(\d+)', name)
|
|
59
|
+
model_num = int(model_match.group(1)) if model_match else 0
|
|
60
|
+
# booted first, iPhone over iPad, highest model first, Pro Max > Pro > base, newest iOS first
|
|
61
|
+
return (not is_booted, not is_iphone, -model_num, name.count('Pro') == 0, 'Max' not in name, -ver_major, -ver_minor)
|
|
62
|
+
|
|
63
|
+
devices_list.sort(key=sort_key)
|
|
64
|
+
|
|
65
|
+
for is_booted, name, _, _, ver in devices_list:
|
|
66
|
+
prefix = '[Booted] ' if is_booted else ''
|
|
67
|
+
print(f'{prefix}{name} ({ver})')
|
|
68
|
+
")
|
|
69
|
+
|
|
70
|
+
if [ -z "$SIMULATORS" ]; then
|
|
71
|
+
echo "No iOS simulators found"
|
|
72
|
+
exit 1
|
|
73
|
+
fi
|
|
74
|
+
|
|
75
|
+
SIM_ARRAY=()
|
|
76
|
+
while IFS= read -r line; do
|
|
77
|
+
SIM_ARRAY+=("$line")
|
|
78
|
+
done <<< "$SIMULATORS"
|
|
79
|
+
|
|
80
|
+
pick "Select a simulator:" "${SIM_ARRAY[@]}" --key "ios-simulator"
|
|
81
|
+
SELECTED_SIM="${SIM_ARRAY[$PICKED_INDEX]}"
|
|
82
|
+
# Strip [Booted] prefix to get "Name (version)"
|
|
83
|
+
SIM_NAME=$(echo "$SELECTED_SIM" | sed 's/^\[Booted\] //')
|
|
84
|
+
|
|
85
|
+
echo ""
|
|
86
|
+
echo "Running: scheme=$SELECTED_SCHEME simulator=$SIM_NAME"
|
|
87
|
+
echo ""
|
|
88
|
+
|
|
89
|
+
cd "$SCRIPT_DIR" && npx react-native run-ios --scheme="$SELECTED_SCHEME" --simulator="$SIM_NAME"
|
|
@@ -157,6 +157,24 @@ def upsert_info_plist_display_name(app_target, ios_dir, project_name)
|
|
|
157
157
|
updated
|
|
158
158
|
end
|
|
159
159
|
|
|
160
|
+
def upsert_info_plist_encryption_flag(app_target, ios_dir, project_name)
|
|
161
|
+
paths = resolve_info_plist_paths(app_target, ios_dir, project_name)
|
|
162
|
+
updated = []
|
|
163
|
+
|
|
164
|
+
paths.each do |path|
|
|
165
|
+
next unless File.exist?(path)
|
|
166
|
+
|
|
167
|
+
plist = Xcodeproj::Plist.read_from_path(path) || {}
|
|
168
|
+
next if plist['ITSAppUsesNonExemptEncryption'] == false
|
|
169
|
+
|
|
170
|
+
plist['ITSAppUsesNonExemptEncryption'] = false
|
|
171
|
+
Xcodeproj::Plist.write_to_path(plist, path)
|
|
172
|
+
updated << "Info.plist ITSAppUsesNonExemptEncryption=false at #{path}"
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
updated
|
|
176
|
+
end
|
|
177
|
+
|
|
160
178
|
def update_scheme_configuration(doc, action_name, build_configuration)
|
|
161
179
|
action = REXML::XPath.first(doc, "//#{action_name}")
|
|
162
180
|
raise "Missing #{action_name} in source scheme." unless action
|
|
@@ -301,6 +319,81 @@ def upsert_firebase_environment_script_phase(app_target)
|
|
|
301
319
|
phase_status
|
|
302
320
|
end
|
|
303
321
|
|
|
322
|
+
def upsert_podfile_node_require_and_permissions(podfile_path)
|
|
323
|
+
return :missing unless File.exist?(podfile_path)
|
|
324
|
+
|
|
325
|
+
content = File.read(podfile_path)
|
|
326
|
+
updated = content.dup
|
|
327
|
+
changes = []
|
|
328
|
+
|
|
329
|
+
# Step 1: Replace old inline require with node_require function if needed
|
|
330
|
+
unless updated.include?('def node_require(script)')
|
|
331
|
+
old_require_pattern = /# Resolve react_native_pods\.rb with node to allow for hoisting\nrequire Pod::Executable\.execute_command\('node', \['-p',\n\s*'require\.resolve\(\n\s*"react-native\/scripts\/react_native_pods\.rb",\n\s*\{paths: \[process\.argv\[1\]\]\},\n\s*\)', __dir__\]\)\.strip/m
|
|
332
|
+
|
|
333
|
+
node_require_block = <<~RUBY.chomp
|
|
334
|
+
def node_require(script)
|
|
335
|
+
# Resolve script with node to allow for hoisting
|
|
336
|
+
require Pod::Executable.execute_command('node', ['-p',
|
|
337
|
+
"require.resolve(
|
|
338
|
+
'\#{script}',
|
|
339
|
+
{paths: [process.argv[1]]},
|
|
340
|
+
)", __dir__]).strip
|
|
341
|
+
end
|
|
342
|
+
|
|
343
|
+
# Use it to require both react-native's and this package's scripts:
|
|
344
|
+
node_require('react-native/scripts/react_native_pods.rb')
|
|
345
|
+
node_require('react-native-permissions/scripts/setup.rb')
|
|
346
|
+
RUBY
|
|
347
|
+
|
|
348
|
+
if updated.match?(old_require_pattern)
|
|
349
|
+
updated.sub!(old_require_pattern, node_require_block)
|
|
350
|
+
changes << 'node_require function (replaced inline require)'
|
|
351
|
+
end
|
|
352
|
+
end
|
|
353
|
+
|
|
354
|
+
# Step 2: Add setup_permissions after prepare_react_native_project! if not present
|
|
355
|
+
unless updated.include?('setup_permissions')
|
|
356
|
+
permissions_block = <<~RUBY
|
|
357
|
+
|
|
358
|
+
# Uncomment the permissions you need
|
|
359
|
+
setup_permissions([
|
|
360
|
+
# 'AppTrackingTransparency',
|
|
361
|
+
# 'Bluetooth',
|
|
362
|
+
# 'Calendars',
|
|
363
|
+
# 'CalendarsWriteOnly',
|
|
364
|
+
# 'Camera',
|
|
365
|
+
# 'Contacts',
|
|
366
|
+
# 'FaceID',
|
|
367
|
+
# 'LocationAccuracy',
|
|
368
|
+
# 'LocationAlways',
|
|
369
|
+
# 'LocationWhenInUse',
|
|
370
|
+
# 'MediaLibrary',
|
|
371
|
+
# 'Microphone',
|
|
372
|
+
# 'Motion',
|
|
373
|
+
'Notifications',
|
|
374
|
+
# 'PhotoLibrary',
|
|
375
|
+
# 'PhotoLibraryAddOnly',
|
|
376
|
+
# 'Reminders',
|
|
377
|
+
# 'Siri',
|
|
378
|
+
# 'SpeechRecognition',
|
|
379
|
+
# 'StoreKit',
|
|
380
|
+
])
|
|
381
|
+
RUBY
|
|
382
|
+
|
|
383
|
+
if updated.include?('prepare_react_native_project!')
|
|
384
|
+
updated.sub!(/prepare_react_native_project!\s*\n/) do |match|
|
|
385
|
+
"#{match}#{permissions_block}"
|
|
386
|
+
end
|
|
387
|
+
changes << 'setup_permissions block'
|
|
388
|
+
end
|
|
389
|
+
end
|
|
390
|
+
|
|
391
|
+
return :unchanged if updated == content
|
|
392
|
+
|
|
393
|
+
File.write(podfile_path, updated)
|
|
394
|
+
changes
|
|
395
|
+
end
|
|
396
|
+
|
|
304
397
|
ios_dir = File.join(Dir.pwd, 'ios')
|
|
305
398
|
project_path = Dir.glob(File.join(ios_dir, '*.xcodeproj')).first
|
|
306
399
|
raise 'Could not find an .xcodeproj under ios/.' unless project_path
|
|
@@ -330,6 +423,7 @@ changes.concat(upsert_product_bundle_identifier(app_target, base_bundle_identifi
|
|
|
330
423
|
base_product_name = extract_base_product_name(app_target)
|
|
331
424
|
changes.concat(upsert_product_name(app_target, base_product_name))
|
|
332
425
|
changes.concat(upsert_info_plist_display_name(app_target, ios_dir, project_name))
|
|
426
|
+
changes.concat(upsert_info_plist_encryption_flag(app_target, ios_dir, project_name))
|
|
333
427
|
firebase_phase_status = upsert_firebase_environment_script_phase(app_target)
|
|
334
428
|
changes << "Firebase plist run script #{firebase_phase_status}" unless firebase_phase_status == 'existing'
|
|
335
429
|
|
|
@@ -359,9 +453,15 @@ formatter.write(scheme_doc.root, output)
|
|
|
359
453
|
output << "\n"
|
|
360
454
|
File.write(dev_scheme_path, output)
|
|
361
455
|
|
|
362
|
-
|
|
456
|
+
podfile_path = File.join(ios_dir, 'Podfile')
|
|
457
|
+
podfile_status = upsert_podfile_project_mapping(podfile_path, project_name)
|
|
363
458
|
changes << 'Podfile project mapping' if podfile_status == :updated
|
|
364
459
|
|
|
460
|
+
node_require_status = upsert_podfile_node_require_and_permissions(podfile_path)
|
|
461
|
+
if node_require_status.is_a?(Array)
|
|
462
|
+
node_require_status.each { |change| changes << "Podfile #{change}" }
|
|
463
|
+
end
|
|
464
|
+
|
|
365
465
|
puts 'Configured iOS build configurations and Dev scheme.'
|
|
366
466
|
if changes.empty?
|
|
367
467
|
puts 'No new build configurations were created (already configured).'
|
|
@@ -1,57 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { QueryClient } from '@tanstack/react-query';
|
|
3
|
-
import { AsyncStorage, PersistQueryClientProvider } from '@tanstack/react-query-persist-client';
|
|
1
|
+
import { PersistQueryClientProvider } from '@tanstack/react-query-persist-client';
|
|
4
2
|
import React from 'react';
|
|
5
3
|
import { LogBox } from 'react-native';
|
|
6
4
|
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
7
5
|
import 'react-native-get-random-values';
|
|
8
6
|
import { KeyboardProvider } from 'react-native-keyboard-controller';
|
|
9
|
-
import { createMMKV } from 'react-native-mmkv';
|
|
10
7
|
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
11
8
|
import { useDeviceContext } from 'twrnc';
|
|
12
9
|
|
|
10
|
+
import { persistOptions, queryClient } from './query-client';
|
|
11
|
+
|
|
13
12
|
import { StorageManager } from '@/components';
|
|
14
|
-
import CONFIG from '@/config';
|
|
15
13
|
import ApplicationRoutes from '@/routes';
|
|
16
14
|
import { tw } from '@/tailwind';
|
|
17
15
|
import 'react-native-url-polyfill/auto';
|
|
18
16
|
|
|
19
17
|
LogBox.ignoreLogs(['VirtualizedLists', 'onAnimatedValueUpdate']);
|
|
20
18
|
|
|
21
|
-
const CACHE_TIME = 0;
|
|
22
|
-
const STALE_TIME = 0;
|
|
23
|
-
|
|
24
|
-
const queryClient = new QueryClient({
|
|
25
|
-
defaultOptions: {
|
|
26
|
-
queries: {
|
|
27
|
-
staleTime: STALE_TIME,
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
const storage = createMMKV({
|
|
33
|
-
encryptionKey: CONFIG.STORAGE_KEY,
|
|
34
|
-
id: 'react-query-persist',
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
export const MmkvStorage: AsyncStorage = {
|
|
38
|
-
getItem: (name) => {
|
|
39
|
-
const value = storage.getString(name);
|
|
40
|
-
|
|
41
|
-
return value ?? null;
|
|
42
|
-
},
|
|
43
|
-
removeItem: (name) => {
|
|
44
|
-
storage.remove(name);
|
|
45
|
-
},
|
|
46
|
-
setItem: (name, value) => storage.set(name, value),
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
const persister = createAsyncStoragePersister({
|
|
50
|
-
storage: MmkvStorage as AsyncStorage,
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
const persistOptions = { maxAge: CACHE_TIME, persister };
|
|
54
|
-
|
|
55
19
|
function Application() {
|
|
56
20
|
useDeviceContext(tw, {
|
|
57
21
|
initialColorScheme: 'light',
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { createAsyncStoragePersister } from '@tanstack/query-async-storage-persister';
|
|
2
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
3
|
+
import { AsyncStorage } from '@tanstack/react-query-persist-client';
|
|
4
|
+
import { createMMKV } from 'react-native-mmkv';
|
|
5
|
+
|
|
6
|
+
import CONFIG from '@/config';
|
|
7
|
+
|
|
8
|
+
const CACHE_TIME = 0;
|
|
9
|
+
const STALE_TIME = 0;
|
|
10
|
+
|
|
11
|
+
export const queryClient = new QueryClient({
|
|
12
|
+
defaultOptions: {
|
|
13
|
+
queries: {
|
|
14
|
+
staleTime: STALE_TIME,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const storage = createMMKV({
|
|
20
|
+
encryptionKey: CONFIG.STORAGE_KEY,
|
|
21
|
+
id: 'react-query-persist',
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export const MmkvStorage: AsyncStorage = {
|
|
25
|
+
getItem: (name) => {
|
|
26
|
+
const value = storage.getString(name);
|
|
27
|
+
|
|
28
|
+
return value ?? null;
|
|
29
|
+
},
|
|
30
|
+
removeItem: (name) => {
|
|
31
|
+
storage.remove(name);
|
|
32
|
+
},
|
|
33
|
+
setItem: (name, value) => storage.set(name, value),
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const persister = createAsyncStoragePersister({
|
|
37
|
+
storage: MmkvStorage as AsyncStorage,
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export const persistOptions = { maxAge: CACHE_TIME, persister };
|
|
Binary file
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
/* eslint-disable no-magic-numbers */
|
|
2
2
|
import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
|
|
3
3
|
import React, { useCallback, useState } from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
Keyboard,
|
|
6
|
+
Pressable,
|
|
7
|
+
Modal as RNBuiltInModal,
|
|
8
|
+
StyleProp,
|
|
9
|
+
View,
|
|
10
|
+
ViewStyle,
|
|
11
|
+
} from 'react-native';
|
|
5
12
|
import RNModal from 'react-native-modal';
|
|
6
13
|
|
|
7
14
|
import CONFIG from '@/config';
|
|
@@ -35,7 +42,12 @@ function IOSModal(props: ModalProps) {
|
|
|
35
42
|
onBackButtonPress={onBackButtonPress}
|
|
36
43
|
onBackdropPress={onBackdropPress}
|
|
37
44
|
>
|
|
38
|
-
|
|
45
|
+
<>
|
|
46
|
+
<Pressable style={tw`absolute h-full w-full`} onPress={onBackdropPress}>
|
|
47
|
+
<View style={tw`h-full w-full bg-black/60`} />
|
|
48
|
+
</Pressable>
|
|
49
|
+
<BottomSheetModalProvider>{children}</BottomSheetModalProvider>
|
|
50
|
+
</>
|
|
39
51
|
</RNModal>
|
|
40
52
|
);
|
|
41
53
|
}
|
|
@@ -52,11 +64,12 @@ function AndroidModal(props: ModalProps) {
|
|
|
52
64
|
visible={isVisible}
|
|
53
65
|
onRequestClose={onBackButtonPress}
|
|
54
66
|
>
|
|
55
|
-
|
|
56
|
-
<Pressable style={tw`
|
|
57
|
-
<
|
|
67
|
+
<>
|
|
68
|
+
<Pressable style={tw`absolute h-full w-full`} onPress={onBackdropPress}>
|
|
69
|
+
<View style={tw`h-full w-full bg-black/60`} />
|
|
58
70
|
</Pressable>
|
|
59
|
-
|
|
71
|
+
<BottomSheetModalProvider>{children}</BottomSheetModalProvider>
|
|
72
|
+
</>
|
|
60
73
|
</RNBuiltInModal>
|
|
61
74
|
);
|
|
62
75
|
}
|
package/templates/shared/apps/mobile/src/components/atoms/Typography/typography.component.tsx
CHANGED
|
@@ -16,7 +16,7 @@ export function Typography(props: Props): JSX.Element {
|
|
|
16
16
|
return (
|
|
17
17
|
<RNText
|
|
18
18
|
{...shouldTruncateTextProps}
|
|
19
|
-
style={[tw`
|
|
19
|
+
style={[tw`font-sans text-base font-normal text-black`, style]}
|
|
20
20
|
{...extraProps}
|
|
21
21
|
/>
|
|
22
22
|
);
|
|
@@ -81,7 +81,7 @@ export function ScreenContainer(props: Props) {
|
|
|
81
81
|
<KeyboardAwareScrollView
|
|
82
82
|
containerStyle={defaultContainerStyle}
|
|
83
83
|
refreshControl={refreshControl as ReactElement<RefreshControlProps>}
|
|
84
|
-
scrollViewRef={scrollViewRef}
|
|
84
|
+
scrollViewRef={scrollViewRef as React.RefObject<RNScrollView>}
|
|
85
85
|
onScroll={onScroll}
|
|
86
86
|
>
|
|
87
87
|
{children}
|
|
@@ -104,7 +104,7 @@ export function ScreenContainer(props: Props) {
|
|
|
104
104
|
<KeyboardAwareScrollView
|
|
105
105
|
containerStyle={defaultContainerStyle}
|
|
106
106
|
refreshControl={refreshControl as ReactElement<RefreshControlProps>}
|
|
107
|
-
scrollViewRef={scrollViewRef}
|
|
107
|
+
scrollViewRef={scrollViewRef as React.RefObject<RNScrollView>}
|
|
108
108
|
onScroll={onScroll}
|
|
109
109
|
>
|
|
110
110
|
{children}
|
|
@@ -39,7 +39,7 @@ export function ScreenHeader(props: Props) {
|
|
|
39
39
|
{extraActionComponent ? (
|
|
40
40
|
extraActionComponent
|
|
41
41
|
) : (
|
|
42
|
-
<GearIcon height={25} style={tw`text-black
|
|
42
|
+
<GearIcon height={25} style={tw`text-black`} width={25} />
|
|
43
43
|
)}
|
|
44
44
|
</View>
|
|
45
45
|
</TouchableOpacity>
|
|
@@ -2,6 +2,7 @@ import { DefaultTheme, NavigationContainer, Theme } from '@react-navigation/nati
|
|
|
2
2
|
import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
|
3
3
|
import React, { useEffect } from 'react';
|
|
4
4
|
import { StatusBar } from 'react-native';
|
|
5
|
+
import BootSplash from 'react-native-bootsplash';
|
|
5
6
|
|
|
6
7
|
import CONFIG from '@/config';
|
|
7
8
|
import { Routes } from '@/routes';
|
|
@@ -50,7 +51,12 @@ export default function ApplicationRoutes() {
|
|
|
50
51
|
);
|
|
51
52
|
|
|
52
53
|
return (
|
|
53
|
-
<NavigationContainer
|
|
54
|
+
<NavigationContainer
|
|
55
|
+
theme={navigationTheme}
|
|
56
|
+
onReady={() => {
|
|
57
|
+
BootSplash.hide();
|
|
58
|
+
}}
|
|
59
|
+
>
|
|
54
60
|
<RootStack.Navigator initialRouteName={initialRouteName} screenOptions={screenOptions}>
|
|
55
61
|
{screens}
|
|
56
62
|
</RootStack.Navigator>
|
|
@@ -34,6 +34,10 @@ rm -rf "$app_rn_node_modules_path"
|
|
|
34
34
|
echo "Deleting $app_rn_ios_pods_path..."
|
|
35
35
|
rm -rf "$app_rn_ios_pods_path"
|
|
36
36
|
|
|
37
|
+
app_rn_ios_pods_checksum="apps/$app_rn_name/ios/.pods-checksum"
|
|
38
|
+
echo "Deleting $app_rn_ios_pods_checksum..."
|
|
39
|
+
rm -f "$app_rn_ios_pods_checksum"
|
|
40
|
+
|
|
37
41
|
echo "Deleting $app_rn_ios_build_path..."
|
|
38
42
|
rm -rf "$app_rn_ios_build_path"
|
|
39
43
|
|
|
File without changes
|