Skip to content

Commit 6d2de72

Browse files
authored
chore(maintenance): adopt TypeScript 5.x (#1672)
* chore(maintenance): upgrade to TypeScript 5.x * docs: update docs with decorators requirement * chore: dependencies * chore: downgrade eslint deps due to nodejs14x
1 parent b2fe341 commit 6d2de72

File tree

9 files changed

+1731
-1813
lines changed

9 files changed

+1731
-1813
lines changed

Diff for: docs/core/logger.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ This functionality will include the following keys in your structured logs:
119119
=== "Decorator"
120120

121121
!!! info
122-
Decorators can only be attached to a class declaration, method, accessor, property, or parameter. Therefore, if you prefer to write your handler as a standard function rather than a Class method, use the middleware or the manual instrumentation instead. See the [official TypeScript documentation](https://www.typescriptlang.org/docs/handbook/decorators.html) for more details.
122+
Powertools decorators can only be attached to class methods and follow the experimetal decorators proposal implementation found in TypeScript 4.x. As such, you need to enable the `experimentalDecorators` compiler option in your `tsconfig.json` file to use them.
123123

124124
```typescript hl_lines="8"
125125
--8<-- "docs/snippets/logger/decorator.ts"

Diff for: docs/core/metrics.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ You can add default dimensions to your metrics by passing them as parameters in
212212
=== "with logMetrics decorator"
213213

214214
!!! info
215-
Decorators can only be attached to a class declaration, method, accessor, property, or parameter. Therefore, if you prefer to write your handler as a standard function rather than a Class method, use the middleware or the manual instrumentation instead. See the [official TypeScript documentation](https://www.typescriptlang.org/docs/handbook/decorators.html) for more details.
215+
Powertools decorators can only be attached to class methods and follow the experimetal decorators proposal implementation found in TypeScript 4.x. As such, you need to enable the `experimentalDecorators` compiler option in your `tsconfig.json` file to use them.
216216

217217
```typescript hl_lines="12"
218218
--8<-- "docs/snippets/metrics/defaultDimensionsDecorator.ts"

Diff for: docs/core/tracer.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ You can quickly start by importing the `Tracer` class, initialize it outside the
9898
=== "Decorator"
9999

100100
!!! info
101-
Decorators can only be attached to a class declaration, method, accessor, property, or parameter. Therefore, if you prefer to write your handler as a standard function rather than a Class method, use the middleware or the manual instrumentation instead. See the [official TypeScript documentation](https://www.typescriptlang.org/docs/handbook/decorators.html) for more details.
101+
Powertools decorators can only be attached to class methods and follow the experimetal decorators proposal implementation found in TypeScript 4.x. As such, you need to enable the `experimentalDecorators` compiler option in your `tsconfig.json` file to use them.
102102

103103
```typescript hl_lines="8"
104104
--8<-- "docs/snippets/tracer/decorator.ts"

Diff for: examples/cdk/package.json

+5-10
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,14 @@
3333
"@aws-sdk/client-ssm": "^3.360.0",
3434
"@aws-sdk/lib-dynamodb": "^3.360.0",
3535
"@types/aws-lambda": "^8.10.109",
36-
"@types/jest": "^29.2.4",
36+
"@types/jest": "^29.5.4",
3737
"@types/node": "18.11.17",
38-
"@typescript-eslint/eslint-plugin": "^5.46.1",
39-
"@typescript-eslint/parser": "^5.46.1",
4038
"aws-cdk": "^2.73.0",
41-
"esbuild": "^0.16.9",
42-
"eslint-import-resolver-node": "^0.3.6",
43-
"eslint-import-resolver-typescript": "^3.5.2",
44-
"eslint-plugin-import": "^2.26.0",
45-
"jest": "^29.3.1",
46-
"ts-jest": "^29.0.3",
39+
"esbuild": "^0.19.2",
40+
"jest": "^29.7.0",
41+
"ts-jest": "^29.1.1",
4742
"ts-node": "^10.9.1",
48-
"typescript": "^4.9.4"
43+
"typescript": "^5.2.2"
4944
},
5045
"dependencies": {
5146
"@middy/core": "^3.6.2",

Diff for: examples/sam/package.json

+5-11
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,12 @@
2222
},
2323
"devDependencies": {
2424
"@types/aws-lambda": "^8.10.109",
25-
"@types/jest": "^29.2.4",
25+
"@types/jest": "^29.5.4",
2626
"@types/node": "18.11.17",
27-
"@typescript-eslint/eslint-plugin": "^5.46.1",
28-
"@typescript-eslint/parser": "^5.46.1",
29-
"eslint": "^8.30.0",
30-
"eslint-import-resolver-node": "^0.3.6",
31-
"eslint-import-resolver-typescript": "^3.5.2",
32-
"eslint-plugin-import": "^2.26.0",
33-
"jest": "^29.3.1",
34-
"ts-jest": "^29.0.3",
27+
"jest": "^29.7.0",
28+
"ts-jest": "^29.1.1",
3529
"ts-node": "^10.9.1",
36-
"typescript": "^4.9.4"
30+
"typescript": "^5.2.2"
3731
},
3832
"dependencies": {
3933
"@aws-lambda-powertools/logger": "^1.12.1",
@@ -44,7 +38,7 @@
4438
"@aws-sdk/client-ssm": "^3.360.0",
4539
"@aws-sdk/lib-dynamodb": "^3.360.0",
4640
"@middy/core": "^3.6.2",
47-
"esbuild": "^0.18.14",
41+
"esbuild": "^0.19.2",
4842
"phin": "^3.7.0"
4943
}
5044
}

0 commit comments

Comments
 (0)