Skip to content

Latest commit

 

History

History
137 lines (105 loc) · 6.38 KB

CONTRIBUTING.md

File metadata and controls

137 lines (105 loc) · 6.38 KB

Contribution Guide (@copyright by dooboolab)

Followed by dooboolab.com's CONTRIBUTING GUILDE @copyright by dooboolab

You should be aware of below stacks(do not need to be professional) to contribute to our repository.

  1. React Native
  2. expo
  3. VSCODE
    • We are using vscode as our ide. Please install eslint plugin.
  4. Graphql
  5. Apollo Client

Installation

  1. Fork our project to yours.
    • Recommended to have forked master branch to be updated to upstream.
    • Configure Syncing a fork.
      • git remote add upstream https://github.com/dooboolab/hackatalk-mobile
      • Check it with git remote -v
    • Fetch the branches from upstream repository by git fetch upstream
    • When you want to give PR, make new branch git checkout -b [feature_name]
      • Before pushing PR, do git fetch upstream from master branch then try the rebase by git rebase master
      • Check your status by git log --decorate --oneline --all --graph or npm run git:log
  2. Git clone your forked repository.
    git clone https://github.com/<your-id>/hackatalk-mobile.git
    
  3. Install your packages
    yarn
    
    • Note that we recommend using yarn because all of our team members do.
    • Also node that yarn.lock and package-lock.json sometimes make collision. Try to delete one of them.
  4. Configure ios project
    • Go to ios directory and run pod install
    • Since react-native is using version 0.60 for now, the project is built with pod project which is required to install packages to build your ios project.
  5. Configure android project
    • Not much required. Be aware your project should be compatible with androidx.
      • Above means you should be careful when using third party react-native native modules because they might not be compatible with androidx which will result in failed build.
  6. Configure environment for project
    • Copy config.sample.ts to config.ts.
      cp config.sample.ts config.ts
      
    • Copy app.sample.json to app.json.
      cp app.sample.json app.json
      

      Note that you should avoid using fake string like "reservedClientId": "<reservedClientId>". Please erase it if you've not have one or put the real one otherwise expo won't start your app.

  7. Install expo-cli
    • npm install -g expo-cli
  8. Run your project
    • ios
      • yarn run ios
    • android
      • yarn run android

        Note that you should open your emulator beforehand before running above command since the script won't automatically open emulator unlike ios.

  9. Configure linting in vscode correctly.

Commit message

Commit messages should include a title, summary, and test plan.

Write the title in the imperative mood and prefix it with a tag that describes the affected code, like [android] or [video], and makes it easier to read through the commit log.

In the summary, explain the motivation behind the commit ("why") and the approach it takes ("how"). Note things that aren't communicated by the code or require more context to infer.

Use the test plan to communicate how to verify the code actually works and to help others in the future create their test plans for the same area of the codebase. Read the Expo guide on Git and Code Reviews for more guidance on PRs and test plans.

This post called How to Write a Git Commit Message has a lot of good guidance, too.

Issue

  • Please search and register if you already have the issue you want to create. If you have a similar issue, you can add additional comments.
  • Please write a problem or suggestion in the issue. Never include more than one item in an issue.
  • Please be as detailed and concise as possible. * If necessary, please take a screenshot and upload an image.

Pull request(PR)

PR is available to master branch.

Each PR should correspond to one idea and implement it coherently. This idea may be a feature that spans several parts of the codebase. For example, changing an API may include changes to the Android, iOS, and web implementations, the JavaScript SDK, and the docs for the API.

Generally, each PR should contain one commit that is amended as you address code review feedback. Each commit should be meaningful and make sense on its own. Similarly, it should be easy to revert each commit. This keeps the commit history easier to read when people are working on this code or searching for a commit that could have broken something.

Coding Guidelines

Please follow the Coding conventions as much as possible when contributing your code. This is mostly covered by eslint plugin in vscode. Add eslint plugin and add below in setting.json in vscode to fix coding style in live editing.

"eslint.enable": true,
"eslint.validate": [
  "javascript",
  "javascriptreact",
  "typescript",
  "typescriptreact"
],

npm run lint command will cover your code style either.

General styles

  • The indent tab is two spaces.
  • The class declaration and the {} in curly brackets such as function, if, foreach, for, and while should be in the following format. Also if you installed eslint in vscode or in your code editor, it will help you with linting. * { should be placed in same line and } should be placed in next line.
for (let i = 0; i < 10; i++) {
  ...
}
array.forEach((e) => {
  ...
});
  • Space before ( and after ).
  • If you find code that does not fit in the coding convention, do not ever try to fix code that is not related to your purpose.

Prettier