@computools/react-native-template-controller 1.0.8 → 1.0.10

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 (67) hide show
  1. package/README.md +8 -1
  2. package/package.json +1 -1
  3. package/template/.env.development +2 -0
  4. package/template/.env.production +2 -0
  5. package/template/.env.staging +2 -0
  6. package/template/android/app/build.gradle +35 -0
  7. package/template/android/app/src/development/AndroidManifest.xml +25 -0
  8. package/template/android/app/src/development/res/drawable/launch_screen.xml +11 -0
  9. package/template/android/app/src/development/res/drawable/rn_edit_text_material.xml +36 -0
  10. package/template/android/app/src/development/res/mipmap-hdpi/ic_launcher.png +0 -0
  11. package/template/android/app/src/development/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  12. package/template/android/app/src/development/res/mipmap-hdpi/logo.png +0 -0
  13. package/template/android/app/src/development/res/mipmap-mdpi/ic_launcher.png +0 -0
  14. package/template/android/app/src/development/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  15. package/template/android/app/src/development/res/mipmap-mdpi/logo.png +0 -0
  16. package/template/android/app/src/development/res/mipmap-xhdpi/ic_launcher.png +0 -0
  17. package/template/android/app/src/development/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  18. package/template/android/app/src/development/res/mipmap-xhdpi/logo.png +0 -0
  19. package/template/android/app/src/development/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  20. package/template/android/app/src/development/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  21. package/template/android/app/src/development/res/mipmap-xxhdpi/logo.png +0 -0
  22. package/template/android/app/src/development/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  23. package/template/android/app/src/development/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  24. package/template/android/app/src/development/res/mipmap-xxxhdpi/logo.png +0 -0
  25. package/template/android/app/src/development/res/values/colors.xml +4 -0
  26. package/template/android/app/src/development/res/values/strings.xml +3 -0
  27. package/template/android/app/src/development/res/values/styles.xml +14 -0
  28. package/template/android/app/src/staging/AndroidManifest.xml +25 -0
  29. package/template/android/app/src/staging/res/drawable/launch_screen.xml +11 -0
  30. package/template/android/app/src/staging/res/drawable/rn_edit_text_material.xml +36 -0
  31. package/template/android/app/src/staging/res/mipmap-hdpi/ic_launcher.png +0 -0
  32. package/template/android/app/src/staging/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  33. package/template/android/app/src/staging/res/mipmap-hdpi/logo.png +0 -0
  34. package/template/android/app/src/staging/res/mipmap-mdpi/ic_launcher.png +0 -0
  35. package/template/android/app/src/staging/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  36. package/template/android/app/src/staging/res/mipmap-mdpi/logo.png +0 -0
  37. package/template/android/app/src/staging/res/mipmap-xhdpi/ic_launcher.png +0 -0
  38. package/template/android/app/src/staging/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  39. package/template/android/app/src/staging/res/mipmap-xhdpi/logo.png +0 -0
  40. package/template/android/app/src/staging/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  41. package/template/android/app/src/staging/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  42. package/template/android/app/src/staging/res/mipmap-xxhdpi/logo.png +0 -0
  43. package/template/android/app/src/staging/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  44. package/template/android/app/src/staging/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  45. package/template/android/app/src/staging/res/mipmap-xxxhdpi/logo.png +0 -0
  46. package/template/android/app/src/staging/res/values/colors.xml +4 -0
  47. package/template/android/app/src/staging/res/values/strings.xml +3 -0
  48. package/template/android/app/src/staging/res/values/styles.xml +14 -0
  49. package/template/ios/Podfile +10 -1
  50. package/template/ios/ReactNativeTemplate/Images.xcassets/AppIcon dev.appiconset/Contents.json +14 -0
  51. package/template/ios/ReactNativeTemplate/Images.xcassets/AppIcon dev.appiconset/appstore.png +0 -0
  52. package/template/ios/ReactNativeTemplate/Images.xcassets/AppIcon stg.appiconset/Contents.json +14 -0
  53. package/template/ios/ReactNativeTemplate/Images.xcassets/AppIcon stg.appiconset/appstore.png +0 -0
  54. package/template/ios/ReactNativeTemplate dev-Info.plist +55 -0
  55. package/template/ios/ReactNativeTemplate stg-Info.plist +55 -0
  56. package/template/ios/ReactNativeTemplate.xcodeproj/project.pbxproj +475 -26
  57. package/template/ios/ReactNativeTemplate.xcodeproj/xcshareddata/xcschemes/ReactNativeTemplate.xcscheme +37 -1
  58. package/template/ios/ReactNativeTemplate.xcodeproj/xcshareddata/xcschemes/ReactNativeTemplateDev.xcscheme +104 -0
  59. package/template/ios/ReactNativeTemplate.xcodeproj/xcshareddata/xcschemes/ReactNativeTemplateStg.xcscheme +95 -0
  60. package/template/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm +2008 -0
  61. package/template/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h +2448 -0
  62. package/template/ios/build/generated/ios/FBReactNativeSpecJSI-generated.cpp +1523 -0
  63. package/template/ios/build/generated/ios/FBReactNativeSpecJSI.h +5509 -0
  64. package/template/ios/build/generated/ios/React-Codegen.podspec.json +1 -0
  65. package/template/package.json +19 -3
  66. package/template/src/app/config/http.ts +30 -1
  67. package/template/src/app/infrastructure/onboarding/Onboarding.screen.tsx +4 -1
