Skip to content

Commit 6bf1b70

Browse files
committed
merge conflict
2 parents f3c9abe + c6622ad commit 6bf1b70

File tree

101 files changed

+2342
-3079
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+2342
-3079
lines changed

Diff for: .github/workflows/on-merge-to-main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
# Generate documentation
6262
#########################
6363
- name: Set up Python
64-
uses: actions/setup-python@v3
64+
uses: actions/setup-python@v4
6565
with:
6666
python-version: '3.8'
6767
- name: Install doc generation dependencies

Diff for: .github/workflows/on-release-prod.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
# Generate documentation
6767
#########################
6868
- name: Set up Python
69-
uses: actions/setup-python@v3
69+
uses: actions/setup-python@v4
7070
with:
7171
python-version: '3.8'
7272
- name: Set RELEASE_VERSION env var

Diff for: .github/workflows/pr_lint_and_test.yml

+13-2
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,16 @@ jobs:
77
runs-on: ubuntu-latest
88
env:
99
NODE_ENV: dev
10+
strategy:
11+
matrix:
12+
version: [12, 14, 16]
13+
fail-fast: false
1014
steps:
1115
- uses: actions/checkout@v3
12-
- name: "Use NodeJS 16"
16+
- name: "Use NodeJS"
1317
uses: actions/setup-node@v3
1418
with:
15-
node-version: '16'
19+
node-version: ${{ matrix.version }}
1620
- name: Install [email protected]
1721
run: npm i -g npm@next-8
1822
- name: "Setup npm"
@@ -61,3 +65,10 @@ jobs:
6165
with:
6266
github-token: ${{ secrets.GITHUB_TOKEN }}
6367
lcov-file: ./coverage/lcov.info
68+
- name: Packages size report
69+
uses: flochaz/[email protected]
70+
with:
71+
build-command: mkdir dist && npm run lerna-package && npm run lerna-package-bundle && bash -c "mv ./packages/*/dist/* dist/" && ls dist
72+
dist-directory: /dist
73+
env:
74+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Diff for: .github/workflows/run-e2e-tests.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,14 @@ jobs:
4949
matrix:
5050
package: [logger, metrics, tracer]
5151
version: [12, 14, 16]
52+
fail-fast: false
5253
steps:
5354
- name: "Checkout"
5455
uses: actions/checkout@v3
55-
- name: "Use NodeJS 16"
56+
- name: "Use NodeJS"
5657
uses: actions/setup-node@v3
5758
with:
58-
node-version: 16
59+
node-version: ${{ matrix.version }}
5960
- name: "Install [email protected]"
6061
run: npm i -g npm@next-8
6162
- name: "Install monorepo packages"

Diff for: CHANGELOG.md

