Skip to content

Commit 726161b

Browse files
authored
refactor: upgrade to typescript 5 (#4464)
1 parent fcabc16 commit 726161b

File tree

185 files changed

+1646
-1774
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

185 files changed

+1646
-1774
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
diff --git a/index.d.ts b/index.d.ts
2+
index 4238da8770e14cabd912c10c8a3b6dee4692209c..beebec01b3e212df0aaf911ded6f1a629f7ac1ae 100644
3+
--- a/index.d.ts
4+
+++ b/index.d.ts
5+
@@ -1,11 +1,22 @@
6+
import { Connection, Transport } from '@elastic/elasticsearch';
7+
-import AWS from 'aws-sdk';
8+
+
9+
+
10+
+export interface ConnectorConfigCredentials {
11+
+ accessKeyId?: string;
12+
+ secretAccessKey?: string;
13+
+ sessionToken?: string;
14+
+}
15+
+
16+
+export interface ConnectorConfig {
17+
+ region: string;
18+
+ credentials: ConnectorConfigCredentials;
19+
+}
20+
21+
export type Connector = {
22+
Connection: typeof Connection;
23+
Transport: typeof Transport;
24+
};
25+
26+
-export const ConnectorFactory: (awsConfig: AWS.Config) => Connector;
27+
+export const ConnectorFactory: (awsConfig: ConnectorConfig) => Connector;
28+
29+
export default ConnectorFactory;

cypress-tests/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"lodash": "^4.17.21",
2020
"nanoid": "^3.3.8",
2121
"node-fetch": "2.6.7",
22-
"typescript": "4.9.5",
22+
"typescript": "5.3.3",
2323
"uniqid": "^5.4.0"
2424
},
2525
"scripts": {

package.json

+11-20
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030
"devDependencies": {
3131
"@babel/cli": "^7.26.4",
3232
"@babel/code-frame": "^7.26.2",
33-
"@babel/compat-data": "^7.26.3",
33+
"@babel/compat-data": "7.26.5",
3434
"@babel/core": "^7.26.0",
3535
"@babel/helper-define-polyfill-provider": "^0.6.3",
3636
"@babel/helper-environment-visitor": "^7.24.7",
37-
"@babel/parser": "^7.26.3",
37+
"@babel/parser": "7.26.5",
3838
"@babel/plugin-proposal-class-properties": "^7.18.6",
3939
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
4040
"@babel/plugin-proposal-throw-expressions": "^7.25.9",
@@ -47,8 +47,8 @@
4747
"@babel/register": "^7.25.9",
4848
"@babel/runtime": "^7.26.0",
4949
"@babel/template": "^7.25.9",
50-
"@babel/traverse": "^7.26.4",
51-
"@babel/types": "^7.26.3",
50+
"@babel/traverse": "7.26.5",
51+
"@babel/types": "7.26.5",
5252
"@commitlint/cli": "^11.0.0",
5353
"@commitlint/config-conventional": "^11.0.0",
5454
"@grpc/grpc-js": "^1.11.1",
@@ -59,8 +59,8 @@
5959
"@types/prettier": "^2.7.3",
6060
"@types/react": "18.2.79",
6161
"@types/react-dom": "18.2.25",
62-
"@typescript-eslint/eslint-plugin": "^5.51.0",
63-
"@typescript-eslint/parser": "^5.51.0",
62+
"@typescript-eslint/eslint-plugin": "^6.21.0",
63+
"@typescript-eslint/parser": "^6.21.0",
6464
"adio": "^1.0.1",
6565
"axios": "^1.7.9",
6666
"babel-jest": "29.7.0",
@@ -117,8 +117,9 @@
117117
"ts-expect": "^1.3.0",
118118
"ts-jest": "29.1.5",
119119
"ts-node": "^10.9.2",
120-
"typescript": "4.9.5",
121-
"typescript-transform-paths": "^3.4.6",
120+
"type-fest": "4.14.0",
121+
"typescript": "5.3.3",
122+
"typescript-transform-paths": "^3.5.3",
122123
"verdaccio": "^6.0.5",
123124
"write-json-file": "^4.3.0",
124125
"yargs": "^17.7.2"
@@ -176,6 +177,8 @@
176177
"verdaccio:start": "yarn verdaccio -c ./.verdaccio.yaml",
177178
"verdaccio:start:detached": "yarn pm2 start \"yarn verdaccio:start\"",
178179
"webiny": "./node_modules/.bin/webiny",
180+
"system:verify": "yarn eslint && yarn prettier:check && yarn adio && yarn check-ts-configs && yarn webiny verify-dependencies",
181+
"system:build": "yarn && yarn ghawac build && yarn webiny sync-dependencies && yarn build",
179182
"wby": "./node_modules/.bin/wby",
180183
"webiny-ui-build-storybook": "cd packages/ui && cross-env OUT=../../netlify-static yarn build-storybook"
181184
},
@@ -229,29 +232,17 @@
229232
"systeminformation": "^5.23.18",
230233
"@emotion/react": "11.10.8",
231234
"@octokit/rest": "^20.0.2",
232-
"braces": "^3.0.3",
233-
"typescript": "4.9.5",
234235
"@types/jsdom": "link:./typings/void",
235236
"@types/webpack": "^5.28.0",
236-
"browserify-sign": "^4.2.2",
237237
"@types/react": "18.2.79",
238238
"@types/react-dom": "18.2.25",
239239
"react": "18.2.0",
240240
"react-dom": "18.2.0",
241-
"follow-redirects": "^1.15.6",
242-
"crypto-js": "^4.2.0",
243-
"ip": "^2.0.1",
244241
"tar": "^6.2.1",
245-
"ejs": "^3.1.10",
246242
"@grpc/grpc-js": "^1.11.1",
247243
"postcss": "^8.4.35",
248244
"semver": "^7.6.3",
249-
"@types/eslint": "8.2.1",
250-
"http-proxy-middleware": "^2.0.7",
251-
"xml2js": "0.6.2",
252245
"[email protected]": "patch:lerna@npm%3A8.1.2#./.yarn/patches/lerna-npm-8.1.2-be48ad2329.patch",
253-
"react-dnd": "^16.0.1",
254-
"react-dnd-html5-backend": "^16.0.1",
255246
"apollo-link@^1.2.14": "patch:apollo-link@npm%3A1.2.14#./.yarn/patches/apollo-link-npm-1.2.14-74f0ba01f9.patch",
256247
"apollo-link@^1.0.0": "patch:apollo-link@npm%3A1.2.14#./.yarn/patches/apollo-link-npm-1.2.14-74f0ba01f9.patch",
257248
"@material/base@^14.0.0": "patch:@material/base@npm%3A14.0.0#./.yarn/patches/@material-base-npm-14.0.0-36e0a55c42.patch"

packages/api-aco/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
"graphql": "^15.9.0",
5252
"prettier": "^2.8.8",
5353
"rimraf": "^6.0.1",
54-
"ttypescript": "^1.5.15",
55-
"typescript": "4.9.5"
54+
"typescript": "5.3.3"
5655
}
5756
}

