Skip to content

Commit

Permalink
docs: update readme and contribution guide
Browse files Browse the repository at this point in the history
  • Loading branch information
Veselina Radeva committed Feb 25, 2018
1 parent f7fdf03 commit 48b6a82
Show file tree
Hide file tree
Showing 4 changed files with 164 additions and 50 deletions.
82 changes: 58 additions & 24 deletions CONTRIBUTING.md
@@ -1,41 +1,75 @@
# Contributing
# Contributing to NativeScript facebook

Third-party patches are essential for keeping nativescript-facebook plugin great so we welcome all pull requests from everyone.
:+1: First of all, thank you for taking the time to contribute! :+1:

## Making Changes
Here are some guides on how to do that:

* Fork the repository on GitHub
* Clone the repo:
<!-- TOC depthFrom:2 -->

git clone git@github.com:<your-username>/nativescript-facebook.git
- [Code of Conduct](#code-of-conduct)
- [Reporting Bugs](#reporting-bugs)
- [Requesting Features](#requesting-features)
- [Submitting a PR](#submitting-a-pr)
- [Where to Start](#where-to-start)

* Make commits of logical units.
* Make sure your commit messages are in the proper format. We strongly recommend to use [semantic commit messages](https://seesparkbox.com/foundry/semantic_commit_messages)
* Add tests for your changes and make them pass. How to run tests you can find in [Testing section](#Testing)
* Push your changes to a topic branch in your fork of the repository.
* Submit a pull request to the **nativescript-facebook** repository.
<!-- /TOC -->

## Testing
## Code of Conduct
Help us keep a healthy and open community. We expect all participants in this project to adhere to the [NativeScript Code Of Conduct](https://github.com/NativeScript/codeofconduct).

There are three main points in order to get nativescript-facebook e2e UI tests running locally on iOS 10 Simulator and Android api 23 Emulator. Before that if you want to take a look at the tests and make some changes find them located in `demo/e2e-tests` folder.

* Install Appium. Test execution depends on [nativescript-dev-appium](https://github.com/NativeScript/nativescript-dev-appium) plugin which is added as dev dependency in `demo` app folder and first command satisfies its requirement to have appium installed.
## Reporting Bugs

$ npm install -g appium@1.6.3
1. Always update to the most recent master release; the bug may already be resolved.
2. Search for similar issues in the issues list for this repo; it may already be an identified problem.
3. If this is a bug or problem that is clear, simple, and is unlikely to require any discussion -- it is OK to open an issue on GitHub with a reproduction of the bug including workflows and screenshots. If possible, submit a Pull Request with a failing test, entire application or module. If you'd rather take matters into your own hands, fix the bug yourself (jump down to the [Submitting a PR](#submitting-a-pr) section).

* Run Android emulator or/and iOS Simulator. For iOS appium will run simulator if such is not running. It is a requirement for appium that Android emulator has device name 'Android Emulator' and uses Android '6.0' version. For iOS Simulator you will need similator with device name 'iPhone 7 100' which is using iOS '10.0' version. These requirements come from the nativescript-dev-appium plugin and are still hardcoded in it, but notice that plugin itself is in development and the future plans are to become the ultimate testing tool for NativeScript plugins.
## Requesting Features

* Navigate to `/demo` folder and execute the commands below to build the plugin and demo app which will produce the package needed for appium to execute the tests :
1. Use Github Issues to submit feature requests.
2. First, search for a similar request and extend it if applicable. This way it would be easier for the community to track the features.
3. When requesting a new feature, please provide as much detail as possible about why you need the feature in your apps. We prefer that you explain a need rather than explain a technical solution for it. That might trigger a nice conversation on finding the best and broadest technical solution to a specific need.

$ npm run ci.android.build
$ npm run ci.ios.build
## Submitting a PR

* Run the tests
Before you begin make sure there is an issue for the bug or feature you will be working on.

$ npm run ci.android.uitest
Following these steps is the best way to get your code included in the project:

or
1. Fork and clone the nativescript-facebook repo:
```bash
git clone https://github.com/<your-git-username>/nativescript-facebook.git
# Navigate to the newly cloned directory
cd nativescript-facebook
# Add an "upstream" remote pointing to the original repo.
git remote add upstream https://github.com/NativeScript/nativescript-facebook.git
```

$ npm run ci.ios.uitest
2. Read our [development workflow guide](DevelopmentWorkflow.md) for local setup

That's it. You should have running UI tests in your Simulator/Emulator.
3. Create a branch for your PR
```bash
git checkout -b <my-fix-branch> master
```

4. The fun part! Make your code changes. Make sure you:
- Follow the [code conventions guide](https://github.com/NativeScript/NativeScript/blob/master/CodingConvention.md).
- Follow the [commit message guidelines](https://github.com/NativeScript/NativeScript/blob/pr-template/CONTRIBUTING.md#commit-messages)
- Update the README if you make changes to the plugin API

5. Before you submit your PR:
- Rebase your changes to the latest master: `git pull --rebase upstream master`.
- Ensure your changes pass tslint validation. (run `npm run tslint` in the `src` folder).

6. Push your fork. If you have rebased you might have to use force-push your branch:
```
git push origin <my-fix-branch> --force
```

7. [Submit your pull request](https://github.com/NativeScript/nativescript-facebook/compare) and compare to `NativeScript/nativescript-facebook`. Please, fill in the Pull Request template - it will help us better understand the PR and increase the chances of it getting merged quickly.

It's our turn from there on! We will review the PR and discuss changes you might have to make before merging it! Thanks!

## Where to Start

If you want to contribute, but you are not sure where to start - look for issues labeled [`help wanted`](https://github.com/NativeScript/nativescript-facebook/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22).
73 changes: 73 additions & 0 deletions DevelopmentWorkflow.md
@@ -0,0 +1,73 @@
# Development Workflow

<!-- TOC depthFrom:2 -->

- [Prerequisites](#prerequisites)
- [Develop locally](#develop-locally)
- [Run UI Tests](#run-ui-tests)

<!-- /TOC -->


## Prerequisites

* Install your native toolchain and NativeScript as [described in the docs](https://docs.nativescript.org/start/quick-setup)

* Review [NativeScript plugins documentation](https://docs.nativescript.org/plugins/plugins) for more details on plugins development


## Develop locally

For local development we recommend using the npm commands provided in the plugin's package.json

Basically executing a bunch of commands will be enough for you to start making changes to the plugin and see them live synced in the demo. It's up to you to decide which demo to use for development - TypeScript or TypeScript + Angular.


To run and develop using TypeScript demo:
```bash
$ cd nativescript-facebook/src
$ npm run demo.ios
$ npm run demo.android
```

To run and develop using TypeScript + Angular demo:
```bash
$ cd nativescript-facebook/src
$ npm run demo.ng.ios
$ npm run demo.ng.android
```

After all the changes are done make sure to
- test them in all the demo apps
- run the UI tests.

For details on plugins development workflow, read [NativeScript plugins documentation](https://docs.nativescript.org/plugins/building-plugins#step-2-set-up-a-development-workflow) covering that topic.


## Run UI Tests

1. Navigate to `demo/e2e`
``` bash
cd demo/e2e
```

2. Make sure to have an emulator set up or connect a physical Android/iOS device.

3. Build the app for Android or iOS
```bash
tns build android
tns build ios
```
4. Install [appium](http://appium.io/) globally.
``` bash
npm install -g appium
```

5. Follow the instructions in the [nativescript-dev-appium](https://github.com/nativescript/nativescript-dev-appium#custom-appium-capabilities) plugin to add an appium capability for your device inside `appium.capabilities.json`.

7. Run the automated tests. The value of the `runType` argument should match the name of the capability that you just added.
``` bash
npm run e2e -- --runType capabilityName
```

[Read more about UI testing](https://docs.nativescript.org/plugins/ui-tests).
53 changes: 28 additions & 25 deletions README.md
Expand Up @@ -9,36 +9,36 @@ NativeScript : Facebook SDK ![apple](https://cdn3.iconfinder.com/data/icons/pico

![demo](https://github.com/nativescript-space/nativescript-facebook/blob/assets/demo.gif?raw=true)

<!-- TOC -->
<!-- TOC depthFrom:2 -->

- [Features](#features)
- [Installation](#installation)
- [Configuration](#configuration)
- [Android](#android)
- [iOS](#ios)
- [Usage](#usage)
- [NativeScript Core](#nativescript-core)
- [Initialization](#initialization)
- [Login](#login)
- [Facebook Login Button](#facebook-login-button)
- [Custom Login Button](#custom-login-button)
- [Log out](#log-out)
- [Facebook Logout Button](#facebook-logout-button)
- [Custom Logout Button](#custom-logout-button)
- [NativeScript Angular](#nativescript-angular)
- [Initialization](#initialization-1)
- [Login](#login-1)
- [Facebook Login Button](#facebook-login-button-1)
- [Custom Login Button](#custom-login-button-1)
- [Logout](#logout)
- [Facebook Logout Button](#facebook-logout-button-1)
- [Custom Logout Button](#custom-logout-button-1)
- [NativeScript Core](#nativescript-core)
- [Initialization](#initialization)
- [Login](#login)
- [Facebook Login Button](#facebook-login-button)
- [Custom Login Button](#custom-login-button)
- [Log out](#log-out)
- [Facebook Logout Button](#facebook-logout-button)
- [Custom Logout Button](#custom-logout-button)
- [NativeScript Angular](#nativescript-angular)
- [Initialization](#initialization-1)
- [Login](#login-1)
- [Facebook Login Button](#facebook-login-button-1)
- [Custom Login Button](#custom-login-button-1)
- [Logout](#logout)
- [Facebook Logout Button](#facebook-logout-button-1)
- [Custom Logout Button](#custom-logout-button-1)
- [Login Response](#login-response)
- [Get Current Access Token](#get-current-access-token)
- [Graph API Example](#graph-api-example)
- [Release notes](#release-notes)
- [FAQ](#faq)
- [Contributing](#contributing)
- [License](#license)
- [Contribute](#contribute)
- [Get Help](#get-help)

<!-- /TOC -->

Expand Down Expand Up @@ -453,13 +453,16 @@ This sample is part of the demo apps and can be observed [here](https://github.c
## Release notes
Check out release notes [here] (https://github.com/NativeScript/nativescript-facebook/releases)
Check out release notes [here](https://github.com/NativeScript/nativescript-facebook/releases)
## FAQ
Check out our FAQ section [here](https://github.com/NativeScript/nativescript-facebook/wiki/FAQ).
## Contributing
Check out our Contribution guide [here](https://github.com/NativeScript/nativescript-facebook/blob/master/CONTRIBUTING.md).
## Contribute
We love PRs! Check out the [contributing guidelines](CONTRIBUTING.md). If you want to contribute, but you are not sure where to start - look for [issues labeled `help wanted`](https://github.com/NativeScript/nativescript-facebook/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22).
## License
[Apache 2.0](https://github.com/NativeScript/nativescript-facebook/blob/master/LICENSE)
## Get Help
Please, use [github issues](https://github.com/NativeScript/nativescript-facebook/issues) strictly for [reporting bugs](CONTRIBUTING.md#reporting-bugs) or [requesting features](CONTRIBUTING.md#requesting-new-features). For general questions and support, check out the [NativeScript community forum](https://discourse.nativescript.org/) or ask our experts in [NativeScript community Slack channel](http://developer.telerik.com/wp-login.php?action=slack-invitation).
![](https://ga-beacon.appspot.com/UA-111455-24/nativescript/nativescript-facebook?pixel)
6 changes: 5 additions & 1 deletion src/package.json
Expand Up @@ -14,7 +14,11 @@
"ci.tslint": "npm i && tslint '**/*.ts' --config '../tslint.json' --exclude '**/node_modules/**'",
"prepublishOnly": "npm run build",
"plugin.link": "npm link && cd ../demo-angular && npm link nativescript-camera",
"plugin.tscwatch": "tsc -skipLibCheck -w"
"plugin.tscwatch": "tsc -skipLibCheck -w",
"demo.ios": "npm i && npm run tsc && cd ../demo && tns run ios --syncAllFiles",
"demo.android": "npm i && npm run tsc && cd ../demo && tns run android --syncAllFiles",
"demo.ng.ios": "npm i && npm run tsc && cd ../demo-angular && tns run ios --syncAllFiles",
"demo.ng.android": "npm i && npm run tsc && cd ../demo-angular && tns run android --syncAllFiles"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 48b6a82

Please sign in to comment.