+17
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,23 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
# [0.10.0](https://github.com/awslabs/aws-lambda-powertools-typescript/compare/v0.9.1...v0.10.0) (2022-06-02)
7+
8+
9+
### Bug Fixes
10+
11+
* **commons:** rename tests subfolder to samples to avoid being deleted by tools such as node-prune ([#882](https://github.com/awslabs/aws-lambda-powertools-typescript/issues/882)) ([74ef816](https://github.com/awslabs/aws-lambda-powertools-typescript/commit/74ef816830eca897d59881b1d260a146a2c9a47c))
12+
13+
14+
### Features
15+
16+
* **all:** nodejs16x support ([#877](https://github.com/awslabs/aws-lambda-powertools-typescript/issues/877)) ([d2b13c9](https://github.com/awslabs/aws-lambda-powertools-typescript/commit/d2b13c945adb1a74b7c5f76d45f28a6979ce6429))
17+
* **logger:** add removeKeys functionality ([#901](https://github.com/awslabs/aws-lambda-powertools-typescript/issues/901)) ([a0f72c2](https://github.com/awslabs/aws-lambda-powertools-typescript/commit/a0f72c275270db33d382bff357f6054f552197e6))
18+
19+
20+
21+
22+
623
## [0.9.1](https://github.com/awslabs/aws-lambda-powertools-typescript/compare/v0.9.0...v0.9.1) (2022-05-24)
724

825

Diff for: CONTRIBUTING.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,7 @@ First, [fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) the
7878
```console
7979
git clone https://github.com/{your-account}/aws-lambda-powertools-typescript.git
8080
cd aws-lambda-powertools-typescript
81-
npm ci --foreground-scripts;
82-
cd examples/cdk; npm ci
83-
cd ../..
84-
cd examples/sam; npm ci
85-
npm run init-environment
81+
npm run setup-local
8682
```
8783

8884
We recommend that you use [Visual Studio Code](https://code.visualstudio.com/) to work on the repo.

Diff for: README.md

-3
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ Each TypeScript utility is installed as standalone NPM package.
4545

4646
* [CDK](https://github.com/awslabs/aws-lambda-powertools-typescript/tree/main/examples/cdk)
4747
* [SAM](https://github.com/awslabs/aws-lambda-powertools-typescript/tree/main/examples/sam)
48-
* [Tracer](https://github.com/awslabs/aws-lambda-powertools-typescript/tree/main/examples/cdk/src)
49-
* [Logger](https://github.com/awslabs/aws-lambda-powertools-typescript/tree/main/packages/logger/examples)
50-
* [Metrics](https://github.com/awslabs/aws-lambda-powertools-typescript/tree/main/packages/metrics/examples)
5148

5249
## Credits
5350

Diff for: docs/core/logger.md

+12-3
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,12 @@ You can append additional persistent keys and values in the logs generated durin
200200
* Via the Logger's `appendKeys` method, for all log items generated after calling this method
201201
* Passing them in the Logger's constructor
202202

203+
To remove the keys you added, you can use the `removeKeys` method.
204+
205+
203206
=== "handler.ts"
204207

205-
```typescript hl_lines="5-12 16-23"
208+
```typescript hl_lines="5-13 17-25 30"
206209
import { Logger } from '@aws-lambda-powertools/logger';
207210

208211
// Add persistent log keys via the constructor
@@ -213,7 +216,8 @@ You can append additional persistent keys and values in the logs generated durin
213216
logger: {
214217
name: '@aws-lambda-powertools/logger',
215218
version: '0.0.1',
216-
}
219+
},
220+
extra_key: "some-value"
217221
}
218222
});
219223

@@ -224,10 +228,14 @@ You can append additional persistent keys and values in the logs generated durin
224228
// logger: {
225229
// name: '@aws-lambda-powertools/logger',
226230
// version: '0.0.1',
227-
// }
231+
// },
232+
// extra_key: "some-value"
228233
// });
229234

230235
export const handler = async (_event: any, _context: any): Promise<unknown> => {
236+
237+
// If you don't want to log the "extra_key" attribute in your logs, you can remove it
238+
logger.removeKeys(["extra_key"])
231239

232240
// This info log will print all extra custom attributes added above
233241
// Extra attributes: logger object with name and version of the logger library, awsAccountId, awsRegion
@@ -271,6 +279,7 @@ You can append additional persistent keys and values in the logs generated durin
271279
}
272280
```
273281

282+
274283
!!! tip "Logger will automatically ignore any key with an `undefined` value"
275284

276285
#### Clearing all state

Diff for: docs/index.md

-3
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ Each TypeScript utility is installed as standalone NPM package.
6464

6565
* [CDK](https://github.com/awslabs/aws-lambda-powertools-typescript/tree/main/examples/cdk){target="_blank"}
6666
* [SAM](https://github.com/awslabs/aws-lambda-powertools-typescript/tree/main/examples/sam){target="_blank"}
67-
* [Tracer](https://github.com/awslabs/aws-lambda-powertools-typescript/tree/main/examples/cdk/lib){target="_blank"}
68-
* [Logger](https://github.com/awslabs/aws-lambda-powertools-typescript/tree/main/packages/logger/examples){target="_blank"}
69-
* [Metrics](https://github.com/awslabs/aws-lambda-powertools-typescript/tree/main/packages/metrics/examples){target="_blank"}
7067

7168
## Credits
7269

Diff for: docs/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
mike==1.1.2
2-
mkdocs-material==8.2.15
2+
mkdocs-material==8.3.6
33
mkdocs-git-revision-date-plugin==0.3.2

Diff for: examples/cdk/CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
# [0.10.0](https://github.com/awslabs/aws-lambda-powertools-typescript/compare/v0.9.1...v0.10.0) (2022-06-02)
7+
8+
9+
### Features
10+
11+
* **all:** nodejs16x support ([#877](https://github.com/awslabs/aws-lambda-powertools-typescript/issues/877)) ([d2b13c9](https://github.com/awslabs/aws-lambda-powertools-typescript/commit/d2b13c945adb1a74b7c5f76d45f28a6979ce6429))
12+
13+
14+
15+
16+
617
## [0.9.1](https://github.com/awslabs/aws-lambda-powertools-typescript/compare/v0.9.0...v0.9.1) (2022-05-24)
718

819
**Note:** Version bump only for package cdk-app

0 commit comments

Comments
 (0)