Skip to content

Commit

Permalink
Merge pull request #73 from AbstractSDK/fix/peer-dependencies
Browse files Browse the repository at this point in the history
fix: dependencies
  • Loading branch information
dalechyn authored Mar 4, 2024
2 parents 6a2610b + 7544fc0 commit eac14a1
Show file tree
Hide file tree
Showing 22 changed files with 1,038 additions and 1,259 deletions.
13 changes: 13 additions & 0 deletions .changeset/chilled-numbers-allow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
"wagemos-cosmoskit-nextjs": patch
"wagemos-graz-nextjs": patch
"@abstract-money/bundle-require": patch
"@abstract-money/cli": patch
"@abstract-money/core": patch
"@abstract-money/cosmwasm-utils": patch
"@abstract-money/provider-cosmoskit": patch
"@abstract-money/provider-graz": patch
"@abstract-money/react": patch
---

Fixes bad dependencies in all of the packages.
13 changes: 4 additions & 9 deletions examples/wagemos-cosmoskit-nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,8 @@
"@abstract-money/provider-cosmoskit": "workspace:*",
"@abstract-money/react": "workspace:*",
"@chain-registry/types": "^0.13.1",
"@cosmjs/amino": "^0.31.0",
"@cosmjs/cosmwasm-stargate": "^0.31.0",
"@cosmjs/encoding": "^0.31.0",
"@cosmjs/launchpad": "^0.27.1",
"@cosmjs/proto-signing": "^0.32.0",
"@cosmjs/stargate": "^0.31.0",
"@cosmjs/tendermint-rpc": "^0.31.0",
"@cosmjs/amino": "^0.32.2",
"@cosmjs/stargate": "^0.32.2",
"@cosmos-kit/keplr": "^2.4.15",
"@cosmos-kit/react": "^2.6.0",
"@hookform/resolvers": "^3.3.2",
Expand All @@ -47,13 +42,13 @@
"devDependencies": {
"@abstract-money/cli": "workspace:*",
"@keplr-wallet/types": "^0.12.44",
"@types/node": "^20",
"@types/node": "^20.0.0",
"@types/react": "^18",
"@types/react-dom": "^18",
"autoprefixer": "^10.0.1",
"pino-pretty": "^10.2.3",
"postcss": "^8",
"tailwindcss": "^3.3.0",
"typescript": "^5"
"typescript": "^5.0.4"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
*/

import { CamelCasedProperties } from "type-fest";
import { SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate";
import { SigningCosmWasmClient, ExecuteResult } from "@abstract-money/cli/cosmjs";
import { AbstractQueryClient, AbstractAccountQueryClient, AbstractAccountClient, AppExecuteMsg, AppExecuteMsgFactory, AbstractClient, AbstractAccountId } from "@abstract-money/core/legacy";
import { StdFee, Coin } from "@cosmjs/amino";
import { StdFee, Coin } from "@abstract-money/cli/cosmjs";
import { Decimal, InstantiateMsg, ExecuteMsg, AssetEntry, AccountTrace, ChainName, Uint128, AccountOdds, AccountId, Bet, AnsAsset, QueryMsg, MigrateMsg, Addr, BetsResponse, ConfigResponse, ListOddsResponse, RoundStatus, RoundsResponse, RoundResponse, OddsResponse } from "./Betting.types";
import { BettingQueryMsgBuilder, BettingExecuteMsgBuilder } from "./Betting.message-builder";
export interface IBettingAppQueryClient {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*/

import { UseQueryOptions, useQuery, useMutation, UseMutationOptions } from "@tanstack/react-query";
import { ExecuteResult } from "@cosmjs/cosmwasm-stargate";
import { StdFee, Coin } from "@cosmjs/amino";
import { ExecuteResult } from "@abstract-money/cli/cosmjs";
import { StdFee, Coin } from "@abstract-money/cli/cosmjs";
import { Decimal, InstantiateMsg, ExecuteMsg, AssetEntry, AccountTrace, ChainName, Uint128, AccountOdds, AccountId, Bet, AnsAsset, QueryMsg, MigrateMsg, Addr, BetsResponse, ConfigResponse, ListOddsResponse, RoundStatus, RoundsResponse, RoundResponse, OddsResponse } from "./Betting.types";
import { BettingAppQueryClient, BettingAppClient } from "./Betting.client";
export const bettingQueryKeys = {
Expand Down
4 changes: 2 additions & 2 deletions examples/wagemos-cosmoskit-nextjs/src/_generated/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'

import { ExecuteResult } from '@cosmjs/cosmwasm-stargate'
import { ExecuteResult } from '@abstract-money/cli/cosmjs'
import { UseMutationOptions } from '@tanstack/react-query'
import { useMemo } from 'react'

Expand Down Expand Up @@ -49,7 +49,7 @@ import {
// React
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

const BETTING_MODULE_ID = 'abstract:betting'
export const BETTING_MODULE_ID = 'abstract:betting'

export const betting = {
queries: {
Expand Down
12 changes: 3 additions & 9 deletions examples/wagemos-graz-nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,7 @@
"@abstract-money/core": "workspace:*",
"@abstract-money/provider-graz": "workspace:*",
"@abstract-money/react": "workspace:*",
"@cosmjs/amino": "^0.31.0",
"@cosmjs/cosmwasm-stargate": "^0.31.0",
"@cosmjs/encoding": "^0.31.0",
"@cosmjs/launchpad": "^0.27.1",
"@cosmjs/proto-signing": "^0.32.0",
"@cosmjs/stargate": "^0.31.0",
"@cosmjs/tendermint-rpc": "^0.31.0",
"@cosmjs/amino": "^0.32.2",
"@hookform/resolvers": "^3.3.2",
"@osmosis-labs/math": "^5.1.0",
"@osmosis-labs/proto-codecs": "^5.1.0",
Expand All @@ -48,13 +42,13 @@
"devDependencies": {
"@abstract-money/cli": "workspace:*",
"@keplr-wallet/types": "^0.12.44",
"@types/node": "^20",
"@types/node": "^20.0.0",
"@types/react": "^18",
"@types/react-dom": "^18",
"autoprefixer": "^10.0.1",
"pino-pretty": "^10.2.3",
"postcss": "^8",
"tailwindcss": "^3.3.0",
"typescript": "^5"
"typescript": "^5.0.4"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
*/

import { CamelCasedProperties } from "type-fest";
import { SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate";
import { SigningCosmWasmClient, ExecuteResult } from "@abstract-money/cli/cosmjs";
import { AbstractQueryClient, AbstractAccountQueryClient, AbstractAccountClient, AppExecuteMsg, AppExecuteMsgFactory, AbstractClient, AbstractAccountId } from "@abstract-money/core/legacy";
import { StdFee, Coin } from "@cosmjs/amino";
import { StdFee, Coin } from "@abstract-money/cli/cosmjs";
import { Decimal, InstantiateMsg, ExecuteMsg, AssetEntry, AccountTrace, ChainName, Uint128, AccountOdds, AccountId, Bet, AnsAsset, QueryMsg, MigrateMsg, Addr, BetsResponse, ConfigResponse, ListOddsResponse, RoundStatus, RoundsResponse, RoundResponse, OddsResponse } from "./Betting.types";
import { BettingQueryMsgBuilder, BettingExecuteMsgBuilder } from "./Betting.message-builder";
export interface IBettingAppQueryClient {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*/

import { UseQueryOptions, useQuery, useMutation, UseMutationOptions } from "@tanstack/react-query";
import { ExecuteResult } from "@cosmjs/cosmwasm-stargate";
import { StdFee, Coin } from "@cosmjs/amino";
import { ExecuteResult } from "@abstract-money/cli/cosmjs";
import { StdFee, Coin } from "@abstract-money/cli/cosmjs";
import { Decimal, InstantiateMsg, ExecuteMsg, AssetEntry, AccountTrace, ChainName, Uint128, AccountOdds, AccountId, Bet, AnsAsset, QueryMsg, MigrateMsg, Addr, BetsResponse, ConfigResponse, ListOddsResponse, RoundStatus, RoundsResponse, RoundResponse, OddsResponse } from "./Betting.types";
import { BettingAppQueryClient, BettingAppClient } from "./Betting.client";
export const bettingQueryKeys = {
Expand Down Expand Up @@ -57,7 +57,7 @@ export function useBettingBetsQuery<TData = BetsResponse>({
args,
options
}: BettingBetsQuery<TData>) {
return useQuery<BetsResponse, Error, TData>(bettingQueryKeys.bets(client?.moduleId, args), () => client && args ? client.bets({
return useQuery<BetsResponse, Error, TData>(bettingQueryKeys.bets(client?.moduleId, args), () => client && args ? client.bets({
roundId: args.roundId
}) : Promise.reject(new Error("Invalid client or args")), { ...options, enabled: !!args && !!client && (options?.enabled != undefined ? options.enabled : true)
});
Expand All @@ -81,7 +81,7 @@ export function useBettingListOddsQuery<TData = ListOddsResponse>({
args,
options
}: BettingListOddsQuery<TData>) {
return useQuery<ListOddsResponse, Error, TData>(bettingQueryKeys.listOdds(client?.moduleId, args), () => client && args ? client.listOdds({
return useQuery<ListOddsResponse, Error, TData>(bettingQueryKeys.listOdds(client?.moduleId, args), () => client && args ? client.listOdds({
roundId: args.roundId
}) : Promise.reject(new Error("Invalid client or args")), { ...options, enabled: !!args && !!client && (options?.enabled != undefined ? options.enabled : true)
});
Expand All @@ -97,7 +97,7 @@ export function useBettingOddsQuery<TData = OddsResponse>({
args,
options
}: BettingOddsQuery<TData>) {
return useQuery<OddsResponse, Error, TData>(bettingQueryKeys.odds(client?.moduleId, args), () => client && args ? client.odds({
return useQuery<OddsResponse, Error, TData>(bettingQueryKeys.odds(client?.moduleId, args), () => client && args ? client.odds({
roundId: args.roundId,
teamId: args.teamId
}) : Promise.reject(new Error("Invalid client or args")), { ...options, enabled: !!args && !!client && (options?.enabled != undefined ? options.enabled : true)
Expand All @@ -114,7 +114,7 @@ export function useBettingListRoundsQuery<TData = RoundsResponse>({
args,
options
}: BettingListRoundsQuery<TData>) {
return useQuery<RoundsResponse, Error, TData>(bettingQueryKeys.listRounds(client?.moduleId, args), () => client && args ? client.listRounds({
return useQuery<RoundsResponse, Error, TData>(bettingQueryKeys.listRounds(client?.moduleId, args), () => client && args ? client.listRounds({
limit: args.limit,
startAfter: args.startAfter
}) : Promise.reject(new Error("Invalid client or args")), { ...options, enabled: !!args && !!client && (options?.enabled != undefined ? options.enabled : true)
Expand All @@ -130,7 +130,7 @@ export function useBettingRoundQuery<TData = RoundResponse>({
args,
options
}: BettingRoundQuery<TData>) {
return useQuery<RoundResponse, Error, TData>(bettingQueryKeys.round(client?.moduleId, args), () => client && args ? client.round({
return useQuery<RoundResponse, Error, TData>(bettingQueryKeys.round(client?.moduleId, args), () => client && args ? client.round({
roundId: args.roundId
}) : Promise.reject(new Error("Invalid client or args")), { ...options, enabled: !!args && !!client && (options?.enabled != undefined ? options.enabled : true)
});
Expand Down
4 changes: 2 additions & 2 deletions examples/wagemos-graz-nextjs/src/_generated/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'

import { ExecuteResult } from '@cosmjs/cosmwasm-stargate'
import { ExecuteResult } from '@abstract-money/cli/cosmjs'
import { UseMutationOptions } from '@tanstack/react-query'
import { useMemo } from 'react'

Expand Down Expand Up @@ -49,7 +49,7 @@ import {
// React
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

const BETTING_MODULE_ID = 'abstract:betting'
export const BETTING_MODULE_ID = 'abstract:betting'

export const betting = {
queries: {
Expand Down
8 changes: 2 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"private": true,
"workspaces": [
"examples/*",
"packages/*"
],
"workspaces": ["examples/*", "packages/*"],
"scripts": {
"build": "turbo build",
"changeset:release": "turbo build && changeset publish",
Expand All @@ -29,7 +26,7 @@
"@types/dedent": "^0.7.0",
"@types/fs-extra": "^9.0.13",
"@types/jest": "^29.5.2",
"@types/node": "17.0.21",
"@types/node": "^20.0.0",
"@types/prettier": "^2.7.2",
"@types/react": "^18.2.0",
"dedent": "^0.7.0",
Expand All @@ -39,7 +36,6 @@
"fs-extra": "^10.1.0",
"jsdom": "^20.0.3",
"lint-staged": "^13.1.0",
"msw": "^1.2.1",
"prettier": "^2.8.3",
"simple-git-hooks": "^2.8.1",
"tsup": "^8.0.0",
Expand Down
11 changes: 3 additions & 8 deletions packages/bundle-require/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,16 @@
"prepublishOnly": "npm run build"
},
"devDependencies": {
"@egoist/prettier-config": "1.0.0",
"@types/node": "16.11.21",
"@types/node": "^20.0.0",
"esbuild": "0.13.15",
"prettier": "2.5.1",
"rimraf": "^3.0.0",
"typescript": "4.5.5",
"vitest": "0.2.5"
"typescript": "^5.0.4",
"vitest": "^1.3.1"
},
"dependencies": {
"load-tsconfig": "^0.2.0"
},
"peerDependencies": {
"esbuild": ">=0.13.x <= 0.16.x"
},
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
}
}
1 change: 1 addition & 0 deletions packages/cli/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Generated file. Do not edit directly.
cosmjs/**
config/**
plugins/**
16 changes: 12 additions & 4 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"optional": true
}
},
"peerDependencies": {
"typescript": ">=5.0.4"
},
"bin": {
"abstract": "./dist/cli.js"
},
Expand All @@ -49,18 +52,18 @@
"pathe": "^1.0.0",
"picocolors": "^1.0.0",
"prettier": "^2.8.1",
"zod": "^3.21.4"
"zod": "^3.21.4",
"@cosmjs/amino": "^0.32.2",
"@cosmjs/cosmwasm-stargate": "^0.32.2"
},
"devDependencies": {
"@types/jest": "^29.5.2",
"@types/node": "^18.11.10",
"@types/node": "^20.0.0",
"@vitest/spy": "^1.0.4",
"fixturez": "^1.1.0",
"rimraf": "^3.0.0",
"serve": "^14.2.0",
"ts-jest": "^29.0.2",
"typedoc": "^0.23.25",
"typedoc-plugin-markdown": "^3.14.0",
"vitest": "^1.0.2"
},
"main": "dist/index.js",
Expand All @@ -71,6 +74,10 @@
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./cosmjs": {
"types": "./dist/cosmjs.d.ts",
"default": "./dist/cosmjs.js"
},
"./config": {
"types": "./dist/config.d.ts",
"default": "./dist/config.js"
Expand All @@ -82,6 +89,7 @@
"./package.json": "./package.json"
},
"files": [
"/cosmjs",
"/config",
"/plugins",
"/dist"
Expand Down
2 changes: 2 additions & 0 deletions packages/cli/src/cosmjs.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from '@cosmjs/amino'
export * from '@cosmjs/cosmwasm-stargate'
19 changes: 14 additions & 5 deletions packages/cli/src/plugins/react.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,15 @@ export function react(options: ReactOptions = {}): ReactResult {
)
await fse.writeFile(
resolve(generatedClientFilePath),
generatedClientFileContent.replace(
'@abstract-money/abstract.js',
'@abstract-money/core/legacy',
),
generatedClientFileContent
.replace(
'@abstract-money/abstract.js',
'@abstract-money/core/legacy',
)
.replaceAll(
/(@cosmjs\/cosmwasm-stargate|@cosmjs\/amino)/gm,
'@abstract-money/cli/cosmjs',
),
)

const generatedMessageBuilderFilePath = join(
Expand Down Expand Up @@ -177,6 +182,10 @@ export function react(options: ReactOptions = {}): ReactResult {
'args")), { ...options, enabled: !!args && ',
)
})
.replaceAll(
/(@cosmjs\/cosmwasm-stargate|@cosmjs\/amino)/gm,
'@abstract-money/cli/cosmjs',
)

await fse.writeFile(
resolve(reactQueryFilePath),
Expand Down Expand Up @@ -460,7 +469,7 @@ export function react(options: ReactOptions = {}): ReactResult {
imports: dedent`
'use client';
import { ExecuteResult } from '@cosmjs/cosmwasm-stargate'
import { ExecuteResult } from '@abstract-money/cli/cosmjs'
import { UseMutationOptions } from '@tanstack/react-query'
import { useMemo } from 'react'
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineConfig } from 'tsup'

import { getConfig } from '../../scripts/tsup'
import { dependencies, devDependencies } from './package.json'
import { dependencies } from './package.json'

export default defineConfig(
getConfig({
Expand All @@ -10,6 +10,7 @@ export default defineConfig(
entry: [
'src/index.ts',
'src/cli.ts',
'src/cosmjs.ts',
'src/config.ts',
'src/plugins/index.ts',
],
Expand Down
Loading

0 comments on commit eac14a1

Please sign in to comment.