Skip to content

Commit 12284e9

Browse files
authored
chore(docs): fix setup steps in contributing doc (#1478)
* chore: update setup steps + managed devcontainers * chore: removed external link from readmes
1 parent 5d6ed1a commit 12284e9

File tree

10 files changed

+41
-76
lines changed

10 files changed

+41
-76
lines changed

Diff for: .devcontainer/devcontainer.json

+11-12
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,18 @@
1111
"VARIANT": "18-bullseye"
1212
}
1313
},
14-
// Set *default* container specific settings.json values on container create.
15-
"settings": {
16-
"git.enableCommitSigning": true
14+
"customizations": {
15+
// Add the ids of extensions you want installed when the container is created.
16+
"extensions": [
17+
"dbaeumer.vscode-eslint",
18+
"esbenp.prettier-vscode",
19+
"firsttris.vscode-jest-runner",
20+
"amazonwebservices.aws-toolkit-vscode"
21+
],
22+
"vscode": {
23+
"git.enableCommitSigning": true
24+
}
1725
},
18-
// Add the IDs of extensions you want installed when the container is created.
19-
"extensions": [
20-
"dbaeumer.vscode-eslint",
21-
"esbenp.prettier-vscode",
22-
"firsttris.vscode-jest-runner",
23-
"visualstudioexptteam.vscodeintellicode",
24-
"amazonwebservices.aws-toolkit-vscode",
25-
"ms-azuretools.vscode-docker"
26-
],
2726
// Use 'postCreateCommand' to run commands after the container is created.
2827
"postCreateCommand": "npm run setup-local",
2928
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.

Diff for: .gitpod.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ tasks:
33
# Install Nodejs version specified in .nvmrc
44
nvm install
55
nvm use
6-
# Install npm 8.x
7-
npm i -g npm@next-8
86
# Install AWS SAM CLI
97
wget https://github.com/aws/aws-sam-cli/releases/latest/download/aws-sam-cli-linux-x86_64.zip
108
unzip aws-sam-cli-linux-x86_64.zip -d sam-installation
@@ -17,4 +15,4 @@ vscode:
1715
- dbaeumer.vscode-eslint
1816
- esbenp.prettier-vscode
1917
- firsttris.vscode-jest-runner
20-
- ms-azuretools.vscode-docker
18+
- amazonwebservices.aws-toolkit-vscode

Diff for: CONTRIBUTING.md

+15-47
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ information to effectively respond to your bug report or contribution.
2323
- [Write](#write-1)
2424
- [Run](#run-1)
2525
- [Automate](#automate)
26-
- [Examples](#examples)
2726
- [Local documentation](#local-documentation)
2827
- [API reference](#api-reference)
2928
- [Docs website](#docs-website)
@@ -71,11 +70,10 @@ The alternative is to use a Cloud IDE like [Gitpod](https://www.gitpod.io/) or [
7170

7271
The following tools need to be installed on your system prior to starting working on a pull request:
7372

74-
- [Node.js >= 18.x](https://nodejs.org/download/release/latest-v18.x/)
75-
- We recommend using a version in [Active LTS](https://nodejs.org/en/about/releases/)
76-
- If you use [nvm](https://github.com/nvm-sh/nvm#nvmrc) or [fnm](https://github.com/Schniz/fnm) you can install the latest LTS version with `nvm use` or `fnm use` respectively. Both will use the `.nvmrc` file in the project's root.
77-
- [npm 8.x](https://www.npmjs.com/)
78-
- After installing Node.js, you can install `npm` with `npm install -g npm@next-8`
73+
- [Node.js 18.x](https://nodejs.org/download/release/latest-v18.x/)
74+
- If you use [nvm](https://github.com/nvm-sh/nvm#nvmrc) or [fnm](https://github.com/Schniz/fnm) you can install the version used in the project with `nvm use` or `fnm use` respectively. Both will use the `.nvmrc` file in the project's root.
75+
- [npm 9.x](https://www.npmjs.com/)
76+
- After installing the Node.js version above, your npm version should be already 9.x as it comes bundled with Node.js.
7977
- [AWS SAM CLI >= 1.65.0](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html)
8078
- AWS SAM CLI is a command line interface for AWS Serverless Application Model (SAM), it's used in one of the examples, and it's part of the pre-push hook.
8179
- [Docker](https://docs.docker.com/get-docker/)
@@ -84,7 +82,7 @@ The following tools need to be installed on your system prior to starting workin
8482
First, [fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) the repository, and then run the following commands to clone and initialize the repository locally.
8583

8684
> **Note**
87-
> In order for the commands below to work you need Node.js `18.x` and npm `8.x`
85+
> In order for the commands below to work you need Node.js `18.x` and npm `9.x`
8886
8987
```console
9088
git clone https://github.com/{your-account}/aws-lambda-powertools-typescript.git
@@ -93,27 +91,28 @@ npm run setup-local
9391
```
9492

9593
We recommend that you use [Visual Studio Code](https://code.visualstudio.com/) to work on the repo.
96-
We use `eslint` to keep our code consistent in terms of style and reducing defects. We recommend installing
97-
the [eslint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) as well.
94+
We use `eslint` and `prettier` to keep our code consistent in terms of style and reducing defects.
95+
We recommend installing the [eslint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) and [prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) extensions as well.
9896

9997
### Repo Layout
10098

101-
The Powertools for AWS Lambda (TypeScript) is a npm project written in [TypeScript](https://www.typescriptlang.org/).
102-
More specifically, it is a [monorepo managed using npm workspaces](https://docs.npmjs.com/cli/v8/using-npm/workspaces).
99+
The Powertools for AWS Lambda (TypeScript) is fully written in [TypeScript](https://www.typescriptlang.org/) and uses a monorepo structure [managed using npm workspaces](https://docs.npmjs.com/cli/v8/using-npm/workspaces).
103100
If you're unfamiliar with any of these technologies, it is useful to learn about them and will make understanding the codebase easier but strictly not necessary for simple contributions.
104101

105102
The repo contains `packages/` directory that contains the Powertools for AWS Lambda (TypeScript) utilities modules. For instance, the source code for the Logger utility can be found at the location `packages/logger` and so on.
106103
The repo also contains a `packages/commons` directory that holds code and logic shared between one or more utilities and that is published as a separate npm package.
107104

105+
There are also other workspaces that are not part of the Powertools for AWS Lambda (TypeScript) utilities modules, but are used for examples (`examples/*`), documentation (`docs/snippets`), and Lambda Layers (`layers`).
106+
108107
### Tests
109108

110-
Tests are under the `tests` folder of each module and split into two categories: unit tests and e2e (end-to-end) tests.
109+
Tests are under the `tests` folder of each module and split into two categories: unit tests and e2e (end-to-end/integration) tests.
111110

112111
You can run each group separately or all together thanks to [jest-runner-groups](https://www.npmjs.com/package/jest-runner-groups).
113112

114113
Unit tests, under `tests/unit` folder, are standard [Jest](https://jestjs.io) tests.
115114

116-
End-to-end tests, under `tests/e2e` folder, will test the module features by deploying AWS Lambda functions into your AWS Account. We use [aws-cdk](https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html) v2 library with TypeScript for creating infrastructure, and [aws-sdk-js v2](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/) for invoking the functions and asserting on the expected behaviors. All steps are also executed by Jest.
115+
Integration tests, under `tests/e2e` folder, will test the module features by deploying AWS Lambda functions into your AWS Account. We use [aws-cdk](https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html) v2 library with TypeScript for creating infrastructure, and the AWS SDK for invoking the functions and asserting on the expected behaviors. All steps are also executed by Jest.
117116

118117
Running end-to-end tests will deploy AWS resources. You will need an AWS account, and the tests might incur costs. The cost from **some services** are covered by the [AWS Free Tier](https://aws.amazon.com/free/?all-free-tier.sort-by=item.additionalFields.SortRank&all-free-tier.sort-order=asc&awsf.Free%20Tier%20Types=*all&awsf.Free%20Tier%20Categories=*all) but not all of them. If you don't have an AWS Account, follow [these instructions to create one](https://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/).
119118

@@ -203,37 +202,6 @@ You can run the end-to-end tests automatically on your forked project by followi
203202

204203
> :warning: **Don't automatically run end-to-end tests on branch push or PRs**. A malicious attacker can submit a pull request to attack your AWS account. Ideally, use a blank account without any important workload/data, and limit `AWS_ROLE_ARN_TO_ASSUME` permission to least minimum privilege.
205204
206-
### Examples
207-
208-
As part of the repo you will find an examples folder at the root. This folder contains examples (written with CDK and SAM) of deployable AWS Lambda functions using Powertools for AWS Lambda (TypeScript).
209-
210-
To test your updates with these examples, you just have to:
211-
212-
1. Build your local version of *aws-lambda-powertools-typescript* npm packages with `npm run package -ws` while in the root folder
213-
2. Move to the examples folder of your choice
214-
```sh
215-
cd packages/examples/cdk
216-
# or
217-
cd packages/examples/sam
218-
```
219-
3. Update their references in examples
220-
```sh
221-
npm install ../../packages/**/dist/aws-lambda-powertools-*
222-
```
223-
4. Run cdk tests
224-
```sh
225-
npm run test
226-
```
227-
5. Deploy
228-
```sh
229-
npm run cdk deploy
230-
# or
231-
sam build --beta-features
232-
sam deploy --guided
233-
```
234-
235-
The last step will deploy AWS resources, therefore, you will need an AWS account, and it might incur some costs which should be covered by the [AWS Free Tier](https://aws.amazon.com/free/?all-free-tier.sort-by=item.additionalFields.SortRank&all-free-tier.sort-order=asc&awsf.Free%20Tier%20Types=*all&awsf.Free%20Tier%20Categories=*all). If you don't have an AWS Account, follow [these instructions to create one](https://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/).
236-
237205
### Local documentation
238206

239207
You might find useful to run both the documentation website and the API reference locally while contributing.
@@ -260,8 +228,8 @@ Alternatively you can run these two commands:
260228

261229
| Category | Convention |
262230
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
263-
| **Docstring** | We use [JSDoc](https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html) annotations to provide type information and create API references. |
264-
| **Style guide** | We use `eslint` to keep our code consistent in terms of style and reducing defects. |
231+
| **Docstring** | We use [TypeDoc](https://typedoc.org) annotations to provide type information and create API references. |
232+
| **Style guide** | We use `eslint` & `prettier` to keep our code consistent in terms of style and reducing defects. |
265233
| **Test coverage** | We use [Jest](https://jestjs.io/) to test our code and [Codecov](https://codecov.io/) to report test coverage. We aim to have 100% test coverage in our unit tests. |
266234
| **Git commits** | We follow [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/). These are not enforced as we squash and merge PRs, but PR titles are enforced during CI. |
267235
| **Documentation** | API reference docs are generated from docstrings which should have an Examples section to allow developers to have what they need within their own IDE. Documentation website covers the wider usage, tips, and strives to be concise. |
@@ -272,7 +240,7 @@ Contributions via pull requests are much appreciated.
272240

273241
### Summary
274242

275-
* This project uses `[email protected]` and `npm@8.x` for development (see [Setup](#setup)).
243+
* This project uses `[email protected]` and `npm@9.x` for development (see [Setup](#setup)).
276244
* Before opening a Pull Request, please find the existing related issue or open a new one to discuss the proposed changes. A PR without a related issue or discussion has a high risk of being rejected. We are very appreciative and thankful for your time and efforts, and we want to make sure they are not wasted.
277245
* After your proposal has been reviewed and accepted by at least one of the project's maintainers, you can submit a pull request.
278246
* When opening a PR, make sure to follow the checklist inside the pull request template.

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ You can use the library in both TypeScript and JavaScript code bases.
2222
- [Contribute](#contribute)
2323
- [Roadmap](#roadmap)
2424
- [Connect](#connect)
25-
- [How to support Powertools for AWS Lambda (TypeScript)?](#how-to-support-aws-lambda-powertools-for-typescript)
25+
- [How to support Powertools for AWS Lambda (TypeScript)?](#how-to-support-powertools-for-aws-lambda-typescript)
2626
- [Becoming a reference customer](#becoming-a-reference-customer)
2727
- [Sharing your work](#sharing-your-work)
2828
- [Using Lambda Layer](#using-lambda-layer)
@@ -101,7 +101,7 @@ Help us prioritize upcoming functionalities or utilities by [upvoting existing R
101101

102102
### Becoming a reference customer
103103

104-
Knowing which companies are using this library is important to help prioritize the project internally. If your company is using Powertools for AWS Lambda (TypeScript), you can request to have your name and logo added to the README file by raising a [Support Powertools for AWS Lambda (TypeScript) (become a reference)](https://github.com/awslabs/aws-lambda-powertools-typescript/issues/new?assignees=&labels=customer-reference&template=support_powertools.yml&title=%5BSupport+Lambda+Powertools%5D%3A+%3Cyour+organization+name%3E){target="_blank"} issue.
104+
Knowing which companies are using this library is important to help prioritize the project internally. If your company is using Powertools for AWS Lambda (TypeScript), you can request to have your name and logo added to the README file by raising a [Support Powertools for AWS Lambda (TypeScript) (become a reference)](https://github.com/awslabs/aws-lambda-powertools-typescript/issues/new?assignees=&labels=customer-reference&template=support_powertools.yml&title=%5BSupport+Lambda+Powertools%5D%3A+%3Cyour+organization+name%3E) issue.
105105

106106
The following companies, among others, use Powertools:
107107

Diff for: packages/commons/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ You can use the library in both TypeScript and JavaScript code bases.
1919
- [Contribute](#contribute)
2020
- [Roadmap](#roadmap)
2121
- [Connect](#connect)
22-
- [How to support Powertools for AWS Lambda (TypeScript)?](#how-to-support-aws-lambda-powertools-for-typescript)
22+
- [How to support Powertools for AWS Lambda (TypeScript)?](#how-to-support-powertools-for-aws-lambda-typescript)
2323
- [Becoming a reference customer](#becoming-a-reference-customer)
2424
- [Sharing your work](#sharing-your-work)
2525
- [Using Lambda Layer](#using-lambda-layer)
@@ -87,7 +87,7 @@ Help us prioritize upcoming functionalities or utilities by [upvoting existing R
8787

8888
### Becoming a reference customer
8989

90-
Knowing which companies are using this library is important to help prioritize the project internally. If your company is using Powertools for AWS Lambda (TypeScript), you can request to have your name and logo added to the README file by raising a [Support Powertools for AWS Lambda (TypeScript) (become a reference)](https://github.com/awslabs/aws-lambda-powertools-typescript/issues/new?assignees=&labels=customer-reference&template=support_powertools.yml&title=%5BSupport+Lambda+Powertools%5D%3A+%3Cyour+organization+name%3E){target="_blank"} issue.
90+
Knowing which companies are using this library is important to help prioritize the project internally. If your company is using Powertools for AWS Lambda (TypeScript), you can request to have your name and logo added to the README file by raising a [Support Powertools for AWS Lambda (TypeScript) (become a reference)](https://github.com/awslabs/aws-lambda-powertools-typescript/issues/new?assignees=&labels=customer-reference&template=support_powertools.yml&title=%5BSupport+Lambda+Powertools%5D%3A+%3Cyour+organization+name%3E) issue.
9191

9292
The following companies, among others, use Powertools:
9393

Diff for: packages/idempotency/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ You can use the library in both TypeScript and JavaScript code bases.
1818
- [Contribute](#contribute)
1919
- [Roadmap](#roadmap)
2020
- [Connect](#connect)
21-
- [How to support Powertools for AWS Lambda (TypeScript)?](#how-to-support-aws-lambda-powertools-for-typescript)
21+
- [How to support Powertools for AWS Lambda (TypeScript)?](#how-to-support-powertools-for-aws-lambda-typescript)
2222
- [Becoming a reference customer](#becoming-a-reference-customer)
2323
- [Sharing your work](#sharing-your-work)
2424
- [Using Lambda Layer](#using-lambda-layer)
@@ -85,7 +85,7 @@ Help us prioritize upcoming functionalities or utilities by [upvoting existing R
8585

8686
### Becoming a reference customer
8787

88-
Knowing which companies are using this library is important to help prioritize the project internally. If your company is using Powertools for AWS Lambda (TypeScript), you can request to have your name and logo added to the README file by raising a [Support Powertools for AWS Lambda (TypeScript) (become a reference)](https://github.com/awslabs/aws-lambda-powertools-typescript/issues/new?assignees=&labels=customer-reference&template=support_powertools.yml&title=%5BSupport+Lambda+Powertools%5D%3A+%3Cyour+organization+name%3E){target="_blank"} issue.
88+
Knowing which companies are using this library is important to help prioritize the project internally. If your company is using Powertools for AWS Lambda (TypeScript), you can request to have your name and logo added to the README file by raising a [Support Powertools for AWS Lambda (TypeScript) (become a reference)](https://github.com/awslabs/aws-lambda-powertools-typescript/issues/new?assignees=&labels=customer-reference&template=support_powertools.yml&title=%5BSupport+Lambda+Powertools%5D%3A+%3Cyour+organization+name%3E) issue.
8989

9090
The following companies, among others, use Powertools:
9191

0 commit comments

Comments
 (0)