@umang-thakkar/base-template 1.0.9 → 1.1.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/README.md CHANGED
@@ -239,9 +239,12 @@ The template includes a complete theming system with automatic system preference
239
239
  - API calls and React Query hooks are in `src/api/queries.ts`.
240
240
  - Example usage:
241
241
  ```ts
242
- import { useQuery } from "react-query";
242
+ import { useQuery } from "@tanstack/react-query";
243
243
  import { fetchData } from "../api/queries";
244
- const { data, isLoading } = useQuery("data", fetchData);
244
+ const { data, isLoading } = useQuery({
245
+ queryKey: ["data"],
246
+ queryFn: fetchData,
247
+ });
245
248
  ```
246
249
 
247
250
  ### 🧰 Utility Functions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umang-thakkar/base-template",
3
- "version": "1.0.9",
3
+ "version": "1.1.1",
4
4
  "description": "The template for react native to setup redux and other neccesary boilerplate codes",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -19,9 +19,9 @@ react {
19
19
 
20
20
  /* Variants */
21
21
  // The list of variants to that are debuggable. For those we're going to
22
- // skip the bundling of the JS bundle and the assets. By default is just 'debug'.
22
+ // skip the bundling of the JS bundle and the assets. Default is "debug", "debugOptimized".
23
23
  // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
24
- // debuggableVariants = ["liteDebug", "prodDebug"]
24
+ // debuggableVariants = ["liteDebug", "liteDebugOptimized", "prodDebug", "prodDebugOptimized"]
25
25
 
26
26
  /* Bundling */
27
27
  // A list containing the node command and its flags. Default is just 'node'.
@@ -5,6 +5,7 @@
5
5
  <application
6
6
  android:name=".MainApplication"
7
7
  android:label="@string/app_name"
8
+ android:usesCleartextTraffic="${usesCleartextTraffic}"
8
9
  android:icon="@mipmap/ic_launcher"
9
10
  android:roundIcon="@mipmap/ic_launcher_round"
10
11
  android:allowBackup="false"
@@ -4,7 +4,8 @@ import com.facebook.react.ReactActivity
4
4
  import com.facebook.react.ReactActivityDelegate
5
5
  import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
6
6
  import com.facebook.react.defaults.DefaultReactActivityDelegate
7
-
7
+ import android.os.Bundle;
8
+ import com.swmansion.rnscreens.fragment.restoration.RNScreensFragmentFactory;
8
9
  class MainActivity : ReactActivity() {
9
10
 
10
11
  /**
@@ -19,4 +20,9 @@ class MainActivity : ReactActivity() {
19
20
  */
20
21
  override fun createReactActivityDelegate(): ReactActivityDelegate =
21
22
  DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
23
+
24
+ override fun onCreate(savedInstanceState: Bundle?) {
25
+ supportFragmentManager.fragmentFactory = RNScreensFragmentFactory()
26
+ super.onCreate(savedInstanceState);
27
+ }
22
28
  }
@@ -5,31 +5,20 @@ import com.facebook.react.PackageList
5
5
  import com.facebook.react.ReactApplication
6
6
  import com.facebook.react.ReactHost
7
7
  import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative
8
- import com.facebook.react.ReactNativeHost
9
- import com.facebook.react.ReactPackage
10
8
  import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
11
- import com.facebook.react.defaults.DefaultReactNativeHost
12
9
 
13
10
  class MainApplication : Application(), ReactApplication {
14
11
 
15
- override val reactNativeHost: ReactNativeHost =
16
- object : DefaultReactNativeHost(this) {
17
- override fun getPackages(): List<ReactPackage> =
18
- PackageList(this).packages.apply {
19
- // Packages that cannot be autolinked yet can be added manually here, for example:
20
- // add(MyReactNativePackage())
21
- }
22
-
23
- override fun getJSMainModuleName(): String = "index"
24
-
25
- override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
26
-
27
- override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
28
- override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
29
- }
30
-
31
- override val reactHost: ReactHost
32
- get() = getDefaultReactHost(applicationContext, reactNativeHost)
12
+ override val reactHost: ReactHost by lazy {
13
+ getDefaultReactHost(
14
+ context = applicationContext,
15
+ packageList =
16
+ PackageList(this).packages.apply {
17
+ // Packages that cannot be autolinked yet can be added manually here, for example:
18
+ // add(MyReactNativePackage())
19
+ },
20
+ )
21
+ }
33
22
 
34
23
  override fun onCreate() {
35
24
  super.onCreate()
@@ -1,6 +1,6 @@
1
1
  distributionBase=GRADLE_USER_HOME
2
2
  distributionPath=wrapper/dists
3
- distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
3
+ distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
4
4
  networkTimeout=10000
5
5
  validateDistributionUrl=true
6
6
  zipStoreBase=GRADLE_USER_HOME
@@ -1,7 +1,7 @@
1
1
  #!/bin/sh
2
2
 
3
3
  #
4
- # Copyright © 2015-2021 the original authors.
4
+ # Copyright © 2015 the original authors.
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -2,6 +2,8 @@
2
2
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
3
  <plist version="1.0">
4
4
  <dict>
5
+ <key>CADisableMinimumFrameDurationOnPhone</key>
6
+ <true/>
5
7
  <key>CFBundleDevelopmentRegion</key>
6
8
  <string>en</string>
7
9
  <key>CFBundleDisplayName</key>
@@ -26,6 +28,7 @@
26
28
  <true/>
27
29
  <key>NSAppTransportSecurity</key>
28
30
  <dict>
31
+ <!-- Do not change NSAllowsArbitraryLoads to true, or you will risk app rejection! -->
29
32
  <key>NSAllowsArbitraryLoads</key>
30
33
  <false/>
31
34
  <key>NSAllowsLocalNetworking</key>
@@ -33,8 +36,6 @@
33
36
  </dict>
34
37
  <key>NSLocationWhenInUseUsageDescription</key>
35
38
  <string></string>
36
- <key>RCTNewArchEnabled</key>
37
- <false/>
38
39
  <key>UILaunchStoryboardName</key>
39
40
  <string>LaunchScreen</string>
40
41
  <key>UIRequiredDeviceCapabilities</key>
@@ -44,8 +45,13 @@
44
45
  <key>UISupportedInterfaceOrientations</key>
45
46
  <array>
46
47
  <string>UIInterfaceOrientationPortrait</string>
48
+ </array>
49
+ <key>UISupportedInterfaceOrientations~ipad</key>
50
+ <array>
47
51
  <string>UIInterfaceOrientationLandscapeLeft</string>
48
52
  <string>UIInterfaceOrientationLandscapeRight</string>
53
+ <string>UIInterfaceOrientationPortrait</string>
54
+ <string>UIInterfaceOrientationPortraitUpsideDown</string>
49
55
  </array>
50
56
  <key>UIViewControllerBasedStatusBarAppearance</key>
51
57
  <false/>
@@ -11,7 +11,6 @@
11
11
  13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
12
12
  761780ED2CA45674006654EE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 761780EC2CA45674006654EE /* AppDelegate.swift */; };
13
13
  81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
14
- F51ED5429573E67DACCDD39C /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */; };
15
14
  /* End PBXBuildFile section */
16
15
 
17
16
  /* Begin PBXFileReference section */
@@ -160,7 +159,6 @@
160
159
  files = (
161
160
  81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */,
162
161
  13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
163
- F51ED5429573E67DACCDD39C /* PrivacyInfo.xcprivacy in Resources */,
164
162
  );
165
163
  runOnlyForDeploymentPostprocessing = 0;
166
164
  };
