Skip to content

Commit e346ba7

Browse files
authored
chore: upgrade to TS 5.8 (#17537)
* chore: upgrade to TS 5.6 * chore: upgrade to TS 5.7 * feat: upgate to TS 5.8 * chore: update eslint * fix: use es2023 also for build
1 parent 1f6bfbb commit e346ba7

File tree

15 files changed

+51
-52
lines changed

15 files changed

+51
-52
lines changed

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,14 @@
9090
"s": "yarn native:start"
9191
},
9292
"resolutions": {
93-
"typescript": "5.5.4",
93+
"typescript": "5.8.2",
9494
"react-native": "0.76.1",
9595
"prettier": "3.2.5",
9696
"type-fest": "4.24.0",
9797
"bcrypto": "5.4.0",
9898
"react": "18.2.0",
9999
"electron": "35.0.1",
100-
"@types/node": "22.10.1",
100+
"@types/node": "22.13.10",
101101
"@types/react": "18.2.55",
102102
"bn.js": "5.2.1",
103103
"node-gyp": "10.2.0",
@@ -120,7 +120,7 @@
120120
"@suite-common/wallet-types": "workspace:*",
121121
"@trezor/eslint": "workspace:*",
122122
"@types/jest": "29.5.12",
123-
"@types/node": "22.10.1",
123+
"@types/node": "22.13.10",
124124
"@types/prettier": "^3.0.0",
125125
"@types/semver": "^7.5.6",
126126
"@types/tar": "^6.1.11",
@@ -144,7 +144,7 @@
144144
"tsconfig-paths": "^4.2.0",
145145
"tslib": "^2.6.2",
146146
"tsx": "^4.19.3",
147-
"typescript": "5.5.4",
147+
"typescript": "5.8.2",
148148
"version-bump-prompt": "^6.1.0"
149149
},
150150
"dependenciesMeta": {

packages/connect-examples/mobile-expo/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"devDependencies": {
2020
"@babel/core": "^7.20.0",
2121
"@types/react": "18.2.45",
22-
"typescript": "^5.3.3"
22+
"typescript": "5.8.2"
2323
},
2424
"private": true
2525
}

packages/connect-plugin-ethereum/tsconfig.libESM.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"compilerOptions": {
44
"outDir": "libESM",
55
"module": "ESNext",
6-
"target": "esnext"
6+
"target": "ES2023"
77
}
88
}

packages/connect-plugin-stellar/tsconfig.libESM.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"compilerOptions": {
44
"outDir": "libESM",
55
"module": "ESNext",
6-
"target": "esnext"
6+
"target": "ES2023"
77
}
88
}

packages/connect/src/api/cipherKeyValue.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,14 @@ export default class CipherKeyValue extends AbstractMethod<
3434
this.params = payload.bundle.map(batch => ({
3535
address_n: validatePath(batch.path),
3636
key: batch.key,
37-
value: batch.value instanceof Buffer ? batch.value.toString('hex') : batch.value,
37+
value:
38+
batch.value instanceof Buffer
39+
? batch.value.toString('hex')
40+
: (batch.value as string),
3841
encrypt: batch.encrypt,
3942
ask_on_encrypt: batch.askOnEncrypt,
4043
ask_on_decrypt: batch.askOnDecrypt,
41-
iv: batch.iv instanceof Buffer ? batch.iv.toString('hex') : batch.iv,
44+
iv: batch.iv instanceof Buffer ? batch.iv.toString('hex') : (batch.iv as string),
4245
}));
4346
}
4447

packages/protobuf/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
},
3636
"dependencies": {
3737
"@trezor/schema-utils": "workspace:*",
38-
"long": "5.2.0",
38+
"long": "5.2.5",
3939
"protobufjs": "7.4.0"
4040
},
4141
"devDependencies": {

packages/suite-desktop-core/src/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"outDir": "../dist",
77
"noEmit": false,
88
"jsx": "preserve",
9-
"target": "esnext",
9+
"target": "ES2023",
1010
"sourceMap": true,
1111
"lib": [
1212
"dom",

packages/trezor-user-env-link/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
},
1717
"devDependencies": {
1818
"ts-node": "^10.9.2",
19-
"typescript": "5.5.4"
19+
"typescript": "5.8.2"
2020
}
2121
}

