Skip to content

Commit b1f508b

Browse files
dreamorosiflochaz
andcommitted
feat(all): nodejs16x support (#877)
* feat: added node16 to e2e test * Added runtime to e2eUtils * feat: added node16 to e2e test * chore: added runtime key * chore: update occurrences of nodejs14x * test sam version * test sam version * revert * sam * sam * sam * sam * chore: added .nvmrc * chore: updated cdk example runtime * Update packages/metrics/tests/e2e/basicFeatures.decorators.test.ts Co-authored-by: Florian Chazal <[email protected]> Co-authored-by: Florian Chazal <[email protected]>
1 parent 937bf62 commit b1f508b

30 files changed

+64
-41
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
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
22
# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 16, 14, 12, 16-bullseye, 14-bullseye, 12-bullseye, 16-buster, 14-buster, 12-buster
3-
ARG VARIANT="14-bullseye"
3+
ARG VARIANT="16-bullseye"
44
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}
55

66
# This section to install additional OS packages.

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// Update 'VARIANT' to pick a Node version: 16, 14, 12.
88
// Append -bullseye or -buster to pin to an OS version.
99
// Use -bullseye variants on local arm64/Apple Silicon.
10-
"args": { "VARIANT": "14-bullseye" }
10+
"args": { "VARIANT": "16-bullseye" }
1111
},
1212

1313
// Set *default* container specific settings.json values on container create.

.github/workflows/on-merge-to-main.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121
#########################
2222
# Release new version
2323
#########################
24-
- name: "Use NodeJS 14"
24+
- name: "Use NodeJS 16"
2525
uses: actions/setup-node@v3
2626
with:
27-
node-version: '14'
27+
node-version: '16'
2828
- name: Install [email protected]
2929
run: npm i -g npm@next-8
3030
- name: "Setup npm"
@@ -39,6 +39,11 @@ jobs:
3939
# the dependencies in a separate step
4040
working-directory: ./examples/cdk
4141
run: npm ci
42+
- name: "Setup SAM"
43+
# We use an ad-hoc action so we can specify the SAM CLI version
44+
uses: aws-actions/setup-sam@v2
45+
with:
46+
version: 1.49.0
4247
- name: Install SAM example packages
4348
# Since we are not managing the SAM examples with npm workspaces we install
4449
# the dependencies in a separate step

.github/workflows/on-release-prod.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121
#########################
2222
# Release new version
2323
#########################
24-
- name: "Use NodeJS 14"
24+
- name: "Use NodeJS 16"
2525
uses: actions/setup-node@v3
2626
with:
27-
node-version: '14'
27+
node-version: '16'
2828
- name: Install [email protected]
2929
run: npm i -g npm@next-8
3030
- name: "Setup npm"
@@ -39,6 +39,11 @@ jobs:
3939
# the dependencies in a separate step
4040
working-directory: ./examples/cdk
4141
run: npm ci
42+
- name: "Setup SAM"
43+
# We use an ad-hoc action so we can specify the SAM CLI version
44+
uses: aws-actions/setup-sam@v2
45+
with:
46+
version: 1.49.0
4247
- name: Install SAM example packages
4348
# Since we are not managing the SAM examples with npm workspaces we install
4449
# the dependencies in a separate step

.github/workflows/pr_lint_and_test.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ jobs:
99
NODE_ENV: dev
1010
steps:
1111
- uses: actions/checkout@v3
12-
- name: Set up Node
12+
- name: "Use NodeJS 16"
1313
uses: actions/setup-node@v3
1414
with:
15-
node-version: '14'
15+
node-version: '16'
1616
- name: Install [email protected]
1717
run: npm i -g npm@next-8
1818
- name: "Setup npm"
@@ -27,6 +27,11 @@ jobs:
2727
# the dependencies in a separate step
2828
working-directory: ./examples/cdk
2929
run: npm ci
30+
- name: "Setup SAM"
31+
# We use an ad-hoc action so we can specify the SAM CLI version
32+
uses: aws-actions/setup-sam@v2
33+
with:
34+
version: 1.49.0
3035
- name: Install SAM example packages
3136
# Since we are not managing the SAM examples with npm workspaces we install
3237
# the dependencies in a separate step

