Skip to content

Commit 5281dce

Browse files
committed
fix vue-query import
1 parent f05e4ca commit 5281dce

File tree

3 files changed

+21
-23
lines changed

3 files changed

+21
-23
lines changed

packages/telescope/__tests__/telescope-vuequery.test.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ const options: TelescopeOptions = {
3434
},
3535

3636
interfaces: {
37-
enabled: false,
38-
useUnionTypes: false
37+
// enabled: false,
38+
useUnionTypes: false,
39+
enabled: true,
40+
useGlobalDecoderRegistry: true
3941
},
4042

4143
prototypes: {
@@ -168,9 +170,8 @@ const options: TelescopeOptions = {
168170
vueQuery: {
169171
enabled: true,
170172
include: {
171-
patterns: ['osmosis/**/gamm/**/query.proto'],
172-
protos: ['akash/cert/v1beta2/query.proto'],
173-
packages: ['cosmos.bank.v1beta1', 'cosmos.staking.v1beta1', 'cosmos.gov.v1']
173+
protos: ['osmosis/**/query.proto', 'cosmos/**/query.proto'],
174+
packages: ['cosmos.bank.v1beta1']
174175
}
175176
},
176177

packages/telescope/src/generators/create-rpc-query-clients.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ export const plugin = (
302302
if (c.proto.pluginValue('vueQuery.enabled')) {
303303
const reactiveRequests = []
304304
serviceImports['./query']?.forEach(servImp => {
305-
if (/^Query.*Request$/.test(servImp)) {
305+
if (/^.*Request$/.test(servImp)) {
306306
reactiveRequests.push(`Reactive${servImp}`)
307307
}
308308
})

packages/telescope/src/utils/index.ts

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,10 @@ export const UTILS: { [key: string]: UtilValue } = {
8383
useRpcClient: '__react-query__',
8484
useTendermintClient: '__react-query__',
8585
ReactQueryParams: '__react-query__',
86-
VueQueryParams: {
87-
type: 'import',
88-
name: 'VueQueryParams',
89-
path: '../../../vue-query'
90-
},
91-
buildUseMutation:'__react-query__',
92-
UseQueryParams:'__react-query__',
93-
buildUseQuery:'__react-query__',
86+
VueQueryParams: '__vue-query__',
87+
buildUseMutation: '__react-query__',
88+
UseQueryParams: '__react-query__',
89+
buildUseQuery: '__react-query__',
9490
UseQueryOptions: '@tanstack/react-query',
9591
QueryStore: '__mobx__',
9692
MobxResponse: '__mobx__',
@@ -105,19 +101,20 @@ export const UTILS: { [key: string]: UtilValue } = {
105101
BinaryWriter: '__binary__',
106102
TelescopeGeneratedType: '__types__',
107103
GlobalDecoderRegistry: '__registry__',
108-
buildTx:'__helper-func-types__',
109-
ISigningClient:'__helper-func-types__',
110-
buildQuery:'__helper-func-types__',
111-
SigningClientResolver:'__helper-func-types__',
112-
RpcResolver:'__helper-func-types__',
113-
toConverters:'@interchainjs/cosmos/utils',
114-
toEncoders:'@interchainjs/cosmos/utils'
104+
buildTx: '__helper-func-types__',
105+
ISigningClient: '__helper-func-types__',
106+
buildQuery: '__helper-func-types__',
107+
SigningClientResolver: '__helper-func-types__',
108+
RpcResolver: '__helper-func-types__',
109+
toConverters: '@interchainjs/cosmos/utils',
110+
toEncoders: '@interchainjs/cosmos/utils'
115111
};
116112

117113
export const UTIL_HELPERS = [
118114
'__helpers__',
119115
'__extern__',
120116
'__react-query__',
117+
'__vue-query__',
121118
'__mobx__',
122119
'__binary__',
123120
'__pinia-endpoint__',
@@ -137,8 +134,8 @@ export const fixlocalpaths = (imports: ImportObj[]) => {
137134
...imp,
138135
path:
139136
UTIL_HELPERS.includes(imp.path) ||
140-
imp.path.startsWith('.') ||
141-
imp.path.startsWith('@')
137+
imp.path.startsWith('.') ||
138+
imp.path.startsWith('@')
142139
? fixedPath
143140
: `./${fixedPath}`,
144141
};

0 commit comments

Comments
 (0)