@@ -181,7 +179,7 @@
181
179
  );
182
180
  runOnlyForDeploymentPostprocessing = 0;
183
181
  shellPath = /bin/sh;
184
- shellScript = "set -e\n\nWITH_ENVIRONMENT=\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n";
182
+ shellScript = "set -e\n\nWITH_ENVIRONMENT=\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"\\\"$WITH_ENVIRONMENT\\\" \\\"$REACT_NATIVE_XCODE\\\"\"\n";
185
183
  };
186
184
  00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */ = {
187
185
  isa = PBXShellScriptBuildPhase;
@@ -275,8 +273,10 @@
275
273
  );
276
274
  PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
277
275
  PRODUCT_NAME = BaseTemplate;
276
+ SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
278
277
  SWIFT_OPTIMIZATION_LEVEL = "-Onone";
279
278
  SWIFT_VERSION = 5.0;
279
+ TARGETED_DEVICE_FAMILY = "1,2";
280
280
  VERSIONING_SYSTEM = "apple-generic";
281
281
  };
282
282
  name = Debug;
@@ -302,7 +302,9 @@
302
302
  );
303
303
  PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
304
304
  PRODUCT_NAME = BaseTemplate;
305
+ SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
305
306
  SWIFT_VERSION = 5.0;
307
+ TARGETED_DEVICE_FAMILY = "1,2";
306
308
  VERSIONING_SYSTEM = "apple-generic";
