-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: example and contribution guide (#10)
- Loading branch information
1 parent
11da1f9
commit e096a72
Showing
19 changed files
with
2,170 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
blank_issues_enabled: false | ||
contact_links: | ||
- name: Report a Bug | ||
url: https://dashboard.bitmovin.com/support/tickets | ||
about: Report a Bug you encountered in our Player React Native SDK in your Bitmovin Customer Dashboard. | ||
- name: Feature Requests | ||
url: https://community.bitmovin.com/t/how-to-submit-a-feature-request-to-us/1463 | ||
about: Learn how to suggest new features for our Player SDKs. | ||
- name: Report a security vulnerability | ||
url: https://bitmovin.atlassian.net/wiki/external/1502085332/YTYwODMwZjQyNjkwNGQ0ODg5MTgwM2NhMDliNjRmODE | ||
about: Report a security vulnerability. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,5 @@ coverage | |
npm-debug.log* | ||
|
||
release/.npmrc | ||
|
||
example/src/config.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# Contributing | ||
|
||
## Issues | ||
|
||
With bugs and problems, please try to describe the issue as detailed as possible to help us reproduce it. | ||
|
||
## Pull Requests | ||
|
||
Before creating a pull request, please | ||
|
||
- Make sure all guidelines are followed | ||
- Make sure your branch is free of merge conflicts | ||
|
||
## Development workflow | ||
|
||
To get started with the project: | ||
|
||
- Create the config file from the dist file `cp ./example/src/config.dist.ts ./example/src/config.ts` and update it with your Bitmovin Player license key | ||
- Run `npm run bootstrap && npm run start:dev` in the root directory to install the required dependencies for each package, start the example app and the build scripts in the watch mode. Any changes you make in your library's JavaScript (TypeScript) code will be reflected in the example app without a rebuild. | ||
|
||
## TypeScript Code Style | ||
|
||
- Follow the `eslint` rules (`npm run lint`). They are enforced automatically via a pre-commit git hook. | ||
- Public functions should be documented with a description that explains _what_ it does | ||
- Every code block that does not obviously explain itself should be commented with an explanation of _why_ and _what_ it does | ||
|
||
## Linting | ||
|
||
### Typescript | ||
|
||
- [ESLint](https://eslint.org/) | ||
- [Prettier](https://prettier.io/) | ||
- [TypeScript](https://www.typescriptlang.org/) | ||
|
||
We use [TypeScript](https://www.typescriptlang.org/) for type checking, [ESLint](https://eslint.org/) with [Prettier](https://prettier.io/) for linting and formatting the code, and [Jest](https://jestjs.io/) for testing. | ||
|
||
Our pre-commit hooks verify that the linter will pass when committing. Make sure your code passes TypeScript and ESLint. Run the following to verify: | ||
|
||
```sh | ||
npm run lint | ||
``` | ||
|
||
To fix lint errors, run the following: | ||
|
||
```sh | ||
npm run lint:fix | ||
``` | ||
|
||
## Testing | ||
|
||
Remember to add tests for your change if possible. Run the tests by: | ||
|
||
```sh | ||
npm run test | ||
``` | ||
|
||
### Adding new tests | ||
|
||
To add new tests: | ||
|
||
1. Create a new file `*.test.ts` or `*.test.tsx` near the file you want to test | ||
2. Implement the test suite using the Jest framework | ||
3. Refer to the `BitmovinPlayer.test.tsx` as an example | ||
|
||
## Scripts | ||
|
||
The `package.json` file contains various scripts for common tasks: | ||
|
||
- `npm run bootstrap`: setup the whole project by installing all dependencies | ||
- `npm run start:dev`: start the example app and the build scripts in the watch mode | ||
- `npm run build`: compile TypeScript files into `./dist` | ||
- `npm run release`: release a new version of the package | ||
- `npm run lint`: lint files with ESLint (includes Prettier) | ||
- `npm run lint:fix`: fix lint errors | ||
- `npm run test`: run the tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/bitmovin.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Bitmovin Player React Demo</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
</html> |
Oops, something went wrong.