Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, 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.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

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

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers 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, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at antokarag@gmail.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
165 changes: 165 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
# Contributing to react-recaptcha-x

The following is a set of guidelines for contributing to this project. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.

## Table Of Contents

[Code of Conduct](#code-of-conduct)

[How to Contribute](#How-to-Contribute)

- [Reporting Bugs](#reporting-bugs)
- [Feature Requests](#feature-requests)
- [Pull Requests](#pull-requests)

[Development Environment](#Development-Environment)

- [Prerequisites](#development-prerequisites)
- [Setup](#Development-Setup)

[Code Quality / Linting](#Code-Quality-/-Linting)

- [Packages / References](#Code-Quality-/-Linting---Packages-/-References)
- [Commands](#Code-Quality-/-Linting---Commands)

[Unit Testing](#Unit-Testing)

- [Packages / References](#Unit-Testing---Packages-/-References)
- [Commands](#Unit-Testing---Commands)
- [Reports](#Unit-Testing---Reports)

[Build / Deployment / Release](#Build-/-Deployment-/-Release)

- [Packages / References](#Build-/-Deployment-/-Release---Packages-/-References)
- [Commands](#Build-/-Deployment-/-Release---Commands)

## Code of Conduct

This project and everyone participating in it is governed by the following [Code of Conduct](https://github.com/antokara/react-recaptcha-x/blob/master/.github/CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at antokarag@gmail.com.

## How to Contribute

### Reporting Bugs

Before creating a bug report, please check the existing [issues list](https://github.com/antokara/react-recaptcha-x/issues) as you might find out that you don't need to create one.

When you are creating a bug report, please include as many details as possible. Fill out the required [bug report template](https://github.com/antokara/react-recaptcha-x/blob/master/.github/ISSUE_TEMPLATE/bug_report.md), which asks for information that helps us resolve issues faster.

### Feature Requests

Before creating a feature request, please check the existing [issues list](https://github.com/antokara/react-recaptcha-x/issues) as you might find out that you don't need to create one.

When you are creating a feature request, please include as many details as possible. Fill out the required [feature request template](https://github.com/antokara/react-recaptcha-x/blob/master/.github/ISSUE_TEMPLATE/feature_request.md), which asks for information that helps us understand the request and use case for it.

### Pull Requests

Please do not open a pull request that does not reference an existing issue. Any given pull request should attempt to solve an existing issue or enhance a feature / documentation / etc.

When you are creating a pull request, please fill out the required [pull request template](https://github.com/antokara/react-recaptcha-x/blob/master/.github/PULL_REQUEST_TEMPLATE.md), which makes sure the pull requests follow certain standards and provide helpful information.

In order for a pull request to get accepted, it must pass the automated Linting / Tests / License Scan and then the manual code review process.

Pull Requests that fail the automated checks, will not get code reviewed until adjusted to pass.

## Development Environment

### Development Prerequisites

1. [nodejs](https://nodejs.org/en/) 10.x.x LTS

### Development Setup

1. `$npm install`
1. `$cd dev`
1. `$npm install`
1. create `.env` file with your reCAPTCHA key(s) using `.env.example` as a template
1. `$npm start`
1. open browser to `http://locahost:9000`

### Code Quality / Linting

#### Code Quality / Linting - Packages / References

1. [Commitlint](https://commitlint.js.org/)
1. [conventional changelog](https://github.com/conventional-changelog/commitlint#readme)
1. [Prettier](https://prettier.io/)
1. [TSLint](https://palantir.github.io/tslint/)
1. [consistent codestyle](https://github.com/ajafff/tslint-consistent-codestyle#rules)
1. [microsoft contrib](https://github.com/microsoft/tslint-microsoft-contrib#supported-rules)
1. [tslint react](https://github.com/palantir/tslint-react#rules)

#### Code Quality / Linting - Commands

1. for Commitlint run `$npm run cl`
1. for Prettier run `$npm run prettier`
1. for TSLint run `$npm run lint`
1. for Typescript compilation validation run `$npm run ts:validate`

### Unit Testing

#### Unit Testing - Packages / References

1. [Jest](https://jestjs.io)
1. [TS Jest](https://github.com/kulshekhar/ts-jest)
1. [React Testing Library](https://testing-library.com/)
1. [Jest DOM](https://github.com/testing-library/jest-dom)

#### Unit Testing - Commands

- for unit tests run `$npm test`
- for unit tests plus code coverage report run `$npm run test:cov`

#### Unit Testing - Reports

- code coverage `/reports/coverage/lcov-report/index.html`

### Build / Deployment / Release

#### Build / Deployment / Release - Packages / References

1. [Typescript compiler](http://www.typescriptlang.org/docs/handbook/compiler-options.html)
1. [Webpack](https://webpack.js.org/)
1. [ts loader](https://github.com/TypeStrong/ts-loader)
1. [Semantic Release](https://semantic-release.gitbook.io/semantic-release/)
1. [commit analyzer](https://github.com/semantic-release/commit-analyzer)
1. [release notes generator](https://github.com/semantic-release/release-notes-generator)
1. [changelog](https://github.com/semantic-release/changelog)
1. [git](https://github.com/semantic-release/git)
1. [github](https://github.com/semantic-release/github)
1. [npm](https://github.com/semantic-release/npm)
1. [Semantic Versioning](https://semver.org/)
1. [Travis CI](https://docs.travis-ci.com/)
1. [builds](https://travis-ci.org/antokara/react-recaptcha-x)

#### Build / Deployment / Release - Commands

For the complete build sequence run:

- `$npm run build`

Alternatively, if you want more control:

- to clean the `dist/` directory, run `$npm run build:clean`
- for _declaration files_ generation, run `$npm run build:types`
- for _javascript files_ generation, run `$npm run build:js`
- for _tsc paths_ resolution, run `$npm run build:tscpaths`

Travis CI lints, tests and builds any GitHub branch and PR.
Once the PR gets merged to **master**, Travis CI runs again
and this time, additionally to lint, test and build, the **deploy** stage runs which executes the `semantic-release`.

When Semantic Release runs, it analyzes the git commits and if applicable, it:

1. generates the updated changelog
1. creates a git (release) tag with the appropriate semantic release
version
1. updates the version in `package.json`
1. commits the file changes and new tag, to the GitHub master branch
1. publishes the new version, to the npm repository with the `latest` tag

There's one final step that needs to be done manually, after we verify the published npm:

- run `$npm dist-tag add react-recaptcha-x@{version} stable`

this will add the `stable` distribution tag, marking the latest release, as the stable one.
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: antokara

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Minimal, Reproducible Example**
If applicable, please reproduce the problem with an example, using a platform such as https://codesandbox.io/

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
29 changes: 29 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Pull Request Template

Thank you for your interest in improving our project.

Please make sure your commit message(s) in the pull request, as well as the actual Pull Request description, meet the [conventional commit format](https://github.com/conventional-changelog/commitlint#what-is-commitlint).

## Bug Fix Template Example

```text
fix(core): send cors headers

* adjust method parameters to properly accept cors headers
* add unit tests for the fixed functionality
* adjust existing tests to the changes

fix #bug-issue-number
```

## Feature Template Example

```text
feat(core): send cors headers

* adjust method parameters to accept cors headers
* add unit tests for the new functionality
* adjust existing tests to the changes

close #feature-issue-number
```
Loading