Skip to content

Commit f405298

Browse files
author
radeva
authored
Merge pull request #158 from NativeScript/radeva/update-readme
docs: update docs
2 parents 0586f3f + a7193c1 commit f405298

File tree

5 files changed

+212
-2
lines changed

5 files changed

+212
-2
lines changed

.github/pull_request_template.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<!--
2+
We, the rest of the NativeScript community, thank you for your
3+
contribution!
4+
To help the rest of the community review your change, please follow the instructions in the template.
5+
-->
6+
7+
<!-- PULL REQUEST TEMPLATE -->
8+
<!-- (Update "[ ]" to "[x]" to check a box) -->
9+
10+
## PR Checklist
11+
12+
- [ ] The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/CONTRIBUTING.md#commit-messages.
13+
- [ ] There is an issue for the bug/feature this PR is for. To avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it.
14+
- [ ] All existing tests are passing
15+
- [ ] Tests for the changes are included
16+
17+
## What is the current behavior?
18+
<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->
19+
20+
## What is the new behavior?
21+
<!-- Describe the changes. -->
22+
23+
Fixes/Implements/Closes #[Issue Number].
24+
25+
<!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. -->
26+
27+
<!--
28+
BREAKING CHANGES:
29+
30+
31+
[Describe the impact of the changes here.]
32+
33+
Migration steps:
34+
[Provide a migration path for existing applications.]
35+
-->
36+