packages/api-admin-settings/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@
3434
"jest-dynalite": "^3.6.1",
3535
"prettier": "^2.8.8",
3636
"rimraf": "^6.0.1",
37-
"ttypescript": "^1.5.15",
38-
"typescript": "4.9.5"
37+
"typescript": "5.3.3"
3938
},
4039
"publishConfig": {
4140
"access": "public",

packages/api-admin-users-so-ddb/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@
2828
"jest": "^29.7.0",
2929
"jest-dynalite": "^3.6.1",
3030
"rimraf": "^6.0.1",
31-
"ttypescript": "^1.5.15",
32-
"typescript": "4.9.5"
31+
"typescript": "5.3.3"
3332
},
3433
"publishConfig": {
3534
"access": "public",

packages/api-admin-users/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"@webiny/cli": "0.0.0",
3333
"@webiny/project-utils": "0.0.0",
3434
"rimraf": "^6.0.1",
35-
"typescript": "4.9.5"
35+
"typescript": "5.3.3"
3636
},
3737
"publishConfig": {
3838
"access": "public",

packages/api-apw-scheduler-so-ddb/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@
3535
"jest": "^29.7.0",
3636
"jest-dynalite": "^3.6.1",
3737
"rimraf": "^6.0.1",
38-
"ttypescript": "^1.5.15",
39-
"typescript": "4.9.5"
38+
"typescript": "5.3.3"
4039
},
4140
"publishConfig": {
4241
"access": "public",

packages/api-apw/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@
4747
"jest": "^29.7.0",
4848
"prettier": "^2.8.8",
4949
"rimraf": "^6.0.1",
50-
"ttypescript": "^1.5.15",
51-
"typescript": "4.9.5"
50+
"typescript": "5.3.3"
5251
},
5352
"publishConfig": {
5453
"access": "public",

packages/api-audit-logs/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@
3232
"@webiny/plugins": "0.0.0",
3333
"@webiny/project-utils": "0.0.0",
3434
"graphql": "^15.9.0",
35-
"ttypescript": "^1.5.15",
36-
"typescript": "4.9.5"
35+
"typescript": "5.3.3"
3736
},
3837
"dependencies": {
3938
"@webiny/api": "0.0.0",

packages/api-authentication-cognito/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@webiny/cli": "0.0.0",
2121
"@webiny/project-utils": "0.0.0",
2222
"rimraf": "^6.0.1",
23-
"typescript": "4.9.5"
23+
"typescript": "5.3.3"
2424
},
2525
"publishConfig": {
2626
"access": "public",

packages/api-authentication/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
"@webiny/project-utils": "0.0.0",
2020
"jest-dynalite": "^3.6.1",
2121
"rimraf": "^6.0.1",
22-
"ttypescript": "^1.5.15",
23-
"typescript": "4.9.5"
22+
"typescript": "5.3.3"
2423
},
2524
"publishConfig": {
2625
"access": "public",

packages/api-background-tasks-ddb/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
"@webiny/cli": "0.0.0",
1818
"@webiny/project-utils": "0.0.0",
1919
"rimraf": "^6.0.1",
20-
"ttypescript": "^1.5.15",
21-
"typescript": "4.9.5"
20+
"typescript": "5.3.3"
2221
},
2322
"publishConfig": {
2423
"access": "public",

packages/api-background-tasks-es/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
"@webiny/cli": "0.0.0",
2020
"@webiny/project-utils": "0.0.0",
2121
"rimraf": "^6.0.1",
22-
"ttypescript": "^1.5.15",
23-
"typescript": "4.9.5"
22+
"typescript": "5.3.3"
2423
},
2524
"publishConfig": {
2625
"access": "public",

packages/api-background-tasks-os/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
"@webiny/cli": "0.0.0",
2020
"@webiny/project-utils": "0.0.0",
2121
"rimraf": "^6.0.1",
22-
"ttypescript": "^1.5.15",
23-
"typescript": "4.9.5"
22+
"typescript": "5.3.3"
2423
},
2524
"publishConfig": {
2625
"access": "public",

packages/api-cognito-authenticator/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"@webiny/cli": "0.0.0",
2424
"@webiny/project-utils": "0.0.0",
2525
"rimraf": "^6.0.1",
26-
"typescript": "4.9.5"
26+
"typescript": "5.3.3"
2727
},
2828
"publishConfig": {
2929
"access": "public",

packages/api-dynamodb-to-elasticsearch/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"@webiny/cli": "0.0.0",
2323
"@webiny/plugins": "0.0.0",
2424
"@webiny/project-utils": "0.0.0",
25-
"typescript": "4.9.5"
25+
"typescript": "5.3.3"
2626
},
2727
"publishConfig": {
2828
"access": "public",

packages/api-elasticsearch-tasks/package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,8 @@
3838
"@webiny/plugins": "0.0.0",
3939
"@webiny/project-utils": "0.0.0",
4040
"rimraf": "^6.0.1",
41-
"ttypescript": "^1.5.15",
42-
"type-fest": "^3.13.1",
43-
"typescript": "4.9.5"
41+
"type-fest": "4.14.0",
42+
"typescript": "5.3.3"
4443
},
4544
"publishConfig": {
4645
"access": "public",

packages/api-elasticsearch/package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,14 @@
1717
"@webiny/error": "0.0.0",
1818
"@webiny/plugins": "0.0.0",
1919
"@webiny/utils": "0.0.0",
20-
"aws-elasticsearch-connector": "^9.2.0",
20+
"aws-elasticsearch-connector": "patch:aws-elasticsearch-connector@npm%3A9.2.0#~/.yarn/patches/aws-elasticsearch-connector-npm-9.2.0-e1245671b1.patch",
2121
"elastic-ts": "^0.12.0"
2222
},
2323
"devDependencies": {
2424
"@webiny/cli": "0.0.0",
2525
"@webiny/project-utils": "0.0.0",
2626
"rimraf": "^6.0.1",
27-
"ttypescript": "^1.5.15",
28-
"typescript": "4.9.5"
27+
"typescript": "5.3.3"
2928
},
3029
"publishConfig": {
3130
"access": "public",

packages/api-elasticsearch/src/client.ts

-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ export const createElasticsearchClient = (options: ElasticsearchClientOptions):
5757
...clientOptions,
5858
...createAwsElasticsearchConnector({
5959
region,
60-
// @ts-expect-error
6160
credentials
6261
})
6362
};

