Skip to content

Commit 999a86c

Browse files
authored
chore: add Node.js 18 support (#1192)
* chore: add Node.js 18 support * build: downgraded @middy/core to 3.x * tests: update default runtime for e2e tests * fix: improved log filtering logic * chore: aws-sdk in node18 e2e tests * tests: updated aws-sdk calls in tracer integration tests * tests: updated aws-sdk calls in tracer integration tests * tests: updated aws-sdk calls in tracer integration tests
1 parent e744d43 commit 999a86c

Some content is hidden

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

42 files changed

+9439
-12567
lines changed

Diff for: .devcontainer/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/blob/v0.212.0/containers/javascript-node/.devcontainer/base.Dockerfile
2-
# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 16, 14, 16-bullseye, 14-bullseye, 16-buster, 14-buster
3-
ARG VARIANT="16-bullseye"
2+
# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 18, 16, 14, 18-bullseye, 16-bullseye, 14-bullseye, 18-buster, 16-buster, 14-buster
3+
ARG VARIANT="18-bullseye"
44
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}
55

66
# This section to install additional OS packages.

Diff for: .devcontainer/devcontainer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
"name": "Node.js",
55
"build": {
66
"dockerfile": "Dockerfile",
7-
// Update 'VARIANT' to pick a Node version: 16, 14.
7+
// Update 'VARIANT' to pick a Node version: 18, 16, 14.
88
// Append -bullseye or -buster to pin to an OS version.
99
// Use -bullseye variants on local arm64/Apple Silicon.
1010
"args": {
11-
"VARIANT": "16-bullseye"
11+
"VARIANT": "18-bullseye"
1212
}
1313
},
1414
// Set *default* container specific settings.json values on container create.

Diff for: .github/ISSUE_TEMPLATE/bug_report.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ body:
5858
attributes:
5959
label: AWS Lambda function runtime
6060
options:
61-
- 14.x
61+
- 18.x
6262
- 16.x
63+
- 14.x
6364
validations:
6465
required: true
6566
- type: dropdown

Diff for: .github/workflows/make-release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Setup NodeJS
2121
uses: actions/setup-node@v3
2222
with:
23-
node-version: "16"
23+
node-version: "18"
2424
cache: "npm"
2525
- name: Setup npm
2626
run: |
@@ -33,7 +33,7 @@ jobs:
3333
path: "./node_modules"
3434
# Use the combo between node version, name, and SHA-256 hash of the lock file as cache key so that
3535
# if one of them changes the cache is invalidated/discarded
36-
key: 16-cache-utils-node-modules-${{ hashFiles('./package-lock.json') }}
36+
key: 18-cache-utils-node-modules-${{ hashFiles('./package-lock.json') }}
3737
- name: Build packages
3838
run: |
3939
npm run build -w packages/commons

Diff for: .github/workflows/publish_layer.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Setup Node.js
3535
uses: actions/setup-node@v3
3636
with:
37-
node-version: "16.12"
37+
node-version: "18"
3838
- name: Set release notes tag
3939
run: |
4040
RELEASE_INPUT=${{ inputs.latest_published_version }}

Diff for: .github/workflows/reusable-publish-docs.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: Setup NodeJS
3939
uses: actions/setup-node@v3
4040
with:
41-
node-version: "16"
41+
node-version: "18"
4242
cache: "npm"
4343
# Use the combo between node version, name, and SHA-256 hash of the lock file as cache key so that
4444
# if one of them changes the cache is invalidated/discarded
@@ -47,7 +47,7 @@ jobs:
4747
uses: actions/cache@v3
4848
with:
4949
path: "./node_modules"
50-
key: 16-cache-utils-node-modules-${{ hashFiles('./package-lock.json') }}
50+
key: 18-cache-utils-node-modules-${{ hashFiles('./package-lock.json') }}
5151
- name: Install dependencies
5252
# We can skip the installation if there was a cache hit
5353
if: steps.cache-node-modules.outputs.cache-hit != 'true'

Diff for: .github/workflows/reusable-run-linting-check-and-unit-tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
NODE_ENV: dev
1111
strategy:
1212
matrix:
13-
version: [14, 16]
13+
version: [14, 16, 18]
1414
fail-fast: false
1515
steps:
1616
- name: Checkout code

Diff for: .github/workflows/reusable_deploy_layer_stack.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
- name: Setup Node.js
6363
uses: actions/setup-node@v3
6464
with:
65-
node-version: "16.12"
65+
node-version: "18"
6666
- name: install cdk and deps
6767
run: |
6868
npm install -g [email protected]

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
strategy:
2121
matrix:
2222
package: [logger, metrics, tracer]
23-
version: [14, 16]
23+
version: [14, 16, 18]
2424
fail-fast: false
2525
steps:
2626
- name: Checkout Repo
@@ -70,7 +70,7 @@ jobs:
7070
strategy:
7171
fail-fast: false
7272
matrix:
73-
version: [14, 16]
73+
version: [14, 16, 18]
7474
steps:
7575
- name: Checkout Repo
7676
uses: actions/checkout@v3
@@ -93,8 +93,8 @@ jobs:
9393
- name: Setup NodeJS
9494
uses: actions/setup-node@v3
9595
with:
96-
# Always use version 16 as we use TypeScript target es2020
97-
node-version: 16
96+
# Always use version 18
97+
node-version: 18
9898
- name: Setup npm
9999
run: npm i -g npm@next-8
100100
- name: "Configure AWS credentials"

Diff for: .nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
lts/gallium
1+
lts/hydrogen

Diff for: CONTRIBUTING.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,20 @@ The alternative is to use a Cloud IDE like [Gitpod](https://www.gitpod.io/) or [
7171

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

74-
- [Node.js >= 16.x](https://nodejs.org/download/release/latest-v16.x/)
74+
- [Node.js >= 18.x](https://nodejs.org/download/release/latest-v18.x/)
7575
- We recommend using a version in [Active LTS](https://nodejs.org/en/about/releases/)
7676
- 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.
7777
- [npm 8.x](https://www.npmjs.com/)
7878
- After installing Node.js, you can install `npm` with `npm install -g npm@next-8`
79-
- [AWS SAM CLI >= 1.49.0](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html)
79+
- [AWS SAM CLI >= 1.65.0](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html)
8080
- 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.
8181
- [Docker](https://docs.docker.com/get-docker/)
8282
- Docker is used to build documentation and Layer.
8383

8484
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.
8585

8686
> **Note**
87-
> In order for the commands below to work you need Node.js `16.x` and npm `8.x`
87+
> In order for the commands below to work you need Node.js `18.x` and npm `8.x`
8888
8989
```console
9090
git clone https://github.com/{your-account}/aws-lambda-powertools-typescript.git
@@ -272,7 +272,7 @@ Contributions via pull requests are much appreciated.
272272

273273
### Summary
274274

275-
* This project uses `node@16.x` and `[email protected]` for development (see [Setup](#setup)).
275+
* This project uses `node@18.x` and `[email protected]` for development (see [Setup](#setup)).
276276
* 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.
277277
* After your proposal has been reviewed and accepted by at least one of the project's maintainers, you can submit a pull request.
278278
* When opening a PR, make sure to follow the checklist inside the pull request template.

0 commit comments

Comments
 (0)