@@ -0,0 +1 @@
1
+ {"name":"React-Codegen","version":"0.72.6","summary":"Temp pod for generated files for React Native","homepage":"https://facebook.com/","license":"Unlicense","authors":"Facebook","compiler_flags":"-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-documentation -Wno-nullability-completeness -std=c++17","source":{"git":""},"header_mappings_dir":"./","platforms":{"ios":"12.4"},"source_files":"**/*.{h,mm,cpp}","pod_target_xcconfig":{"HEADER_SEARCH_PATHS":"\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\" \"$(PODS_ROOT)/Headers/Private/React-Fabric\" \"$(PODS_ROOT)/Headers/Private/React-RCTFabric\"","FRAMEWORK_SEARCH_PATHS":[]},"dependencies":{"React-jsiexecutor":[],"RCT-Folly":[],"RCTRequired":[],"RCTTypeSafety":[],"React-Core":[],"React-jsi":[],"ReactCommon/turbomodule/bridging":[],"ReactCommon/turbomodule/core":[],"React-NativeModulesApple":[],"glog":[],"DoubleConversion":[],"hermes-engine":[],"React-rncore":[],"FBReactNativeSpec":[]}}
@@ -8,7 +8,22 @@
8
8
  "lint": "eslint .",
9
9
  "start": "react-native start",
10
10
  "test": "jest",
11
- "test-coverage": "jest test --coverage --watchAll=false"
11
+ "test-coverage": "jest test --coverage --watchAll=false",
12
+ "ios:dev": "react-native run-ios --scheme \"ReactNativeTemplateDev\" ",
13
+ "ios:stg": "react-native run-ios --scheme \"ReactNativeTemplateStg\"",
14
+ "ios:prod": "react-native run-ios --scheme \"ReactNativeTemplate\"",
15
+ "android:stg": "react-native run-android --mode=stagingdebug --appId=com.reactnativetemplate.staging",
16
+ "android:stg-release": "react-native run-android --mode=stagingrelease",
17
+ "android:dev": "react-native run-android --mode=developmentdebug --appId=com.reactnativetemplate.development",
18
+ "android:dev-release": "react-native run-android --mode=developmentrelease",
19
+ "android:prod": "react-native run-android --mode=productiondebug --appId=com.reactnativetemplate",
20
+ "android:prod-release": "react-native run-android --mode=productionrelease",
21
+ "apk:dev": "cd android && ./gradlew clean && ./gradlew assembleDevelopmentRelease",
22
+ "apk:prod": "cd android && ./gradlew clean && ./gradlew assembleProductionRelease",
23
+ "apk:stage": "cd android && ./gradlew clean && ./gradlew assembleStagingRelease",
24
+ "aab:dev": "cd android && ./gradlew clean && ./gradlew bundleDevelopmentRelease",
25
+ "aab:prod": "cd android && ./gradlew clean && ./gradlew bundleProductionRelease",
26
+ "aab:stage": "cd android && ./gradlew clean && ./gradlew bundleStagingRelease"
12
27
  },
