Skip to content

Latest commit

 

History

History
72 lines (47 loc) · 4.14 KB

File metadata and controls

72 lines (47 loc) · 4.14 KB
title description
Development environment
Setting up your development environment for contribution

Join our Discord{target="_blank" rel="nofollow"}

This page describes how to setup your development environment (Cloud or locally) to contribute to Powertools for AWS Lambda (TypeScript).

```mermaid graph LR Dev["Development environment"] --> Quality["Run quality checks locally"] --> PR["Prepare pull request"] --> Collaborate ``` End-to-end process

Requirements

!!! question "First time contributing to an open-source project ever?" Read this introduction on how to fork and clone a project on GitHub{target="_blank" rel="nofollow"}.

Unless you're using the pre-configured Cloud environment, you'll need the following installed:

  • GitHub account{target="_blank" rel="nofollow"}. You'll need to be able to fork, clone, and contribute via pull request.
  • Node.js 20.x{target="_blank" rel="nofollow"}. The repository contains an .nvmrc file, so if you use tools like nvm, fnm you can switch version quickly.
  • npm 10.x. We use it to install dependencies and manage the workspaces.
  • Docker{target="_blank" rel="nofollow"}. We use it to run documentation, and non-JavaScript tooling.
  • Fork the repository. You'll work against your fork of this repository.

??? note "Additional requirements if running end-to-end tests"

* [AWS Account bootstrapped with CDK](https://docs.aws.amazon.com/cdk/v2/guide/bootstrapping.html){target="_blank"}
* [AWS CLI installed and configured](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)

Cloud environment

!!! warning "A word of caution" Before using a Cloud environment, be mindful of the pricing structure. You can find more information about each service pricing respectively on Gitpod{target="_blank" rel="nofollow"} and GitHub Codespaces{target="_blank" rel="nofollow"} pages. When in doubt, use the local environment below.

Once provisioned, each Cloud environment will come with all development dependencies and tools you'll need to contribute already installed.

Gitpod

To use a pre-configured Gitpod environment, create or login to a Gitpod account, then replace YOUR_USERNAME with your GitHub username or organization.

https://gitpod.io/#https://github.com/YOUR_USERNAME/powertools-lambda-typescript  #(1)!
  1. For example, if your username is octocat, then the final URL should be https://gitpod.io/#https://github.com/octocat/powertools-lambda-typescript

GitHub Codespaces

To use a pre-configured GitHub Codespaces environment, navigate to your fork of the repository, then click on the green Code button, and select Create codespace on <branch_name> under the Codespaces tab (where <branch_name> is the branch you want to work on).

Local environment

Assuming you've got all requirements.

You can use npm run setup-local to install all dependencies locally and setup pre-commit hooks.

!!! note "Curious about what setup-local does under the hood?" We use npm scripts to automate common tasks{target="_blank" rel="nofollow"} locally and in Continuous Integration environments.

Local documentation

You might find useful to run both the documentation website and the API reference locally while contributing:

  • Docs website: npm run docs-runLocalDocker
    • If this is your first time running the docs, you need to build the image: npm run docs-buildDockerImage
  • API reference: npm run docs-api-build-run