Skip to content

Commit 5e6b1eb

Browse files
committed
Update README with build status, license, and version info. Add developing and contributing guidelines.
1 parent 7d77b2c commit 5e6b1eb

File tree

3 files changed

+158
-13
lines changed

3 files changed

+158
-13
lines changed

CONTRIBUTING.md

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Contributing Guidelines
2+
3+
For anyone looking to get involved to this project, we are glad to hear from you. Here are a few types of contributions
4+
that we would be interested in hearing about.
5+
6+
* Bug fixes
7+
- If you find a bug, please first report it using Github Issues.
8+
- Issues that have already been identified as a bug will be labelled `bug`.
9+
- If you'd like to submit a fix for a bug, send a Pull Request from your own fork and mention the Issue number.
10+
+ Include a test that isolates the bug and verifies that it was fixed.
11+
* New Features
12+
- If you'd like to accomplish something in the library that it doesn't already do, describe the problem in a new
13+
Github Issue.
14+
- Issues that have been identified as a feature request will be labelled `enhancement`.
15+
- If you'd like to implement the new feature, please wait for feedback from the project maintainers before spending
16+
too much time writing the code. In some cases, `enhancement`s may not align well with the project objectives at
17+
the time.
18+
* Tests, Documentation, Miscellaneous
19+
- If you think the test coverage could be improved, the documentation could be clearer, you've got an alternative
20+
implementation of something that may have more advantages, or any other change we would still be glad hear about
21+
it.
22+
- If its a trivial change, go ahead and send a Pull Request with the changes you have in mind
23+
- If not, open a Github Issue to discuss the idea first.
24+
25+
## Requirements
26+
27+
For a contribution to be accepted:
28+
29+
* The test suite must be complete and pass
30+
* Code must follow existing styling conventions
31+
* Commit messages must be descriptive. Related issues should be mentioned by number.
32+
33+
If the contribution doesn't meet these criteria, a maintainer will discuss it with you on the Issue. You can still
34+
continue to add more commits to the branch you have sent the Pull Request from.
35+
36+
## How To
37+
38+
1. Fork this repository on GitHub.
39+
1. Clone/fetch your fork to your local development machine.
40+
1. Create a new branch (e.g. `issue-12`, `feat.add_foo`, etc) from the 'develop' and check it out.
41+
1. Make your changes and commit them. (Did the tests pass?)
42+
1. Push your new branch to your fork. (e.g. `git push myname issue-12`)
43+
1. Open a Pull Request from your new branch to the original fork's `develop` branch.
44+
45+
## Developer Guidelines
46+
47+
See DEVELOPING.md for guidelines for developing this project.