CONTRIBUTING.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Contributing to NativeScript Imagepicker
2+
3+
:+1: First of all, thank you for taking the time to contribute! :+1:
4+
5+
Here are some guides on how to do that:
6+
7+
<!-- TOC depthFrom:2 -->
8+
9+
- [Code of Conduct](#code-of-conduct)
10+
- [Reporting Bugs](#reporting-bugs)
11+
- [Requesting Features](#requesting-features)
12+
- [Submitting a PR](#submitting-a-pr)
13+
- [Where to Start](#where-to-start)
14+
15+
<!-- /TOC -->
16+
17+
## Code of Conduct
18+
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).
19+
20+
21+
## Reporting Bugs
22+
23+
1. Always update to the most recent master release; the bug may already be resolved.
24+
2. Search for similar issues in the issues list for this repo; it may already be an identified problem.
25+
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).
26+
27+
## Requesting Features
28+
29+
1. Use Github Issues to submit feature requests.
30+
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.
31+
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.
32+
33+
## Submitting a PR
34+
35+
Before you begin make sure there is an issue for the bug or feature you will be working on.
36+
37+
Following these steps is the best way to get your code included in the project:
38+
39+
1. Fork and clone the nativescript-imagepicker repo:
40+
```bash
41+
git clone https://github.com/<your-git-username>/nativescript-imagepicker.git
42+
# Navigate to the newly cloned directory
43+
cd nativescript-imagepicker
44+
# Add an "upstream" remote pointing to the original repo.
45+
git remote add upstream https://github.com/NativeScript/nativescript-imagepicker.git
46+
```
47+
48+
2. Read our [development workflow guide](DevelopmentWorkflow.md) for local setup
49+
50+
3. Create a branch for your PR
51+
```bash
52+
git checkout -b <my-fix-branch> master
53+
```
54+
55+
4. The fun part! Make your code changes. Make sure you:
56+
- Follow the [code conventions guide](https://github.com/NativeScript/NativeScript/blob/master/CodingConvention.md).
57+
- Follow the [commit message guidelines](https://github.com/NativeScript/NativeScript/blob/pr-template/CONTRIBUTING.md#commit-messages)
58+
- Update the README if you make changes to the plugin API
59+
60+
5. Before you submit your PR:
61+
- Rebase your changes to the latest master: `git pull --rebase upstream master`.
62+
- Ensure your changes pass tslint validation. (run `npm run tslint` in the `src` folder).
63+
64+
6. Push your fork. If you have rebased you might have to use force-push your branch:
65+
```
66+
git push origin <my-fix-branch> --force
67+
```
68+
69+
7. [Submit your pull request](https://github.com/NativeScript/nativescript-imagepicker/compare) and compare to `NativeScript/nativescript-imagepicker`. Please, fill in the Pull Request template - it will help us better understand the PR and increase the chances of it getting merged quickly.
70+
71+
It's our turn from there on! We will review the PR and discuss changes you might have to make before merging it! Thanks!
72+
73+
## Where to Start
74+
75+
If you want to contribute, but you are not sure where to start - look for issues labeled [`help wanted`](https://github.com/NativeScript/nativescript-imagepicker/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22).

DevelopmentWorkflow.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Development Workflow
2+
3+
<!-- TOC depthFrom:2 -->
4+
5+
- [Prerequisites](#prerequisites)
6+
- [Develop locally](#develop-locally)
7+
- [Run UI Tests](#run-ui-tests)
8+
9+
<!-- /TOC -->
10+
11+
12+
## Prerequisites
13+
14+
* Install your native toolchain and NativeScript as [described in the docs](https://docs.nativescript.org/start/quick-setup)
15+
16+
* Review [NativeScript plugins documentation](https://docs.nativescript.org/plugins/plugins) for more details on plugins development
17+
18+
19+
## Develop locally
20+
21+
For local development we recommend using the npm commands provided in the plugin's package.json
22+
23+
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.
24+
25+
26+
To run and develop using TypeScript demo:
27+
```bash
28+
$ cd nativescript-imagepicker/src
29+
$ npm run demo.ios
30+
$ npm run demo.android
31+
```
32+
33+
To run and develop using TypeScript + Angular demo:
34+
```bash
35+
$ cd nativescript-imagepicker/src
36+
$ npm run demo.ng.ios
37+
$ npm run demo.ng.android
38+
```
39+
40+
After all the changes are done make sure to
41+
- test them in all the demo apps
42+
- run the UI tests.
43+
44+
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.
45+
46+
47+
## Run UI Tests
48+
49+
1. Navigate to `demo/e2e`
50+
``` bash
51+
cd demo/e2e
52+
```
53+
54+
2. Make sure to have an emulator set up or connect a physical Android/iOS device.
55+
56+
3. Build the app for Android or iOS
57+
```bash
58+
tns build android
59+
tns build ios
60+
```
61+
4. Install [appium](http://appium.io/) globally.
62+
``` bash
63+
npm install -g appium
64+
```
65+
66+
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`.
67+
68+
7. Run the automated tests. The value of the `runType` argument should match the name of the capability that you just added.
69+
``` bash
70+
npm run e2e -- --runType capabilityName
71+
```
72+
73+
[Read more about UI testing](https://docs.nativescript.org/plugins/ui-tests).

README.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,25 @@ Imagepicker plugin supporting both single and multiple selection.
99
<br />Plugin supports **iOS8+** and uses [Photos Framework](https://developer.apple.com/library/prerelease/ios//documentation/Photos/Reference/Photos_Framework/index.html).
1010
<br />For **Android** it uses Intents to open the stock images or file pickers. For Android 6 (API 23) and above the permissions to read file storage should be explicitly required. See demo for implementation details.
1111

12+
<!-- TOC depthFrom:2 -->
13+
14+
- [Installation](#installation)
15+
- [Configuration](#configuration)
16+
- [Migrating from 3.x.x to 4.x.x](#migrating-from-3xx-to-4xx)
17+
- [Usage](#usage)
18+
- [Import the plugin](#import-the-plugin)
19+
- [Create imagepicker](#create-imagepicker)
20+
- [Request permissions, show the images list and process the selection](#request-permissions-show-the-images-list-and-process-the-selection)
21+
- [API](#api)
22+
- [Methods](#methods)
23+
- [Properties](#properties)
24+
- [Image properties](#image-properties)
25+
- [Contribute](#contribute)
26+
- [Get Help](#get-help)
27+
28+
<!-- /TOC -->
29+
30+
1231
## Installation
1332

1433
In Command prompt / Terminal navigate to your application root folder and run:
@@ -120,6 +139,11 @@ Once image is picked some options can be applied to it before it is used:
120139
| maxHeight | null | Image max height |
121140
| aspectRatio | fit | iOS only. Possible values are `fit` and `fill`. [Read more](https://developer.apple.com/documentation/photos/phimagecontentmode) |
122141
123-
## License
142+
## Contribute
143+
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-imagepicker/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22).
124144
125-
2015, Telerik AD
145+
146+
## Get Help
147+
Please, use [github issues](https://github.com/NativeScript/nativescript-imagepicker/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).
148+
149+
![](https://ga-beacon.appspot.com/UA-111455-24/nativescript/nativescript-imagepicker?pixel)

src/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
"plugin.tscwatch": "npm run tsc -- -w",
2929
"demo.ios": "npm i && npm run tsc && cd ../demo && tns run ios --syncAllFiles",
3030
"demo.android": "npm i && npm run tsc && cd ../demo && tns run android --syncAllFiles",
31+
"demo.ng.ios": "npm i && npm run tsc && cd ../demo-angular && tns run ios --syncAllFiles",
32+
"demo.ng.android": "npm i && npm run tsc && cd ../demo-angular && tns run android --syncAllFiles",
3133
"clean": "rm -rf node_modules && cd ../demo && rm -rf hooks node_modules platforms && cd ../src && npm run plugin.link"
3234
},
3335
"keywords": [

0 commit comments

Comments
 (0)