307
309
  };
308
310
  name = Release;
@@ -376,10 +378,7 @@
376
378
  "-DFOLLY_CFG_NO_COROUTINES=1",
377
379
  "-DFOLLY_HAVE_CLOCK_GETTIME=1",
378
380
  );
379
- REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
380
381
  SDKROOT = iphoneos;
381
- SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";
382
- USE_HERMES = true;
383
382
  };
384
383
  name = Debug;
385
384
  };
@@ -444,9 +443,7 @@
444
443
  "-DFOLLY_CFG_NO_COROUTINES=1",
445
444
  "-DFOLLY_HAVE_CLOCK_GETTIME=1",
446
445
  );
447
- REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
448
446
  SDKROOT = iphoneos;
449
- USE_HERMES = true;
450
447
  VALIDATE_PRODUCT = YES;
451
448
  };
452
449
  name = Release;
@@ -24,7 +24,6 @@ target 'BaseTemplate' do
24
24
  )
25
25
 
26
26
  post_install do |installer|
27
- # https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
28
27
  react_native_post_install(
29
28
  installer,
30
29
  config[:reactNativePath],
@@ -10,47 +10,47 @@
10
10
  "test": "jest"
11
11
  },
12
12
  "dependencies": {
13
- "@react-native-async-storage/async-storage": "^2.2.0",
14
- "@react-navigation/native": "^7.1.17",
15
- "@react-navigation/native-stack": "^7.3.25",
16
- "@react-navigation/stack": "^7.4.7",
17
- "@reduxjs/toolkit": "^2.8.2",
18
- "@tanstack/react-query": "^5.85.5",
19
- "axios": "^1.11.0",
20
- "moment": "^2.30.1",
21
- "react": "19.1.0",
22
- "react-native": "0.81.0",
23
- "react-native-gesture-handler": "^2.28.0",
24
- "react-native-reanimated": "^4.1.2",
25
- "react-native-safe-area-context": "^5.5.2",
26
- "react-native-screens": "^4.15.0",
13
+ "@react-native-async-storage/async-storage": "^3.1.1",
14
+ "@react-navigation/native": "^7.3.3",
15
+ "@react-navigation/native-stack": "^7.17.5",
16
+ "@react-navigation/stack": "^7.10.5",
17
+ "@reduxjs/toolkit": "^2.12.0",
18
+ "@tanstack/react-query": "^5.101.0",
19
+ "axios": "^1.18.0",
20
+ "date-fns": "^4.4.0",
21
+ "react": "19.2.3",
22
+ "react-native": "0.84.0",
23
+ "react-native-gesture-handler": "^3.0.1",
24
+ "react-native-safe-area-context": "^5.8.0",
25
+ "react-native-screens": "^4.25.0",
27
26
  "react-native-svg": "^15.12.1",
28
- "react-native-worklets": "^0.6.0",
29
- "react-redux": "^9.2.0",
27
+ "react-native-reanimated": "^4.4.1",
28
+ "react-native-worklets": "^0.10.0",
29
+ "react-redux": "^9.3.0",
30
30
  "redux-persist": "^6.0.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@babel/core": "^7.25.2",
34
34
  "@babel/preset-env": "^7.25.3",
35
35
  "@babel/runtime": "^7.25.0",
36
- "@react-native-community/cli": "20.0.0",
37
- "@react-native-community/cli-platform-android": "20.0.0",
38
- "@react-native-community/cli-platform-ios": "20.0.0",
39
- "@react-native/babel-preset": "0.81.0",
40
- "@react-native/eslint-config": "0.81.0",
41
- "@react-native/metro-config": "0.81.0",
42
- "@react-native/typescript-config": "0.81.0",
36
+ "@react-native-community/cli": "20.1.0",
37
+ "@react-native-community/cli-platform-android": "20.1.0",
38
+ "@react-native-community/cli-platform-ios": "20.1.0",
39
+ "@react-native/babel-preset": "0.84.0",
40
+ "@react-native/eslint-config": "0.84.0",
41
+ "@react-native/metro-config": "0.84.0",
42
+ "@react-native/typescript-config": "0.84.0",
43
43
  "@tanstack/eslint-plugin-query": "^5.83.1",
44
44
  "@types/jest": "^29.5.13",
45
- "@types/react": "^19.1.0",
45
+ "@types/react": "^19.2.0",
46
46
  "@types/react-test-renderer": "^19.1.0",
47
47
  "eslint": "^8.19.0",
48
48
  "jest": "^29.6.3",
49
49
  "prettier": "2.8.8",
50
- "react-test-renderer": "19.1.0",
50
+ "react-test-renderer": "19.2.3",
51
51
  "typescript": "^5.8.3"
52
52
  },
