@brightlayer-ui/react-native-template-routing-typescript 2.2.0 → 3.0.0-alpha.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.
Files changed (90) hide show
  1. package/README.md +7 -17
  2. package/package.json +1 -1
  3. package/template/.bundle/config +2 -0
  4. package/template/.eslintrc.js +57 -0
  5. package/template/.prettierrc.js +7 -0
  6. package/template/.watchmanconfig +1 -0
  7. package/template/App.tsx +1 -2
  8. package/template/Gemfile +9 -0
  9. package/template/Gemfile.lock +105 -0
  10. package/template/README.md +79 -0
  11. package/template/__tests__/App.test.tsx +17 -0
  12. package/template/_gitignore +74 -0
  13. package/template/android/app/build.gradle +120 -0
  14. package/template/android/app/debug.keystore +0 -0
  15. package/template/android/app/proguard-rules.pro +10 -0
  16. package/template/android/app/src/debug/AndroidManifest.xml +9 -0
  17. package/template/android/app/src/main/AndroidManifest.xml +25 -0
  18. package/template/android/app/src/main/java/com/routingtemplate/MainActivity.kt +28 -0
  19. package/template/android/app/src/main/java/com/routingtemplate/MainApplication.kt +43 -0
  20. package/template/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
  21. package/template/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  22. package/template/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  23. package/template/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  24. package/template/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  25. package/template/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  26. package/template/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  27. package/template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  28. package/template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  29. package/template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  30. package/template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  31. package/template/android/app/src/main/res/values/strings.xml +3 -0
  32. package/template/android/app/src/main/res/values/styles.xml +9 -0
  33. package/template/android/build.gradle +21 -0
  34. package/template/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  35. package/template/android/gradle/wrapper/gradle-wrapper.properties +7 -0
  36. package/template/android/gradle.properties +41 -0
  37. package/template/android/gradlew +249 -0
  38. package/template/android/gradlew.bat +92 -0
  39. package/template/android/link-assets-manifest.json +25 -0
  40. package/template/android/settings.gradle +4 -0
  41. package/template/app.json +4 -0
  42. package/template/assets/fonts/OpenSans-Bold.ttf +0 -0
  43. package/template/assets/fonts/OpenSans-ExtraBold.ttf +0 -0
  44. package/template/assets/fonts/OpenSans-Light.ttf +0 -0
  45. package/template/assets/fonts/OpenSans-Regular.ttf +0 -0
  46. package/template/assets/fonts/OpenSans-SemiBold.ttf +0 -0
  47. package/template/assets/images/Logo.png +0 -0
  48. package/template/babel.config.js +1 -2
  49. package/template/eslint.config.mjs +10 -0
  50. package/template/index.js +10 -0
  51. package/template/ios/.xcode.env +11 -0
  52. package/template/ios/Podfile +40 -0
  53. package/template/ios/Podfile.lock +1496 -0
  54. package/template/ios/blankTemplate/AppDelegate.h +6 -0
  55. package/template/ios/blankTemplate/AppDelegate.mm +31 -0
  56. package/template/ios/blankTemplate/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
  57. package/template/ios/blankTemplate/Images.xcassets/Contents.json +6 -0
  58. package/template/ios/blankTemplate/Info.plist +75 -0
  59. package/template/ios/blankTemplate/LaunchScreen.storyboard +47 -0
  60. package/template/ios/blankTemplate/PrivacyInfo.xcprivacy +37 -0
  61. package/template/ios/blankTemplate/main.m +10 -0
  62. package/template/ios/blankTemplate.xcodeproj/project.pbxproj +741 -0
  63. package/template/ios/blankTemplate.xcodeproj/xcshareddata/xcschemes/blankTemplate.xcscheme +88 -0
  64. package/template/ios/blankTemplate.xcworkspace/contents.xcworkspacedata +10 -0
  65. package/template/ios/blankTemplate.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  66. package/template/ios/blankTemplateTests/Info.plist +24 -0
  67. package/template/ios/blankTemplateTests/blankTemplateTests.m +66 -0
  68. package/template/ios/link-assets-manifest.json +25 -0
  69. package/template/jest.config.js +12 -0
  70. package/template/jestSetupFile.js +1 -8
  71. package/template/metro.config.js +7 -25
  72. package/template/package.json +62 -0
  73. package/template/src/navigation/index.tsx +15 -14
  74. package/template/src/navigation/navigation-drawer.tsx +1 -2
  75. package/template/src/screens/home.tsx +77 -58
  76. package/template/src/screens/pageOne.tsx +3 -5
  77. package/template/src/screens/pageTwo.tsx +3 -5
  78. package/template/tsconfig.json +60 -0
  79. package/template/yarn.lock +7260 -0
  80. package/template.config.js +4 -0
  81. package/CHANGELOG.md +0 -62
  82. package/dependencies.json +0 -23
  83. package/images/Logo.svg +0 -11
  84. package/template/__mocks__/svgMock.js +0 -8
  85. package/template/react-native.config.js +0 -3
  86. /package/{fonts → template/android/app/src/main/assets/fonts}/OpenSans-Bold.ttf +0 -0
  87. /package/{fonts → template/android/app/src/main/assets/fonts}/OpenSans-ExtraBold.ttf +0 -0
  88. /package/{fonts → template/android/app/src/main/assets/fonts}/OpenSans-Light.ttf +0 -0
  89. /package/{fonts → template/android/app/src/main/assets/fonts}/OpenSans-Regular.ttf +0 -0
  90. /package/{fonts → template/android/app/src/main/assets/fonts}/OpenSans-SemiBold.ttf +0 -0