packages/utils/tsconfig.libESM.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"compilerOptions": {
44
"outDir": "libESM",
55
"module": "ESNext",
6-
"target": "esnext"
6+
"target": "ES2023"
77
}
88
}

packages/utxo-lib/src/transaction/zcash.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,10 @@ function getExtraData(tx: TransactionBase<ZcashSpecific>) {
309309
return tx.toBuffer().subarray(offset);
310310
}
311311

312-
function getBlake2bDigestHash(buffer: Buffer, personalization: string | Buffer) {
313-
const hash = blake2b(buffer, undefined, 32, undefined, Buffer.from(personalization));
312+
function getBlake2bDigestHash(buffer: Buffer, personalization: string | Buffer<ArrayBufferLike>) {
313+
const personalizedBuffer =
314+
typeof personalization === 'string' ? Buffer.from(personalization) : personalization;
315+
const hash = blake2b(buffer, undefined, 32, undefined, personalizedBuffer);
314316

315317
return Buffer.from(hash);
316318
}

suite-common/formatters/src/makeFormatter.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ type FormatterProps<TInput, TDataContext extends DataContext> = {
3030
export interface Formatter<TInput, TOutput, TDataContext extends DataContext = DataContext> {
3131
/** Formats a value. */
3232
format: FormatMethod<TInput, TOutput, TDataContext>;
33-
(props: FormatterProps<TInput, TDataContext>): JSX.Element | null;
33+
(props: FormatterProps<TInput, TDataContext>): JSX.Element;
3434
/** Name of the formatter for easier debugging and profiling. */
3535
displayName?: string;
3636
}
@@ -44,8 +44,9 @@ export const makeFormatter = <TInput, TOutput, TDataContext extends DataContext
4444
format: FormatDefinition<TInput, TOutput, TDataContext>,
4545
displayName = 'Formatter',
4646
): Formatter<TInput, TOutput, TDataContext> => {
47-
const FormatterComponent: Formatter<TInput, TOutput, TDataContext> = props =>
48-
<>{format(props.value, props, useShouldRedactNumbers())}</> ?? null;
47+
const FormatterComponent: Formatter<TInput, TOutput, TDataContext> = props => (
48+
<>{format(props.value, props, useShouldRedactNumbers())}</>
49+
);
4950
FormatterComponent.displayName = displayName;
5051

5152
FormatterComponent.format = (value, dataContext = {}) => format(value, dataContext);

suite-native/app/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
"@suite-common/test-utils": "workspace:^",
137137
"@trezor/connect-mobile": "workspace:^",
138138
"@types/jest": "^29.5.12",
139-
"@types/node": "22.10.1",
139+
"@types/node": "22.13.10",
140140
"babel-plugin-transform-inline-environment-variables": "^0.4.4",
141141
"babel-plugin-transform-remove-console": "^6.9.4",
142142
"detox": "^20.34.4",
@@ -145,7 +145,7 @@
145145
"jest-junit": "^16.0.0",
146146
"metro": "0.81.0",
147147
"ts-jest": "^29.1.2",
148-
"typescript": "^5.3.3"
148+
"typescript": "5.8.2"
149149
},
150150
"private": true
151151
}

tsconfig.base.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"jsx": "preserve",
77
"module": "ESNext",
88
"moduleResolution": "Bundler",
9-
"target": "esnext",
9+
"target": "ES2023",
1010
"removeComments": true,
1111
"noUnusedLocals": true,
1212
"noUnusedParameters": true,

yarn.lock

