Skip to content

Commit

Permalink
doc: add contributing docs
Browse files Browse the repository at this point in the history
  • Loading branch information
gz65555 committed Jan 28, 2021
1 parent c30eb2d commit dc6d02f
Show file tree
Hide file tree
Showing 3 changed files with 377 additions and 0 deletions.
132 changes: 132 additions & 0 deletions .github/CODE_OF_CONDUCTOR.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[INSERT CONTACT METHOD].
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].

Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].

For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available
at [https://www.contributor-covenant.org/translations][translations].

[homepage]: https://www.contributor-covenant.org
[v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
100 changes: 100 additions & 0 deletions .github/COMMIT_MESSAGE_CONVENTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# Git Commit Message Convention

> This is adapted from [Angular's commit convention](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular).
<br />Messages must be matched by the following regex:<br />

```
/^(revert: )?(build|ci|docs|feat|fix|perf|refactor|test|types|style)(\(.+\))?: .{1,50}/
```


## Full Message Format

<br />A commit message consists of a **header**, **body** and **footer**. The header has a **type**, **scope** and **subject**:<br />

```
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
```


### Commit Message Header


```
<type>(<scope>): <short summary>
│ │ │
│ │ └─⫸ Summary in present tense. Not capitalized. No period at the end.
│ │
│ └─⫸ Commit Scope: |core|2d|rhi-webgl|animations|loaders|controls|math|framebuffer-picker
└─⫸ Commit Type: build|ci|docs|feat|fix|perf|refactor|test|types|style
```

<br />The `<type>` and `<summary>` fields are mandatory, the `(<scope>)` field is optional.<br />

## Explains


- **build**: Changes that affect the build system or external dependencies
- **ci**: Changes to our CI configuration files and scripts
- **docs**: Changes that only affect documentions
- **feat**: A new feature
- **fix**: A  bug fix
- **perf**: A code change that improves performance
- **refactor**: A code change that neither fixes a bug nor adds a feature
- **test**: adding missing tests, refactoring tests; no production code change
- **types**: change only affect TypeScript's types.
- **style**: formatting, missing semi colons, etc; no code change



## Examples

<br />Appears under "Features" header, `loaders` subheader:<br />

```
feat(loaders): add 'timeout' option
```

<br />Appears under "Bug Fixes" header, `rhi-webgl` subheader, with a link to issue #28:<br />

```
fix(rhi-webgl): return null when creating a shader while gl context is lost
Closes #28
```


### Revert commits

<br />If the commit reverts a previous commit, it should begin with `revert:`, followed by the header of the reverted commit.<br />
<br />The content of the commit message body should contain:<br />

- information about the SHA of the commit being reverted in the following format: `This reverts commit <SHA>`.
- a clear description of the reason for reverting the commit message.


<br />Appears under the "Reverts" header:<br />

```
revert: feat(loaders): add 'timeout' option
This reverts commit 861ffe334f2b16608230b205700683c2f8f5de91.
```


### Breaking changes

<br />All breaking changes have to be mentioned in footer with the description of the change.<br />

```
BREAKING CHANGE:
The `addEventListener` function has changed to `on/once`.
```

145 changes: 145 additions & 0 deletions .github/HOW_TO_CONTRIBUTE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
# How to Contribute

The following is a set of guidelines for contributing to Oasis. Please spend several minutes reading the article before you create an issue or pull request.<br />

## Code of Conductor

<br />We have adopted the [Contributor Covenant](https://www.contributor-covenant.org/) as its Code of Conduct, and we expect project participants to adhere to it. Please read [the full text](./CODE_OF_CONDUCTOR.md) so that you can understand what actions will and will not be tolerated.<br />

## Issue Reporting

<br />You can make use of the Github Issues for Oasis to:<br />

1. Report a bug.
1. Request a feature
1. Ask a question


<br />Before reqorting an issue, please take the following steps:<br />

1. Search the existing issues.
1. Clearly describe the issue including steps to reproduce when it is a bug.
1. Provite an online example. Make use of [jsFiddle](http://jsfiddle.net/), [jsBin](http://jsbin.com/).


<br />If you open an issue that does not conform to the requirements, **it will be closed immediately**.<br />

## Contributing Code


### Setting Up

<br />To set up for contributing code, you will take a few steps:<br />

1. Ensure you have node.js installed. You can download Node.js from [nodejs.org](https://nodejs.org/en/) and make sure your Node.js is later than `12`. Use `node -v` to check your Node.js version.
1. Fork the Oasis repository.
1. Run `npm run bootstrap` in your cloned folder to install all the dependencies for Oasis.



### Making a Change

<br />After setting up the environment of Oasis, you can make your change already. The only thing you should make sure is that you checked out the correct branch.<br />

### Test Your Change

<br />You can test your change by the following ways:<br />

- Clone the oasis playground repository and write a demo for your change.
- Write an uint test in the Oasis repository and run `npm run test` to execute the uint test.



### Submitting a Pull Request

<br />After you have made and tested your change, commit and push it to your fork. Then, open a Pull Request from your fork to the main Oasis repository on the branch you used in the `Making a Change` section of this document.<br />

### Reviewing a Pull Request


#### Addressing review feedback

<br />If we ask for changes via code reviews then:<br />

1. Make the required updates to the code.
1. Re-run the Angular test suites to ensure tests are still passing.
1. Create a fixup commit and push to your GitHub repository (this will update your Pull Request):

```
git commit --all --fixup HEAD
git push
```

<br />That's it! Thank you for your contribution!<br />

##### Updating the commit message

<br />A reviewer might often suggest changes to a commit message (for example, to add more context for a change or adhere to our [commit message guidelines](./COMMIT_MESSAGE_CONVENTION.md)). In order to update the commit message of the last commit on your branch:<br />

1. Check out your branch:

```
git checkout my-fix-branch
```

2. Amend the last commit and modify the commit message:

```
git commit --amend
```

3. Push to your GitHub repository:

```
git push --force-with-lease
```


> NOTE:
> If you need to update the commit message of an earlier commit, you can use `git rebase` in interactive mode. See the [git docs](https://git-scm.com/docs/git-rebase#_interactive_mode) for more details.


#### After your pull request is merged

<br />After your pull request is merged, you can safely delete your branch and pull the changes from the main (upstream) repository:<br />

- Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:

```
git push origin --delete my-fix-branch
```

- Check out the master branch:

```
git checkout master -f
```

- Delete the local branch:

```
git branch -D my-fix-branch
```

- Update your master with the latest upstream version:

```
git pull --ff upstream master
```


## Coding Rules

<br />To ensure consistency throughout the source code, keep these rules in mind as you are working:<br />

- All features or bug fixes **must be tested** by one or more specs (unit-tests).
- All public API methods **must be documented**.
- We use Prettier as an automatic code formatter. Run `npm run prettier` after making any changes to the code.



## Credits

<br />Thank you to all the people who have already contributed to Oasis!<br />
<br />// WIP: Contributors

0 comments on commit dc6d02f

Please sign in to comment.