You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- 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`
- 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.
79
77
-[AWS SAM CLI >= 1.65.0](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html)
80
78
- 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.
81
79
-[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
84
82
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.
85
83
86
84
> **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`
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.
98
96
99
97
### Repo Layout
100
98
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).
103
100
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.
104
101
105
102
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.
106
103
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.
107
104
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
+
108
107
### Tests
109
108
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.
111
110
112
111
You can run each group separately or all together thanks to [jest-runner-groups](https://www.npmjs.com/package/jest-runner-groups).
113
112
114
113
Unit tests, under `tests/unit` folder, are standard [Jest](https://jestjs.io) tests.
115
114
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.
117
116
118
117
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/).
119
118
@@ -203,37 +202,6 @@ You can run the end-to-end tests automatically on your forked project by followi
203
202
204
203
> :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.
205
204
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
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
-
237
205
### Local documentation
238
206
239
207
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:
|**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. |
265
233
|**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. |
266
234
|**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. |
267
235
|**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.
272
240
273
241
### Summary
274
242
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)).
276
244
* 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.
277
245
* After your proposal has been reviewed and accepted by at least one of the project's maintainers, you can submit a pull request.
278
246
* When opening a PR, make sure to follow the checklist inside the pull request template.
Copy file name to clipboardExpand all lines: README.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ You can use the library in both TypeScript and JavaScript code bases.
22
22
-[Contribute](#contribute)
23
23
-[Roadmap](#roadmap)
24
24
-[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)
26
26
-[Becoming a reference customer](#becoming-a-reference-customer)
27
27
-[Sharing your work](#sharing-your-work)
28
28
-[Using Lambda Layer](#using-lambda-layer)
@@ -101,7 +101,7 @@ Help us prioritize upcoming functionalities or utilities by [upvoting existing R
101
101
102
102
### Becoming a reference customer
103
103
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.
105
105
106
106
The following companies, among others, use Powertools:
Copy file name to clipboardExpand all lines: packages/commons/README.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ You can use the library in both TypeScript and JavaScript code bases.
19
19
-[Contribute](#contribute)
20
20
-[Roadmap](#roadmap)
21
21
-[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)
23
23
-[Becoming a reference customer](#becoming-a-reference-customer)
24
24
-[Sharing your work](#sharing-your-work)
25
25
-[Using Lambda Layer](#using-lambda-layer)
@@ -87,7 +87,7 @@ Help us prioritize upcoming functionalities or utilities by [upvoting existing R
87
87
88
88
### Becoming a reference customer
89
89
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.
91
91
92
92
The following companies, among others, use Powertools:
Copy file name to clipboardExpand all lines: packages/idempotency/README.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ You can use the library in both TypeScript and JavaScript code bases.
18
18
-[Contribute](#contribute)
19
19
-[Roadmap](#roadmap)
20
20
-[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)
22
22
-[Becoming a reference customer](#becoming-a-reference-customer)
23
23
-[Sharing your work](#sharing-your-work)
24
24
-[Using Lambda Layer](#using-lambda-layer)
@@ -85,7 +85,7 @@ Help us prioritize upcoming functionalities or utilities by [upvoting existing R
85
85
86
86
### Becoming a reference customer
87
87
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.
89
89
90
90
The following companies, among others, use Powertools:
0 commit comments