提交 d1a18cb3 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Add .github/CONTRIBUTING.md

上级 0cb94aa8
# Contributing to mediasoup
Thanks for taking the time to contribute to mediasoup! 🎉👍
## License
By contributing to mediasoup, you agree that your contributions will be licensed under its MIT License.
## Reporting Bugs
We primarily use GitHub as an issue tracker. Just open an issue in GitHub if you have encountered a bug in mediasoup.
If you have questions or doubts about mediasoup or need support, please use the mediasoup Discourse Group instead:
* https://mediasoup.discourse.group
If you got a crash in mediasoup, please try to provide a core dump into the issue report:
* https://mediasoup.org/support/#crashes-in-mediasoup-get-a-core-dump
## Pull Request Process
When creating a Pull Request for mediasoup, ensure that you run the following commands to verify that the code in your PR conforms to the code syntax of the project and does not break existing funtionality:
* `npm run lint`: Check JavaScript and C++ linting rules.
* `npm run typescript:build`: Compile TypeScript code (under `src/` folder) into JavaScript code (under `lib/` folder).
* `npm run test`: Run JavaScript and C++ test units.
The full list of `npm` scripts (and `make` tasks) is available in the [docs/Building.md](/docs/Building.md) file.
Once all these commands succeed, wait for the Travis CI checks to complete and verify they run successfully (otherwise the PR won't be accepted).
## Coding Style
In adition to automatic checks performed by commands above, we also enforce other minor things related to coding style:
### Comments in JavaScript and C++
We use `//` for inline comments in both JavaScript and C++ source files.
* Comments must start with upercase letter.
* Comments must not exceed 80 columns (split into different lines if necessary).
* Comments must end with a dot.
Example (good):
```js
// Calculate foo based on bar value.
const foo = bar / 2;
```
Example (bad):
```js
// calculate foo based on bar value
const foo = bar / 2;
```
When adding inline documentation for methods or functions, we use `/** */` syntax. Example:
```js
/**
* Calculates current score for foo and bar.
*/
function calculateScore(): number
{
// [...]
}
```
......@@ -10,12 +10,12 @@ The `package.json` file in the main folder includes the following scripts:
### `npm run typescript:build`
Compiles mediasoup TypeScript code (`lib` folder) into es2020 JavaScript and places it into the `lib` directory.
Compiles mediasoup TypeScript code (`lib` folder) JavaScript and places it into the `lib` directory.
### `npm run typescript:watch`
Compiles mediasoup TypeScript code (`lib` folder) into es2020 JavaScript, places it into the `lib` directory an watches for changes in the TypeScript files.
Compiles mediasoup TypeScript code (`lib` folder) JavaScript, places it into the `lib` directory an watches for changes in the TypeScript files.
### `npm run lint`
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论