package/README.md CHANGED
@@ -2,14 +2,13 @@
2
2
 
3
3
  ![npm (scoped)](https://img.shields.io/npm/v/@brightlayer-ui/react-native-template-routing-typescript?color=%23007bc1&label=%40brightlayer-ui%2Freact-native-template-routing-typescript)
4
4
 
5
- This is an official Brightlayer UI template used internally by the [Brightlayer UI CLI](https://www.npmjs.com/package/@brightlayer-ui/cli).
6
5
 
7
6
  This template includes the installation and initial setup of routing using [React Navigation](https://reactnavigation.org/). It includes several placeholder routes/screens and a [Drawer](https://brightlayer-ui-components.github.io/react-native/?path=/info/components-documentation--drawer) navigator from the Brightlayer UI [React Native Component Library](https://www.npmjs.com/package/@brightlayer-ui/react-native-components).
8
7
 
9
8
  ## Usage
10
- This template can be used with the Brightlayer UI CLI:
9
+ To create a new project using the Routing Template simply run :
11
10
  ```sh
12
- npx -p @brightlayer-ui/cli blui new react-native --name=myapp --cli=rnc --language=ts --template=routing
11
+ npx react-native init MyApp --template @brightlayer-ui/react-native-template-routing-typescript
13
12
  ```
14
13
 
15
14
  ## Project Structure
@@ -20,10 +19,11 @@ Projects created using this template will start out with the following file stru
20
19
  |── /android // android project folder
21
20
  |── /assets // fonts and images used by the application
22
21
  |── App.tsx // app entry point
23
- |── /pages // sample application pages
24
- └── /router
25
- |── index.tsx // sets up routing
26
- └── navigation-drawer.tsx // sets up Drawer
22
+ └── src
23
+ |── /screens // sample application pages
24
+ └── /Navigation
25
+ |── index.tsx // sets up routing
26
+ └── navigation-drawer.tsx // sets up Drawer
27
27
  ```
28
28
 
29
29
  ## Clear Metro bundler cache (recommended)
@@ -32,13 +32,3 @@ Run the command into the root of the created project.
32
32
  ```sh
33
33
  yarn start --reset-cache
34
34
  ```
35
-
36
- ### Android
37
- This template supports the latest version of the react-native-reanimated package, which needs to reinstall the NDK module from Android Studio. You can do this via Android Studio: Go to Tools -> SDK Manager -> SDK Tools. And Reinstall or install `23.1.7779620` NDK version.
38
-
39
- ### iOS
40
-
41
- Make sure to install pods first before running the app.
42
- ```sh
43
- cd ios && pod install && cd ..
44
- ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightlayer-ui/react-native-template-routing-typescript",
3
- "version": "2.2.0",
3
+ "version": "3.0.0-alpha.1",
4
4
  "author": "brightlayer-ui <brightlayer-ui@eaton.com>",
5
5
  "keywords": [
6
6
  "react native",
@@ -0,0 +1,2 @@
1
+ BUNDLE_PATH: "vendor/bundle"
2
+ BUNDLE_FORCE_RUBY_PLATFORM: 1
@@ -0,0 +1,57 @@
1
+ module.exports = {
2
+ root: true,
3
+ parser: '@typescript-eslint/parser',
4
+ extends: ['@brightlayer-ui/eslint-config/tsx'],
5
+ parserOptions: {
6
+ project: './tsconfig.json',
7
+ },
8
+ plugins: ['react-hooks'],
9
+ rules: {
10
+ 'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
11
+ 'react-hooks/exhaustive-deps': 'warn', // Checks effect dependencies
12
+ 'react/display-name': 'off',
13
+ '@typescript-eslint/naming-convention': [
14
+ 'error',
15
+ {
16
+ selector: 'default',
17
+ format: ['camelCase', 'PascalCase'],
18
+ },
19
+ {
20
+ selector: 'variable',
21
+ format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
22
+ },
23
+ {
24
+ selector: 'property',
25
+ format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
26
+ },
27
+ {
28
+ selector: 'property',
29
+ format: null,
30
+ modifiers: ['requiresQuotes'],
31
+ },
32
+ {
33
+ selector: 'enumMember',
34
+ format: ['UPPER_CASE'],
35
+ },
36
+ {
37
+ selector: 'parameter',
38
+ format: ['camelCase'],
39
+ leadingUnderscore: 'allow',
40
+ },
41
+ {
42
+ selector: 'memberLike',
43
+ modifiers: ['private'],
44
+ format: ['camelCase'],
45
+ leadingUnderscore: 'require',
46
+ },
47
+ {
48
+ selector: 'typeLike',
49
+ format: ['PascalCase'],
50
+ },
51
+ {
52
+ selector: 'import',
53
+ format: ['camelCase', 'PascalCase'],
54
+ },
55
+ ],
56
+ },
57
+ };
@@ -0,0 +1,7 @@
1
+ module.exports = {
2
+ arrowParens: 'avoid',
3
+ bracketSameLine: true,
4
+ bracketSpacing: false,
5
+ singleQuote: true,
6
+ trailingComma: 'all',
7
+ };
@@ -0,0 +1 @@
1
+ {}
package/template/App.tsx CHANGED
@@ -10,8 +10,7 @@ import React from 'react';
10
10
  import { Provider as ThemeProvider } from 'react-native-paper';
11
11
  import { SafeAreaProvider } from 'react-native-safe-area-context';
12
12
  import * as BLUIThemes from '@brightlayer-ui/react-native-themes';
13
- import { MainRouter } from './src/navigation';
14
-
13
+ import MainRouter from './src/navigation';
15
14
  export const App = (): JSX.Element => (
16
15
  <ThemeProvider theme={BLUIThemes.blue}>
17
16
  <SafeAreaProvider>
@@ -0,0 +1,9 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4
+ ruby ">= 2.6.10"
5
+
6
+ # Cocoapods 1.15 introduced a bug which break the build. We will remove the upper
7
+ # bound in the template on Cocoapods with next React Native release.
8
+ gem 'cocoapods', '>= 1.13', '< 1.15'
9
+ gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
@@ -0,0 +1,105 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ CFPropertyList (3.0.7)
5
+ base64
6
+ nkf
7
+ rexml
8
+ activesupport (6.1.7.7)
9
+ concurrent-ruby (~> 1.0, >= 1.0.2)
10
+ i18n (>= 1.6, < 2)
11
+ minitest (>= 5.1)
12
+ tzinfo (~> 2.0)
13
+ zeitwerk (~> 2.3)
14
+ addressable (2.8.6)
15
+ public_suffix (>= 2.0.2, < 6.0)
16
+ algoliasearch (1.27.5)
17
+ httpclient (~> 2.8, >= 2.8.3)
18
+ json (>= 1.5.1)
19
+ atomos (0.1.3)
20
+ base64 (0.2.0)
21
+ claide (1.1.0)
22
+ cocoapods (1.14.3)
23
+ addressable (~> 2.8)
24
+ claide (>= 1.0.2, < 2.0)
25
+ cocoapods-core (= 1.14.3)
26
+ cocoapods-deintegrate (>= 1.0.3, < 2.0)
27
+ cocoapods-downloader (>= 2.1, < 3.0)
28
+ cocoapods-plugins (>= 1.0.0, < 2.0)
29
+ cocoapods-search (>= 1.0.0, < 2.0)
30
+ cocoapods-trunk (>= 1.6.0, < 2.0)
31
+ cocoapods-try (>= 1.1.0, < 2.0)
32
+ colored2 (~> 3.1)
33
+ escape (~> 0.0.4)
34
+ fourflusher (>= 2.3.0, < 3.0)
35
+ gh_inspector (~> 1.0)
36
+ molinillo (~> 0.8.0)
37
+ nap (~> 1.0)
38
+ ruby-macho (>= 2.3.0, < 3.0)
39
+ xcodeproj (>= 1.23.0, < 2.0)
40
+ cocoapods-core (1.14.3)
41
+ activesupport (>= 5.0, < 8)
42
+ addressable (~> 2.8)
43
+ algoliasearch (~> 1.0)
44
+ concurrent-ruby (~> 1.1)
45
+ fuzzy_match (~> 2.0.4)
46
+ nap (~> 1.0)
47
+ netrc (~> 0.11)
48
+ public_suffix (~> 4.0)
49
+ typhoeus (~> 1.0)
50
+ cocoapods-deintegrate (1.0.5)
51
+ cocoapods-downloader (2.1)
52
+ cocoapods-plugins (1.0.0)
53
+ nap
54
+ cocoapods-search (1.0.1)
55
+ cocoapods-trunk (1.6.0)
56
+ nap (>= 0.8, < 2.0)
57
+ netrc (~> 0.11)
58
+ cocoapods-try (1.2.0)
59
+ colored2 (3.1.2)
60
+ concurrent-ruby (1.2.3)
61
+ escape (0.0.4)
62
+ ethon (0.16.0)
63
+ ffi (>= 1.15.0)
64
+ ffi (1.16.3)
65
+ fourflusher (2.3.1)
66
+ fuzzy_match (2.0.4)
67
+ gh_inspector (1.1.3)
68
+ httpclient (2.8.3)
69
+ i18n (1.14.5)
70
+ concurrent-ruby (~> 1.0)
71
+ json (2.7.2)
72
+ minitest (5.22.3)
73
+ molinillo (0.8.0)
74
+ nanaimo (0.3.0)
75
+ nap (1.1.0)
76
+ netrc (0.11.0)
77
+ nkf (0.2.0)
78
+ public_suffix (4.0.7)
79
+ rexml (3.2.6)
80
+ ruby-macho (2.5.1)
81
+ typhoeus (1.4.1)
82
+ ethon (>= 0.9.0)
83
+ tzinfo (2.0.6)
84
+ concurrent-ruby (~> 1.0)
85
+ xcodeproj (1.24.0)
86
+ CFPropertyList (>= 2.3.3, < 4.0)
87
+ atomos (~> 0.1.3)
88
+ claide (>= 1.0.2, < 2.0)
89
+ colored2 (~> 3.1)
90
+ nanaimo (~> 0.3.0)
91
+ rexml (~> 3.2.4)
92
+ zeitwerk (2.6.13)
93
+
94
+ PLATFORMS
95
+ ruby
96
+
97
+ DEPENDENCIES
98
+ activesupport (>= 6.1.7.5, < 7.1.0)
99
+ cocoapods (>= 1.13, < 1.15)
100
+
101
+ RUBY VERSION
102
+ ruby 2.6.10p210
103
+
104
+ BUNDLED WITH
105
+ 1.17.2
@@ -0,0 +1,79 @@
1
+ This is a new [**React Native**](https://reactnative.dev) project, bootstrapped using [`@react-native-community/cli`](https://github.com/react-native-community/cli).
2
+
3
+ # Getting Started
4
+
5
+ >**Note**: Make sure you have completed the [React Native - Environment Setup](https://reactnative.dev/docs/environment-setup) instructions till "Creating a new application" step, before proceeding.
6
+
7
+ ## Step 1: Start the Metro Server
8
+
9
+ First, you will need to start **Metro**, the JavaScript _bundler_ that ships _with_ React Native.
10
+
11
+ To start Metro, run the following command from the _root_ of your React Native project:
12
+
13
+ ```bash
14
+ # using npm
15
+ npm start
16
+
17
+ # OR using Yarn
18
+ yarn start
19
+ ```
20
+
21
+ ## Step 2: Start your Application
22
+
23
+ Let Metro Bundler run in its _own_ terminal. Open a _new_ terminal from the _root_ of your React Native project. Run the following command to start your _Android_ or _iOS_ app:
24
+
25
+ ### For Android
26
+
27
+ ```bash
28
+ # using npm
29
+ npm run android
30
+
31
+ # OR using Yarn
32
+ yarn android
33
+ ```
34
+
35
+ ### For iOS
36
+
37
+ ```bash
38
+ # using npm
39
+ npm run ios
40
+
41
+ # OR using Yarn
42
+ yarn ios
43
+ ```
44
+
45
+ If everything is set up _correctly_, you should see your new app running in your _Android Emulator_ or _iOS Simulator_ shortly provided you have set up your emulator/simulator correctly.
46
+
47
+ This is one way to run your app — you can also run it directly from within Android Studio and Xcode respectively.
48
+
49
+ ## Step 3: Modifying your App
50
+
51
+ Now that you have successfully run the app, let's modify it.
52
+
53
+ 1. Open `App.tsx` in your text editor of choice and edit some lines.
54
+ 2. For **Android**: Press the <kbd>R</kbd> key twice or select **"Reload"** from the **Developer Menu** (<kbd>Ctrl</kbd> + <kbd>M</kbd> (on Window and Linux) or <kbd>Cmd ⌘</kbd> + <kbd>M</kbd> (on macOS)) to see your changes!
55
+
56
+ For **iOS**: Hit <kbd>Cmd ⌘</kbd> + <kbd>R</kbd> in your iOS Simulator to reload the app and see your changes!
57
+
58
+ ## Congratulations! :tada:
59
+
60
+ You've successfully run and modified your React Native App. :partying_face:
61
+
62
+ ### Now what?
63
+
64
+ - If you want to add this new React Native code to an existing application, check out the [Integration guide](https://reactnative.dev/docs/integration-with-existing-apps).
65
+ - If you're curious to learn more about React Native, check out the [Introduction to React Native](https://reactnative.dev/docs/getting-started).
66
+
67
+ # Troubleshooting
68
+
69
+ If you can't get this to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page.
70
+
71
+ # Learn More
72
+
73
+ To learn more about React Native, take a look at the following resources:
74
+
75
+ - [React Native Website](https://reactnative.dev) - learn more about React Native.
76
+ - [Getting Started](https://reactnative.dev/docs/environment-setup) - an **overview** of React Native and how setup your environment.
77
+ - [Learn the Basics](https://reactnative.dev/docs/getting-started) - a **guided tour** of the React Native **basics**.
78
+ - [Blog](https://reactnative.dev/blog) - read the latest official React Native **Blog** posts.
79
+ - [`@facebook/react-native`](https://github.com/facebook/react-native) - the Open Source; GitHub **repository** for React Native.
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @format
3
+ */
4
+
5
+ import 'react-native';
6
+ import React from 'react';
7
+ import App from '../App';
8
+
9
+ // Note: import explicitly to use the types shipped with jest.
10
+ import { it } from '@jest/globals';
11
+
12
+ // Note: test renderer must be required after react-native.
13
+ import renderer from 'react-test-renderer';
14
+
15
+ it('renders correctly', () => {
16
+ renderer.create(<App />);
17
+ });
@@ -0,0 +1,74 @@
1
+ # OSX
2
+ #
3
+ .DS_Store
4
+
5
+ # Xcode
6
+ #
7
+ build/
8
+ *.pbxuser
9
+ !default.pbxuser
10
+ *.mode1v3
11
+ !default.mode1v3
12
+ *.mode2v3
13
+ !default.mode2v3
14
+ *.perspectivev3
15
+ !default.perspectivev3
16
+ xcuserdata
17
+ *.xccheckout
18
+ *.moved-aside
19
+ DerivedData
20
+ *.hmap
21
+ *.ipa
22
+ *.xcuserstate
23
+ **/.xcode.env.local
24
+
25
+ # Android/IntelliJ
26
+ #
27
+ build/
28
+ .idea
29
+ .gradle
30
+ local.properties
31
+ *.iml
32
+ *.hprof
33
+ .cxx/
34
+ *.keystore
35
+ !debug.keystore
36
+
37
+ # node.js
38
+ #
39
+ node_modules/
40
+ npm-debug.log
41
+ yarn-error.log
42
+
43
+ # fastlane
44
+ #
45
+ # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
46
+ # screenshots whenever they are needed.
47
+ # For more information about the recommended setup visit:
48
+ # https://docs.fastlane.tools/best-practices/source-control/
49
+
50
+ **/fastlane/report.xml
51
+ **/fastlane/Preview.html
52
+ **/fastlane/screenshots
53
+ **/fastlane/test_output
54
+
55
+ # Bundle artifact
56
+ *.jsbundle
57
+
58
+ # Ruby / CocoaPods
59
+ **/Pods/
60
+ /vendor/bundle/
61
+
62
+ # Temporary files created by Metro to check the health of the file watcher
63
+ .metro-health-check*
64
+
65
+ # testing
66
+ /coverage
67
+
68
+ # Yarn
69
+ .yarn/*
70
+ !.yarn/patches
71
+ !.yarn/plugins
72
+ !.yarn/releases
73
+ !.yarn/sdks
74
+ !.yarn/versions
@@ -0,0 +1,120 @@
1
+ apply plugin: "com.android.application"
2
+ apply plugin: "org.jetbrains.kotlin.android"
3
+ apply plugin: "com.facebook.react"
4
+
5
+ /**
6
+ * This is the configuration block to customize your React Native Android app.
7
+ * By default you don't need to apply any configuration, just uncomment the lines you need.
8
+ */
9
+ react {
10
+ /* Folders */
11
+ // The root of your project, i.e. where "package.json" lives. Default is '..'
12
+ // root = file("../")
13
+ // The folder where the react-native NPM package is. Default is ../node_modules/react-native
14
+ // reactNativeDir = file("../node_modules/react-native")
15
+ // The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
16
+ // codegenDir = file("../node_modules/@react-native/codegen")
17
+ // The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
18
+ // cliFile = file("../node_modules/react-native/cli.js")
19
+
20
+ /* Variants */
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'.
23
+ // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
24
+ // debuggableVariants = ["liteDebug", "prodDebug"]
25
+
26
+ /* Bundling */
27
+ // A list containing the node command and its flags. Default is just 'node'.
28
+ // nodeExecutableAndArgs = ["node"]
29
+ //
30
+ // The command to run when bundling. By default is 'bundle'
31
+ // bundleCommand = "ram-bundle"
32
+ //
33
+ // The path to the CLI configuration file. Default is empty.
34
+ // bundleConfig = file(../rn-cli.config.js)
35
+ //
36
+ // The name of the generated asset file containing your JS bundle
37
+ // bundleAssetName = "MyApplication.android.bundle"
38
+ //
39
+ // The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
40
+ // entryFile = file("../js/MyApplication.android.js")
41
+ //
42
+ // A list of extra flags to pass to the 'bundle' commands.
43
+ // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
44
+ // extraPackagerArgs = []
45
+
46
+ /* Hermes Commands */
47
+ // The hermes compiler command to run. By default it is 'hermesc'
48
+ // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
49
+ //
50
+ // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
51
+ // hermesFlags = ["-O", "-output-source-map"]
52
+ }
53
+
54
+ /**
55
+ * Set this to true to Run Proguard on Release builds to minify the Java bytecode.
56
+ */
57
+ def enableProguardInReleaseBuilds = false
58
+
59
+ /**
60
+ * The preferred build flavor of JavaScriptCore (JSC)
61
+ *
62
+ * For example, to use the international variant, you can use:
63
+ * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
64
+ *
65
+ * The international variant includes ICU i18n library and necessary data
66
+ * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
67
+ * give correct results when using with locales other than en-US. Note that
68
+ * this variant is about 6MiB larger per architecture than default.
69
+ */
70
+ def jscFlavor = 'org.webkit:android-jsc:+'
71
+
72
+ android {
73
+ ndkVersion rootProject.ext.ndkVersion
74
+ buildToolsVersion rootProject.ext.buildToolsVersion
75
+ compileSdk rootProject.ext.compileSdkVersion
76
+
77
+ namespace "com.routingtemplate"
78
+ defaultConfig {
79
+ applicationId "com.routingtemplate"
80
+ minSdkVersion rootProject.ext.minSdkVersion
81
+ targetSdkVersion rootProject.ext.targetSdkVersion
82
+ versionCode 1
83
+ versionName "1.0"
84
+ }
85
+ signingConfigs {
86
+ debug {
87
+ storeFile file('debug.keystore')
88
+ storePassword 'android'
89
+ keyAlias 'androiddebugkey'
90
+ keyPassword 'android'
91
+ }
92
+ }
93
+ buildTypes {
94
+ debug {
95
+ signingConfig signingConfigs.debug
96
+ }
97
+ release {
98
+ // Caution! In production, you need to generate your own keystore file.
99
+ // see https://reactnative.dev/docs/signed-apk-android.
100
+ signingConfig signingConfigs.debug
101
+ minifyEnabled enableProguardInReleaseBuilds
102
+ proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
103
+ }
104
+ }
105
+ }
106
+
107
+ dependencies {
108
+ // The version of react-native is set by the React Native Gradle Plugin
109
+ implementation("com.facebook.react:react-android")
110
+
111
+ if (hermesEnabled.toBoolean()) {
112
+ implementation("com.facebook.react:hermes-android")
113
+ } else {
114
+ implementation jscFlavor
115
+ }
116
+ }
117
+
118
+ apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
119
+ apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
120
+ apply from: "../../node_modules/@brightlayer-ui/react-native-vector-icons/fonts.gradle"
@@ -0,0 +1,10 @@
1
+ # Add project specific ProGuard rules here.
2
+ # By default, the flags in this file are appended to flags specified
3
+ # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
4
+ # You can edit the include path and order by changing the proguardFiles
5
+ # directive in build.gradle.
6
+ #
7
+ # For more details, see
8
+ # http://developer.android.com/guide/developing/tools/proguard.html
9
+
10
+ # Add any project specific keep options here:
@@ -0,0 +1,9 @@
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>
@@ -0,0 +1,25 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
+
3
+ <uses-permission android:name="android.permission.INTERNET" />
4
+
5
+ <application
6
+ android:name=".MainApplication"
7
+ android:label="@string/app_name"
8
+ android:icon="@mipmap/ic_launcher"
9
+ android:roundIcon="@mipmap/ic_launcher_round"
10
+ android:allowBackup="false"
11
+ android:theme="@style/AppTheme">
12
+ <activity
13
+ android:name=".MainActivity"
14
+ android:label="@string/app_name"
15
+ android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
16
+ android:launchMode="singleTask"
17
+ android:windowSoftInputMode="adjustResize"
18
+ android:exported="true">
19
+ <intent-filter>
20
+ <action android:name="android.intent.action.MAIN" />
21
+ <category android:name="android.intent.category.LAUNCHER" />
22
+ </intent-filter>
23
+ </activity>
24
+ </application>
25
+ </manifest>
@@ -0,0 +1,28 @@
1
+ package com.routingtemplate
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
+ * added for react-native-screens
12
+ */
13
+ override fun onCreate(savedInstanceState: Bundle?) {
14
+ super.onCreate(null)
15
+ }
16
+ /**
17
+ * Returns the name of the main component registered from JavaScript. This is used to schedule
18
+ * rendering of the component.
19
+ */
20
+ override fun getMainComponentName(): String = "blankTemplate"
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
+ }
@@ -0,0 +1,43 @@
1
+ package com.routingtemplate
2
+
3
+ import android.app.Application
4
+ import com.facebook.react.PackageList
5
+ import com.facebook.react.ReactApplication
6
+ import com.facebook.react.ReactHost
7
+ import com.facebook.react.ReactNativeHost
8
+ import com.facebook.react.ReactPackage
9
+ import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
10
+ import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
11
+ import com.facebook.react.defaults.DefaultReactNativeHost
12
+ import com.facebook.soloader.SoLoader
13
+
14
+ class MainApplication : Application(), ReactApplication {
15
+
16
+ override val reactNativeHost: ReactNativeHost =
17
+ object : DefaultReactNativeHost(this) {
18
+ override fun getPackages(): List<ReactPackage> =
19
+ PackageList(this).packages.apply {
20
+ // Packages that cannot be autolinked yet can be added manually here, for example:
21
+ // add(MyReactNativePackage())
22
+ }
23
+
24
+ override fun getJSMainModuleName(): String = "index"
25
+
26
+ override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
27
+
28
+ override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
29
+ override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
30
+ }
31
+
32
+ override val reactHost: ReactHost
33
+ get() = getDefaultReactHost(applicationContext, reactNativeHost)
34
+
35
+ override fun onCreate() {
36
+ super.onCreate()
37
+ SoLoader.init(this, false)
38
+ if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
39
+ // If you opted-in for the New Architecture, we load the native entry point for this app.
40
+ load()
41
+ }
42
+ }
43
+ }