Skip to content

Commit

Permalink
Update CONTRIBUTING.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ofhouse committed May 3, 2021
1 parent 943a6d0 commit cf34579
Showing 1 changed file with 28 additions and 6 deletions.
34 changes: 28 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,55 @@

Contributions are welcome!

As a general advice it is always a good idea to raise a [issue](https://github.com/dealmore/terraform-aws-next-js-image-optimization/issues) before creating a new pull request.
As a general advice it is always a good idea to raise an [issue](https://github.com/dealmore/terraform-aws-next-js-image-optimization/issues) before creating a new pull request.
This ensures that we don't have to reject pull requests that are not aligning with our roadmap and not wasting your valuable time.

## Contribution Prerequisites

The project is a monorepo which contains both the Terraform module and the code used by AWS Lambda for image processing (called worker component).
The project is a monorepo which contains both the Terraform module and the code used by AWS Lambda for image processing written in Node.js (called worker component).

For the Terraform part you should have installed:

- [Terraform CLI](https://www.terraform.io/downloads.html) at 0.13+

For the worker component you should have installed:

- [Node.js](https://nodejs.org/) at v12.0.0+
- [Yarn 1](https://classic.yarnpkg.com/) at v1.2.0+.
- [Node.js](https://nodejs.org/) at v14.0.0+
- [Yarn 1](https://classic.yarnpkg.com/) at v1.2.0+

## Development Workflow

### Terraform module

> **Note:** You should not change the documentation of the **Requirements**, **Providers**, **Inputs** and **Outputs** sections in the `README.md` when contributing.
> **Note:** You should not make changes to the documentation of the **Requirements**, **Providers**, **Inputs** and **Outputs** sections in the `README.md` when contributing.
> The values there are auto generated by a GitHub action task once a PR is merged.
#### Codestyle

We use a [GitHub Action](https://github.com/dealmore/terraform-aws-next-js-image-optimization/actions/workflows/lint.yml) to make sure that the committed code is properly formatted.
Before submitting a PR, you should make sure that the code is properly formatted.

You can do this by running the Terraform [`fmt` command](https://www.terraform.io/docs/cli/commands/fmt.html) in the root of the repository:

```sh
terraform fmt -recursive
```

### Worker component (Node.js)

After cloning the repository, run `yarn` to fetch its dependencies.

#### Codestyle

We use a [GitHub Action](https://github.com/dealmore/terraform-aws-next-js-image-optimization/actions/workflows/lint.yml) to make sure that the committed code is properly formatted.
Before submitting a PR, you should make sure that the code is properly formatted.

You can do this by running the `fix:prettier` command from the root of the repository:

```sh
yarn fix:prettier
```

## Testing

Automatic testing is only done for the worker component written in Node.js.
Expand Down Expand Up @@ -68,7 +90,7 @@ module "next_image_optimizer" {
## End-to-end testing (Node.js)

The end-to-end testing is only used for testing the worker component.
For this a local environment of AWS Lambda is created to simulate a execution under the same conditions as it would run in a AWS data center.
A local environment of AWS Lambda is created for this to simulate a execution under the same conditions as it would run in a AWS data center.

### Prerequisites

Expand Down

0 comments on commit cf34579

Please sign in to comment.