Skip to content
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

chore: upgrade to TS 5.8 #17537

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@
"s": "yarn native:start"
},
"resolutions": {
"typescript": "5.5.4",
"typescript": "5.8.2",
"react-native": "0.76.1",
"prettier": "3.2.5",
"type-fest": "4.24.0",
"bcrypto": "5.4.0",
"react": "18.2.0",
"electron": "34.1.0",
"@types/node": "22.10.1",
"@types/node": "22.13.10",
"@types/react": "18.2.55",
"bn.js": "5.2.1",
"node-gyp": "10.2.0",
Expand All @@ -117,7 +117,7 @@
"@suite-common/wallet-types": "workspace:*",
"@trezor/eslint": "workspace:*",
"@types/jest": "29.5.12",
"@types/node": "22.10.1",
"@types/node": "22.13.10",
"@types/prettier": "^3.0.0",
"@types/semver": "^7.5.6",
"@types/tar": "^6.1.11",
Expand All @@ -141,7 +141,7 @@
"tsconfig-paths": "^4.2.0",
"tslib": "^2.6.2",
"tsx": "^4.19.3",
"typescript": "5.5.4",
"typescript": "5.8.2",
"version-bump-prompt": "^6.1.0"
},
"dependenciesMeta": {
Expand Down
2 changes: 1 addition & 1 deletion packages/connect-examples/mobile-expo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"devDependencies": {
"@babel/core": "^7.20.0",
"@types/react": "18.2.45",
"typescript": "^5.3.3"
"typescript": "5.8.2"
},
"private": true
}
7 changes: 5 additions & 2 deletions packages/connect/src/api/cipherKeyValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,14 @@ export default class CipherKeyValue extends AbstractMethod<
this.params = payload.bundle.map(batch => ({
address_n: validatePath(batch.path),
key: batch.key,
value: batch.value instanceof Buffer ? batch.value.toString('hex') : batch.value,
value:
batch.value instanceof Buffer
? batch.value.toString('hex')
: (batch.value as string),
encrypt: batch.encrypt,
ask_on_encrypt: batch.askOnEncrypt,
ask_on_decrypt: batch.askOnDecrypt,
iv: batch.iv instanceof Buffer ? batch.iv.toString('hex') : batch.iv,
iv: batch.iv instanceof Buffer ? batch.iv.toString('hex') : (batch.iv as string),
}));
}

Expand Down
8 changes: 4 additions & 4 deletions packages/eslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
"type-check": "yarn g:tsc --build"
},
"devDependencies": {
"@eslint/js": "^9.19.0",
"eslint": "^9.19.0",
"@eslint/js": "^9.22.0",
"eslint": "^9.22.0",
"eslint-plugin-chai-friendly": "^1.0.1",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jest": "^28.11.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-local-rules": "^3.0.2",
"eslint-plugin-react": "^7.37.4",
"eslint-plugin-react-hooks": "^5.1.0",
"typescript-eslint": "^8.23.0"
"eslint-plugin-react-hooks": "^5.2.0",
"typescript-eslint": "^8.26.0"
}
}
2 changes: 1 addition & 1 deletion packages/protobuf/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
},
"dependencies": {
"@trezor/schema-utils": "workspace:*",
"long": "5.2.0",
"long": "5.2.5",
"protobufjs": "7.4.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/trezor-user-env-link/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
},
"devDependencies": {
"ts-node": "^10.9.2",
"typescript": "5.5.4"
"typescript": "5.8.2"
}
}
6 changes: 4 additions & 2 deletions packages/utxo-lib/src/transaction/zcash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,10 @@ function getExtraData(tx: TransactionBase<ZcashSpecific>) {
return tx.toBuffer().subarray(offset);
}

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

return Buffer.from(hash);
}
Expand Down
5 changes: 3 additions & 2 deletions suite-common/formatters/src/makeFormatter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ export const makeFormatter = <TInput, TOutput, TDataContext extends DataContext
format: FormatDefinition<TInput, TOutput, TDataContext>,
displayName = 'Formatter',
): Formatter<TInput, TOutput, TDataContext> => {
const FormatterComponent: Formatter<TInput, TOutput, TDataContext> = props =>
<>{format(props.value, props, useShouldRedactNumbers())}</> ?? null;
const FormatterComponent: Formatter<TInput, TOutput, TDataContext> = props => (
<>{format(props.value, props, useShouldRedactNumbers())}</>
);
FormatterComponent.displayName = displayName;

FormatterComponent.format = (value, dataContext = {}) => format(value, dataContext);
Expand Down
4 changes: 2 additions & 2 deletions suite-native/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
"@suite-common/test-utils": "workspace:^",
"@trezor/connect-mobile": "workspace:^",
"@types/jest": "^29.5.12",
"@types/node": "22.10.1",
"@types/node": "22.13.10",
"babel-plugin-transform-inline-environment-variables": "^0.4.4",
"babel-plugin-transform-remove-console": "^6.9.4",
"detox": "^20.34.4",
Expand All @@ -145,7 +145,7 @@
"jest-junit": "^16.0.0",
"metro": "0.81.0",
"ts-jest": "^29.1.2",
"typescript": "^5.3.3"
"typescript": "5.8.2"
},
"private": true
}
2 changes: 1 addition & 1 deletion tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"jsx": "preserve",
"module": "ESNext",
"moduleResolution": "Bundler",
"target": "esnext",
"target": "ES2023",
"removeComments": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
Expand Down
Loading
Loading