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: typescript v5 #1129

Merged
merged 4 commits into from
Oct 31, 2023
Merged
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
28 changes: 28 additions & 0 deletions .changeset/neat-kiwis-look.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
"@talismn/balances-substrate-equilibrium": patch
"@talismn/chaindata-provider-extension": patch
"@talismn/balances-substrate-assets": patch
"@talismn/balances-substrate-native": patch
"@talismn/balances-substrate-tokens": patch
"@talismn/balances-default-modules": patch
"@talismn/balances-substrate-psp22": patch
"@talismn/balances-substrate-orml": patch
"@talismn/balances-evm-native": patch
"@talismn/chain-connector-evm": patch
"@talismn/balances-evm-erc20": patch
"@talismn/chaindata-provider": patch
"@talismn/chain-connector": patch
"@talismn/connection-meta": patch
"@talismn/mutate-metadata": patch
"@talismn/eslint-config": patch
"@talismn/on-chain-id": patch
"talisman-ui": patch
"@talismn/token-rates": patch
"@talismn/balances": patch
"@talismn/icons": patch
"@talismn/scale": patch
"@talismn/util": patch
"@talismn/orb": patch
---

bump typescript version
4 changes: 2 additions & 2 deletions apps/extension/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-env es6 */
/* eslint-env es2022 */
/** @type {import('ts-jest').InitialOptionsTsJest} */
const { defaults } = require("jest-config")
const { pathsToModuleNameMapper } = require("ts-jest")
Expand All @@ -15,7 +15,7 @@ module.exports = {
"^rxjs/internal/(.*)$": "rxjs/dist/cjs/internal/$1",
...pathsToModuleNameMapper(compilerOptions.paths, {
prefix: "<rootDir>/src",
})
}),
},
extraGlobals: ["Math"],
moduleFileExtensions: [...defaults.moduleFileExtensions, "ts", "tsx"],
Expand Down
10 changes: 5 additions & 5 deletions apps/extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@
"@types/react-highlight": "^0.12.5",
"@types/uuid": "^8.3.4",
"@types/webextension-polyfill": "0.9.1",
"@typescript-eslint/eslint-plugin": "^5.47.0",
"@typescript-eslint/parser": "^5.47.0",
"anylogger": "^1.0.11",
"anylogger-loglevel": "^1.0.0",
"assert": "^2.0.0",
Expand Down Expand Up @@ -137,7 +135,7 @@
"toml": "^3.0.0",
"ts-loader": "9.4.4",
"ts-results": "3.3.0",
"typescript": "4.9.4",
"typescript": "^5.2.2",
"url-join": "^5.0.0",
"uuid": "^8.3.2",
"webextension-polyfill": "0.8.0",
Expand All @@ -163,14 +161,16 @@
"@types/bcryptjs": "^2.4.2",
"@types/lz-string": "^1.3.34",
"@types/semver": "^7.3.9",
"@typescript-eslint/eslint-plugin": "^6.9.0",
"@typescript-eslint/parser": "^6.9.0",
"archiver": "5.3.1",
"autoprefixer": "^10.4.12",
"babel-jest": "27.5.1",
"babel-plugin-module-extension-resolver": "^1.0.0",
"browserify-zlib": "^0.2.0",
"crypto-browserify": "3.12.0",
"eslint": "^8.15.0",
"eslint-webpack-plugin": "^3.1.1",
"eslint": "^8.52.0",
"eslint-webpack-plugin": "^4.0.1",
"fake-indexeddb": "4.0.1",
"html-webpack-plugin": "^5.5.3",
"https-browserify": "^1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion config/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"clean": "rm -rf node_modules"
},
"dependencies": {
"eslint": "^8.15.0",
"eslint": "^8.52.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-import": "2.27.5",
"eslint-plugin-jest": "26.1.5",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"@commitlint/config-conventional": "^17.0.0",
"@talismn/eslint-config": "workspace:*",
"@testing-library/react": "^14.0.0",
"@typescript-eslint/eslint-plugin": "^5.33.0",
"@typescript-eslint/parser": "^5.33.0",
"@typescript-eslint/eslint-plugin": "^6.9.0",
"@typescript-eslint/parser": "^6.9.0",
"concurrently": "^7.6.0",
"husky": "^8.0.3",
"import-sort-style-module": "^6.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/balances-default-modules/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
"@talismn/eslint-config": "workspace:*",
"@talismn/tsconfig": "workspace:*",
"@types/jest": "^27.5.1",
"eslint": "^8.4.0",
"eslint": "^8.52.0",
"jest": "^28.1.0",
"ts-jest": "^28.0.2",
"typescript": "^4.6.4"
"typescript": "^5.2.2"
},
"eslintConfig": {
"root": true,
Expand Down
4 changes: 2 additions & 2 deletions packages/balances-evm-erc20/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
"@talismn/tsconfig": "workspace:*",
"@types/jest": "^27.5.1",
"@types/lodash": "^4.14.180",
"eslint": "^8.4.0",
"eslint": "^8.52.0",
"jest": "^28.1.0",
"ts-jest": "^28.0.2",
"typescript": "^4.6.4"
"typescript": "^5.2.2"
},
"peerDependencies": {
"@polkadot/util": "11.x"
Expand Down
4 changes: 2 additions & 2 deletions packages/balances-evm-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
"@talismn/tsconfig": "workspace:*",
"@types/jest": "^27.5.1",
"@types/lodash": "^4.14.180",
"eslint": "^8.4.0",
"eslint": "^8.52.0",
"jest": "^28.1.0",
"ts-jest": "^28.0.2",
"typescript": "^4.6.4"
"typescript": "^5.2.2"
},
"eslintConfig": {
"root": true,
Expand Down
4 changes: 2 additions & 2 deletions packages/balances-substrate-assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
"@talismn/eslint-config": "workspace:*",
"@talismn/tsconfig": "workspace:*",
"@types/jest": "^27.5.1",
"eslint": "^8.4.0",
"eslint": "^8.52.0",
"jest": "^28.1.0",
"ts-jest": "^28.0.2",
"typescript": "^4.6.4"
"typescript": "^5.2.2"
},
"peerDependencies": {
"@polkadot/types": "10.x",
Expand Down
4 changes: 2 additions & 2 deletions packages/balances-substrate-equilibrium/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
"@talismn/eslint-config": "workspace:*",
"@talismn/tsconfig": "workspace:*",
"@types/jest": "^27.5.1",
"eslint": "^8.4.0",
"eslint": "^8.52.0",
"jest": "^28.1.0",
"ts-jest": "^28.0.2",
"typescript": "^4.6.4"
"typescript": "^5.2.2"
},
"peerDependencies": {
"@polkadot/types": "10.x",
Expand Down
4 changes: 2 additions & 2 deletions packages/balances-substrate-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
"@talismn/tsconfig": "workspace:*",
"@types/jest": "^27.5.1",
"@types/lodash": "^4.14.180",
"eslint": "^8.4.0",
"eslint": "^8.52.0",
"jest": "^28.1.0",
"ts-jest": "^28.0.2",
"typescript": "^4.6.4"
"typescript": "^5.2.2"
},
"peerDependencies": {
"@polkadot/types": "10.x",
Expand Down
4 changes: 2 additions & 2 deletions packages/balances-substrate-orml/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
"@talismn/eslint-config": "workspace:*",
"@talismn/tsconfig": "workspace:*",
"@types/jest": "^27.5.1",
"eslint": "^8.4.0",
"eslint": "^8.52.0",
"jest": "^28.1.0",
"ts-jest": "^28.0.2",
"typescript": "^4.6.4"
"typescript": "^5.2.2"
},
"peerDependencies": {
"@polkadot/types": "10.x",
Expand Down
4 changes: 2 additions & 2 deletions packages/balances-substrate-psp22/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
"@talismn/tsconfig": "workspace:*",
"@types/jest": "^27.5.1",
"@types/lodash": "^4.14.180",
"eslint": "^8.4.0",
"eslint": "^8.52.0",
"jest": "^28.1.0",
"ts-jest": "^28.0.2",
"typescript": "^4.6.4"
"typescript": "^5.2.2"
},
"peerDependencies": {
"@polkadot/api-contract": "^10.x",
Expand Down
4 changes: 2 additions & 2 deletions packages/balances-substrate-tokens/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
"@talismn/eslint-config": "workspace:*",
"@talismn/tsconfig": "workspace:*",
"@types/jest": "^27.5.1",
"eslint": "^8.4.0",
"eslint": "^8.52.0",
"jest": "^28.1.0",
"ts-jest": "^28.0.2",
"typescript": "^4.6.4"
"typescript": "^5.2.2"
},
"peerDependencies": {
"@polkadot/types": "10.x",
Expand Down
4 changes: 2 additions & 2 deletions packages/balances/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
"@talismn/tsconfig": "workspace:*",
"@types/jest": "^27.5.1",
"@types/lodash": "^4.14.180",
"eslint": "^8.4.0",
"eslint": "^8.52.0",
"jest": "^28.1.0",
"ts-jest": "^28.0.2",
"typescript": "^4.6.4"
"typescript": "^5.2.2"
},
"peerDependencies": {
"@polkadot/types": "10.x"
Expand Down
4 changes: 2 additions & 2 deletions packages/chain-connector-evm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
"@talismn/tsconfig": "workspace:*",
"@types/jest": "^27.5.1",
"@types/lodash": "^4.14.180",
"eslint": "^8.4.0",
"eslint": "^8.52.0",
"jest": "^28.1.0",
"ts-jest": "^28.0.2",
"typescript": "^4.6.4"
"typescript": "^5.2.2"
},
"eslintConfig": {
"root": true,
Expand Down
13 changes: 10 additions & 3 deletions packages/chain-connector-evm/src/ChainConnectorEvm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ import { ethers } from "ethers"

import { RPC_CALL_TIMEOUT } from "./constants"
import log from "./log"
import { BatchRpcProvider, AcalaRpcProvider, StandardRpcProvider, addOnfinalityApiKey, getHealthyRpc, isAcalaNetwork } from "./util"
import {
AcalaRpcProvider,
BatchRpcProvider,
StandardRpcProvider,
addOnfinalityApiKey,
getHealthyRpc,
isAcalaNetwork,
} from "./util"

export type GetProviderOptions = {
/** If true, returns a provider which will batch requests */
Expand Down Expand Up @@ -161,8 +168,8 @@ export class ChainConnectorEvm {
batch === true
? new BatchRpcProvider(connection, network)
: isAcalaNetwork(network.chainId)
? new AcalaRpcProvider(connection, network)
: new StandardRpcProvider(connection, network)
? new AcalaRpcProvider(connection, network)
: new StandardRpcProvider(connection, network)

// in case an error is thrown, rotate rpc urls cache
// also clear provider cache to force logic going through getHealthyRpc again on next call
Expand Down
12 changes: 6 additions & 6 deletions packages/chain-connector-evm/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export const RPC_HEALTHCHECK_TIMEOUT = 10_000
export const RPC_CALL_TIMEOUT = 20_000
export const ACALA_NETWORK_IDS = [
595, // Mandala
596, // Karura Testnet
597, // Acala Testnet
686, // Karura
787, // Acala
]
595, // Mandala
596, // Karura Testnet
597, // Acala Testnet
686, // Karura
787, // Acala
]
4 changes: 2 additions & 2 deletions packages/chain-connector-evm/src/util.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AcalaJsonRpcProvider } from "@acala-network/eth-providers"
import { throwAfter } from "@talismn/util"
import { ethers } from "ethers"
import { AcalaJsonRpcProvider } from "@acala-network/eth-providers"

import { ACALA_NETWORK_IDS, RPC_HEALTHCHECK_TIMEOUT } from "./constants"
import { EvmJsonRpcBatchProvider } from "./EvmJsonRpcBatchProvider"
Expand Down Expand Up @@ -46,7 +46,7 @@ export const isHealthyRpc = async (url: string, chainId: number) => {
}
}

