Skip to content

Commit f8ee9f8

Browse files
committed
refactor!: rewrite module with bob template
1 parent 2f1ee6e commit f8ee9f8

File tree

81 files changed

+7185
-5005
lines changed

Some content is hidden

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

81 files changed

+7185
-5005
lines changed

.circleci/config.yml

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
version: 2
2+
3+
defaults: &defaults
4+
docker:
5+
- image: circleci/node:10
6+
working_directory: ~/project
7+
8+
jobs:
9+
install-dependencies:
10+
<<: *defaults
11+
steps:
12+
- checkout
13+
- attach_workspace:
14+
at: ~/project
15+
- restore_cache:
16+
keys:
17+
- dependencies-{{ checksum "package.json" }}
18+
- dependencies-
19+
- restore_cache:
20+
keys:
21+
- dependencies-example-{{ checksum "example/package.json" }}
22+
- dependencies-example-
23+
- run: |
24+
yarn install --cwd example --frozen-lockfile
25+
yarn install --frozen-lockfile
26+
- save_cache:
27+
key: dependencies-{{ checksum "package.json" }}
28+
paths: node_modules
29+
- save_cache:
30+
key: dependencies-example-{{ checksum "example/package.json" }}
31+
paths: example/node_modules
32+
- persist_to_workspace:
33+
root: .
34+
paths: .
35+
lint:
36+
<<: *defaults
37+
steps:
38+
- attach_workspace:
39+
at: ~/project
40+
- run: |
41+
yarn lint
42+
typescript:
43+
<<: *defaults
44+
steps:
45+
- attach_workspace:
46+
at: ~/project
47+
- run: yarn typescript
48+
unit-tests:
49+
<<: *defaults
50+
steps:
51+
- attach_workspace:
52+
at: ~/project
53+
- run: yarn test --coverage
54+
- store_artifacts:
55+
path: coverage
56+
destination: coverage
57+
build-package:
58+
<<: *defaults
59+
steps:
60+
- attach_workspace:
61+
at: ~/project
62+
- run: yarn prepare
63+
64+
65+
workflows:
66+
version: 2
67+
build-and-test:
68+
jobs:
69+
- install-dependencies
70+
- lint:
71+
requires:
72+
- install-dependencies
73+
- typescript:
74+
requires:
75+
- install-dependencies
76+
- unit-tests:
77+
requires:
78+
- install-dependencies
79+
- build-package:
80+
requires:
81+
- install-dependencies

.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
9+
indent_style = space
10+
indent_size = 2
11+
12+
end_of_line = lf
13+
charset = utf-8
14+
trim_trailing_whitespace = true
15+
insert_final_newline = true
File renamed without changes.

.gitignore

+26-49
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
e2e/GeocoderE2EApp
2-
_example
3-
4-
.project
5-
.settings
6-
71
# OSX
82
#
93
.DS_Store
104

5+
# XDE
6+
.expo/
7+
8+
# VSCode
9+
.vscode/
10+
jsconfig.json
11+
1112
# Xcode
1213
#
1314
build/
@@ -28,56 +29,32 @@ DerivedData
2829
*.xcuserstate
2930
project.xcworkspace
3031

31-
# node.js
32+
# Android/IJ
3233
#
33-
node_modules/
34-
npm-debug.log
35-
36-
# Built application files
37-
*.apk
38-
*.ap_
39-
40-
# Files for the Dalvik VM
41-
*.dex
42-
43-
# Java class files
44-
*.class
45-
*.iml
46-
*.aar
47-
*.zip
48-
google-services.json
49-
50-
# Generated files
51-
bin/
52-
gen/
53-
54-
# Gradle files
5534
.idea
5635
.gradle
5736
local.properties
58-
*.iml
59-
local.properties
60-
.idea/workspace.xml
61-
.idea/libraries
62-
build
63-
captures
64-
.gradle/
65-
build/
37+
android.iml
6638

67-
# Local configuration file (sdk path, etc)
68-
local.properties
69-
70-
# Proguard folder generated by Eclipse
71-
proguard/
72-
73-
# Log Files
74-
*.log
39+
.project
40+
.settings
7541

76-
# Android Studio Navigation editor temp files
77-
.navigation/
42+
# Cocoapods
43+
#
44+
example/ios/Pods
7845

79-
# Android Studio captures folder
80-
captures/
46+
# node.js
47+
#
48+
node_modules/
49+
npm-debug.log
50+
yarn-debug.log
51+
yarn-error.log
52+
53+
# BUCK
54+
buck-out/
55+
\.buckd/
56+
android/app/libs
57+
android/keystores/debug.keystore
8158

8259
# generated by bob
8360
lib/

CONTRIBUTING.md

