Skip to content

Commit 3228382

Browse files
authored
Merge pull request #113 from NativeScript/lini/add-development-workflow
docs: add development workflow
2 parents 979602b + 6235d2d commit 3228382

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

DevelopmentWorkflow.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Development Workflow
2+
3+
<!-- TOC depthFrom:2 -->
4+
5+
- [Prerequisites](#prerequisites)
6+
- [Develop locally](#develop-locally)
7+
- [Testing the plugin](#testing-the-plugin)
8+
9+
<!-- /TOC -->
10+
11+
## Prerequisites
12+
13+
- Install your native toolchain and NativeScript as [described in the docs](https://docs.nativescript.org/start/quick-setup)
14+
15+
- Review [NativeScript plugins documentation](https://docs.nativescript.org/plugins/plugins) for more details on plugins development
16+
17+
## Develop locally
18+
19+
For local development we recommend using the npm commands provided in the root directory of the repository.
20+
21+
To run and develop using TypeScript demo:
22+
23+
```bash
24+
# Build the plugin. This compiles all TypeScript files in the plugin directory, which is referenced in the demo's package.json
25+
npm run tsc
26+
# Run the demo server, which is used to handle uploads from the demo app. Best to run from a separate terminal.
27+
npm run start-server
28+
# Run the demo for iOS or Android.
29+
npm run start-demo-ios
30+
npm run start-demo-android
31+
```
32+
33+
## Testing the plugin
34+
35+
The demo application is configured to run on a simulator/emulator on the local machine. If you want to test on a real device, you should change the URL in the `demo/app/home-view-model.ts` to point to the machine that is running the demo server. Be careful if using an online test service, e.g. [http://httpbin.org/post](http://httpbin.org/post). Some services are configured to return the uploaded file contents in the server response, which might crash the demo app if the uploaded file is large.
36+
37+
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.

0 commit comments

Comments
 (0)