title | description |
---|---|
Development environment |
Setting up your development environment for contribution |
{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!!! 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 22.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)
!!! warning "A word of caution" Before using one of the services below check out their pricing. You can find more information about each service pricing respectively on Gitpod{target="_blank" rel="nofollow"} and GitHub Codespaces{target="_blank" rel="nofollow"} pages.
Once provisioned, each Cloud environment will come with all development dependencies and tools you'll need to contribute already installed.
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)!
- For example, if your username is
octocat
, then the final URL should behttps://gitpod.io/#https://github.com/octocat/powertools-lambda-typescript
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).
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.
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
- If this is your first time running the docs, you need to build the image:
- API reference:
npm run docs-api-build-run