export const isAcalaNetwork = (chainId: number) => ACALA_NETWORK_IDS.includes(chainId);
export const isAcalaNetwork = (chainId: number) => ACALA_NETWORK_IDS.includes(chainId)

export const getHealthyRpc = async (rpcUrls: string[], network: ethers.providers.Network) => {
for (const rpcUrl of rpcUrls) if (await isHealthyRpc(rpcUrl, network.chainId)) return rpcUrl
Expand Down
4 changes: 2 additions & 2 deletions packages/chain-connector/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
"@talismn/eslint-config": "workspace:*",
"@talismn/tsconfig": "workspace:*",
"@types/jest": "^27.5.1",
"eslint": "^8.4.0",
"eslint": "^8.52.0",
"jest": "^28.1.0",
"ts-jest": "^28.0.2",
"typescript": "^4.6.4"
"typescript": "^5.2.2"
},
"peerDependencies": {
"@polkadot/rpc-provider": "10.x",
Expand Down
4 changes: 2 additions & 2 deletions packages/chaindata-provider-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
"@talismn/eslint-config": "workspace:*",
"@talismn/tsconfig": "workspace:*",
"@types/jest": "^27.5.1",
"eslint": "^8.4.0",
"eslint": "^8.52.0",
"jest": "^28.1.0",
"ts-jest": "^28.0.2",
"ts-node": "^10.9.1",
"typescript": "^4.6.4"
"typescript": "^5.2.2"
},
"eslintConfig": {
"root": true,
Expand Down
4 changes: 2 additions & 2 deletions packages/chaindata-provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
"@talismn/eslint-config": "workspace:*",
"@talismn/tsconfig": "workspace:*",
"@types/jest": "^27.5.1",
"eslint": "^8.4.0",
"eslint": "^8.52.0",
"jest": "^28.1.0",
"ts-jest": "^28.0.2",
"typescript": "^4.6.4"
"typescript": "^5.2.2"
},
"preconstruct": {
"entrypoints": [
Expand Down
4 changes: 2 additions & 2 deletions packages/connection-meta/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
"@talismn/eslint-config": "workspace:*",
"@talismn/tsconfig": "workspace:*",
"@types/jest": "^27.5.1",
"eslint": "^8.4.0",
"eslint": "^8.52.0",
"jest": "^28.1.0",
"ts-jest": "^28.0.2",
"typescript": "^4.6.4"
"typescript": "^5.2.2"
},
"eslintConfig": {
"root": true,
Expand Down
4 changes: 2 additions & 2 deletions packages/icons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
"@talismn/tsconfig": "workspace:*",
"@types/jest": "^27.5.1",
"@types/react": "18.0.14",
"eslint": "^8.4.0",
"eslint": "^8.52.0",
"jest": "^28.1.0",
"react": "18.2.0",
"ts-jest": "^28.0.2",
"typescript": "^4.6.4"
"typescript": "^5.2.2"
},
"peerDependencies": {
"react": ">=18.2.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/mutate-metadata/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@
"@talismn/eslint-config": "workspace:*",
"@talismn/tsconfig": "workspace:*",
"@types/jest": "^27.5.1",
"eslint": "^8.4.0",
"eslint": "^8.52.0",
"jest": "^28.1.0",
"ts-jest": "^28.0.2",
"typescript": "^4.6.4"
"typescript": "^5.2.2"
},
"preconstruct": {
"exports": {
Expand Down
4 changes: 2 additions & 2 deletions packages/on-chain-id/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
"@talismn/eslint-config": "workspace:*",
"@talismn/tsconfig": "workspace:*",
"@types/jest": "^27.5.1",
"eslint": "^8.4.0",
"eslint": "^8.52.0",
"jest": "^28.1.0",
"ts-jest": "^28.0.2",
"typescript": "^4.6.4"
"typescript": "^5.2.2"
},
"peerDependencies": {
"@polkadot/types": "10.x"
Expand Down
Loading