.github/workflows/run-e2e-tests.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@ jobs:
99
steps:
1010
- name: "Checkout"
1111
uses: actions/checkout@v3
12-
- name: "Use NodeJS 14"
12+
- name: "Use NodeJS 16"
1313
uses: actions/setup-node@v3
1414
with:
15-
# Always use version 14 as we use TypeScript target es2020
16-
node-version: 14
15+
node-version: 16
1716
- name: "Install [email protected]"
1817
run: npm i -g npm@next-8
1918
- name: "Install monorepo packages"
@@ -25,6 +24,11 @@ jobs:
2524
# the dependencies in a separate step
2625
working-directory: ./examples/cdk
2726
run: npm ci
27+
- name: "Setup SAM"
28+
# We use an ad-hoc action so we can specify the SAM CLI version
29+
uses: aws-actions/setup-sam@v2
30+
with:
31+
version: 1.49.0
2832
- name: Install SAM example packages
2933
# Since we are not managing the SAM examples with npm workspaces we install
3034
# the dependencies in a separate step
@@ -43,16 +47,15 @@ jobs:
4347
contents: read
4448
strategy:
4549
matrix:
46-
version: [12, 14]
4750
package: [logger, metrics, tracer]
51+
version: [12, 14, 16]
4852
steps:
4953
- name: "Checkout"
5054
uses: actions/checkout@v3
51-
- name: "Use NodeJS 14"
55+
- name: "Use NodeJS 16"
5256
uses: actions/setup-node@v3
5357
with:
54-
# Always use version 14 as we use TypeScript target es2020
55-
node-version: 14
58+
node-version: 16
5659
- name: "Install [email protected]"
5760
run: npm i -g npm@next-8
5861
- name: "Install monorepo packages"

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
lts/fermium
1+
lts/gallium

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ The alternative is to use a Cloud IDE like [Gitpod](https://www.gitpod.io/) or [
6161

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

64-
- [Node.js >= 14.18.1](https://nodejs.org/download/release/latest-v14.x/)
64+
- [Node.js >= 16.x](https://nodejs.org/download/release/latest-v16.x/)
6565
- We recommend using a version in [Active LTS](https://nodejs.org/en/about/releases/)
6666
- 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.
6767
- [npm 8.x](https://www.npmjs.com/)
@@ -250,7 +250,7 @@ Contributions via pull requests are much appreciated.
250250
251251
### Summary
252252
253-
* This project uses `node@14.x` and `[email protected]` for development (see [Setup](#setup)).
253+
* This project uses `node@16.x` and `[email protected]` for development (see [Setup](#setup)).
254254
* 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.
255255
* After your proposal has been reviewed and accepted by at least one of the project's maintainers, you can submit a pull request.
256256
* When opening a PR, make sure to follow the checklist inside the pull request template.

docs/core/logger.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ For a **complete list** of supported environment variables, refer to [this secti
8282
ShoppingCartApiFunction:
8383
Type: AWS::Serverless::Function
8484
Properties:
85-
Runtime: nodejs14.x
85+
Runtime: nodejs16.x
8686
Environment:
8787
Variables:
8888
LOG_LEVEL: WARN

docs/core/metrics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ The `Metrics` utility is instantiated outside of the Lambda handler. In doing th
101101
HelloWorldFunction:
102102
Type: AWS::Serverless::Function
103103
Properties:
104-
Runtime: nodejs14.x
104+
Runtime: nodejs16.x
105105
Environment:
106106
Variables:
107107
POWERTOOLS_SERVICE_NAME: orders

0 commit comments

Comments
 (0)