+180
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
# Contributing
2+
3+
We want this community to be friendly and respectful to each other. Please follow it in all your interactions with the project.
4+
5+
## Development workflow
6+
7+
To get started with the project, run `yarn bootstrap` in the root directory to install the required dependencies for each package:
8+
9+
```sh
10+
yarn bootstrap
11+
```
12+
13+
While developing, you can run the [example app](/example/) to test your changes.
14+
15+
To start the packager:
16+
17+
```sh
18+
yarn example start
19+
```
20+
21+
To run the example app on Android:
22+
23+
```sh
24+
yarn example android
25+
```
26+
27+
To run the example app on iOS:
28+
29+
```sh
30+
yarn example android
31+
```
32+
33+
Make sure your code passes TypeScript and ESLint. Run the following to verify:
34+
35+
```sh
36+
yarn typescript
37+
yarn lint
38+
```
39+
40+
To fix formatting errors, run the following:
41+
42+
```sh
43+
yarn lint --fix
44+
```
45+
46+
Remember to add tests for your change if possible. Run the unit tests by:
47+
48+
```sh
49+
yarn test
50+
```
51+
52+
### Commit message convention
53+
54+
We follow the [conventional commits specification](https://www.conventionalcommits.org/en) for our commit messages:
55+
56+
- `fix`: bug fixes, e.g. fix crash due to deprecated method.
57+
- `feat`: new features, e.g. add new method to the module.
58+
- `refactor`: code refactor, e.g. migrate from class components to hooks.
59+
- `docs`: changes into documentation, e.g. add usage example for the module..
60+
- `test`: adding or updating tests, eg add integration tests using detox.
61+
- `chore`: tooling changes, e.g. change CI config.
62+
63+
Our pre-commit hooks verify that your commit message matches this format when committing.
64+
65+
### Linting and tests
66+
67+
[ESLint](https://eslint.org/), [Prettier](https://prettier.io/), [TypeScript](https://www.typescriptlang.org/)
68+
69+
We use [TypeScript](https://www.typescriptlang.org/) for type checking, [ESLint](https://eslint.org/) with [Prettier](https://prettier.io/) for linting and formatting the code, and [Jest](https://jestjs.io/) for testing.
70+
71+
Our pre-commit hooks verify that the linter and tests pass when committing.
72+
73+
### Scripts
74+
75+
The `package.json` file contains various scripts for common tasks:
76+
77+
- `yarn bootstrap`: setup project by installing all dependencies and pods.
78+
- `yarn typescript`: type-check files with TypeScript.
79+
- `yarn lint`: lint files with ESLint.
80+
- `yarn test`: run unit tests with Jest.
81+
- `yarn example start`: start the Metro server for the example app.
82+
- `yarn example android`: run the example app on Android.
83+
- `yarn example ios`: run the example app on iOS.
84+
85+
### Sending a pull request
86+
87+
> **Working on your first pull request?** You can learn how from this _free_ series: [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github).
88+
89+
When you're sending a pull request:
90+
91+
- Prefer small pull requests focused on one change.
92+
- Verify that linters and tests are passing.
93+
- Review the documentation to make sure it looks good.
94+
- Follow the pull request template when opening a pull request.
95+
- For pull requests that change the API or implementation, discuss with maintainers first by opening an issue.
96+
97+
## Code of Conduct
98+
99+
### Our Pledge
100+
101+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
102+
103+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
104+
105+
### Our Standards
106+
107+
Examples of behavior that contributes to a positive environment for our community include:
108+
109+
- Demonstrating empathy and kindness toward other people
110+
- Being respectful of differing opinions, viewpoints, and experiences
111+
- Giving and gracefully accepting constructive feedback
112+
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
113+
- Focusing on what is best not just for us as individuals, but for the overall community
114+
115+
Examples of unacceptable behavior include:
116+
117+
- The use of sexualized language or imagery, and sexual attention or
118+
advances of any kind
119+
- Trolling, insulting or derogatory comments, and personal or political attacks
120+
- Public or private harassment
121+
- Publishing others' private information, such as a physical or email
122+
address, without their explicit permission
123+
- Other conduct which could reasonably be considered inappropriate in a
124+
professional setting
125+
126+
### Enforcement Responsibilities
127+
128+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
129+
130+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
131+
132+
### Scope
133+
134+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
135+
136+
### Enforcement
137+
138+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [INSERT CONTACT METHOD]. All complaints will be reviewed and investigated promptly and fairly.
139+
140+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
141+
142+
### Enforcement Guidelines
143+
144+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
145+
146+
#### 1. Correction
147+
148+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
149+
150+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
151+
152+
#### 2. Warning
153+
154+
**Community Impact**: A violation through a single incident or series of actions.
155+
156+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
157+
158+
#### 3. Temporary Ban
159+
160+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
161+
162+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
163+
164+
#### 4. Permanent Ban
165+
166+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
167+
168+
**Consequence**: A permanent ban from any sort of public interaction within the community.
169+
170+
### Attribution
171+
172+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
173+
available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
174+
175+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
176+
177+
[homepage]: https://www.contributor-covenant.org
178+
179+
For answers to common questions about this code of conduct, see the FAQ at
180+
https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
The MIT License (MIT)
22

33
Copyright (c) 2015 Alexey
4-
Copyright (c) 2018 Tim Wang <[email protected]>
4+
Copyright (c) 2018-2020 Yao Wang <[email protected]>
55

66
Permission is hereby granted, free of charge, to any person obtaining a copy
77
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)