Skip to content

Commit

Permalink
Merge pull request #128 from AbstractSDK/adair/try-fix-types
Browse files Browse the repository at this point in the history
Try fixing types
  • Loading branch information
adairrr authored Oct 22, 2024
2 parents 3e4e8bb + e045825 commit 1b112f4
Show file tree
Hide file tree
Showing 18 changed files with 66 additions and 141 deletions.
4 changes: 2 additions & 2 deletions examples/wagemos-cosmoskit-nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@radix-ui/react-select": "^2.0.0",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-toast": "^1.1.5",
"@tanstack/react-query": "^4",
"@tanstack/react-query": "4.36.1",
"chain-registry": "^1.63.60",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
Expand All @@ -37,7 +37,7 @@
"react-hook-form": "^7.48.2",
"tailwind-merge": "^2.0.0",
"tailwindcss-animate": "^1.0.7",
"type-fest": "^3.5.0",
"type-fest": "^4.2.6",
"zod": "^3.22.4"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export function CosmosKitProvider(props: { children: ReactNode }) {
})}
assetLists={assets}
wallets={wallets}
// @ts-ignore
signerOptions={signerOptions}
sessionOptions={{
duration: 1000 * 60 * 60 * 24 * 7,
Expand Down
4 changes: 2 additions & 2 deletions examples/wagemos-graz-nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@radix-ui/react-select": "^2.0.0",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-toast": "^1.1.5",
"@tanstack/react-query": "^4",
"@tanstack/react-query": "4.36.1",
"@tanstack/react-query-devtools": "^5.40.0",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
Expand All @@ -38,7 +38,7 @@
"react-hook-form": "^7.48.2",
"tailwind-merge": "^2.0.0",
"tailwindcss-animate": "^1.0.7",
"type-fest": "^3.5.0",
"type-fest": "^4.2.6",
"zod": "^3.22.4"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@manypkg/get-packages": "^1.1.3",
"@microsoft/api-extractor": "^7.39.1",
"@tanstack/query-core": "^4",
"@tanstack/react-query": "^4",
"@tanstack/react-query": "4.36.1",
"@types/dedent": "^0.7.0",
"@types/fs-extra": "^9.0.13",
"@types/jest": "^29.5.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { dependencies } from './package.json'

export default defineConfig(
getConfig({
// experimentalDts: false,
experimentalDts: false,
//dev: process.env.DEV === 'true',
entry: [
'src/index.ts',
Expand Down
5 changes: 2 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"string-ts": "^2.0.0",
"ts-mixer": "^6.0.2",
"ts-pattern": "^4.0.6",
"type-fest": "^3.5.0",
"type-fest": "^4.2.6",
"yup": "1.3.2"
},
"peerDependenciesMeta": {
Expand Down Expand Up @@ -75,8 +75,7 @@
"serve": "^14.2.0",
"ts-jest": "^29.0.2"
},
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/actions/wallet/create-account-monarchy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { SigningCosmWasmClient } from '@cosmjs/cosmwasm-stargate'
import { CamelCasedProperties, Merge } from 'type-fest'
import { OverrideProperties } from 'type-fest/source/override-properties'
import { CamelCasedProperties, OverrideProperties } from 'type-fest'
import { AccountTypes, RegistryTypes } from '../../codegen/abstract'
import { WithCosmWasmSignOptions } from '../../types/parameters'
import { WithOptional } from '../../types/utils'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/actions/wallet/create-account.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SigningCosmWasmClient } from '@cosmjs/cosmwasm-stargate'
import { CamelCasedProperties, Merge } from 'type-fest'
import { OverrideProperties } from 'type-fest/source/override-properties'
import { OverrideProperties } from 'type-fest'
import { AccountTypes, RegistryTypes } from '../../codegen/abstract'
import { WithCosmWasmSignOptions } from '../../types/parameters'
import { WithOptional } from '../../types/utils'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function encodeAssetsAccountTransferMsgs(
to_address: toAddress,
},
},
} as const
} satisfies CosmosMsgForEmpty
}
if (msg.typeUrl === '/cosmwasm.wasm.v1.MsgExecuteContract') {
const { contract, msg: execMsg } = msg.value
Expand All @@ -32,7 +32,7 @@ export function encodeAssetsAccountTransferMsgs(
msg: toBase64(execMsg),
},
},
} as const
} satisfies CosmosMsgForEmpty
}
throw new Error(`Unsupported message type: ${msg.typeUrl}`)
}) satisfies CosmosMsgForEmpty[]
Expand Down
12 changes: 4 additions & 8 deletions packages/cosmwasm-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,20 @@
"rimraf": "^3.0.0",
"@types/node": "^20.0.0"
},
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.cjs",
"import": "./dist/index.js"
"default": "./dist/index.js"
},
"./client": {
"types": "./dist/client/index.d.ts",
"require": "./dist/client/index.cjs",
"import": "./dist/client/index.js"
"default": "./dist/client/index.js"
},
"./query": {
"types": "./dist/query/index.d.ts",
"require": "./dist/query/index.cjs",
"import": "./dist/query/index.js"
"default": "./dist/query/index.js"
},
"./package.json": "./package.json"
},
Expand Down
3 changes: 2 additions & 1 deletion packages/cosmwasm-utils/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import { dependencies } from './package.json'

