With bugs and problems, please try to describe the issue as detailed as possible to help us reproduce it.
Before creating a pull request, please
- Make sure all guidelines are followed
- Make sure your branch is free of merge conflicts
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.
- 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
We use TypeScript for type checking, ESLint with Prettier for linting and formatting the code, and Jest 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:
npm run lint
To fix lint errors, run the following:
npm run lint:fix
Remember to add tests for your change if possible. Run the tests by:
npm run test
To add new tests:
- Create a new file
*.test.ts
or*.test.tsx
near the file you want to test - Implement the test suite using the Jest framework
- Refer to the
BitmovinPlayer.test.tsx
as an example
The package.json
file contains various scripts for common tasks:
npm run bootstrap
: setup the whole project by installing all dependenciesnpm run start:dev
: start the example app and the build scripts in the watch modenpm run build
: compile TypeScript files into./dist
npm run release
: release a new version of the packagenpm run lint
: lint files with ESLint (includes Prettier)npm run lint:fix
: fix lint errorsnpm run test
: run the tests