From bcee7e0bfb4f4bfaf91fa1ab9068dcaa6777dc9d Mon Sep 17 00:00:00 2001 From: Andrea Amorosi Date: Sat, 6 Apr 2024 13:55:20 +0200 Subject: [PATCH 1/2] chore: bump Powertools for AWS Lambda (TypeScript) --- .../{{cookiecutter.project_name}}/hello-world/app.ts | 3 +-- .../hello-world/package.json | 8 ++++---- .../{{cookiecutter.project_name}}/hello-world/app.ts | 2 +- .../hello-world/package.json | 6 +++--- .../{{cookiecutter.project_name}}/hello-world/app.ts | 2 +- .../hello-world/package.json | 9 ++++----- 6 files changed, 14 insertions(+), 16 deletions(-) diff --git a/nodejs16.x/hello-ts-pt/{{cookiecutter.project_name}}/hello-world/app.ts b/nodejs16.x/hello-ts-pt/{{cookiecutter.project_name}}/hello-world/app.ts index 5ff1b6a9e..8f9230251 100644 --- a/nodejs16.x/hello-ts-pt/{{cookiecutter.project_name}}/hello-world/app.ts +++ b/nodejs16.x/hello-ts-pt/{{cookiecutter.project_name}}/hello-world/app.ts @@ -1,6 +1,6 @@ import { APIGatewayProxyEvent, APIGatewayProxyResult, Context } from 'aws-lambda'; {%- if cookiecutter["Powertools for AWS Lambda (TypeScript) Metrics"] == "enabled"%} -import { Metrics, MetricUnits } from '@aws-lambda-powertools/metrics'; +import { Metrics } from '@aws-lambda-powertools/metrics'; {%- endif %} {%- if cookiecutter["Powertools for AWS Lambda (TypeScript) Logging"] == "enabled"%} import { Logger } from '@aws-lambda-powertools/logger'; @@ -30,7 +30,6 @@ const tracer = new Tracer(); * @returns {APIGatewayProxyResult} object - API Gateway Lambda Proxy Output Format * */ - export const lambdaHandler = async (event: APIGatewayProxyEvent, context: Context): Promise => { let response: APIGatewayProxyResult; diff --git a/nodejs16.x/hello-ts-pt/{{cookiecutter.project_name}}/hello-world/package.json b/nodejs16.x/hello-ts-pt/{{cookiecutter.project_name}}/hello-world/package.json index ea3e39fe0..74c7a5387 100644 --- a/nodejs16.x/hello-ts-pt/{{cookiecutter.project_name}}/hello-world/package.json +++ b/nodejs16.x/hello-ts-pt/{{cookiecutter.project_name}}/hello-world/package.json @@ -7,9 +7,9 @@ "author": "SAM CLI", "license": "MIT", "dependencies": { - "@aws-lambda-powertools/logger": "^1.5.1", - "@aws-lambda-powertools/metrics": "^1.5.1", - "@aws-lambda-powertools/tracer": "^1.5.1", + "@aws-lambda-powertools/logger": "^2.0.3", + "@aws-lambda-powertools/metrics": "^2.0.3", + "@aws-lambda-powertools/tracer": "^2.0.3", "esbuild": "^0.17.6" }, "scripts": { @@ -34,4 +34,4 @@ "ts-node": "^10.9.1", "typescript": "^4.9.4" } -} +} \ No newline at end of file diff --git a/nodejs18.x/hello-ts-pt/{{cookiecutter.project_name}}/hello-world/app.ts b/nodejs18.x/hello-ts-pt/{{cookiecutter.project_name}}/hello-world/app.ts index 5ff1b6a9e..b6976fecc 100644 --- a/nodejs18.x/hello-ts-pt/{{cookiecutter.project_name}}/hello-world/app.ts +++ b/nodejs18.x/hello-ts-pt/{{cookiecutter.project_name}}/hello-world/app.ts @@ -1,6 +1,6 @@ import { APIGatewayProxyEvent, APIGatewayProxyResult, Context } from 'aws-lambda'; {%- if cookiecutter["Powertools for AWS Lambda (TypeScript) Metrics"] == "enabled"%} -import { Metrics, MetricUnits } from '@aws-lambda-powertools/metrics'; +import { Metrics } from '@aws-lambda-powertools/metrics'; {%- endif %} {%- if cookiecutter["Powertools for AWS Lambda (TypeScript) Logging"] == "enabled"%} import { Logger } from '@aws-lambda-powertools/logger'; diff --git a/nodejs18.x/hello-ts-pt/{{cookiecutter.project_name}}/hello-world/package.json b/nodejs18.x/hello-ts-pt/{{cookiecutter.project_name}}/hello-world/package.json index 32ab2b29f..06cbeeb71 100644 --- a/nodejs18.x/hello-ts-pt/{{cookiecutter.project_name}}/hello-world/package.json +++ b/nodejs18.x/hello-ts-pt/{{cookiecutter.project_name}}/hello-world/package.json @@ -7,9 +7,9 @@ "author": "SAM CLI", "license": "MIT", "dependencies": { - "@aws-lambda-powertools/logger": "^1.5.1", - "@aws-lambda-powertools/metrics": "^1.5.1", - "@aws-lambda-powertools/tracer": "^1.5.1", + "@aws-lambda-powertools/logger": "^2.0.3", + "@aws-lambda-powertools/metrics": "^2.0.3", + "@aws-lambda-powertools/tracer": "^2.0.3", "esbuild": "^0.17.6" }, "scripts": { diff --git a/nodejs20.x/hello-ts-pt/{{cookiecutter.project_name}}/hello-world/app.ts b/nodejs20.x/hello-ts-pt/{{cookiecutter.project_name}}/hello-world/app.ts index 5ff1b6a9e..b6976fecc 100644 --- a/nodejs20.x/hello-ts-pt/{{cookiecutter.project_name}}/hello-world/app.ts +++ b/nodejs20.x/hello-ts-pt/{{cookiecutter.project_name}}/hello-world/app.ts @@ -1,6 +1,6 @@ import { APIGatewayProxyEvent, APIGatewayProxyResult, Context } from 'aws-lambda'; {%- if cookiecutter["Powertools for AWS Lambda (TypeScript) Metrics"] == "enabled"%} -import { Metrics, MetricUnits } from '@aws-lambda-powertools/metrics'; +import { Metrics } from '@aws-lambda-powertools/metrics'; {%- endif %} {%- if cookiecutter["Powertools for AWS Lambda (TypeScript) Logging"] == "enabled"%} import { Logger } from '@aws-lambda-powertools/logger'; diff --git a/nodejs20.x/hello-ts-pt/{{cookiecutter.project_name}}/hello-world/package.json b/nodejs20.x/hello-ts-pt/{{cookiecutter.project_name}}/hello-world/package.json index 2153e2ea5..48e6e7288 100644 --- a/nodejs20.x/hello-ts-pt/{{cookiecutter.project_name}}/hello-world/package.json +++ b/nodejs20.x/hello-ts-pt/{{cookiecutter.project_name}}/hello-world/package.json @@ -1,5 +1,4 @@ -{ - "name": "hello_world", +2{0 3"name": "hello_world", "version": "1.0.0", "description": "hello world sample for NodeJS", "main": "app.js", @@ -7,9 +6,9 @@ "author": "SAM CLI", "license": "MIT", "dependencies": { - "@aws-lambda-powertools/logger": "^1.5.1", - "@aws-lambda-powertools/metrics": "^1.5.1", - "@aws-lambda-powertools/tracer": "^1.5.1", + "@aws-lambda-powertools/logger": "^2.0.3", + "@aws-lambda-powertools/metrics": "^2.0.3", + "@aws-lambda-powertools/tracer": "^2.0.3", "esbuild": "^0.17.6" }, "scripts": { From 66d0e0868676d46a123c6335cd559b241f2fcc8e Mon Sep 17 00:00:00 2001 From: Andrea Amorosi Date: Sat, 6 Apr 2024 13:57:42 +0200 Subject: [PATCH 2/2] chore: revert changed lines --- .../{{cookiecutter.project_name}}/hello-world/app.ts | 1 + .../{{cookiecutter.project_name}}/hello-world/package.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/nodejs16.x/hello-ts-pt/{{cookiecutter.project_name}}/hello-world/app.ts b/nodejs16.x/hello-ts-pt/{{cookiecutter.project_name}}/hello-world/app.ts index 8f9230251..b6976fecc 100644 --- a/nodejs16.x/hello-ts-pt/{{cookiecutter.project_name}}/hello-world/app.ts +++ b/nodejs16.x/hello-ts-pt/{{cookiecutter.project_name}}/hello-world/app.ts @@ -30,6 +30,7 @@ const tracer = new Tracer(); * @returns {APIGatewayProxyResult} object - API Gateway Lambda Proxy Output Format * */ + export const lambdaHandler = async (event: APIGatewayProxyEvent, context: Context): Promise => { let response: APIGatewayProxyResult; diff --git a/nodejs16.x/hello-ts-pt/{{cookiecutter.project_name}}/hello-world/package.json b/nodejs16.x/hello-ts-pt/{{cookiecutter.project_name}}/hello-world/package.json index 74c7a5387..aacc212dd 100644 --- a/nodejs16.x/hello-ts-pt/{{cookiecutter.project_name}}/hello-world/package.json +++ b/nodejs16.x/hello-ts-pt/{{cookiecutter.project_name}}/hello-world/package.json @@ -34,4 +34,4 @@ "ts-node": "^10.9.1", "typescript": "^4.9.4" } -} \ No newline at end of file +}