+23-30
Original file line numberDiff line numberDiff line change
@@ -9967,7 +9967,7 @@ __metadata:
99679967
"@trezor/theme": "workspace:*"
99689968
"@trezor/trezor-user-env-link": "workspace:*"
99699969
"@types/jest": "npm:^29.5.12"
9970-
"@types/node": "npm:22.10.1"
9970+
"@types/node": "npm:22.13.10"
99719971
"@whatwg-node/events": "npm:0.1.2"
99729972
abortcontroller-polyfill: "npm:1.7.6"
99739973
babel-plugin-transform-inline-environment-variables: "npm:^0.4.4"
@@ -10015,7 +10015,7 @@ __metadata:
1001510015
react-redux: "npm:9.2.0"
1001610016
redux-persist: "npm:6.0.0"
1001710017
ts-jest: "npm:^29.1.2"
10018-
typescript: "npm:^5.3.3"
10018+
typescript: "npm:5.8.2"
1001910019
languageName: unknown
1002010020
linkType: soft
1002110021

@@ -12192,7 +12192,7 @@ __metadata:
1219212192
resolution: "@trezor/protobuf@workspace:packages/protobuf"
1219312193
dependencies:
1219412194
"@trezor/schema-utils": "workspace:*"
12195-
long: "npm:5.2.0"
12195+
long: "npm:5.2.5"
1219612196
protobufjs: "npm:7.4.0"
1219712197
protobufjs-cli: "npm:^1.1.3"
1219812198
tsx: "npm:^4.19.3"
@@ -12816,7 +12816,7 @@ __metadata:
1281612816
"@trezor/websocket-client": "workspace:*"
1281712817
cross-fetch: "npm:^4.0.0"
1281812818
ts-node: "npm:^10.9.2"
12819-
typescript: "npm:5.5.4"
12819+
typescript: "npm:5.8.2"
1282012820
languageName: unknown
1282112821
linkType: soft
1282212822

@@ -13866,12 +13866,12 @@ __metadata:
1386613866
languageName: node
1386713867
linkType: hard
1386813868

13869-
"@types/node@npm:22.10.1":
13870-
version: 22.10.1
13871-
resolution: "@types/node@npm:22.10.1"
13869+
"@types/node@npm:22.13.10":
13870+
version: 22.13.10
13871+
resolution: "@types/node@npm:22.13.10"
1387213872
dependencies:
1387313873
undici-types: "npm:~6.20.0"
13874-
checksum: 10/c802a526da2f3fa3ccefd00a71244e7cb825329951719e79e8fec62b1dbc2855388c830489770611584665ce10be23c05ed585982038b24924e1ba2c2cce03fd
13874+
checksum: 10/57dc6a5e0110ca9edea8d7047082e649fa7fa813f79e4a901653b9174141c622f4336435648baced5b38d9f39843f404fa2d8d7a10981610da26066bc8caab48
1387513875
languageName: node
1387613876
linkType: hard
1387713877

@@ -18759,7 +18759,7 @@ __metadata:
1875918759
expo-status-bar: "npm:^2.0.0"
1876018760
react: "npm:18.2.0"
1876118761
react-native: "npm:0.76.1"
18762-
typescript: "npm:^5.3.3"
18762+
typescript: "npm:5.8.2"
1876318763
languageName: unknown
1876418764
linkType: soft
1876518765

@@ -29565,17 +29565,10 @@ __metadata:
2956529565
languageName: node
2956629566
linkType: hard
2956729567

29568-
"long@npm:5.2.0":
29569-
version: 5.2.0
29570-
resolution: "long@npm:5.2.0"
29571-
checksum: 10/9bb47091fea71634d9bf59f150ecc25180c44bead2e1408d78f3ff4ea68f16b38587be413b59acb46fb0bbe51e6823ec8547aa61aa8aef10cae4ff9a2538db3d
29572-
languageName: node
29573-
linkType: hard
29574-
29575-
"long@npm:^5.0.0":
29576-
version: 5.2.4
29577-
resolution: "long@npm:5.2.4"
29578-
checksum: 10/c27c060a683d4d76dc48da12ded0ae49c610aaf10d028ec938829d7bebe916979dcc8b67ed71f8bf6d845a90151b66a9b741a3ee51ec874908e496c2a576697a
29568+
"long@npm:5.2.5, long@npm:^5.0.0":
29569+
version: 5.2.5
29570+
resolution: "long@npm:5.2.5"
29571+
checksum: 10/972589d04a564ef4c066069d5ed06db14cd63de2a08d4f6c989512fa414bc2239479564e3a85de3efd42eb533ce142cdcaa28f12f4ecd051670015d36cbbb10b
2957929572
languageName: node
2958029573
linkType: hard
2958129574