13
28
  "dependencies": {
14
29
  "@hookform/resolvers": "2.9.11",
@@ -21,8 +36,9 @@
21
36
  "react": "18.2.0",
22
37
  "react-hook-form": "7.43.5",
23
38
  "react-i18next": "13.0.1",
24
- "react-native": "0.72.6",
39
+ "react-native": "0.72.7",
25
40
  "react-native-bootsplash": "4.5.3",
41
+ "react-native-config": "1.5.1",
26
42
  "react-native-mmkv": "2.6.3",
27
43
  "react-native-safe-area-context": "4.5.0",
28
44
  "react-native-screens": "3.20.0",
@@ -55,4 +71,4 @@
55
71
  "engines": {
56
72
  "node": ">=16"
57
73
  }
58
- }
74
+ }
@@ -1,4 +1,4 @@
1
- import axios, {type AxiosInstance} from 'axios';
1
+ import axios, {HttpStatusCode, type AxiosInstance} from 'axios';
2
2
 
3
3
  import {AnyJson} from '../types/any-json';
4
4
 
@@ -15,6 +15,7 @@ export class Http {
15
15
  private baseURL: string;
16
16
  private headers: Headers;
17
17
  private axiosInstance: AxiosInstance;
18
+ private refreshToken: (() => Promise<string>) | null = null;
18
19
 
19
20
  public constructor(baseURL: string = '', headers: Headers = {}) {
20
21
  this.baseURL = baseURL;
@@ -63,5 +64,33 @@ export class Http {
63
64
 
64
65
  private createAxiosInstance() {
65
66
  this.axiosInstance = axios.create({baseURL: this.baseURL, headers: this.headers});
67
+
68
+ if (this.refreshToken !== null) {
69
+ this.axiosInstance.interceptors.response.use(
70
+ response => response,
71
+ async error => {
72
+ const originalRequest = error.config;
73
+
74
+ if ([HttpStatusCode.Unauthorized, HttpStatusCode.Forbidden].includes(error.response.status) && !originalRequest._retry) {
75
+ const accessToken = await this.refreshToken!();
76
+
77
+ this.addBearerToken(accessToken);
78
+ this.createAxiosInstance();
79
+
80
+ const originalRequestWithUpdatedToken = {
81
+ ...originalRequest,
82
+ headers: {
83
+ ...originalRequest.headers,
84
+ ...this.headers,
85
+ },
86
+ _retry: true,
87
+ };
88
+
89
+ return this.axiosInstance.request(originalRequestWithUpdatedToken);
90
+ }
91
+ return Promise.reject(error);
92
+ },
93
+ );
94
+ }
66
95
  }
67
96
  }
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
- import {Dimensions, ScrollView, StyleSheet, View} from 'react-native';
2
+ import Config from "react-native-config";
3
+ import {Dimensions, ScrollView, StyleSheet, Text, View} from 'react-native';
3
4
  import {type NativeStackScreenProps} from '@react-navigation/native-stack';
4
5
 
5
6
  import {MainStackParamsList, MainStackRoutes} from '@infra/MainStackRoutes.routes';
@@ -25,6 +26,8 @@ export const Onboarding: React.FC<NativeStackScreenProps<MainStackParamsList, Ma
25
26
  <Step text={localization.t('brandPhrase', {count: 2}).toUpperCase()} />
26
27
  <Step text={localization.t('brandPhrase', {count: 3}).toUpperCase()} />
27
28
  </ScrollView>
29
+ <Text>ENV: {Config.ENV}</Text>
30
+ <Text>API_URL: {Config.API_URL}</Text>
28
31
  <View style={styles.controllsWrapper}>
29
32
  <Button onPress={onSkip} text={localization.t('buttons.skip')} />
30
33
  </View>