export default defineConfig(
getConfig({
experimentalDts: false,
outDir: 'dist',
//dev: process.env.DEV === 'true',
entry: ['src/index.ts', 'src/client/index.ts', 'src/query/index.ts'],
external: [...Object.keys(dependencies)],
format: ['esm', 'cjs'],
format: ['esm'],
}),
)
23 changes: 4 additions & 19 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
"dependencies": {
"@abstract-money/core": "workspace:*",
"@tanstack/react-query": "^4",
"@tanstack/react-query": "^4.12",
"dedent": "^0.7.0",
"@cosmjs/cosmwasm-stargate": "^0.32.3",
"@cosmjs/stargate": "^0.32.3",
Expand All @@ -51,31 +51,16 @@
"ts-pattern": "^4.0.6",
"tslib": "^2.3.1"
},
"main": "dist/index.cjs",
"module": "./dist/index.js",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
},
"require": {
"types": "./dist/index.d.cts",
"require": "./dist/index.cjs"
}
"default": "./dist/index.js"
},
"./hooks": {
"types": "./dist/hooks/index.d.ts",
"import": {
"types": "./dist/hooks/index.d.ts",
"import": "./dist/hooks/index.js"
},
"require": {
"types": "./dist/hooks/index.d.cts",
"require": "./dist/hooks/index.cjs"
}
"default": "./dist/hooks/index.js"
},
"./package.json": "./package.json"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ export function useRemoteAccountIds<TData = QueryData>({
)

const enabled = React.useMemo(
() => Boolean(accountPublicClient && (query.enabled ?? true)),
() =>
Boolean(
accountPublicClient && ((query.enabled as boolean | undefined) ?? true),
),
[query.enabled, accountPublicClient],
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { AccountId, AccountPublicClient } from '@abstract-money/core'
import {
QueryFunction,
UseQueryOptions,
UseQueryResult,
useQuery,
} from '@tanstack/react-query'
import { QueryFunction } from '@tanstack/react-query'
import React from 'react'
import { useConfig } from '../../../contexts'
import { WithArgs } from '../../../types/args'
Expand Down
4 changes: 2 additions & 2 deletions packages/react/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"@cosmjs/cosmwasm-stargate": [
"packages/core/node_modules/@cosmjs/cosmwasm-stargate/build"
],
"@tanstack/react-query": ["packages/react/node_modules/@tanstack/react-query/src"],
"@tanstack/query-core": ["node_modules/@tanstack/query-core/src"]
// "@tanstack/react-query": ["packages/react/node_modules/@tanstack/react-query/src"],
// "@tanstack/query-core": ["node_modules/@tanstack/query-core/src"]
},
"resolveJsonModule": true,
"skipLibCheck": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/react/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ export default defineConfig(
banner: {
js: '"use client";',
},
format: ['esm', 'cjs'],
format: ['esm'],
}),
)
Loading

0 comments on commit 1b112f4

Please sign in to comment.