packages/api-file-manager-ddb/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@
3333
"jest-dynalite": "^3.6.1",
3434
"jsonpack": "^1.1.5",
3535
"rimraf": "^6.0.1",
36-
"ttypescript": "^1.5.15",
37-
"typescript": "4.9.5"
36+
"typescript": "5.3.3"
3837
},
3938
"publishConfig": {
4039
"access": "public",

packages/api-file-manager-s3/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"@webiny/cli": "0.0.0",
3636
"@webiny/project-utils": "0.0.0",
3737
"rimraf": "^6.0.1",
38-
"typescript": "4.9.5"
38+
"typescript": "5.3.3"
3939
},
4040
"publishConfig": {
4141
"access": "public",

packages/api-file-manager/package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,12 @@
3737
"zod": "^3.23.8"
3838
},
3939
"devDependencies": {
40-
"@types/sharp": "^0.32.0",
4140
"@webiny/api-i18n": "0.0.0",
4241
"@webiny/cli": "0.0.0",
4342
"@webiny/utils": "0.0.0",
4443
"jest": "^29.7.0",
4544
"rimraf": "^6.0.1",
46-
"ttypescript": "^1.5.15",
47-
"typescript": "4.9.5"
45+
"typescript": "5.3.3"
4846
},
4947
"publishConfig": {
5048
"access": "public",

packages/api-file-manager/src/delivery/AssetDelivery/privateFiles/NotAuthorizedAssetReply.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export class NotAuthorizedAssetReply extends AssetReply {
77
code: 403,
88
headers: ResponseHeaders.create({
99
"cache-control": "no-store",
10-
"content-type": "application/json"
10+
"content-type": "application/json; charset=utf-8"
1111
}),
1212
body: () => ({ error: "Not authorized!", code: "NOT_AUTHORIZED" })
1313
});

