@cosmwasm/ts-codegen 0.5.5 → 0.5.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -51,6 +51,11 @@ var _default = /*#__PURE__*/function () {
51
51
  name: 'optionalClient',
52
52
  message: 'optionalClient?',
53
53
  "default": false
54
+ }, {
55
+ type: 'confirm',
56
+ name: 'v4',
57
+ message: 'Use react-query v4?',
58
+ "default": false
54
59
  }];
55
60
  _context.next = 3;
56
61
  return (0, _prompt.prompt)(questions, argv);
@@ -53,7 +53,7 @@ var _default = /*#__PURE__*/function () {
53
53
  QueryClient = null;
54
54
  ReadOnlyInstance = null;
55
55
  body = [];
56
- body.push(w.importStmt(['useQuery', 'UseQueryOptions'], 'react-query'));
56
+ body.push(w.importStmt(['useQuery', 'UseQueryOptions'], options !== null && options !== void 0 && options.v4 ? '@tanstack/react-query' : 'react-query'));
57
57
  body.push(w.importStmt(Object.keys(typeHash), "./".concat(Contract))); // query messages
58
58
 
59
59
  if (QueryMsg) {
@@ -26,6 +26,11 @@ export default (async argv => {
26
26
  name: 'optionalClient',
27
27
  message: 'optionalClient?',
28
28
  default: false
29
+ }, {
30
+ type: 'confirm',
31
+ name: 'v4',
32
+ message: 'Use react-query v4?',
33
+ default: false
29
34
  }];
30
35
 
31
36
  const _await$prompt = await prompt(questions, argv),
@@ -15,7 +15,7 @@ export default (async (name, schemas, outPath, options) => {
15
15
  let QueryClient = null;
16
16
  let ReadOnlyInstance = null;
17
17
  const body = [];
18
- body.push(w.importStmt(['useQuery', 'UseQueryOptions'], 'react-query'));
18
+ body.push(w.importStmt(['useQuery', 'UseQueryOptions'], options?.v4 ? '@tanstack/react-query' : 'react-query'));
19
19
  body.push(w.importStmt(Object.keys(typeHash), `./${Contract}`)); // query messages
20
20
 
21
21
  if (QueryMsg) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cosmwasm/ts-codegen",
3
- "version": "0.5.5",
4
- "description": "A TypeScript Transpiler for CosmWasm Smart Contracts",
3
+ "version": "0.5.8",
4
+ "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.",
5
5
  "author": "Dan Lynch <pyramation@gmail.com>",
6
6
  "homepage": "https://github.com/cosmwasm/ts-codegen",
7
7
  "license": "SEE LICENSE IN LICENSE",
@@ -90,7 +90,7 @@
90
90
  "minimist": "1.2.6",
91
91
  "mkdirp": "1.0.4",
92
92
  "shelljs": "0.8.5",
93
- "wasm-ast-types": "^0.4.1"
93
+ "wasm-ast-types": "^0.4.3"
94
94
  },
95
- "gitHead": "6847a42410c041f2a2de781eb1b49c3bc39a2b19"
95
+ "gitHead": "c5fc4992d9da5f1c9da1f2c34469994dee7801df"
96
96
  }
@@ -1,2 +1,2 @@
1
- declare const _default: (name: string, schemas: any[], outPath: string, options?: { optionalClient?: boolean }) => Promise<void>;
1
+ declare const _default: (name: string, schemas: any[], outPath: string, options?: { optionalClient?: boolean, v4?: boolean }) => Promise<void>;
2
2
  export default _default;