@@ -40655,7 +40648,7 @@ __metadata:
4065540648
"@suite-common/wallet-types": "workspace:*"
4065640649
"@trezor/eslint": "workspace:*"
4065740650
"@types/jest": "npm:29.5.12"
40658-
"@types/node": "npm:22.10.1"
40651+
"@types/node": "npm:22.13.10"
4065940652
"@types/prettier": "npm:^3.0.0"
4066040653
"@types/semver": "npm:^7.5.6"
4066140654
"@types/tar": "npm:^6.1.11"
@@ -40679,7 +40672,7 @@ __metadata:
4067940672
tsconfig-paths: "npm:^4.2.0"
4068040673
tslib: "npm:^2.6.2"
4068140674
tsx: "npm:^4.19.3"
40682-
typescript: "npm:5.5.4"
40675+
typescript: "npm:5.8.2"
4068340676
version-bump-prompt: "npm:^6.1.0"
4068440677
dependenciesMeta:
4068540678
core-js-pure:
@@ -41148,23 +41141,23 @@ __metadata:
4114841141
languageName: node
4114941142
linkType: hard
4115041143

41151-
"typescript@npm:5.5.4":
41152-
version: 5.5.4
41153-
resolution: "typescript@npm:5.5.4"
41144+
"typescript@npm:5.8.2":
41145+
version: 5.8.2
41146+
resolution: "typescript@npm:5.8.2"
4115441147
bin:
4115541148
tsc: bin/tsc
4115641149
tsserver: bin/tsserver
41157-
checksum: 10/1689ccafef894825481fc3d856b4834ba3cc185a9c2878f3c76a9a1ef81af04194849840f3c69e7961e2312771471bb3b460ca92561e1d87599b26c37d0ffb6f
41150+
checksum: 10/dbc2168a55d56771f4d581997be52bab5cbc09734fec976cfbaabd787e61fb4c6cf9125fd48c6f98054ce549c77ecedefc7f64252a830dd8e9c3381f61fbeb78
4115841151
languageName: node
4115941152
linkType: hard
4116041153

41161-
"typescript@patch:typescript@npm%3A5.5.4#optional!builtin<compat/typescript>":
41162-
version: 5.5.4
41163-
resolution: "typescript@patch:typescript@npm%3A5.5.4#optional!builtin<compat/typescript>::version=5.5.4&hash=379a07"
41154+
"typescript@patch:typescript@npm%3A5.8.2#optional!builtin<compat/typescript>":
41155+
version: 5.8.2
41156+
resolution: "typescript@patch:typescript@npm%3A5.8.2#optional!builtin<compat/typescript>::version=5.8.2&hash=5786d5"
4116441157
bin:
4116541158
tsc: bin/tsc
4116641159
tsserver: bin/tsserver
41167-
checksum: 10/746fdd0865c5ce4f15e494c57ede03a9e12ede59cfdb40da3a281807853fe63b00ef1c912d7222143499aa82f18b8b472baa1830df8804746d09b55f6cf5b1cc
41160+
checksum: 10/97920a082ffc57583b1cb6bc4faa502acc156358e03f54c7fc7fdf0b61c439a717f4c9070c449ee9ee683d4cfc3bb203127c2b9794b2950f66d9d307a4ff262c
4116841161
languageName: node
4116941162
linkType: hard
4117041163

0 commit comments

Comments
 (0)