packages/api-file-manager/src/delivery/setupAssetDelivery.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export const setupAssetDelivery = (params: AssetDeliveryParams) => {
4747
const headers = assetReply.getHeaders();
4848

4949
// Set default headers.
50-
headers.set("x-webiny-base64-encoded", true);
50+
headers.set("x-webiny-base64-encoded", "true");
5151

5252
reply.code(assetReply.getCode());
5353
reply.headers(headers.getHeaders());

packages/api-form-builder-so-ddb-es/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@
4646
"jest": "^29.7.0",
4747
"jest-dynalite": "^3.6.1",
4848
"rimraf": "^6.0.1",
49-
"ttypescript": "^1.5.15",
50-
"typescript": "4.9.5"
49+
"typescript": "5.3.3"
5150
},
5251
"publishConfig": {
5352
"access": "public",

packages/api-form-builder-so-ddb/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@
3636
"jest": "^29.7.0",
3737
"jest-dynalite": "^3.6.1",
3838
"rimraf": "^6.0.1",
39-
"ttypescript": "^1.5.15",
40-
"typescript": "4.9.5"
39+
"typescript": "5.3.3"
4140
},
4241
"publishConfig": {
4342
"access": "public",

packages/api-form-builder/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@
5151
"jest": "^29.7.0",
5252
"jest-dynalite": "^3.6.1",
5353
"rimraf": "^6.0.1",
54-
"ttypescript": "^1.5.15",
55-
"typescript": "4.9.5"
54+
"typescript": "5.3.3"
5655
},
5756
"publishConfig": {
5857
"access": "public",

packages/api-headless-cms-aco/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@
3434
"@webiny/project-utils": "0.0.0",
3535
"@webiny/wcp": "0.0.0",
3636
"graphql": "^15.9.0",
37-
"ttypescript": "^1.5.15",
38-
"typescript": "4.9.5"
37+
"typescript": "5.3.3"
3938
},
4039
"dependencies": {
4140
"@webiny/api": "0.0.0",

0 commit comments

Comments
 (0)