-
-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
48 additions
and
47 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 |
---|---|---|
@@ -1,68 +1,69 @@ | ||
# Contributing | ||
|
||
[![PRs Welcome][pr-welcome-badge]][pr-welcome-link] | ||
Thank you for your interest in this project. If you can, feel free to contribute and help improve it. | ||
There are many ways to contribute to `otplib`, and it does not only involve writing code. | ||
|
||
Thank you for reaching this document. :) | ||
Feel free to contribute code, documentation, ideas for improvements or even example snippets. | ||
All are welcomed. | ||
Here's a few ideas to get started: | ||
|
||
## Some notes about this project: | ||
- Try out the library. Does everything work as expected? If not, just let us know by opening an issue. | ||
- Read through the docs. If you find anything confusing or can be improved, do try to help out. | ||
- You can make edits by clicking "Edit" at the top of most docs. | ||
|
||
### Semantic Versioning | ||
Contributions are very welcome. If you are unsure if something fits into the library, open an issue anyway. | ||
|
||
This repository generally follows semantic versioning. We release patch versions for bug fixes, minor versions for new features, and major versions for any breaking changes. | ||
## Development process | ||
|
||
All releases to npm or any other supported distribution channels will corresponding to a tagged commit. | ||
GitHub is currently the source of truth. This project does have mirror repositories in bitbucket / gitlab, | ||
but it is mostly for emergencies. All automations are wired to the GitHub project. | ||
|
||
### Commit messages | ||
When a change lands on GitHub, it will be checked by the continuous integration system. | ||
|
||
As the release information is generated from commit messages, it is highly recommended that commit messages | ||
are in the format of [conventional-commits](https://conventionalcommits.org/) | ||
### Code organization | ||
|
||
For example: `feat(browser): description`, `fix: description`, `chore(readme): description` etc. | ||
- This project uses 2 primary branches: `master` and `gh-pages`. | ||
- Publishing to `gh-pages` is mostly handled by the CI system. | ||
- Releases are managed by tags. | ||
- `v0.0.0` represents **stable builds** | ||
- `v0.0.0-0` represents **pre-releases** | ||
- Tags follow semantic versioning. | ||
- patch versions for bug fixes. | ||
- minor versions for new features. | ||
- major versions for any breaking changes. | ||
- Release information are generated from the git messages. | ||
- Commit messages should follow the format of [conventional-commits](https://conventionalcommits.org/). | ||
- Eg: `feat: description`, `fix: description`, `chore: description` | ||
|
||
### Testing | ||
### Releases | ||
|
||
To only run linting: | ||
This project is published on `npm`, under 2 tags: `latest` and `next`. | ||
|
||
`npm run lint:js` | ||
`latest` contains **stable builds** while `next` contains **pre-release**. | ||
End-users can install latest stable using `npm install otplib` and | ||
pre-releases using `npm install otplib@next` | ||
|
||
To run tests and coverage: | ||
All releases are handled via the CI system. | ||
|
||
`npm run test` | ||
### License | ||
|
||
To continuously watch and run tests, run the following: | ||
By contributing to `otplib`, you agree that your contributions will be licensed under its MIT license. | ||
|
||
`npm run test:watch` | ||
### Pull Request Checklist | ||
|
||
### Type Definitions | ||
- is the code linted? | ||
- `npm run lint:js` | ||
- is the code formatted nicely? | ||
- `npm run lint:format` | ||
- is the code tested? | ||
- `npm run test` | ||
- `npm run test:watch` if you want to continuously watch and run test on file change. | ||
- are there any changes in method signature? | ||
- `.d.ts` files were introduced in `v10.0.0`, and can be found in `packages/types-ts`. | ||
- updating these type definition files is highly recommended, but can be in separate PRs | ||
- `npm run build && npm run lint:ts` | ||
|
||
#### TypeScript | ||
Please **do not** bump the version and tag your pull request | ||
with a v\[number\] as it corresponds to a release. | ||
|
||
`.d.ts` files were introduced in `v10.0.0`, and can be found in `packages/types-ts`. | ||
### Thank You | ||
|
||
Before adding new type defintions, first do a `npm run build`. | ||
This is because the types are checked against the published bundle and not your source files. | ||
|
||
To check for validity, you can use `npm run lint:ts` to lint your files. | ||
|
||
### Sending a Pull Request | ||
|
||
If you send a pull request, please do it against the master branch. | ||
|
||
Please **do not** bump the version and tag your pull request with a v\[number\] as it corresponds to a release. | ||
|
||
Before submitting a pull request, please make sure the following is done: | ||
|
||
* Fork the repository and create your branch from master. | ||
* If you've added code that should be tested, add tests! | ||
* Ensure the test suite passes (`npm run test`). | ||
* Make sure your code lints (`npm run lint:js`). | ||
* Update type definitions if you change any function signatures (`npm run lint:ts`). | ||
* Ensure code is properly formatted `npm run lint:format` | ||
* Make a PR to this repository's master branch. | ||
|
||
Thank you for contributing! | ||
|
||
[pr-welcome-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square&longCache=true | ||
[pr-welcome-link]: https://github.com/yeojz/otplib/blob/master/CONTRIBUTING.md | ||
Thank you for any contributions! |