Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9f73d1a

Browse files
authored
feat: eva material compatibility
1 parent 39ec20b commit 9f73d1a

File tree

586 files changed

+8116
-4344
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

586 files changed

+8116
-4344
lines changed

.gitignore

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
node_modules/**/*
2-
.expo/*
31
npm-debug.*
42
*.jks
53
*.jks.bak
@@ -16,6 +14,7 @@ local.properties
1614

1715
# node.js
1816
node_modules/
17+
node_modules/**/*
1918
npm-debug.log
2019

2120
# env
@@ -24,7 +23,30 @@ env/index.js
2423
# expo
2524

2625
.expo
26+
.expo/*
2727
.expo-shared/
2828
web-build/
2929

3030
dist
31+
32+
# Bundle artifact
33+
*.jsbundle
34+
35+
# native
36+
37+
# Android/IntelliJ
38+
#
39+
build/
40+
.gradle
41+
*.iml
42+
*.apk
43+
44+
# BUCK
45+
buck-out/
46+
\.buckd/
47+
*.keystore
48+
!debug.keystore
49+
50+
# CocoaPods
51+
/ios/Pods/
52+

DEV_DOCS.md

Lines changed: 62 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,46 @@
1-
[Running](#running)
2-
1+
[Run](#run)
2+
[Run with Expo](#run-with-expo)
3+
[Environments](#environments)
4+
[Building](#building)
35
[Reusing Screens](#reusing-screens)
46

5-
# Running
7+
# Run
8+
9+
Before running, application dependencies should be installed and linked.
10+
11+
`yarn && npx react-native link && cd ios && pod install` from the project root.
12+
13+
By default, Kitten Tricks starts like a regular React Native application. In case you want it to run
14+
with Expo, see [Expo](#run-with-expo) section.
615

7-
`yarn && yarn start` from the project root
16+
`yarn start` from the project root to start Metro Bundler.
17+
`yarn ios` or `yarn android` to run application on the device.
818

9-
## Environments:
19+
# Run with Expo
20+
21+
`expo start` from the project root. This will start a local Expo server and output an options to run
22+
application on iOS, Android or Web.
23+
24+
When running with Expo, `ios` and `android` folder are not needed for this project.
25+
Also, some of the business logic may have different implementation for Expo and Bare React Native apps.
26+
In Kitten Tricks, we handle it with [`.expo` file extension](https://docs.expo.io/versions/latest/bare/using-expo-client/#practical-patterns-for-client-compatible-bare-apps).
27+
28+
# Environments
1029

1130
Kitten Tricks application supports two environments:
1231

1332
- **Production** (Provides Eva Design System and UI Kitten modules published to npm)
1433
- **Development** (Provides local Eva Design System and UI Kitten modules)
1534

16-
### Run in production mode:
35+
Environment configuration can be found in [./env](./env) dir.
36+
It includes `.env` files to locate environment-dependent modules and tsconfig files for each environment.
37+
To switch environment manually, you can run `yarn env prod` or `yarn env dev`.
38+
39+
## Production mode
1740

18-
`npm start`
41+
`yarn start`
1942

20-
### Run in development mode:
43+
## Development mode
2144

2245
- Clone Eva Design System and UI Kitten projects to the directory containing Kitten Tricks:
2346
```bash
@@ -31,27 +54,48 @@ git clone https://github.com/eva-design/eva && git clone https://github.com/akve
3154
- kittenTricks
3255
- react-native-ui-kitten
3356
```
34-
- Install dependencies if needed and finally run `npm run start:dev`
57+
- Install dependencies if needed and finally run `yarn start:dev`
58+
59+
# Building
60+
61+
## Transpile to JavaScript
62+
63+
We use [Typescript](https://www.typescriptlang.org/) to build Kitten Tricks.
64+
Use `yarn build` to compile it to JavaScript. This will output the source code with `.js` files in
65+
[`./dist/tsc-out`](./dist/tsc-out) dir.
66+
67+
Don't use this output as source code in your project in case you would like to [reuse screens](#reusing-screens).
68+
69+
## Web Bundle
70+
71+
`expo build:web` from the project root to build runnable web bundle.
72+
This will output web bundle in [`./web-build`](./web-build) dir.
3573

3674
# Reusing Screens
3775

38-
All screens presented in Kitten Tricks application are listed in [`./src/scenes`](./src/scenes) directory and structured by following categories:
76+
All screens presented in Kitten Tricks application are listed in [`./src/layouts`](./src/layouts) directory and structured by following categories:
3977

40-
- [Auth](./src/scenes/auth)
41-
- [Social](./src/scenes/social)
42-
- [Articles](./src/scenes/articles)
43-
- [Messaging](./src/scenes/messaging)
44-
- [Dashboards](./src/scenes/dashboards)
45-
- [Ecommerce](./src/scenes/ecommerce)
78+
- [Auth](./src/layouts/auth)
79+
- [Social](./src/layouts/social)
80+
- [Articles](./src/layouts/articles)
81+
- [Messaging](./src/layouts/messaging)
82+
- [Dashboards](./src/layouts/dashboards)
83+
- [Ecommerce](./src/layouts/ecommerce)
4684

4785
If you would like to reuse it, you may copy and paste the entire screen folder.
4886

4987
Some of the screens may contain 3rd-party modules that need to be installed.
5088
You can find them in `3rd-party.ts` files.
5189

5290
E.g in case of reusing `Forgot Password` screen, you may need:
53-
- Copy [Forgot Password](./src/scenes/auth/forgot-password) directory into your project
54-
- Install and configure 3rd-party modules listed in [3rd-party.ts](./src/scenes/auth/forgot-password/extra/3rd-party.ts) file.
91+
- Copy [Forgot Password](./src/layouts/auth/forgot-password) directory into your project
92+
- Install and configure 3rd-party modules listed in [3rd-party.ts](./src/layouts/auth/forgot-password/extra/3rd-party.ts) file.
93+
94+
Note that the source code for reusable screens doesn't include headers, safe areas and navigation logic.
95+
In case you want to add this, the following links might be helpful:
96+
97+
- [Supporting safe areas](https://reactnavigation.org/docs/en/next/handling-safe-area.html)
98+
- [Adding navigation headers](https://akveo.github.io/react-native-ui-kitten/docs/components/top-navigation)
5599

56100
## Structure
57101

android/app/_BUCK

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# To learn about Buck see [Docs](https://buckbuild.com/).
2+
# To run your application with Buck:
3+
# - install Buck
4+
# - `npm start` - to start the packager
5+
# - `cd android`
6+
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
7+
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
8+
# - `buck install -r android/app` - compile, install and run application
9+
#
10+
11+
load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
12+
13+
lib_deps = []
14+
15+
create_aar_targets(glob(["libs/*.aar"]))
16+
17+
create_jar_targets(glob(["libs/*.jar"]))
18+
19+
android_library(
20+
name = "all-libs",
21+
exported_deps = lib_deps,
22+
)
23+
24+
android_library(
25+
name = "app-code",
26+
srcs = glob([
27+
"src/main/java/**/*.java",
28+
]),
29+
deps = [
30+
":all-libs",
31+
":build_config",
32+
":res",
33+
],
34+
)
35+
36+
android_build_config(
37+
name = "build_config",
38+
package = "com.akveo.kittenTricks",
39+
)
40+
41+
android_resource(
42+
name = "res",
43+
package = "com.akveo.kittenTricks",
44+
res = "src/main/res",
45+
)
46+
47+
android_binary(
48+
name = "app",
49+
keystore = "//android/keystores:debug",
50+
manifest = "src/main/AndroidManifest.xml",
51+
package_type = "debug",
52+
deps = [
53+
":app-code",
54+
],
55+
)

0 commit comments

Comments
 (0)