Skip to content

chore: add Node.js 18 support #1192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Dec 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/blob/v0.212.0/containers/javascript-node/.devcontainer/base.Dockerfile
# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 16, 14, 16-bullseye, 14-bullseye, 16-buster, 14-buster
ARG VARIANT="16-bullseye"
# [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
ARG VARIANT="18-bullseye"
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}

# This section to install additional OS packages.
Expand Down
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"name": "Node.js",
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick a Node version: 16, 14.
// Update 'VARIANT' to pick a Node version: 18, 16, 14.
// Append -bullseye or -buster to pin to an OS version.
// Use -bullseye variants on local arm64/Apple Silicon.
"args": {
"VARIANT": "16-bullseye"
"VARIANT": "18-bullseye"
}
},
// Set *default* container specific settings.json values on container create.
Expand Down
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ body:
attributes:
label: AWS Lambda function runtime
options:
- 14.x
- 18.x
- 16.x
- 14.x
validations:
required: true
- type: dropdown
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/make-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: "16"
node-version: "18"
cache: "npm"
- name: Setup npm
run: |
Expand All @@ -33,7 +33,7 @@ jobs:
path: "./node_modules"
# Use the combo between node version, name, and SHA-256 hash of the lock file as cache key so that
# if one of them changes the cache is invalidated/discarded
key: 16-cache-utils-node-modules-${{ hashFiles('./package-lock.json') }}
key: 18-cache-utils-node-modules-${{ hashFiles('./package-lock.json') }}
- name: Build packages
run: |
npm run build -w packages/commons
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_layer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "16.12"
node-version: "18"
- name: Set release notes tag
run: |
RELEASE_INPUT=${{ inputs.latest_published_version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/reusable-publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: "16"
node-version: "18"
cache: "npm"
# Use the combo between node version, name, and SHA-256 hash of the lock file as cache key so that
# if one of them changes the cache is invalidated/discarded
Expand All @@ -47,7 +47,7 @@ jobs:
uses: actions/cache@v3
with:
path: "./node_modules"
key: 16-cache-utils-node-modules-${{ hashFiles('./package-lock.json') }}
key: 18-cache-utils-node-modules-${{ hashFiles('./package-lock.json') }}
- name: Install dependencies
# We can skip the installation if there was a cache hit
if: steps.cache-node-modules.outputs.cache-hit != 'true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
NODE_ENV: dev
strategy:
matrix:
version: [14, 16]
version: [14, 16, 18]
fail-fast: false
steps:
- name: Checkout code
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable_deploy_layer_stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "16.12"
node-version: "18"
- name: install cdk and deps
run: |
npm install -g [email protected]
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/run-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
matrix:
package: [logger, metrics, tracer]
version: [14, 16]
version: [14, 16, 18]
fail-fast: false
steps:
- name: Checkout Repo
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version: [14, 16]
version: [14, 16, 18]
steps:
- name: Checkout Repo
uses: actions/checkout@v3
Expand All @@ -93,8 +93,8 @@ jobs:
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
# Always use version 16 as we use TypeScript target es2020
node-version: 16
# Always use version 18
node-version: 18
- name: Setup npm
run: npm i -g npm@next-8
- name: "Configure AWS credentials"
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/gallium
lts/hydrogen
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,20 @@ The alternative is to use a Cloud IDE like [Gitpod](https://www.gitpod.io/) or [

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

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

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.

> **Note**
> In order for the commands below to work you need Node.js `16.x` and npm `8.x`
> In order for the commands below to work you need Node.js `18.x` and npm `8.x`

```console
git clone https://github.com/{your-account}/aws-lambda-powertools-typescript.git
Expand Down Expand Up @@ -272,7 +272,7 @@ Contributions via pull requests are much appreciated.

### Summary

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