DEVELOPING.md

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Development Guidelines
2+
3+
This document describes tools, tasks and workflow that one needs to be familiar with in order to effectively maintain this project. If you use this package within your own software as is but don't plan on modifying it, this guide is **not** for you.
4+
5+
## Tools
6+
7+
This project is developed with [TypeScript](https://www.typescriptlang.org/) and uses [Webpack](https://webpack.js.org/) in conjunction with [Babel](https://babeljs.io/) to compile and bundle code into a browser-friendly UMD module. To install the dependencies required for development, simply run:
8+
```
9+
$ npm install
10+
```
11+
12+
## Tasks
13+
14+
### Build
15+
16+
To compile and bundle the package:
17+
```
18+
$ npm run build
19+
```
20+
21+
### Test
22+
This project's tests are written with Karma and Jasmine. Before running the tests, you will need to create a `.env` file with the following values in the root directory of the repository.
23+
```
24+
TEST_API_KEY={OPENTOK_API_KEY}
25+
TEST_API_SECRET={OPENTOK_API_SECRET}
26+
```
27+
*You can obtain a project key and secret from the TokBox [Account Portal](https://tokbox.com/account/).*
28+
29+
To run the tests:
30+
```
31+
$ npm run test
32+
```
33+
34+
### Releasing
35+
36+
In order to create a release, the following should be completed in order.
37+
38+
1. Build the project and ensure that there are no `typescript` or `tslint` errors.
39+
1. Ensure all the tests are passing.
40+
1. Make sure you are on the `develop` branch of the repository, with all changes merged/commited
41+
already.
42+
1. Update the version number anywhere it appears in the source code and documentation. See [Versioning](#versioning) for information about selecting an appropriate version number. Files to check:
43+
- package.json
44+
1. Commit the version number change with the message "Update to version x.y.z", substituting the new
45+
version number.
46+
1. Create a git tag: `git tag -a vx.y.z -m "Release vx.y.z"`
47+
1. Ensure that you have permission to update the
48+
[opentok npm module](https://www.npmjs.org/package/opentok)
49+
1. Run `npm publish` to release to npm.
50+
1. Change the version number for future development by incrementing the patch number (z) adding
51+
"-alpha.1" in the source code (not the documentation). For possible files, see above. Then make
52+
another commit with the message "Begin development on next version".
53+
1. Push the changes to the source repository: `git push origin dev && git push --tags origin`
54+
1. Add a description to the [GitHub Releases](https://github.com/opentok/opentok-node/releases) page with any notable changes.
55+
56+
## Workflow
57+
58+
### Versioning
59+
60+
The project uses [semantic versioning](http://semver.org/) as a policy for incrementing version numbers. For planned
61+
work that will go into a future version, there should be a Milestone created in the Github Issues named with the version
62+
number (e.g. "v2.2.1").
63+
64+
During development the version number should end in "-alpha.x" or "-beta.x", where x is an increasing number starting from 1.
65+
66+
### Branches
67+
68+
* `develop` - the main development branch.
69+
* `master` - reflects the latest stable release.
70+
* `feat.foo` - feature branches. these are used for longer running tasks that cannot be accomplished in one commit.
71+
once merged into master, these branches should be deleted.
72+
* `vx.x.x` - if development for a future version/milestone has begun while master is working towards a sooner
73+
release, this is the naming scheme for that branch. once merged into master, these branches should be deleted.
74+
75+
### Tags
76+
77+
* `vx.x.x` - commits are tagged with a final version number during release.
78+
79+
### Issues
80+
81+
Issues are labelled to help track their progress within the pipeline.
82+
83+
* no label - these issues have not been triaged.
84+
* `bug` - confirmed bug. aim to have a test case that reproduces the defect.
85+
* `enhancement` - contains details/discussion of a new feature. it may not yet be approved or placed into a
86+
release/milestone.
87+
* `wontfix` - closed issues that were never addressed.
88+
* `duplicate` - closed issue that is the same to another referenced issue.
89+
* `question` - purely for discussion
90+
91+
### Management
92+
93+
When in doubt, find the maintainers and ask.
94+

README.md

+17-13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
2+
![logo](https://raw.githubusercontent.com/opentok/opentok-network-test-js/master/media/tokbox-logo.png)
3+
14
# OpenTok Network Test
25

3-
![logo](./media/tokbox-logo.png)
6+
[![Build Status](https://travis-ci.org/opentok/opentok-network-test-js.svg?branch=master)](https://travis-ci.org/opentok/opentok-network-test-js)
7+
[![license](https://img.shields.io/github/license/opentok/opentok-network-test-js.svg)](./.github/CONTRIBUTING.md)
8+
[![npm](https://img.shields.io/npm/v/opentok-network-test-js.svg)](https://www.npmjs.com/package/opentok-accelerator-core)
49

510
This Node module lets you check network connectivity to resources and services required
611
to use [OpenTok](https://tokbox.com). Run this on a web client to get the following information:
@@ -19,15 +24,14 @@ tool](https://tokbox.com/developer/tools/precall/).
1924

2025
First, install the package:
2126

22-
npm install opentok-network-test-js
23-
24-
*Important:* The node module is not currently available on npmjs.com. For now, see
25-
the instructions on building the module below.
27+
```
28+
$ npm install opentok-network-test-js
29+
```
2630

2731
Now load the OpenTok Network Test in your project:
2832

2933
```javascript
30-
var OTNetworkTest = require('opentok-network-test-js');
34+
const OTNetworkTest = require('opentok-network-test-js');
3135
```
3236

3337
Load the OpenTok.js library.
@@ -49,7 +53,7 @@ unique session ID for each client. This session ID is used for the network test,
4953
be different than the session ID used for communication in the app. The test session must be
5054
a routed session -- one that uses the [OpenTok Media
5155
Router](https://tokbox.com/developer/guides/create-session/#media-mode). Also generate a test
52-
token that has publish privileges.
56+
token that has publish privileges.
5357

5458
Then run the test methods:
5559

@@ -92,7 +96,7 @@ otNetworkTest.testConnectivity().then((results) => {
9296

9397
This code uses Promises returned by the `OTNetworkTest.testConnectivity()`
9498
and `OTNetworkTest.testQuality()` methods. Alternatively, you can pass completion
95-
handler functions into each of these methods.
99+
handler functions into each of these methods.
96100

97101
See the following section for details on using the test results.
98102

@@ -154,7 +158,7 @@ This callback function takes two parameters:
154158

155159
* `error` -- An Error object. The `name` Property of this object is set to `ConnectivityError`.
156160
The `message` property describes the reason for the error. This will usually result from an
157-
invalid API key, session ID, or token passed into the `OTNetworkTest()` constructor. This
161+
invalid API key, session ID, or token passed into the `OTNetworkTest()` constructor. This
158162
is only set when the test could not run because of an error. If the connectivity can run
159163
(even if it results in failed tests), this property is undefined.
160164

@@ -269,15 +273,15 @@ is invoked when the connectivity check completes. This callback function takes t
269273
For example, `'No microphone was found.'`
270274

271275
* `bitrate` (Number) -- The average number of video bits per second during the last
272-
five seconds of the test.
276+
five seconds of the test.
273277

274278
* `frameRate` (Number) -- The average number of frames per second during the last five seconds
275279
of the test. Note that this is different than the `recommendedFrameRate`. The `frameRate`
276280
value is the actual frame rate observed during the test, and the `recommendedFrameRate`
277281
is the recommended frame rate.
278282

279283
* `packetLossRatio` (Number) -- The audio packet loss ratio during the last five seconds
280-
of the test.
284+
of the test.
281285

282286
* `audio` (Object) -- Contains the following properties:
283287

@@ -287,10 +291,10 @@ is invoked when the connectivity check completes. This callback function takes t
287291
For example, `'No microphone was found.'`
288292

289293
* `bitrate` (Number) -- The average number of audio bits per second during the last five seconds
290-
of the test.
294+
of the test.
291295

292296
* `packetLossRatio` (Number) -- The video packet loss ratio during the last five seconds
293-
of the test.
297+
of the test.
294298

295299
`results` is undefined if there was an error in running the tests (and the `error` parameter
296300
is unset).

0 commit comments

Comments
 (0)