53
53
  "engines": {
54
- "node": ">=18"
54
+ "node": ">= 22.11.0"
55
55
  }
56
56
  }
@@ -1,24 +1,19 @@
1
1
  import axios from "axios";
2
- import moment from "moment";
2
+ import { format, isValid, parseISO } from "date-fns";
3
3
 
4
4
  const errorMessage = (error: unknown): string => {
5
- if (axios.isAxiosError(error)) {
6
- return error.response?.data?.message || error.message;
7
- }
8
- return String(error);
5
+ if (axios.isAxiosError(error)) {
6
+ return error.response?.data?.message || error.message;
7
+ }
8
+ return String(error);
9
9
  };
10
10
 
11
11
  export function toFormattedDate(
12
- dateString: string,
13
- format: string
14
- ): string | any {
15
- if (!dateString) { return null; }
16
-
17
- const date = moment(dateString);
18
-
19
- if (!date.isValid()) {
20
- return null;
21
- }
22
-
23
- return date.format(format);
24
- }
12
+ dateString: string,
13
+ formatStr: string,
14
+ ): string | null {
15
+ if (!dateString) return null;
16
+ const date = parseISO(dateString);
17
+ if (!isValid(date)) return null;
18
+ return format(date, formatStr);
19
+ }
@@ -1,3 +1,8 @@
1
1
  {
2
- "extends": "@react-native/typescript-config/tsconfig.json"
3
- }
2
+ "extends": "@react-native/typescript-config",
3
+ "compilerOptions": {
4
+ "types": ["jest"]
5
+ },
6
+ "include": ["**/*.ts", "**/*.tsx"],
7
+ "exclude": ["**/node_modules", "**/Pods"]
8
+ }
@@ -1,9 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
- xmlns:tools="http://schemas.android.com/tools">
4
-
5
- <application
6
- android:usesCleartextTraffic="true"
7
- tools:targetApi="28"
8
- tools:ignore="GoogleAppIndexingWarning"/>
9
- </manifest>