@cosmwasm/ts-codegen 0.11.2 → 0.13.1

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.
@@ -433,9 +433,10 @@ var TSBuilder = /*#__PURE__*/function () {
433
433
  ast = (0, _bundler.recursiveModuleBundle)(bundleVariables);
434
434
  code = (0, _generator["default"])(t.program([].concat(importPaths, (0, _toConsumableArray2["default"])(ast)))).code;
435
435
  (0, _mkdirp.sync)(this.outPath);
436
+ if (code.trim() === '') code = 'export {};';
436
437
  (0, _fs.writeFileSync)((0, _path.join)(this.outPath, bundleFile), _header.header + code);
437
438
 
438
- case 9:
439
+ case 10:
439
440
  case "end":
440
441
  return _context7.stop();
441
442
  }
@@ -17,7 +17,7 @@ var _index = _interopRequireDefault(require("../index"));
17
17
 
18
18
  var _default = /*#__PURE__*/function () {
19
19
  var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(argv) {
20
- var questions, _yield$prompt, schema, out, name, plugin, bundle, questions2, _yield$prompt2, optionalClient, version, questions3, _yield$prompt3, mutations, questions4, _yield$prompt4, bundleFile, bundleScope, options;
20
+ var questions, _yield$prompt, schema, out, name, plugin, bundle, questions2, _yield$prompt2, optionalClient, version, queryKeys, questions3, _yield$prompt3, mutations, questions4, _yield$prompt4, bundleFile, bundleScope, options;
21
21
 
22
22
  return _regenerator["default"].wrap(function _callee$(_context) {
23
23
  while (1) {
@@ -82,6 +82,11 @@ var _default = /*#__PURE__*/function () {
82
82
  message: 'which react-query version?',
83
83
  "default": 'v3',
84
84
  choices: ['v3', 'v4']
85
+ }, {
86
+ type: 'confirm',
87
+ name: 'queryKeys',
88
+ message: 'queryKeys?',
89
+ "default": false
85
90
  }]);
86
91
  }
87
92
 
@@ -93,6 +98,7 @@ var _default = /*#__PURE__*/function () {
93
98
  _yield$prompt2 = _context.sent;
94
99
  optionalClient = _yield$prompt2.optionalClient;
95
100
  version = _yield$prompt2.version;
101
+ queryKeys = _yield$prompt2.queryKeys;
96
102
  questions3 = [];
97
103
 
98
104
  if (version === 'v4') {
@@ -106,10 +112,10 @@ var _default = /*#__PURE__*/function () {
106
112
  }
107
113
 
108
114
  ;
109
- _context.next = 24;
115
+ _context.next = 25;
110
116
  return (0, _prompt.prompt)(questions3, argv);
111
117
 
112
- case 24:
118
+ case 25:
113
119
  _yield$prompt3 = _context.sent;
114
120
  mutations = _yield$prompt3.mutations;
115
121
  ///////// END REACT QUERY
@@ -131,10 +137,10 @@ var _default = /*#__PURE__*/function () {
131
137
  }
132
138
 
133
139
  ;
134
- _context.next = 31;
140
+ _context.next = 32;
135
141
  return (0, _prompt.prompt)(questions4, argv);
136
142
 
137
- case 31:
143
+ case 32:
138
144
  _yield$prompt4 = _context.sent;
139
145
  bundleFile = _yield$prompt4.bundleFile;
140
146
  bundleScope = _yield$prompt4.bundleScope;
@@ -149,6 +155,7 @@ var _default = /*#__PURE__*/function () {
149
155
  reactQuery: {
150
156
  enabled: plugin.includes('react-query'),
151
157
  optionalClient: optionalClient,
158
+ queryKeys: queryKeys,
152
159
  version: version,
153
160
  mutations: mutations
154
161
  },
@@ -164,7 +171,7 @@ var _default = /*#__PURE__*/function () {
164
171
  bundleFile: bundleFile
165
172
  }
166
173
  };
167
- _context.next = 37;
174
+ _context.next = 38;
168
175
  return (0, _index["default"])({
169
176
  contracts: [{
170
177
  name: name,
@@ -174,7 +181,7 @@ var _default = /*#__PURE__*/function () {
174
181
  options: options
175
182
  });
176
183
 
177
- case 37:
184
+ case 38:
178
185
  case "end":
179
186
  return _context.stop();
180
187
  }
@@ -19,7 +19,7 @@ var _fs = require("fs");
19
19
 
20
20
  var _cleanse = require("./cleanse");
21
21
 
22
- var _jsonSchemaToTypescript = require("json-schema-to-typescript");
22
+ var _jsonSchemaToTypescript = require("@pyramation/json-schema-to-typescript");
23
23
 
24
24
  var _parse = require("./parse");
25
25
 
@@ -170,8 +170,9 @@ export class TSBuilder {
170
170
  createFileBundle(`${this.options.bundle.scope}.${file.contract}`, file.localname, bundleFile, importPaths, bundleVariables);
171
171
  });
172
172
  const ast = recursiveModuleBundle(bundleVariables);
173
- const code = generate(t.program([...importPaths, ...ast])).code;
173
+ let code = generate(t.program([...importPaths, ...ast])).code;
174
174
  mkdirp(this.outPath);
175
+ if (code.trim() === '') code = 'export {};';
175
176
  writeFileSync(join(this.outPath, bundleFile), header + code);
176
177
  }
177
178
 
@@ -57,13 +57,19 @@ export default (async argv => {
57
57
  message: 'which react-query version?',
58
58
  default: 'v3',
59
59
  choices: ['v3', 'v4']
60
+ }, {
61
+ type: 'confirm',
62
+ name: 'queryKeys',
63
+ message: 'queryKeys?',
64
+ default: false
60
65
  }]);
61
66
  }
62
67
 
63
68
  ;
64
69
  const {
65
70
  optionalClient,
66
- version
71
+ version,
72
+ queryKeys
67
73
  } = await prompt(questions2, argv);
68
74
  const questions3 = [];
69
75
 
@@ -115,6 +121,7 @@ export default (async argv => {
115
121
  reactQuery: {
116
122
  enabled: plugin.includes('react-query'),
117
123
  optionalClient,
124
+ queryKeys,
118
125
  version,
119
126
  mutations
120
127
  },
@@ -7,7 +7,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
7
7
  import { sync as glob } from 'glob';
8
8
  import { readFileSync } from 'fs';
9
9
  import { cleanse } from './cleanse';
10
- import { compile } from 'json-schema-to-typescript';
10
+ import { compile } from '@pyramation/json-schema-to-typescript';
11
11
  import { parser } from './parse';
12
12
  ;
13
13
  export const readSchemas = async ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmwasm/ts-codegen",
3
- "version": "0.11.2",
3
+ "version": "0.13.1",
4
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",
@@ -80,6 +80,7 @@
80
80
  "@babel/runtime": "^7.18.9",
81
81
  "@babel/traverse": "7.18.11",
82
82
  "@babel/types": "7.18.10",
83
+ "@pyramation/json-schema-to-typescript": " 11.0.4",
83
84
  "case": "1.6.3",
84
85
  "dargs": "7.0.0",
85
86
  "deepmerge": "4.2.2",
@@ -87,14 +88,13 @@
87
88
  "fuzzy": "0.1.3",
88
89
  "glob": "8.0.3",
89
90
  "inquirerer": "0.1.3",
90
- "json-schema-to-typescript": "11.0.1",
91
91
  "long": "^5.2.0",
92
92
  "minimist": "1.2.6",
93
93
  "mkdirp": "1.0.4",
94
94
  "parse-package-name": "1.0.0",
95
95
  "rimraf": "3.0.2",
96
96
  "shelljs": "0.8.5",
97
- "wasm-ast-types": "^0.8.2"
97
+ "wasm-ast-types": "^0.9.0"
98
98
  },
99
- "gitHead": "d36b8c2de0e9f6eb14c9056705d460600a2b15d5"
99
+ "gitHead": "37ca0c4ace985d47d31fcbcf24b585e185b65432"
100
100
  }