Skip to content

chore: end of support for nodejs12x runtime #1190

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 4 commits into from
Dec 15, 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
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# 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, 12, 16-bullseye, 14-bullseye, 12-bullseye, 16-buster, 14-buster, 12-buster
# [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"
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}

Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "Node.js",
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick a Node version: 16, 14, 12.
// Update 'VARIANT' to pick a Node version: 16, 14.
// Append -bullseye or -buster to pin to an OS version.
// Use -bullseye variants on local arm64/Apple Silicon.
"args": {
Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ body:
attributes:
label: AWS Lambda function runtime
options:
- 12.x
- 14.x
- 16.x
validations:
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: [12, 14, 16]
version: [14, 16]
fail-fast: false
steps:
- name: Checkout code
Expand Down
4 changes: 2 additions & 2 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: [12, 14, 16]
version: [14, 16]
fail-fast: false
steps:
- name: Checkout Repo
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version: [12, 14, 16]
version: [14, 16]
steps:
- name: Checkout Repo
uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions layer-publisher/src/powertools-typescript-layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ export class PowerToolsTypeScriptLayer extends lambda.LayerVersion {
super(scope, id, {
layerVersionName: props?.layerVersionName,
description: `Lambda Powertools for TypeScript version ${props?.version}`,
compatibleRuntimes: [ lambda.Runtime.NODEJS_12_X, lambda.Runtime.NODEJS_14_X, lambda.Runtime.NODEJS_16_X ],
compatibleRuntimes: [ lambda.Runtime.NODEJS_14_X, lambda.Runtime.NODEJS_16_X ],
code: lambda.Code.fromAsset(path.join(__dirname, '.'), {
assetHash: Md5.hashStr(commandJoined),
bundling: {
image: lambda.Runtime.NODEJS_12_X.bundlingImage,
image: lambda.Runtime.NODEJS_14_X.bundlingImage,
local: {
tryBundle(outputDir: string) {
try {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"lib/**/*"
],
"engines": {
"node": ">=12"
"node": ">=14"
},
"dependencies": {
"hosted-git-info": "^5.0.0"
Expand Down
3 changes: 1 addition & 2 deletions packages/commons/tests/utils/e2eUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ import { InvocationLogs } from './InvocationLogs';

const lambdaClient = new AWS.Lambda();

const testRuntimeKeys = [ 'nodejs12x', 'nodejs14x', 'nodejs16x' ];
const testRuntimeKeys = [ 'nodejs14x', 'nodejs16x' ];
export type TestRuntimesKey = typeof testRuntimeKeys[number];
export const TEST_RUNTIMES: Record<TestRuntimesKey, Runtime> = {
nodejs12x: Runtime.NODEJS_12_X,
nodejs14x: Runtime.NODEJS_14_X,
nodejs16x: Runtime.NODEJS_16_X,
};
Expand Down
4 changes: 2 additions & 2 deletions packages/commons/tsconfig-dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"experimentalDecorators": true,
"noImplicitAny": true,
"target": "ES2019",
"target": "ES2020",
"module": "commonjs",
"declaration": true,
"declarationMap": true,
Expand All @@ -23,7 +23,7 @@
"watchDirectory": "useFsEvents",
"fallbackPolling": "dynamicPriority"
},
"lib": [ "es2019" ],
"lib": [ "es2020" ],
"types": [
"jest",
"node"
Expand Down
4 changes: 2 additions & 2 deletions packages/commons/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"experimentalDecorators": true,
"noImplicitAny": true,
"target": "ES2019",
"target": "ES2020",
"module": "commonjs",
"declaration": true,
"declarationMap": true,
Expand All @@ -23,7 +23,7 @@
"watchDirectory": "useFsEvents",
"fallbackPolling": "dynamicPriority"
},
"lib": [ "es2019" ],
"lib": [ "es2020" ],
"types": [
"jest",
"node"
Expand Down
1 change: 0 additions & 1 deletion packages/idempotency/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"commit": "commit",
"test": "npm run test:unit",
"test:unit": "jest --group=unit --detectOpenHandles --coverage --verbose",
"test:e2e:nodejs12x": "echo \"Not implemented\"",
"test:e2e:nodejs14x": "echo \"Not implemented\"",
"test:e2e:nodejs16x": "echo \"Not implemented\"",
"test:e2e": "echo \"Not implemented\"",
Expand Down
4 changes: 2 additions & 2 deletions packages/idempotency/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"experimentalDecorators": true,
"noImplicitAny": true,
"target": "ES2019",
"target": "ES2020",
"module": "commonjs",
"declaration": true,
"outDir": "lib",
Expand All @@ -22,7 +22,7 @@
"watchDirectory": "useFsEvents",
"fallbackPolling": "dynamicPriority"
},
"lib": [ "es2019" ],
"lib": [ "es2020" ],
"types": [
"node"
]
Expand Down
3 changes: 1 addition & 2 deletions packages/logger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"commit": "commit",
"test": "npm run test:unit",
"test:unit": "jest --group=unit --detectOpenHandles --coverage --verbose",
"test:e2e:nodejs12x": "RUNTIME=nodejs12x jest --group=e2e",
"test:e2e:nodejs14x": "RUNTIME=nodejs14x jest --group=e2e",
"test:e2e:nodejs16x": "RUNTIME=nodejs16x jest --group=e2e",
"test:e2e": "jest --group=e2e",
Expand Down Expand Up @@ -59,4 +58,4 @@
"serverless",
"nodejs"
]
}
}
6 changes: 3 additions & 3 deletions packages/logger/src/Logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,8 @@ class Logger extends Utility implements ClassThatLogs {
/**
* The descriptor.value is the method this decorator decorates, it cannot be undefined.
*/
const originalMethod = descriptor.value;
/* eslint-disable @typescript-eslint/no-non-null-assertion */
const originalMethod = descriptor.value!;

// eslint-disable-next-line @typescript-eslint/no-this-alias
const loggerRef = this;
Expand All @@ -331,10 +332,9 @@ class Logger extends Utility implements ClassThatLogs {

Logger.injectLambdaContextBefore(loggerRef, event, context, options);

/* eslint-disable @typescript-eslint/no-non-null-assertion */
let result: unknown;
try {
result = await originalMethod!.apply(this, [ event, context, callback ]);
result = await originalMethod.apply(this, [ event, context, callback ]);
} catch (error) {
throw error;
} finally {
Expand Down
4 changes: 2 additions & 2 deletions packages/logger/tsconfig-dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"experimentalDecorators": true,
"noImplicitAny": true,
"target": "ES2019",
"target": "ES2020",
"module": "commonjs",
"declaration": true,
"declarationMap": true,
Expand All @@ -22,7 +22,7 @@
"watchDirectory": "useFsEvents",
"fallbackPolling": "dynamicPriority"
},
"lib": [ "es2019" ],
"lib": [ "es2020" ],
"types": [
"jest",
"node"
Expand Down
4 changes: 2 additions & 2 deletions packages/logger/tsconfig.es.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"experimentalDecorators": true,
"noImplicitAny": true,
"target": "ES2019",
"target": "ES2020",
"module": "commonjs",
"declaration": true,
"declarationMap": true,
Expand All @@ -22,7 +22,7 @@
"watchDirectory": "useFsEvents",
"fallbackPolling": "dynamicPriority"
},
"lib": [ "es2019" ],
"lib": [ "es2020" ],
"types": [
"jest",
"node"
Expand Down
4 changes: 2 additions & 2 deletions packages/logger/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"experimentalDecorators": true,
"noImplicitAny": true,
"target": "ES2019",
"target": "ES2020",
"module": "commonjs",
"declaration": true,
"outDir": "lib",
Expand All @@ -22,7 +22,7 @@
"watchDirectory": "useFsEvents",
"fallbackPolling": "dynamicPriority"
},
"lib": [ "es2019" ],
"lib": [ "es2020" ],
"types": [
"jest",
"node"
Expand Down
3 changes: 1 addition & 2 deletions packages/metrics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"commit": "commit",
"test": "npm run test:unit",
"test:unit": "jest --group=unit --detectOpenHandles --coverage --verbose",
"test:e2e:nodejs12x": "RUNTIME=nodejs12x jest --group=e2e",
"test:e2e:nodejs14x": "RUNTIME=nodejs14x jest --group=e2e",
"test:e2e:nodejs16x": "RUNTIME=nodejs16x jest --group=e2e",
"test:e2e": "jest --group=e2e",
Expand Down Expand Up @@ -56,4 +55,4 @@
"serverless",
"nodejs"
]
}
}
4 changes: 2 additions & 2 deletions packages/metrics/tsconfig.es.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"experimentalDecorators": true,
"noImplicitAny": true,
"target": "ES2019",
"target": "ES2020",
"module": "commonjs",
"declaration": true,
"declarationMap": true,
Expand All @@ -23,7 +23,7 @@
"watchDirectory": "useFsEvents",
"fallbackPolling": "dynamicPriority"
},
"lib": [ "es2019" ],
"lib": [ "es2020" ],
"types": [
"jest",
"node"
Expand Down
4 changes: 2 additions & 2 deletions packages/metrics/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"experimentalDecorators": true,
"noImplicitAny": true,
"target": "ES2019",
"target": "ES2020",
"module": "commonjs",
"declaration": true,
"declarationMap": true,
Expand All @@ -24,7 +24,7 @@
"watchDirectory": "useFsEvents",
"fallbackPolling": "dynamicPriority"
},
"lib": [ "es2019" ],
"lib": [ "es2020" ],
"types": [
"jest",
"node"
Expand Down
1 change: 0 additions & 1 deletion packages/parameters/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"commit": "commit",
"test": "npm run test:unit",
"test:unit": "jest --group=unit --detectOpenHandles --coverage --verbose",
"test:e2e:nodejs12x": "echo \"Not implemented\"",
"test:e2e:nodejs14x": "echo \"Not implemented\"",
"test:e2e:nodejs16x": "echo \"Not implemented\"",
"test:e2e": "echo \"Not implemented\"",
Expand Down
4 changes: 2 additions & 2 deletions packages/parameters/tsconfig-dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"experimentalDecorators": true,
"noImplicitAny": true,
"target": "ES2019",
"target": "ES2020",
"module": "commonjs",
"declaration": true,
"declarationMap": true,
Expand All @@ -22,7 +22,7 @@
"watchDirectory": "useFsEvents",
"fallbackPolling": "dynamicPriority"
},
"lib": [ "es2019" ],
"lib": [ "es2020" ],
"types": [
"jest",
"node"
Expand Down
4 changes: 2 additions & 2 deletions packages/parameters/tsconfig.es.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"experimentalDecorators": true,
"noImplicitAny": true,
"target": "ES2019",
"target": "ES2020",
"module": "commonjs",
"declaration": true,
"declarationMap": true,
Expand All @@ -22,7 +22,7 @@
"watchDirectory": "useFsEvents",
"fallbackPolling": "dynamicPriority"
},
"lib": [ "es2019" ],
"lib": [ "es2020" ],
"types": [
"jest",
"node"
Expand Down
4 changes: 2 additions & 2 deletions packages/parameters/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"experimentalDecorators": true,
"noImplicitAny": true,
"target": "ES2019",
"target": "ES2020",
"module": "commonjs",
"declaration": true,
"outDir": "lib",
Expand All @@ -22,7 +22,7 @@
"watchDirectory": "useFsEvents",
"fallbackPolling": "dynamicPriority"
},
"lib": [ "es2019" ],
"lib": [ "es2020" ],
"types": [
"jest",
"node"
Expand Down
3 changes: 1 addition & 2 deletions packages/tracer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"commit": "commit",
"test": "npm run test:unit",
"test:unit": "jest --group=unit --detectOpenHandles --coverage --verbose",
"test:e2e:nodejs12x": "RUNTIME=nodejs12x jest --group=e2e",
"test:e2e:nodejs14x": "RUNTIME=nodejs14x jest --group=e2e",
"test:e2e:nodejs16x": "RUNTIME=nodejs16x jest --group=e2e",
"test:e2e": "jest --group=e2e",
Expand Down Expand Up @@ -59,4 +58,4 @@
"serverless",
"nodejs"
]
}
}
4 changes: 2 additions & 2 deletions packages/tracer/tsconfig.es.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"experimentalDecorators": true,
"noImplicitAny": true,
"target": "ES2019",
"target": "ES2020",
"module": "commonjs",
"declaration": true,
"declarationMap": true,
Expand All @@ -23,7 +23,7 @@
"watchDirectory": "useFsEvents",
"fallbackPolling": "dynamicPriority"
},
"lib": [ "es2019" ],
"lib": [ "es2020" ],
"types": [
"jest",
"node"
Expand Down
Loading